sofa-support.h 634 B

123456789101112131415161718192021222324252627282930
  1. #ifndef UTILS_SOFA_SUPPORT_H
  2. #define UTILS_SOFA_SUPPORT_H
  3. #include <cstddef>
  4. #include <memory>
  5. #include <vector>
  6. #include "mysofa.h"
  7. struct MySofaDeleter {
  8. void operator()(MYSOFA_HRTF *sofa) { mysofa_free(sofa); }
  9. };
  10. using MySofaHrtfPtr = std::unique_ptr<MYSOFA_HRTF,MySofaDeleter>;
  11. // Per-field measurement info.
  12. struct SofaField {
  13. using uint = unsigned int;
  14. double mDistance{0.0};
  15. uint mEvCount{0u};
  16. uint mEvStart{0u};
  17. std::vector<uint> mAzCounts;
  18. };
  19. const char *SofaErrorStr(int err);
  20. std::vector<SofaField> GetCompatibleLayout(const size_t m, const float *xyzs);
  21. #endif /* UTILS_SOFA_SUPPORT_H */