00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef __mitkColorTable_h
00012 #define __mitkColorTable_h
00013
00014 #include "mitkObject.h"
00015 #include "mitkVisualizationIncludes.h"
00016
00017 class mitkColorList;
00018
00024 class MITK_VISUALIZATION_API mitkColorTable : public mitkObject
00025 {
00026 public:
00027 MITK_TYPE(mitkColorTable, mitkObject)
00028
00029 virtual void PrintSelf(ostream &os);
00030
00034 mitkColorTable();
00035
00043 void SetDefaultColor(int r, int g, int b, int a=0);
00044
00055 void AddColor(double pixVal, int r, int g, int b, int a=0);
00056
00062 void RemoveColor(double pixVal);
00063
00068 void RemoveColor(int index);
00069
00073 void RemoveAllColors();
00074
00078 int GetColorCount();
00079
00090 bool SetColor(int index, int r, int g, int b, int a=0);
00091
00100 bool SetValue(int index, double pixVal);
00101
00114 bool SetValueColor(int index, double pixVal, int r, int g, int b, int a=0);
00115
00125 bool GetColor(double pixVal, int &r, int &g, int &b);
00126
00137 bool GetColor(double pixVal, int &r, int &g, int &b, int &a);
00138
00148 bool GetColor(double pixVal, unsigned char &r, unsigned char &g, unsigned char &b);
00149
00159 bool GetColor(double pixVal, unsigned char color[3]);
00160
00170 bool GetColor(int index, int &r, int &g, int &b);
00171
00182 bool GetColor(int index, int &r, int &g, int &b, int &a);
00183
00193 bool GetColor(int index, unsigned char &r, unsigned char &g, unsigned char &b);
00194
00204 bool GetColor(int index, unsigned char color[3]);
00205
00213 bool GetValue(int index, double &pixVal);
00214
00226 bool GetValueColor(int index, double &pixVal, int &r, int &g, int &b);
00227
00240 bool GetValueColor(int index, double &pixVal, int &r, int &g, int &b, int &a);
00241
00253 bool GetValueColor(int index, double &pixVal, unsigned char &r, unsigned char &g, unsigned char &b);
00254
00266 bool GetValueColor(int index, double &pixVal, unsigned char color[3]);
00267
00272 void Copy(mitkColorTable *src);
00273
00274 protected:
00275 virtual ~mitkColorTable();
00276
00277 int _getIndex(double pixVal);
00278 int _getIndex(int index);
00279
00280 mitkColorList *m_ColorList;
00281
00282 private:
00283 mitkColorTable(const mitkColorTable&);
00284 void operator = (const mitkColorTable&);
00285
00286 };
00287
00288
00289
00290
00291
00292
00293 #endif
00294