|
Simple++
Powerfull and lightning fast C++ Library
|
#include <Gradient.h>
Public Member Functions | |
| GradientLinear (float angle, const Math::Vec2< float > &p=Math::Vec2< float >::null, unsigned int length=0, const InterFunc &functor=InterFunc()) | |
| Create a new Linear Gradient. More... | |
| void | setAngle (float angle) |
| set the angle of this linear gradient More... | |
| void | setPoint (const Math::Vec2< float > &p) |
| set the starting point of this gradient More... | |
| void | setLength (unsigned int length) |
| float | getAngle () const |
| get the angle of this gradient More... | |
| float | getAngleRad () const |
| get the angle of this gradient More... | |
| const Math::Vec2< float > & | getPoint () const |
| get the point of this gradient More... | |
| unsigned int | getLength () const |
| get the length of this gradient More... | |
| const Math::Vec2< float > & | getDirection () const |
| get the unitary vector representing the direction of this gradient. More... | |
| int | computeIndex (const Math::Vec2< float > &p, int maxIndex) const |
| Compute the index in the interpolated array. 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< float > &p, int maxIndex, const Math::Vec2< float > &direction) |
| 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... | |
| Graphic::GradientLinear< C, InterFunc >::GradientLinear | ( | float | angle, |
| const Math::Vec2< float > & | p = Math::Vec2<float>::null, |
||
| unsigned int | length = 0, |
||
| const InterFunc & | functor = InterFunc() |
||
| ) |
Create a new Linear Gradient.
| angle | Angle in degree point of this gradient. |
| length | Length of this gradient (0 mean auto computed) |
| functor | Functor used to interpolate the colors overloaded with : template<typename C> inline C operator()(const C & color1, const C & color2, float x) const; |
| int Graphic::GradientLinear< C, InterFunc >::computeIndex | ( | const Math::Vec2< float > & | p, |
| int | maxIndex | ||
| ) | const |
Compute the index in the interpolated array.
| p | Point relative of this gradient. |
| maxIndex | maximal value of an interpolation table index. |
|
static |
Compute the index in the interpolated array.
| p | Point relative of this gradient. |
| maxIndex | maximal value of an interpolation table index. |
| direction | Unitary vector representing the direction if this gradient. |
| float Graphic::GradientLinear< C, InterFunc >::getAngle | ( | ) | const |
get the angle of this gradient
| float Graphic::GradientLinear< C, InterFunc >::getAngleRad | ( | ) | const |
get the angle of this gradient
| const Math::Vec2< float > & Graphic::GradientLinear< C, InterFunc >::getDirection | ( | ) | const |
get the unitary vector representing the direction of this gradient.
| unsigned int Graphic::GradientLinear< C, InterFunc >::getLength | ( | ) | const |
get the length of this gradient
| const Math::Vec2< float > & Graphic::GradientLinear< C, InterFunc >::getPoint | ( | ) | const |
get the point of this gradient
| void Graphic::GradientLinear< C, InterFunc >::setAngle | ( | float | angle | ) |
set the angle of this linear gradient
| angle | Angle in Degree of this gradient (0 mean left to right) then it's anti clockwise |
| void Graphic::GradientLinear< C, InterFunc >::setLength | ( | unsigned int | length | ) |
brief set the length of this linear gradient param length Length in pixels (0 mean auto computed)
| void Graphic::GradientLinear< C, InterFunc >::setPoint | ( | const Math::Vec2< float > & | p | ) |
set the starting point of this gradient
| p | Point (between 0 and 1) |
1.8.11