MeVisLabToolboxReference
|
00001 // **InsertLicense** code 00002 //---------------------------------------------------------------------------------- 00004 00010 //---------------------------------------------------------------------------------- 00011 00012 00013 #ifndef __mlLUTFCombine_H 00014 #define __mlLUTFCombine_H 00015 00016 // Local includes 00017 #ifndef __mlLUTSystem_H 00018 #include "mlLUTSystem.h" 00019 #endif 00020 #ifndef __mlLUTFunction_H 00021 #include "mlLUTFunction.h" 00022 #endif 00023 00024 00025 00026 ML_START_NAMESPACE 00027 00028 00030 class MLLUT_EXPORT LUTFCombine : public LUTFunction 00031 { 00032 public: 00033 00035 LUTFCombine (void) : LUTFunction(LUT_L, true) {} 00036 00037 00039 00040 00042 virtual bool isValid (void) const; 00043 00045 virtual int getNativeMinIndex (void) const; 00046 00048 virtual int getNativeMaxIndex (void) const; 00049 00051 virtual int getHeight (void) const; 00052 00054 virtual int getDepth (void) const; 00055 00057 virtual double getNativeMinValue (void) const; 00058 00060 virtual double getNativeMaxValue (void) const; 00061 00063 00065 enum Mode { 00066 REPLACE = 0, 00067 ADD, BLEND, SUBTRACT, MULTIPLY, MIN, MAX, 00068 NUM_MODES 00069 }; 00070 00072 enum Mask { 00073 MASK_R = 0, MASK_G, MASK_B, MASK_A, MASK_RGB, MASK_RGBA, 00074 NUM_MASKS 00075 }; 00076 00078 class LUTEntry { 00079 public: 00080 Mode mode; 00081 Mask mask; 00082 LUTFunction* function; 00083 }; 00084 00086 void clearEntries(); 00087 00089 void addEntry(const LUTEntry& entry); 00090 00092 unsigned int getNumEntries() const; 00093 00095 const LUTEntry& getEntry(int i) const; 00096 00097 protected: 00098 00100 00101 00106 virtual bool renderLUTNative (LUTDataBase *lutData, LUTIteratorBase *lutIterator) const; 00107 00114 virtual bool renderLUTRescaled (LUTDataBase *lutData, LUTIteratorBase *lutIterator, 00115 double minIndex, double maxIndex) const; 00116 00119 template <typename T> 00120 bool renderLUT (LUTData<T> *lutData, LUTIterator<T> *lutIterator, double minIndex, double maxIndex, 00121 bool rescale) const; 00122 00124 00125 std::vector<LUTEntry> _entries; 00126 00127 ML_CLASS_HEADER(LUTFCombine); 00128 00129 }; 00130 00131 00132 ML_END_NAMESPACE 00133 00134 00135 #endif 00136 // __mlLUTFCombine_H