WXP C++ Library Version 6.74.9
Loading...
Searching...
No Matches
ColorMap.h
1#ifndef _WINC_COLORMAP
2#define _WINC_COLORMAP
3
4#include <WXP/Color.h>
5#include <WXP/RGB.h>
6
7namespace WXP {
8 class ColorMap {
9 Color *colors;
10 int num;
11 int max;
12 int num_fill;
13 public:
14
15 ColorMap();
16 ColorMap( int size );
17 ColorMap( const ColorMap &color );
18 ColorMap& operator=( const ColorMap &color );
19 ~ColorMap();
20 int init( int size );
21 int init();
22 int set( const ColorMap &color );
23 int add( const char *name, float red, float grn, float blu );
24 int add( const char *name, RGB &rgb );
26 int getMax( ) { return max; };
28 int getNum( ) { return num; };
29 int getInd( const char *name );
30 const char *getName( int ind );
31 int get( int ind, RGB &rgb );
32 int getRGB( int ind, float &red, float &grn, float &blu );
33 int getIRGB( int ind, int &red, int &grn, int &blu );
34 int setValue( int ind, int val );
35 int getValue( int ind );
36 int getValue( const char *name );
38 int getNumFill() { return num_fill; };
39 bool isColorNear( int ind, RGB &rgb );
40
41 int setNumFill( int nfill );
42 int print();
43
44 static const int BACK = -1;
45 static const int OFF = -1;
46 static const int END = -2;
48 static inline bool isColor( int a ){ return (a >= 0); }
49 };
50}
51
52#endif
This class defines a specific color map. This is a mapping between color indices, color names and RGB...
Definition ColorMap.h:8
int add(const char *name, float red, float grn, float blu)
Definition ColorMap.cc:116
int getInd(const char *name)
Definition ColorMap.cc:154
int setNumFill(int nfill)
Definition ColorMap.cc:336
int getValue(int ind)
Definition ColorMap.cc:313
static bool isColor(int a)
Definition ColorMap.h:48
static const int END
Definition ColorMap.h:46
int getNumFill()
Definition ColorMap.h:38
int print()
Definition ColorMap.cc:363
int set(const ColorMap &color)
Definition ColorMap.cc:90
int setValue(int ind, int val)
Definition ColorMap.cc:302
~ColorMap()
Definition ColorMap.cc:59
int get(int ind, RGB &rgb)
Definition ColorMap.cc:238
static const int BACK
Definition ColorMap.h:44
ColorMap & operator=(const ColorMap &color)
Definition ColorMap.cc:50
const char * getName(int ind)
Definition ColorMap.cc:228
int getRGB(int ind, float &red, float &grn, float &blu)
Definition ColorMap.cc:260
bool isColorNear(int ind, RGB &rgb)
Definition ColorMap.cc:347
int getIRGB(int ind, int &red, int &grn, int &blu)
Definition ColorMap.cc:282
ColorMap()
Definition ColorMap.cc:32
int getNum()
Definition ColorMap.h:28
int init()
Definition ColorMap.cc:80
static const int OFF
Definition ColorMap.h:45
int getMax()
Definition ColorMap.h:26
All WXP classes fall under the WXP namespace.
Definition Angle.h:4
This struct stores basic color values.
Definition Color.h:5
This struct defines a set of RGB values.
Definition RGB.h:5