MeVisLabToolboxReference
|
00001 // **InsertLicense** code 00002 //---------------------------------------------------------------------------------- 00004 00010 //---------------------------------------------------------------------------------- 00011 00012 00013 #ifndef __mlLUTFRampPair_H 00014 #define __mlLUTFRampPair_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 #ifndef __mlLUTFPrimitive_H 00024 #include "mlLUTFPrimitive.h" 00025 #endif 00026 00027 00028 00029 ML_START_NAMESPACE 00030 00031 00033 class MLLUT_EXPORT LUTFRampPair : public LUTFunction 00034 { 00035 public: 00036 00038 LUTFRampPair (void); 00039 00040 00042 00043 00045 virtual void setRelative (bool relative); 00046 00048 virtual double getRGBCenter (void) const { return _rgbRamp.getCenter(); } 00049 00051 virtual void setRGBCenter (double center) { _rgbRamp.setCenter(center); changed(); } 00052 00054 virtual double getRGBWidth (void) const { return _rgbRamp.getWidth(); } 00055 00057 virtual void setRGBWidth (double width) { _rgbRamp.setWidth(width); changed(); } 00058 00060 virtual void getRGBStart (double *r, double *g, double *b) const; 00061 00063 virtual void setRGBStart (double r, double g, double b); 00064 00066 virtual void getRGBEnd (double *r, double *g, double *b) const; 00067 00069 virtual void setRGBEnd (double r, double g, double b); 00070 00072 virtual double getAlphaCenter (void) const { return _alphaRamp.getCenter(); } 00073 00075 virtual void setAlphaCenter (double center) { _alphaRamp.setCenter(center); changed(); } 00076 00078 virtual double getAlphaWidth (void) const { return _alphaRamp.getWidth(); } 00079 00081 virtual void setAlphaWidth (double width) { _alphaRamp.setWidth(width); changed(); } 00082 00084 virtual double getAlphaStart (void) const { return _alphaRamp.getBaseValue(); } 00085 00087 virtual void setAlphaStart (double a) { _alphaRamp.setBaseValue(a); changed(); } 00088 00090 virtual double getAlphaEnd (void) const { return _alphaRamp.getPeakValue(); } 00091 00093 virtual void setAlphaEnd (double a) { _alphaRamp.setPeakValue(a); changed(); } 00094 00096 00097 00099 00100 00102 virtual int getNativeMinIndex (void) const; 00103 00105 virtual int getNativeMaxIndex (void) const; 00106 00108 00109 00110 protected: 00111 00113 00114 00119 virtual bool renderLUTNative (LUTDataBase *lutData, LUTIteratorBase *lutIterator) const; 00120 00127 virtual bool renderLUTRescaled (LUTDataBase *lutData, LUTIteratorBase *lutIterator, 00128 double minIndex, double maxIndex) const; 00129 00131 virtual LUTDataBase *createLUT (LUTDataBase *lutData) const; 00132 00137 template <typename T> 00138 bool copyLUT (LUTData<T> *lutData, LUTIterator<T> *lutIterator, 00139 const LUTData<double> *rgbLut, const LUTData<T> *alphaLut) const; 00140 00142 00143 00145 LUTFPrimitive _rgbRamp; 00146 00148 LUTFPrimitive _alphaRamp; 00149 00151 double _rgbStart[3], _rgbEnd[3]; 00152 00153 00154 00155 ML_CLASS_HEADER(LUTFRampPair); 00156 00157 }; 00158 00159 00160 ML_END_NAMESPACE 00161 00162 00163 #endif 00164 // __mlLUTFRampPair_H