aboutsummaryrefslogtreecommitdiffstats
path: root/utils/sofa-support.h
blob: 1229f49dc3d8704b12c42bf45ea5589195668e0a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef UTILS_SOFA_SUPPORT_H
#define UTILS_SOFA_SUPPORT_H

#include <cstddef>
#include <memory>
#include <vector>

#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);

std::vector<SofaField> GetCompatibleLayout(const size_t m, const float *xyzs);

#endif /* UTILS_SOFA_SUPPORT_H */