Fix lambda callback parameter type
[openal-soft.git] / core / cubic_tables.h
blobb32764451737ece14b435eb9515f2ad0691c41f2
1 #ifndef CORE_CUBIC_TABLES_H
2 #define CORE_CUBIC_TABLES_H
4 #include <array>
5 #include <cstddef>
7 #include "cubic_defs.h"
8 #include "opthelpers.h"
11 struct SIMDALIGN CubicTable {
12 std::array<CubicCoefficients,CubicPhaseCount> mTable{};
15 struct GaussianTable : CubicTable { GaussianTable(); };
16 inline const GaussianTable gGaussianFilter;
18 struct SplineTable : CubicTable { SplineTable(); };
19 inline const SplineTable gSplineFilter;
22 struct CubicFilter {
23 static constexpr std::size_t sTableBits{8};
24 static constexpr std::size_t sTableSteps{1 << sTableBits};
25 static constexpr std::size_t sTableMask{sTableSteps - 1};
27 std::array<float,sTableSteps*2 + 1> mFilter{};
29 CubicFilter();
31 [[nodiscard]] constexpr
32 auto getCoeff0(std::size_t i) const noexcept -> float { return mFilter[sTableSteps+i]; }
33 [[nodiscard]] constexpr
34 auto getCoeff1(std::size_t i) const noexcept -> float { return mFilter[i]; }
35 [[nodiscard]] constexpr
36 auto getCoeff2(std::size_t i) const noexcept -> float { return mFilter[sTableSteps-i]; }
37 [[nodiscard]] constexpr
38 auto getCoeff3(std::size_t i) const noexcept -> float { return mFilter[sTableSteps*2-i]; }
40 inline const CubicFilter gCubicTable;
42 #endif /* CORE_CUBIC_TABLES_H */