00001 #ifndef _WINC_COLORMAP
00002 #define _WINC_COLORMAP
00003
00004 #include <WXP/Color.h>
00005 #include <WXP/RGB.h>
00006
00007 namespace WXP {
00008 class ColorMap {
00009 Color *colors;
00010 int num;
00011 int max;
00012 int num_fill;
00013 public:
00014
00015 ColorMap();
00016 ColorMap( int size );
00017 ColorMap( const ColorMap &color );
00018 ColorMap& operator=( const ColorMap &color );
00019 ~ColorMap();
00020 int init( int size );
00021 int init();
00022 int set( const ColorMap &color );
00023 int add( const char *name, float red, float grn, float blu );
00024 int add( const char *name, RGB &rgb );
00026 int getMax( ) { return max; };
00028 int getNum( ) { return num; };
00029 int getInd( const char *name );
00030 const char *getName( int ind );
00031 int get( int ind, RGB &rgb );
00032 int getRGB( int ind, float &red, float &grn, float &blu );
00033 int getIRGB( int ind, int &red, int &grn, int &blu );
00034 int setValue( int ind, int val );
00035 int getValue( int ind );
00036 int getValue( const char *name );
00038 int getNumFill() { return num_fill; };
00039 bool isColorNear( int ind, RGB &rgb );
00040
00041 int setNumFill( int nfill );
00042 int print();
00043
00044 static const int BACK = -1;
00045 static const int OFF = -1;
00046 static const int END = -2;
00047 static inline bool isColor( int a ){ return (a >= 0); }
00048 };
00049 }
00050
00051 #endif