2021-01-26 13:01:35 -06:00
|
|
|
#ifndef UTILS_SOFA_SUPPORT_H
|
|
|
|
|
#define UTILS_SOFA_SUPPORT_H
|
|
|
|
|
|
|
|
|
|
#include <cstddef>
|
|
|
|
|
#include <memory>
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
2024-06-30 14:35:57 -05:00
|
|
|
#include "alspan.h"
|
|
|
|
|
|
2021-01-26 13:01:35 -06:00
|
|
|
#include "mysofa.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct MySofaDeleter {
|
|
|
|
|
void operator()(MYSOFA_HRTF *sofa) { mysofa_free(sofa); }
|
|
|
|
|
};
|
|
|
|
|
using MySofaHrtfPtr = std::unique_ptr<MYSOFA_HRTF,MySofaDeleter>;
|
|
|
|
|
|
|
|
|
|
// Per-field measurement info.
|
|
|
|
|
struct SofaField {
|
|
|
|
|
using uint = unsigned int;
|
|
|
|
|
|
|
|
|
|
double mDistance{0.0};
|
|
|
|
|
uint mEvCount{0u};
|
|
|
|
|
uint mEvStart{0u};
|
|
|
|
|
std::vector<uint> mAzCounts;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const char *SofaErrorStr(int err);
|
|
|
|
|
|
2024-06-30 14:35:57 -05:00
|
|
|
auto GetCompatibleLayout(al::span<const float> xyzs) -> std::vector<SofaField>;
|
2021-01-26 13:01:35 -06:00
|
|
|
|
|
|
|
|
#endif /* UTILS_SOFA_SUPPORT_H */
|