VISR  0.11.7
Versatile Interactive Scene Renderer
lagrange_interpolator.hpp
Go to the documentation of this file.
1 /* Copyright Institute of Sound and Vibration Research - All rights reserved */
2 
3 #ifndef VISR_LIBRBBL_LAGRANGE_INTERPOLATOR_HPP_INCLUDED
4 #define VISR_LIBRBBL_LAGRANGE_INTERPOLATOR_HPP_INCLUDED
5 
6 #include "export_symbols.hpp"
7 
9 
10 #include <libefl/basic_vector.hpp>
12 
13 #include <cstddef>
14 #include <vector>
15 
16 namespace visr
17 {
18 namespace rbbl
19 {
20 
24 template <typename SampleType, std::size_t order >
25 class VISR_RBBL_LIBRARY_SYMBOL LagrangeInterpolator: public FractionalDelayBase<SampleType>
26 {
27 public:
28 
35  explicit LagrangeInterpolator( std::size_t maxNumSamples,
36  std::size_t alignmentElements = 0);
37 
38  virtual ~LagrangeInterpolator();
39 
40  SampleType methodDelay() const override;
41 
42  virtual void interpolate( SampleType const * basePointer,
43  SampleType * result,
44  std::size_t numSamples,
45  SampleType startDelay, SampleType endDelay,
46  SampleType startGain, SampleType endGain ) override;
47 private:
48 
49  std::vector<std::ptrdiff_t> mBaseOffsets;
50 
52 
54 
55  efl::BasicVector<SampleType> mIntersamplePositions;
56 
58 
62  static constexpr SampleType cMethodDelay = static_cast<SampleType>(0.5) * static_cast<SampleType>(order);
63 };
64 
65 } // namespace rbbl
66 } // namespace visr
67 
68 #endif // #ifndef VISR_LIBRBBL_LAGRANGE_INTERPOLATOR_HPP_INCLUDED
Definition: lagrange_interpolator.hpp:25
Definition: options.cpp:10
Definition: fractional_delay_base.hpp:19
float SampleType
Definition: constants.hpp:14