Simple++
Powerfull and lightning fast C++ Library
Public Member Functions | Static Public Member Functions | List of all members
Graphic::GradientHorizontal< C, InterFunc > Class Template Reference

#include <Gradient.h>

Inheritance diagram for Graphic::GradientHorizontal< C, InterFunc >:
Graphic::Gradient< C, InterFunc >

Public Member Functions

 GradientHorizontal (const InterFunc &functor=InterFunc())
 Create a new Horizontal gradient. More...
 
- Public Member Functions inherited from Graphic::Gradient< C, InterFunc >
 ~Gradient ()
 destructor More...
 
void addPoint (float position, const C &color)
 add a point to this gradient. More...
 
Vector< GradientPoint< C > * >::Size getNumPoints () const
 get the number of points of this gradient. More...
 
GradientPoint< C > & operator[] (typename Vector< GradientPoint< C > * >::Size i)
 Operator [] to direct access points inside this gradient. More...
 
const GradientPoint< C > & operator[] (typename Vector< GradientPoint< C > * >::Size i) const
 Operator [] to direct access points inside this gradient. More...
 
template<size_t N, typename InterFunc2 = InterFunc>
void computeInterpolation (C(&buffer)[N], const InterFunc2 &functor=InterFunc(), float begin=0.0f, float end=1.0f) const
 Compute the interpolation of every color of this gradient in an 1D array. More...
 
template<typename InterFunc2 = InterFunc>
void computeInterpolation (C *buffer, size_t size, const InterFunc2 &functor=InterFunc(), float begin=0.0f, float end=1.0f) const
 Compute the interpolation of every color of this gradient in an 1D array. More...
 
void computeInterpolation (C *buffer, size_t size, float begin=0.0f, float end=1.0f) const
 Compute the interpolation of every color of this gradient in an 1D array. More...
 

Static Public Member Functions

static int computeIndex (const Math::Vec2< Size > &p)
 Compute the index in the interpolated array. More...
 
static int computeIndex (const Point &p, int maxIndex)
 Compute the index in the interpolated array. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Graphic::Gradient< C, InterFunc >
 Gradient (const InterFunc &functor=InterFunc())
 Create a new gradient. More...
 

Constructor & Destructor Documentation

template<typename C , typename InterFunc >
Graphic::GradientHorizontal< C, InterFunc >::GradientHorizontal ( const InterFunc &  functor = InterFunc())

Create a new Horizontal gradient.

Parameters
functorFunctor used to interpolate the colors overloaded with : template<typename C> inline C operator()(const C & color1, const C & color2, float x) const;

Member Function Documentation

template<typename C , typename InterFunc >
int Graphic::GradientHorizontal< C, InterFunc >::computeIndex ( const Math::Vec2< Size > &  p)
static

Compute the index in the interpolated array.

Parameters
pPoint relative of this gradient.
Returns
Computed index.
template<typename C , typename InterFunc >
int Graphic::GradientHorizontal< C, InterFunc >::computeIndex ( const Point p,
int  maxIndex 
)
static

Compute the index in the interpolated array.

Parameters
pPoint relative of this gradient.
maxIndexmaximal value of an interpolation table index.
Returns
Computed index.

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