|
Core 1.0
|
Palette with array of colors. More...
#include <palette.h>
Public Member Functions | |
| Palette () | |
| Create an empty palette. | |
| Palette (const AnalyticPalette &, int=16) | |
| Create a palette from an analytic palette. | |
| Palette (const QVector< QColor > &) | |
| Create a palette. | |
| Palette (const QVector< Color > &) | |
| Create a palette. | |
| Palette (const QVector< Color > &, const QVector< double > &) | |
| Create a palette. | |
| Palette (const Color &, const Color &, const Color &, const double &=0.5) | |
| Create a diverging palette. | |
| Palette (const QImage &) | |
| Create a palette from an image. | |
| Palette | Reverse () const |
| Reverse the enrties of the palette. | |
| void | ScaleTo (const double &=0.0, const double &=1.0) |
| Scale the range of values of the palette so that it lies in the prescribed interval. | |
| Color | GetColor (double) const |
| Compute a color in the palette. | |
| void | Saturate (const double &) |
| Saturate all colors of the palette. | |
| void | Brighten (const double &) |
| Brighten all colors of the palette. | |
Public Member Functions inherited from GenericPalette | |
| virtual QImage | Draw (int=32, int=1024) const |
| Draws an image with the colors of the palette. | |
| virtual QImage | CreateImage (int, int=16, bool=false) const |
| Create an image form a palette. | |
Protected Attributes | |
| QVector< Color > | c |
| Array of colors. | |
| QVector< double > | a |
| Anchors. | |
| int | type = 0 |
| Type, used to speed-up queries. | |
Palette with array of colors.
| Palette::Palette | ( | const AnalyticPalette & | p, |
| int | n = 16 ) |
Create a palette from an analytic palette.
| p | Analytic palette. |
| n | Sampling. |
| Palette::Palette | ( | const QVector< QColor > & | qtc | ) |
Create a palette.
This constructeur allows to create a simple color ramp easily:
| qtc | Set of evenly distributed Qt colors points. |
| Palette::Palette | ( | const QVector< Color > & | c | ) |
Create a palette.
| c | Set of evenly distributed colors points. |
| Palette::Palette | ( | const QVector< Color > & | c, |
| const QVector< double > & | a ) |
Create a diverging palette.
| ca,cb,cc | End colors and diverging color. |
| ab | Diverging entry. |
| Palette::Palette | ( | const QImage & | image | ) |
Create a palette from an image.
The function chekcs the larger dimension of the image, and scans it accordingly.
| image | Input palette colors. |
| void Palette::Brighten | ( | const double & | x | ) |
Brighten all colors of the palette.
| x | Coefficient. |
|
virtual |
Compute a color in the palette.
| t | Interpolation parameter. |
Reimplemented from GenericPalette.
| void Palette::Saturate | ( | const double & | x | ) |
Saturate all colors of the palette.
| x | Coefficient. |
| void Palette::ScaleTo | ( | const double & | x = 0.0, |
| const double & | y = 1.0 ) |
Scale the range of values of the palette so that it lies in the prescribed interval.
| x,y | Interval. |