UNIVERS
15.3
UNIVERS base processing software API
|
#include <ZPalette.H>
Public Member Functions | |
ZPalette (const ZConnect &zconnect) | |
ZPalette (const ZPalette &zpal) | |
virtual | ~ZPalette () |
virtual void | set_smooth_rate (int n=100) |
virtual void | load_palette (const char *szPalName) |
virtual void | append_palette (const char *szPalName) |
virtual void | revert_order () |
virtual void | add_color (ColorPixel theColorPixel) |
virtual void | add_color (const char *szColorName) |
virtual void | add_color (float rgb[3]) |
virtual void | insert_color (unsigned index, ColorPixel theColorPixel) |
virtual void | insert_color (unsigned index, const char *szColorName) |
virtual void | insert_color (unsigned index, float rgb[3]) |
virtual void | remove_color (unsigned index) |
virtual void | reset_colors () |
unsigned | colors_count () const |
ColorPixel | color (unsigned index) const |
const char * | color_name (unsigned index) const |
ColorPixel & | fetch_color (unsigned index) |
ColorPixel & | operator[] (unsigned index) |
Pixmap | draw_palette (const ZSize &zs, Logic bReverse=FALSE, ZDimension dim=zdHorizontal) const |
Public Member Functions inherited from ZConnect | |
ZConnect (Display *display) | |
ZConnect (const ZConnect &zconnect) | |
void | flush () |
void | x_error (int code) const |
ZRect | rect (Drawable drawable) const |
virtual ZRect | rect () const |
int | depth (Drawable drawable) const |
Window | root_wid () const |
ColorPixel | white () const |
ColorPixel | black () const |
ColorPixel | color (const char *szColorName) const |
Protected Attributes | |
int | nSmooth |
Additional Inherited Members | |
Public Attributes inherited from ZConnect | |
Display * | dpy |
ScreenNo | scr_no |
Color palette is simple array of unsigned longs (color cells).
ZPalette::ZPalette | ( | const ZConnect & | zconnect | ) |
Create empty palette
ZPalette::ZPalette | ( | const ZPalette & | zpal | ) |
Create copy of the palette
|
virtual |
Just to make compiler happy
|
virtual |
Add color in palette (at the end)
Reimplemented in ZScaledPalette.
|
virtual |
Append list of colors with palette of pointed name. Leading '-' means reverse order of colors. "c1:c2:...:cN" may be used for obtaining smooth palette.
ColorPixel ZPalette::color | ( | unsigned | index | ) | const |
Get color by index
unsigned ZPalette::colors_count | ( | ) | const |
Return count of colors in palette
Pixmap ZPalette::draw_palette | ( | const ZSize & | zs, |
Logic | bReverse = FALSE , |
||
ZDimension | dim = zdHorizontal |
||
) | const |
Create pixmap of given size with horizontal or vertical palette image (color bars)
ColorPixel& ZPalette::fetch_color | ( | unsigned | index | ) |
Get or change color by index
|
virtual |
Insert color before pointed index
Reimplemented in ZScaledPalette.
|
virtual |
Load palette with pointed name. Leading '-' means reverse order of colors. "c1:c2:...:cN" may be used for obtaining smooth palette.
|
virtual |
Add several colors to fit the gradient from one given color to another. Delete color at pointed index
Reimplemented in ZScaledPalette.
|
virtual |
Delete all colors
Reimplemented in ZScaledPalette.
|
virtual |
Revert order of colors
Reimplemented in ZScaledPalette.
|
virtual |
Set number of smooth colors (100 by default). Should be set before load_palette()/append_palette().
|
protected |
Number of resulting color after building
smooth palette.