UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ZPalette.H
1 /* ZPalette.H */
2 /* $Id: ZPalette.H,v 1.14 2005/09/30 08:06:02 vlad Exp $ */
3 
4 #if !defined __ZPalette_H
5 
6 #define __ZPalette_H
7 
8 #include <mix/Types.h>
9 #include <mix/FloatAr.H>
10 #include <mix/LongAr.H>
11 #include <zm/ZBase.H>
12 
18 class ZPalette : virtual public ZConnect
19 {
20 public:
21 
23  ZPalette (const ZConnect& zconnect);
24 
26  ZPalette (const ZPalette& zpal);
27 
29  virtual ~ZPalette ();
30 
33  virtual void set_smooth_rate (int n = 100);
34 
38  virtual void load_palette (const char* szPalName);
39 
43  virtual void append_palette (const char* szPalName);
44 
46  virtual void revert_order ();
47 
49  virtual void add_color (ColorPixel theColorPixel);
50  virtual void add_color (const char* szColorName);
51  virtual void add_color (float rgb[3]);
52 
54  virtual void insert_color (unsigned index, ColorPixel theColorPixel);
55  virtual void insert_color (unsigned index, const char* szColorName);
56  virtual void insert_color (unsigned index, float rgb[3]);
57 
60  /*virtual void add_gradient (int n, const char* szColorName1,
61  const char* szColorName2);*/
62 
64  virtual void remove_color (unsigned index);
65 
67  virtual void reset_colors ();
68 
70  unsigned colors_count () const;
71 
73  ColorPixel color (unsigned index) const;
74 
75  const char* color_name(unsigned index) const;
76 
78  ColorPixel& fetch_color (unsigned index);
79  ColorPixel& operator[] (unsigned index)
80  {return fetch_color(index);}
81 
84  Pixmap draw_palette (const ZSize& zs,
85  Logic bReverse = FALSE,
86  ZDimension dim = zdHorizontal) const;
87 
88 protected:
89 
90  int nSmooth;
93 private:
94 
95  char **color_names;
96  ULongAr c;
98 };
99 
100 
101 #endif // ZPalette.H
virtual ~ZPalette()
virtual void set_smooth_rate(int n=100)
Definition: ZBase.H:58
ColorPixel & fetch_color(unsigned index)
Definition: ZBase.H:118
Definition: ZPalette.H:18
Pixmap draw_palette(const ZSize &zs, Logic bReverse=FALSE, ZDimension dim=zdHorizontal) const
ColorPixel color(unsigned index) const
virtual void add_color(ColorPixel theColorPixel)
virtual void remove_color(unsigned index)
virtual void load_palette(const char *szPalName)
unsigned colors_count() const
virtual void append_palette(const char *szPalName)
Definition: LongAr.H:80
virtual void reset_colors()
virtual void revert_order()
ZPalette(const ZConnect &zconnect)
virtual void insert_color(unsigned index, ColorPixel theColorPixel)
int nSmooth
Definition: ZPalette.H:90