![]() |
anatomist
5.1.2
3D neuroimaging data viewer
|
The gradient of colors. More...
#include <anatomist/gradientwidget/gradient.h>
Public Member Functions | |
Gradient () | |
Constructor. More... | |
Gradient (bool hsv) | |
Constructor. More... | |
~Gradient () | |
Destructor. More... | |
bool | isHsv () const |
Get the mode of the gradient. More... | |
const Spline & | getSpline (int index) const |
Get one of the splines of the gradient. More... | |
Spline & | getSpline (int index) |
Get one of the splines of the gradient. More... | |
void | fillGradient (QRgb *buffer, int length=GRADIENT_LENGTH, double *data=NULL, bool withAlpha=false) const |
Generate the color table for the gradient. More... | |
void | invert () |
Invert the gradient. More... | |
Static Public Member Functions | |
static QRgb | hsvToRgb (double h, double s, double v) |
Calculate a color from HSV components. More... | |
The gradient of colors.
The gradients consists of three splines which define the waveforms of the color components. The gradient may work in a RGB mode or HSV mode.
Definition at line 23 of file gradient.h.
Gradient::Gradient | ( | ) |
Constructor.
Gradient::Gradient | ( | bool | hsv | ) |
Constructor.
hsv | Mode of the gradient, true - HSV, false - RGB. |
Gradient::~Gradient | ( | ) |
Destructor.
void Gradient::fillGradient | ( | QRgb * | buffer, |
int | length = GRADIENT_LENGTH , |
||
double * | data = NULL , |
||
bool | withAlpha = false |
||
) | const |
Generate the color table for the gradient.
[out] | buffer | The array to fill. |
length | The length of the array. | |
data | The components array to use (3 x length, or 4 x length if withAlpha is true). If NULL , a temporary array is used. | |
withAlpha | if true, the returned array is RGBA, and the data array must be allocated 4 x length. |
|
inline |
Get one of the splines of the gradient.
index | The spline index (0, 1 or 2). |
Definition at line 71 of file gradient.h.
|
inline |
Get one of the splines of the gradient.
index | The spline index (0, 1 or 2). |
Definition at line 60 of file gradient.h.
|
inlinestatic |
Calculate a color from HSV components.
All components should be in range from 0 to 1.
h | The hue component. |
s | The saturation component. |
v | The value component. |
Definition at line 104 of file gradient.h.
void Gradient::invert | ( | ) |
Invert the gradient.
|
inline |
Get the mode of the gradient.
true
if gradient is HSV, false
if RGB. Definition at line 49 of file gradient.h.