Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members

mitkColorTable.h

00001 /*=========================================================================
00002 
00003   Program:   3DMed
00004   Date:      $Date: 2014-02-25 18:30:00 +0800 $
00005   Version:   $Version: 4.6.0 $
00006   Copyright: MIPG, Institute of Automation, Chinese Academy of Sciences
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 //#define DEFINED_mitkColorTable
00290 
00291 
00292 
00293 #endif
00294 

Generated on Tue Feb 25 15:00:36 2014 for MITK (Medical Imaging ToolKit) by  doxygen 1.4.3