20#ifndef INCLUDED_SLIDESHOW_SOURCE_ENGINE_ACTIVITIES_INTERPOLATION_HXX
21#define INCLUDED_SLIDESHOW_SOURCE_ENGINE_ACTIVITIES_INTERPOLATION_HXX
24#include <osl/diagnose.h>
25#include <rtl/ustring.hxx>
43 const ::slideshow::internal::RGBColor& rFrom,
44 const ::slideshow::internal::RGBColor& rTo,
55 OSL_FAIL(
"lerp<sal_Int16> called" );
64 OSL_FAIL(
"lerp<OUString> called" );
73 OSL_FAIL(
"lerp<bool> called" );
133 ::std::size_t nTotalFrames )
139 const double nFraction( nTotalFrames > 1 ?
double(nFrame)/(nTotalFrames-1) : 1.0 );
141 return rInterpolator( rFrom, rTo, nFraction );
146 const sal_Int16& rFrom,
147 const sal_Int16& rTo,
149 ::std::size_t nTotalFrames )
155 return nFrame < nTotalFrames/2 ? rFrom : rTo;
160 const OUString& rFrom,
163 ::std::size_t nTotalFrames )
169 return nFrame < nTotalFrames/2 ? rFrom : rTo;
177 ::std::size_t nTotalFrames )
183 return nFrame < nTotalFrames/2 ? bFrom : bTo;
::slideshow::internal::RGBColor lerp< ::slideshow::internal::RGBColor >(const ::slideshow::internal::RGBColor &rFrom, const ::slideshow::internal::RGBColor &rTo, double t)
Specialization for RGBColor, to employ color-specific interpolator.
ValueType lerp(const ValueType &rFrom, const ValueType &rTo, double t)
B2DPolygon interpolate(const B2DPolygon &rOld1, const B2DPolygon &rOld2, double t)
OUString lerp< OUString >(const OUString &, const OUString &rTo, double)
Specialization also for string, although this code should not be called.
sal_Int16 lerp< sal_Int16 >(const sal_Int16 &, const sal_Int16 &rTo, double)
Specialization also for sal_Int16, although this code should not be called.
bool lerp< bool >(const bool &, const bool &rTo, double)
Specialization also for bool, although this code should not be called.
bool lerp< bool >(const Interpolator< bool > &, const bool &bFrom, const bool &bTo, sal_uInt32 nFrame, ::std::size_t nTotalFrames)
Specialization for non-interpolatable bools.
HSLColor interpolate(const HSLColor &rFrom, const HSLColor &rTo, double t, bool bCCW)
HSL color linear interpolator.
sal_Int16 lerp< sal_Int16 >(const Interpolator< sal_Int16 > &, const sal_Int16 &rFrom, const sal_Int16 &rTo, sal_uInt32 nFrame, ::std::size_t nTotalFrames)
Specialization for non-interpolatable constants/enums.
OUString lerp< OUString >(const Interpolator< OUString > &, const OUString &rFrom, const OUString &rTo, sal_uInt32 nFrame, ::std::size_t nTotalFrames)
Specialization for non-interpolatable strings.
ValueType lerp(const Interpolator< ValueType > &rInterpolator, const ValueType &rFrom, const ValueType &rTo, sal_uInt32 nFrame, ::std::size_t nTotalFrames)
Generic linear interpolator.
const bool mbCCW
When true: interpolate counter-clockwise.
HSLColor operator()(const HSLColor &rFrom, const HSLColor &rTo, double t) const
ValueType operator()(const ValueType &rFrom, const ValueType &rTo, double t) const