cgv
Loading...
Searching...
No Matches
cgv::math::interpolator< ValueT, ParamT > Class Template Referenceabstract

Template of an abstract interface for interpolators that can be evaluated at a position t and return an interpolated value at that position. More...

#include <interpolate.h>

Inheritance diagram for cgv::math::interpolator< ValueT, ParamT >:
cgv::math::piecewise_interpolator_storage< ValueT, ValueT, float > cgv::math::piecewise_interpolator_storage< std::pair< float, ValueT >, ValueT, float > cgv::math::function_ref_interpolator< ValueT, ParamT > cgv::math::identity_interpolator< ValueT, ParamT > cgv::math::piecewise_interpolator_storage< PointT, ValueT, ParamT > cgv::media::schemes::rgb_per_channel_piecewise_interpolator< ParamT > cgv::math::piecewise_interpolator< ValueT, float > cgv::math::uniform_piecewise_interpolator< ValueT, float > cgv::math::piecewise_interpolator< ValueT, ParamT > cgv::math::uniform_piecewise_interpolator< ValueT, ParamT > cgv::math::linear_interpolator< ValueT, ParamT > cgv::math::smooth_interpolator< ValueT, ParamT > cgv::math::discrete_interpolator< ValueT, ParamT > cgv::math::uniform_linear_interpolator< ValueT, ParamT > cgv::math::uniform_smooth_interpolator< ValueT, ParamT >

Public Member Functions

virtual std::unique_ptr< interpolatorclone () const =0
 
virtual ValueT at (ParamT t) const =0
 Return the interpolated value at position t.
 
virtual std::vector< ValueT > quantize (size_t n) const
 Return a sequence of n uniformly-spaced samples from the interpolator within the parameter range [0,1].
 

Detailed Description

template<typename ValueT, typename ParamT = float>
class cgv::math::interpolator< ValueT, ParamT >

Template of an abstract interface for interpolators that can be evaluated at a position t and return an interpolated value at that position.

Definition at line 545 of file interpolate.h.

Member Function Documentation

◆ at()

template<typename ValueT , typename ParamT = float>
virtual ValueT cgv::math::interpolator< ValueT, ParamT >::at ( ParamT  t) const
pure virtual

◆ quantize()

template<typename ValueT , typename ParamT = float>
virtual std::vector< ValueT > cgv::math::interpolator< ValueT, ParamT >::quantize ( size_t  n) const
inlinevirtual

Return a sequence of n uniformly-spaced samples from the interpolator within the parameter range [0,1].

The first sample is always located at t = 0 and the last sample is always located at t = 1. A derived class might override this function in order to provide a more efficient implementation.

Parameters
nThe number of samples to be evaluated.
Returns
The sequence of values.

Reimplemented in cgv::math::uniform_linear_interpolator< ValueT, ParamT >, and cgv::math::linear_interpolator< ValueT, ParamT >.

Definition at line 563 of file interpolate.h.

References cgv::math::interpolator< ValueT, ParamT >::at().

Referenced by cgv::media::discrete_color_scheme::get_colors().


The documentation for this class was generated from the following file: