sofa-support.h 656 B

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