MrSID Decode SDK for Raster Reference Manual
9.5.1.4427
|
00001 /* $Id$ */ 00002 /* ////////////////////////////////////////////////////////////////////////// 00003 // // 00004 // This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue, // 00005 // Suite 200, Seattle, WA 98104. Unauthorized use or distribution // 00006 // prohibited. Access to and use of this code is permitted only under // 00007 // license from LizardTech, Inc. Portions of the code are protected by // 00008 // US and foreign patents and other filings. All Rights Reserved. // 00009 // // 00011 /* PUBLIC */ 00012 00013 #ifndef LTI_DYNAMIC_RANGE_FILTER_H 00014 #define LTI_DYNAMIC_RANGE_FILTER_H 00015 00016 // lt_lib_mrsid_core 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 // LTIImageStage 00094 virtual lt_int64 getEncodingCost(const LTIScene& scene) const; 00095 virtual lt_uint32 getModifications(const LTIScene &scene) const; 00096 00097 // LizardTech-internal only 00098 const LTIPixel &getSrcMin() const { return m_srcMin; } 00099 const LTIPixel &getSrcMax() const { return m_srcMax; } 00100 LT_STATUS setSrcMinMax(const LTIPixel& srcMin, const LTIPixel& srcMax); 00101 LT_STATUS setDstMinMax(const LTIPixel& srcMin, const LTIPixel& srcMax); 00102 00103 void setPixelFillMethod(LTIPixelFillMethod method, double fuzzyThreshold); 00104 00105 static LT_STATUS push(LTIImageStage *&pipeline, const LTIPixel &pixelProps, 00106 bool applyDynamicRange); 00107 00108 static LT_STATUS transformBuffer(const LTIPixel &srcMin, 00109 const LTIPixel &srcMax, 00110 const LTISceneBuffer &srcBuffer, 00111 const LTIPixel &dstMin, 00112 const LTIPixel &dstMax, 00113 LTISceneBuffer &dstBuffer, 00114 lt_uint32 numCols, 00115 lt_uint32 numRows); 00116 00117 static LT_STATUS transformPixel(const LTIPixel &srcMin, 00118 const LTIPixel &srcMax, 00119 const LTIPixel &srcPixel, 00120 const LTIPixel &dstMin, 00121 const LTIPixel &dstMax, 00122 LTIPixel &dstPixel); 00123 LT_STATUS reinit(void); 00124 00125 protected: 00126 LT_STATUS decodeBegin(const LTIPixel &pixelProps, 00127 const LTIScene &fullScene); 00128 LT_STATUS decodeStrip(LTISceneBuffer &stripBuffer, 00129 const LTIScene &stripScene); 00130 LT_STATUS decodeEnd(void); 00131 00132 private: 00133 00134 lt_uint32 m_mods; 00135 lt_uint16 *m_bandSelection; 00136 00137 LTIPixel m_srcMin; 00138 LTIPixel m_srcMax; 00139 LTIPixel m_dstMin; 00140 LTIPixel m_dstMax; 00141 00142 LTIPixelFillMethod m_fillMethod; 00143 double m_srcFuzzyThreshold; 00144 double m_dstFuzzyThreshold; 00145 bool m_needNoDataFixup; 00146 LTIPixel m_shiftedNoData; 00147 00148 }; 00149 00150 00151 LT_END_NAMESPACE(LizardTech) 00152 00153 #endif // LTI_DYNAMIC_RANGE_FILTER_H