21#include <com/sun/star/uno/Sequence.hxx>
22#include <osl/diagnose.h>
29 OSL_ENSURE( rKeyStops.size() > 1,
30 "KeyStopLerp::KeyStopLerp(): key stop vector must have two entries or more" );
33 for( std::size_t
i=1, len=rKeyStops.size();
i<len; ++
i )
35 if( rKeyStops[
i-1] > rKeyStops[
i] )
36 OSL_FAIL(
"KeyStopLerp::KeyStopLerp(): time vector is not sorted in ascending order!" );
46 maKeyStops(
std::move(rKeyStops)),
53 maKeyStops(rKeyStops.
begin(), rKeyStops.
end()),
69 std::max<std::ptrdiff_t>(
78 const double fRawLerp=
86 std::clamp(fRawLerp,0.0,1.0));
std::vector< double > maKeyStops
std::ptrdiff_t mnLastIndex
ResultType lerp(double fAlpha) const
Find two nearest bucket index & interpolate.
std::pair< std::ptrdiff_t, double > ResultType
KeyStopLerp(std::vector< double > &&rKeyStops)
Create lerper with given vector of stops.
static void validateInput(const std::vector< double > &rKeyStops)
enumrange< T >::Iterator begin(enumrange< T >)