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

mitkColorTransferFunction.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 __mitkColorTransferFunction_h
00012 #define __mitkColorTransferFunction_h
00013 
00014 #include "mitkObject.h"
00015 #include "mitkVisualizationIncludes.h"
00016 
00017 struct mitkColorPoint
00018 {
00019     int x;
00020     float r;
00021     float g;
00022     float b;
00023 };
00024 
00025 class mitkColorPointArray;
00026 
00034 class MITK_VISUALIZATION_API mitkColorTransferFunction : public mitkObject
00035 {
00036 public:
00037     MITK_TYPE(mitkColorTransferFunction,mitkObject)
00038 
00039     mitkColorTransferFunction();        
00040     virtual void PrintSelf(ostream& os);    
00041     
00049     void AddPoint(int x, float rColor, float gColor, float bColor);
00050 
00057     void RemovePoint(int x);
00058 
00062     void RemoveAllPoints();
00063 
00068     int GetPointsCount();
00069 
00075     int GetDataValueAtPoint(int pointIndex);
00076 
00082     float GetRedColorAtPoint(int pointIndex);
00083 
00089     float GetGreenColorAtPoint(int pointIndex);
00090 
00096     float GetBlueColorAtPoint(int pointIndex);
00097 
00110     void SetMax(int xMax, float rMax, float gMax, float bMax);  
00111 
00112 
00117     int  GetMaxX() {return m_MaxX;}
00118 
00124     float GetRedValue(int x);
00125 
00131     float GetGreenValue(int x);
00132 
00138     float GetBlueValue(int x);  
00139 
00146     float* GetRData() {return m_RData;}
00147 
00154     float* GetGData() {return m_GData;}
00155 
00162     float* GetBData() {return m_BData;}
00163 
00169     bool IsModified() const { return m_Modified; }
00170 
00175     void SetUnmodified() { m_Modified = false; }
00176 
00177 protected:  
00178     int m_MaxX; 
00179     mitkColorPointArray *m_Points;  
00180     float *m_RData;
00181     float *m_GData;
00182     float *m_BData;
00183     
00184     bool m_Modified;
00185 
00186     virtual ~mitkColorTransferFunction();               
00187     void _buildRFunction(int x1, float r1, int x2, float r2);
00188     void _buildGFunction(int x1, float g1, int x2, float g2);
00189     void _buildBFunction(int x1, float b1, int x2, float b2);
00190     
00191 private:
00192     mitkColorTransferFunction(const mitkColorTransferFunction&);  
00193     void operator=(const mitkColorTransferFunction&); 
00194 };
00195 
00196  
00197     //#define DEFINED_mitkColorTransferFunction
00198      
00199 
00200 
00201 #endif
00202 
00203 
00204 
00205 

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