]> git.tdb.fi Git - ext/openal.git/blob - utils/sofa-support.h
Import OpenAL Soft 1.23.1 sources
[ext/openal.git] / utils / sofa-support.h
1 #ifndef UTILS_SOFA_SUPPORT_H
2 #define UTILS_SOFA_SUPPORT_H
3
4 #include <cstddef>
5 #include <memory>
6 #include <vector>
7
8 #include "mysofa.h"
9
10
11 struct MySofaDeleter {
12     void operator()(MYSOFA_HRTF *sofa) { mysofa_free(sofa); }
13 };
14 using MySofaHrtfPtr = std::unique_ptr<MYSOFA_HRTF,MySofaDeleter>;
15
16 // Per-field measurement info.
17 struct SofaField {
18     using uint = unsigned int;
19
20     double mDistance{0.0};
21     uint mEvCount{0u};
22     uint mEvStart{0u};
23     std::vector<uint> mAzCounts;
24 };
25
26 const char *SofaErrorStr(int err);
27
28 std::vector<SofaField> GetCompatibleLayout(const size_t m, const float *xyzs);
29
30 #endif /* UTILS_SOFA_SUPPORT_H */