00001
00002
00003
00004
00005
00006
00007
00008
00009
00011
00012
00013 #ifndef LTI_DYNAMIC_RANGE_FILTER_H
00014 #define LTI_DYNAMIC_RANGE_FILTER_H
00015
00016
00017 #include "lti_pixel.h"
00018 #include "lti_imageFilter.h"
00019 #include "lti_imageStageOverrides.h"
00020
00021
00022 LT_BEGIN_NAMESPACE(LizardTech)
00023
00024
00030 #ifdef SWIG
00031 class LTIDynamicRangeFilter : public LTIImageFilter
00032 #else
00033 class LTIDynamicRangeFilter : public LTIOverridePixelProps
00034 <LTIOverrideBackgroundPixel
00035 <LTIImageFilter> >
00036 #endif
00037 {
00038 LTI_REFERENCE_COUNTED_BOILERPLATE(LTIDynamicRangeFilter);
00039 public:
00056 LT_STATUS initialize(LTIImageStage* srcImage,
00057 const LTIPixel *srcDRMin = NULL,
00058 const LTIPixel *srcDRMax = NULL,
00059 LTIDataType dstDataType = LTI_DATATYPE_INVALID);
00060
00071 LT_STATUS initialize(LTIImageStage* srcImage,
00072 LTIDataType dstDataType);
00073
00089 LT_STATUS initialize(LTIImageStage *srcImage,
00090 const LTIPixel *srcMin, const LTIPixel *srcMax,
00091 const LTIPixel &dstMin, const LTIPixel &dstMax);
00092
00093
00094 virtual lt_int64 getEncodingCost(const LTIScene& scene) const;
00095 virtual lt_uint32 getModifications(const LTIScene &scene) const;
00096
00097
00098 LT_STATUS setSrcMinMax(const LTIPixel& srcMin, const LTIPixel& srcMax);
00099 LT_STATUS setDstMinMax(const LTIPixel& srcMin, const LTIPixel& srcMax);
00100
00101 static LT_STATUS push(LTIImageStage *&pipeline, const LTIPixel &pixelProps,
00102 bool applyDynamicRange);
00103
00104 static LT_STATUS transformBuffer(const LTIPixel &srcMin,
00105 const LTIPixel &srcMax,
00106 const LTISceneBuffer &srcBuffer,
00107 const LTIPixel &dstMin,
00108 const LTIPixel &dstMax,
00109 LTISceneBuffer &dstBuffer,
00110 lt_uint32 numCols,
00111 lt_uint32 numRows);
00112
00113 static LT_STATUS transformPixel(const LTIPixel &srcMin,
00114 const LTIPixel &srcMax,
00115 const LTIPixel &srcPixel,
00116 const LTIPixel &dstMin,
00117 const LTIPixel &dstMax,
00118 LTIPixel &dstPixel);
00119
00120 protected:
00121 LT_STATUS decodeBegin(const LTIPixel &pixelProps,
00122 const LTIScene &fullScene);
00123 LT_STATUS decodeStrip(LTISceneBuffer &stripBuffer,
00124 const LTIScene &stripScene);
00125 LT_STATUS decodeEnd(void);
00126
00127 private:
00128 void updateMods(void);
00129
00130 lt_uint32 m_mods;
00131 lt_uint16 *m_bandSelection;
00132
00133 LTIPixel m_srcMin;
00134 LTIPixel m_srcMax;
00135 LTIPixel m_dstMin;
00136 LTIPixel m_dstMax;
00137 };
00138
00139
00140 LT_END_NAMESPACE(LizardTech)
00141
00142 #endif // LTI_DYNAMIC_RANGE_FILTER_H