MeVisLabToolboxReference
MeVisLab/Standard/Sources/Shared/MLLUT/mlLUTFBlend.h
Go to the documentation of this file.
00001 // **InsertLicense** code
00002 //----------------------------------------------------------------------------------
00004 
00010 //----------------------------------------------------------------------------------
00011 
00012 
00013 #ifndef __mlLUTFBlend_H
00014 #define __mlLUTFBlend_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 LUTFBlend : public LUTFunction
00031 {
00032 public:
00033 
00035   LUTFBlend (void);
00036 
00037 
00039   virtual void setInputLUTs (LUTFunction *inLUT1, LUTFunction *inLUT2);
00040 
00041   
00043 
00044 
00046   virtual void setBlendingSteps (int numBlendingSteps);
00047   
00049   virtual int getBlendingSteps (void) const { return _numBlendingSteps; }
00050 
00052 
00053   
00055 
00056 
00058   virtual bool isValid (void) const;
00059 
00061   virtual LUTDimensionality getDimensionality (void) const { return _dimensionality; }
00062 
00064   virtual int getNativeMinIndex (void) const;
00065 
00067   virtual int getNativeMaxIndex (void) const;
00068 
00070   virtual int getHeight (void) const;
00071 
00073   virtual int getDepth (void) const;
00074 
00076   virtual double getNativeMinValue (void) const;
00077 
00079   virtual double getNativeMaxValue (void) const;
00080 
00082 
00083   
00086 
00087 
00092   virtual bool render (LUTDataBase *lutData) const;
00093 
00100   virtual bool renderRescaled (LUTDataBase *lutData, double minIndex, double maxIndex) const;
00101 
00103 
00104 
00105   
00106 protected:
00107 
00109 
00110 
00116   virtual LUTVisualType getRenderType (LUTDataBase *lutData) const { return lutData->getVisualType(); }
00117 
00122   virtual bool renderLUTNative (LUTDataBase *lutData, LUTIteratorBase *lutIterator) const;
00123 
00130   virtual bool renderLUTRescaled (LUTDataBase *lutData, LUTIteratorBase *lutIterator,
00131                                   double minIndex, double maxIndex) const;
00132 
00134   virtual bool renderLUT (LUTDataBase *lutData, LUTIteratorBase *lutIterator) const;
00135 
00137   virtual bool startRender (LUTDataBase *lutData, double minIndex, double maxIndex, bool rescaled) const;
00138 
00140   virtual void clearLutData (void) const;
00141 
00143   template <typename T>
00144   LUTData<T> *createInputLUTData (LUTData<T> *outLutData, int blendIndex, LUTFunction *lutFunction, 
00145                                   double minIndex, double maxIndex, bool rescaled) const;
00146 
00149   template <typename T>
00150   void blendData (LUTData<T> *outLutData, double blendFactor, int inRow, int outRow, int outLayer) const;
00151 
00153   template <typename T>
00154   void copyData (LUTData<T> *outLutData, LUTDataBase *inLutData, int inRow, int outRow, int outLayer) const;
00155 
00157 
00158   
00160   LUTFunction *_inLUT1, *_inLUT2;
00161 
00163   int _numBlendingSteps;
00164 
00166   mutable LUTDataBase *_lutData1, *_lutData2;
00167 
00169   LUTDimensionality _dimensionality;
00170   
00171   
00172   ML_CLASS_HEADER(LUTFBlend);
00173 
00174 };
00175 
00176 
00177 ML_END_NAMESPACE
00178 
00179 #endif
00180 // __mlLUTFBlend_H