00001 #ifndef _WINC_ENHANCE
00002 #define _WINC_ENHANCE
00003
00004 #include <WXP/ColorMap.h>
00005
00006 namespace WXP {
00007 class Enhance {
00008 char name[20];
00009 int *index;
00010 float *value;
00011 int type;
00012 int ind;
00013 int num;
00014 int max;
00015 public:
00016
00017 Enhance( ColorMap &colormap, const char *str );
00018 Enhance();
00019 ~Enhance();
00020 int init();
00021 int getNum();
00022 int set( ColorMap &colormap, const char *str );
00023 int readFile( ColorMap &colormap, const char *file );
00024 int validateValues();
00025 int decode( ColorMap &colormap, const char *str );
00026 int getIndex( int ind );
00027 float getValue( int ind );
00028 int getIndex( float rvalue );
00029 int getColor( float rvalue );
00030 inline bool isIndex(){ return type == INDEX; };
00031 inline bool isValue(){ return type == VALUE; };
00032 inline const char *getName(){ return name; };
00033 int print();
00034
00035 static float getIRInd( float val );
00036
00037 enum Type { INDEX, VALUE };
00038 };
00039 }
00040 #endif