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

#include <ZPalette.H>

Inheritance diagram for ZPalette:
ZConnect ZScaledPalette ZtColoredMatrix ZtSeismicTrace

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
 

Detailed Description

Color palette is simple array of unsigned longs (color cells).

Constructor & Destructor Documentation

ZPalette::ZPalette ( const ZConnect zconnect)

Create empty palette

ZPalette::ZPalette ( const ZPalette zpal)

Create copy of the palette

virtual ZPalette::~ZPalette ( )
virtual

Just to make compiler happy

Member Function Documentation

virtual void ZPalette::add_color ( ColorPixel  theColorPixel)
virtual

Add color in palette (at the end)

Reimplemented in ZScaledPalette.

virtual void ZPalette::append_palette ( const char *  szPalName)
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 void ZPalette::insert_color ( unsigned  index,
ColorPixel  theColorPixel 
)
virtual

Insert color before pointed index

Reimplemented in ZScaledPalette.

virtual void ZPalette::load_palette ( const char *  szPalName)
virtual

Load palette with pointed name. Leading '-' means reverse order of colors. "c1:c2:...:cN" may be used for obtaining smooth palette.

virtual void ZPalette::remove_color ( unsigned  index)
virtual

Add several colors to fit the gradient from one given color to another. Delete color at pointed index

Reimplemented in ZScaledPalette.

virtual void ZPalette::reset_colors ( )
virtual

Delete all colors

Reimplemented in ZScaledPalette.

virtual void ZPalette::revert_order ( )
virtual

Revert order of colors

Reimplemented in ZScaledPalette.

virtual void ZPalette::set_smooth_rate ( int  n = 100)
virtual

Set number of smooth colors (100 by default). Should be set before load_palette()/append_palette().

Member Data Documentation

int ZPalette::nSmooth
protected
      Number of resulting color after building

smooth palette.


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