Core 1.0
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
Palette Class Reference

Palette with array of colors. More...

#include <palette.h>

Inheritance diagram for Palette:
GenericPalette

Public Member Functions

 Palette ()
 Create an empty palette.
 
 Palette (const AnalyticPalette &, int=16)
 Create a palette from an analytic palette. More...
 
 Palette (const QVector< QColor > &)
 Create a palette. More...
 
 Palette (const QVector< Color > &)
 Create a palette. More...
 
 Palette (const QVector< Color > &, const QVector< double > &)
 Create a palette. More...
 
 Palette (const Color &, const Color &, const Color &, const double &=0.5)
 Create a diverging palette. More...
 
 Palette (const QImage &)
 Create a palette from an image. More...
 
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. More...
 
Color GetColor (const double &) const
 Compute a color in the palette. More...
 
void Saturate (const double &)
 Saturate all colors of the palette. More...
 
void Brighten (const double &)
 Brighten all colors of the palette. More...
 
- Public Member Functions inherited from GenericPalette
virtual QImage Draw (int=32, int=1024) const
 Draws an image with the colors of the palette. More...
 
virtual QImage CreateImage (int, int=16, bool=false) const
 Create an image form a palette. More...
 

Static Public Member Functions

static Palette ShadedRelief ()
 Generate a shader relief palette.
 
static Palette BrownDesert ()
 Brown desert palette.
 

Protected Attributes

QVector< Colorc
 Array of colors.
 
QVector< double > a
 Anchors.
 
int type = 0
 Type, used to speed-up queries.
 

Detailed Description

Palette with array of colors.

Constructor & Destructor Documentation

◆ Palette() [1/6]

Palette::Palette ( const AnalyticPalette p,
int  n = 16 
)

Create a palette from an analytic palette.

Parameters
pAnalytic palette.
nSampling.

◆ Palette() [2/6]

Palette::Palette ( const QVector< QColor > &  qtc)

Create a palette.

Parameters
qtcSet of evenly distributed Qt colors points.

◆ Palette() [3/6]

Palette::Palette ( const QVector< Color > &  c)

Create a palette.

Parameters
cSet of evenly distributed colors points.

◆ Palette() [4/6]

Palette::Palette ( const QVector< Color > &  c,
const QVector< double > &  a 
)

Create a palette.

Parameters
cArray of colors.
aArray of indices.

◆ Palette() [5/6]

Palette::Palette ( const Color ca,
const Color cb,
const Color cc,
const double &  ab = 0.5 
)

Create a diverging palette.

Parameters
ca,cb,ccEnd colors and diverging color.
abDiverging entry.

◆ Palette() [6/6]

Palette::Palette ( const QImage &  image)

Create a palette from an image.

Parameters
imageInput palette colors.

Member Function Documentation

◆ Brighten()

void Palette::Brighten ( const double &  x)

Brighten all colors of the palette.

Parameters
xCoefficient.

◆ GetColor()

Color Palette::GetColor ( const double &  t) const
virtual

Compute a color in the palette.

Parameters
tInterpolation parameter.

Reimplemented from GenericPalette.

◆ Saturate()

void Palette::Saturate ( const double &  x)

Saturate all colors of the palette.

Parameters
xCoefficient.

◆ ScaleTo()

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.

Parameters
x,yInterval.