00001
00002
00003
00004
00005
00006
00007
00008
00009
00011
00012
00013 #ifndef LTI_MULTIRESFILTER_H
00014 #define LTI_MULTIRESFILTER_H
00015
00016
00017 #include "lti_imageFilter.h"
00018 #include "lti_imageStageOverrides.h"
00019 #include "lti_scene.h"
00020
00021 LT_BEGIN_NAMESPACE(LizardTech)
00022
00023 class LTIResampler;
00024
00036 #ifdef SWIG
00037 class LTIMultiResFilter : public LTIImageFilter
00038 #else
00039 class LTIMultiResFilter : public LTIOverrideDimensions
00040 <LTIOverrideGeoCoord
00041 <LTIOverrideMagnification
00042 <LTIOverrideStripHeight
00043 <LTIImageFilter> > > >
00044 #endif
00045 {
00046 LTI_REFERENCE_COUNTED_BOILERPLATE(LTIMultiResFilter);
00047 public:
00060 LT_STATUS initialize(LTIImageStage* srcImage);
00061
00077 LT_STATUS initialize(LTIImageStage* srcImage,
00078 lt_int8 scaleFactor);
00079
00080 LT_STATUS initialize(LTIImageStage* srcImage,
00081 double deltaMag,
00082 double minMag,
00083 double maxMag);
00084
00085
00086 LT_STATUS getDimsAtMag(double mag,
00087 lt_uint32 &width,
00088 lt_uint32 &height) const;
00089
00090
00091 lt_int64 getEncodingCost(const LTIScene& scene) const;
00092 bool getReaderScene(const LTIScene &decodeScene,
00093 LTIScene &readerScene) const;
00094 virtual lt_uint32 getModifications(const LTIScene &scene) const;
00095 bool getPipelineInfo(LTIPipelineInfo info) const;
00096
00101 LT_STATUS setResampleMethod(LTIResampleMethod resampleMethod);
00102 LT_STATUS setResamplePixelCenter(bool usePixelCenter);
00103
00104 void setMagSnapThreshold(double threshold);
00105
00106
00107
00108
00109 void setDeltaMagXY(double deltaMagX, double deltaMagY);
00110
00111
00112 static double magForIcon(const LTIImage &image,
00113 lt_uint32 iconSize);
00114 static double magForIcon(lt_uint32 width, lt_uint32 height,
00115 lt_uint32 iconSize);
00116
00117 static LT_STATUS push(LTIImageStage *&pipeline, const LTIScene &dstScene, LTIResampleMethod method = LTI_RESAMPLE_NEAREST);
00118 static LT_STATUS push(LTIImageStage *&pipeline, double mag, LTIResampleMethod method = LTI_RESAMPLE_NEAREST);
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 protected:
00128 enum Mode
00129 {
00130 MODE_INVALID,
00131 MODE_RESAMPLE,
00132 MODE_PASSTHROUGH,
00133 MODE_DOWNSAMPLE_FULLREAD,
00134 MODE_ALL_AT_ONCE
00135 };
00136
00137 bool getChildScene(const LTIScene &scene,
00138 Mode &mode,
00139 double &xScale,
00140 double &yScale,
00141 LTIScene &childScene) const;
00142
00143 enum
00144 {
00145
00146
00147
00148
00149
00150
00151
00152 kMaxMagnification = 512
00153 };
00154
00155 private:
00156 struct StripCache;
00157
00158 double m_deltaMagX;
00159 double m_deltaMagY;
00160
00161 double m_magSnapThreshold;
00162
00163 Mode m_mode;
00164 double m_xScale;
00165 double m_yScale;
00166 LTIScene m_childScene;
00167 double m_dx;
00168 double m_dy;
00169 double m_curY;
00170
00171 lt_int32 m_childStrip;
00172 lt_int32 m_myStrip;
00173
00174 StripCache *m_stripCache0;
00175 StripCache *m_stripCache1;
00176
00177 LTIResampler *m_resampler;
00178 bool m_usePixelCenter;
00179 };
00180
00181
00182 LT_END_NAMESPACE(LizardTech)
00183
00184 #endif // LTI_MULTIRESFILTER_H