UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | List of all members
ZqbPalette Class Reference

#include <zqb_palette.hpp>

Inheritance diagram for ZqbPalette:
ZqbScaledPalette ZqbScaledPalette

Public Member Functions

 ZqbPalette (const QColor &c=Qt::black)
 
 ZqbPalette (int n, const QColor &c1, const QColor &c2)
 
 ZqbPalette (int n, const QColor &c1, const QColor &c2, const QColor &c3)
 
 ZqbPalette (const ZqbPalette &zpal)
 
virtual ~ZqbPalette ()
 
ZqbPaletteoperator= (const ZqbPalette &zpal)
 
virtual void revertColorsOrder ()
 
virtual int numberOfColors () const
 
virtual const QColor & color (int index) const
 
const QColor & operator[] (int index) const
 
virtual QColor & color (int index)
 
QColor & operator[] (int index)
 
virtual int colorIndex (const QColor &c) const
 
const int operator[] (const QColor &c) const
 
virtual void drawPalette (QPixmap &pixmap, Qt::Orientation eOrient) const
 
virtual int addColor (const QColor &c)
 
ZqbPaletteoperator+= (const QColor &c)
 
virtual int addPalette (const ZqbPalette &pal)
 
ZqbPaletteoperator+= (const ZqbPalette &pal)
 
void expandToColor (int n, const QColor &c)
 
int addColors (int n, const QColor &c1, const QColor &c2)
 
int addColors (int n, const QColor &c1, const QColor &c2, const QColor &c3)
 
 ZqbPalette (const QColor &c=Qt::black)
 
 ZqbPalette (int n, const QColor &c1, const QColor &c2)
 
 ZqbPalette (int n, const QColor &c1, const QColor &c2, const QColor &c3)
 
 ZqbPalette (const ZqbPalette &zpal)
 
virtual ~ZqbPalette ()
 
ZqbPaletteoperator= (const ZqbPalette &zpal)
 
virtual void revertColorsOrder ()
 
virtual int numberOfColors () const
 
virtual const QColor & color (int index) const
 
const QColor & operator[] (int index) const
 
virtual QColor & color (int index)
 
QColor & operator[] (int index)
 
virtual int colorIndex (const QColor &c) const
 
int operator[] (const QColor &c) const
 
virtual void drawPalette (QPixmap &pixmap, Qt::Orientation eOrient) const
 
virtual int addColor (const QColor &c)
 
ZqbPaletteoperator+= (const QColor &c)
 
virtual int addPalette (const ZqbPalette &pal)
 
ZqbPaletteoperator+= (const ZqbPalette &pal)
 
void expandToColor (int n, const QColor &c)
 
int addColors (int n, const QColor &c1, const QColor &c2)
 
int addColors (int n, const QColor &c1, const QColor &c2, const QColor &c3)
 

Detailed Description

Color palette is simple array of colors.

Constructor & Destructor Documentation

ZqbPalette::ZqbPalette ( const QColor &  c = Qt::black)

Create palette of one given color (black by default).

ZqbPalette::ZqbPalette ( int  n,
const QColor &  c1,
const QColor &  c2 
)

Create palette as vector of n colors distributed smoothly from first color to the second.

ZqbPalette::ZqbPalette ( int  n,
const QColor &  c1,
const QColor &  c2,
const QColor &  c3 
)

Create palette as vector of n colors distributed smoothly from first color to the third via the second. White color (Qt::white()) is advised as the second color.

ZqbPalette::ZqbPalette ( const ZqbPalette zpal)

Create copy of the palette.

virtual ZqbPalette::~ZqbPalette ( )
virtual

Free all colors.

ZqbPalette::ZqbPalette ( const QColor &  c = Qt::black)

Create palette of one given color (black by default).

ZqbPalette::ZqbPalette ( int  n,
const QColor &  c1,
const QColor &  c2 
)

Create palette as vector of n colors distributed smoothly from first color to the second.

ZqbPalette::ZqbPalette ( int  n,
const QColor &  c1,
const QColor &  c2,
const QColor &  c3 
)

Create palette as vector of n colors distributed smoothly from first color to the third via the second. White color (Qt::white()) is advised as the second color.

ZqbPalette::ZqbPalette ( const ZqbPalette zpal)

Create copy of the palette.

virtual ZqbPalette::~ZqbPalette ( )
virtual

Free all colors.

Member Function Documentation

virtual int ZqbPalette::addColor ( const QColor &  c)
virtual

Append one more color at the end of array and return its index.

virtual int ZqbPalette::addColor ( const QColor &  c)
virtual

Append one more color at the end of array and return its index.

int ZqbPalette::addColors ( int  n,
const QColor &  c1,
const QColor &  c2 
)
inline

Append n colors distributed smoothly from first color to the second and return start index of appended palette.

int ZqbPalette::addColors ( int  n,
const QColor &  c1,
const QColor &  c2 
)
inline

Append n colors distributed smoothly from first color to the second and return start index of appended palette.

int ZqbPalette::addColors ( int  n,
const QColor &  c1,
const QColor &  c2,
const QColor &  c3 
)
inline

Append n colors distributed smoothly from first color to the third via the second and return start index of appended palette.

int ZqbPalette::addColors ( int  n,
const QColor &  c1,
const QColor &  c2,
const QColor &  c3 
)
inline

Append n colors distributed smoothly from first color to the third via the second and return start index of appended palette.

virtual int ZqbPalette::addPalette ( const ZqbPalette pal)
virtual

Append the whole palette at the end of color array and return start index of appended palette.

virtual int ZqbPalette::addPalette ( const ZqbPalette pal)
virtual

Append the whole palette at the end of color array and return start index of appended palette.

virtual const QColor& ZqbPalette::color ( int  index) const
virtual

Get color by its index (counted from 0). If index is out of bounds then let's use the closest correct index or return Qt::black().

virtual const QColor& ZqbPalette::color ( int  index) const
virtual

Get color by its index (counted from 0). If index is out of bounds then let's use the closest correct index or return Qt::black().

virtual QColor& ZqbPalette::color ( int  index)
virtual

Access color by its index (counted from 0). If index is out of bounds then let's use the closest correct index or return Qt::black().

virtual QColor& ZqbPalette::color ( int  index)
virtual

Access color by its index (counted from 0). If index is out of bounds then let's use the closest correct index or return Qt::black().

virtual int ZqbPalette::colorIndex ( const QColor &  c) const
virtual

Get index of given color. The color is searched from the low end of color array and the first matched color is solved as found. Returns -1 if the color is not found.

virtual int ZqbPalette::colorIndex ( const QColor &  c) const
virtual

Get index of given color. The color is searched from the low end of color array and the first matched color is solved as found. Returns -1 if the color is not found.

virtual void ZqbPalette::drawPalette ( QPixmap &  pixmap,
Qt::Orientation  eOrient 
) const
virtual

Fill pixmap with image of the palette with Qt::Horizontal or Qt::Vertical orientation.

virtual void ZqbPalette::drawPalette ( QPixmap &  pixmap,
Qt::Orientation  eOrient 
) const
virtual

Fill pixmap with image of the palette with Qt::Horizontal or Qt::Vertical orientation.

void ZqbPalette::expandToColor ( int  n,
const QColor &  c 
)

Append n colors distributed smoothly from the last color in the palette to the given color.

void ZqbPalette::expandToColor ( int  n,
const QColor &  c 
)

Append n colors distributed smoothly from the last color in the palette to the given color.

virtual int ZqbPalette::numberOfColors ( ) const
virtual

Return number of colors in the palette.

virtual int ZqbPalette::numberOfColors ( ) const
virtual

Return number of colors in the palette.

ZqbPalette& ZqbPalette::operator+= ( const QColor &  c)
inline

Append one more color at the end of array. Almost synonymous for addColor().

ZqbPalette& ZqbPalette::operator+= ( const QColor &  c)
inline

Append one more color at the end of array. Almost synonymous for addColor().

ZqbPalette& ZqbPalette::operator+= ( const ZqbPalette pal)
inline

Append the whole palette at the end of color array. Almost synonymous for addPalette().

ZqbPalette& ZqbPalette::operator+= ( const ZqbPalette pal)
inline

Append the whole palette at the end of color array. Almost synonymous for addPalette().

ZqbPalette& ZqbPalette::operator= ( const ZqbPalette zpal)

Assign the palette.

ZqbPalette& ZqbPalette::operator= ( const ZqbPalette zpal)

Assign the palette.

const QColor& ZqbPalette::operator[] ( int  index) const
inline

Get color by its index (counted from 0). Synonymous for color().

const QColor& ZqbPalette::operator[] ( int  index) const
inline

Get color by its index (counted from 0). Synonymous for color().

QColor& ZqbPalette::operator[] ( int  index)
inline

Access color by its index (counted from 0). Synonymous for color().

QColor& ZqbPalette::operator[] ( int  index)
inline

Access color by its index (counted from 0). Synonymous for color().

int ZqbPalette::operator[] ( const QColor &  c) const
inline

Get index of given color. Returns -1 if the color is not found. Synonymous for colorIndex().

const int ZqbPalette::operator[] ( const QColor &  c) const
inline

Get index of given color. Returns -1 if the color is not found. Synonymous for colorIndex().

virtual void ZqbPalette::revertColorsOrder ( )
virtual

Revert order of colors in the palette.

virtual void ZqbPalette::revertColorsOrder ( )
virtual

Revert order of colors in the palette.


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