MrSID Decode SDK for Raster Reference Manual  9.5.4.4709
lti_mosaicFilter.h
Go to the documentation of this file.
1 /* $Id$ */
2 /* //////////////////////////////////////////////////////////////////////////
3 // //
4 // This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue, //
5 // Suite 200, Seattle, WA 98104. Unauthorized use or distribution //
6 // prohibited. Access to and use of this code is permitted only under //
7 // license from LizardTech, Inc. Portions of the code are protected by //
8 // US and foreign patents and other filings. All Rights Reserved. //
9 // //
11 /* PUBLIC */
12 
13 #ifndef LTI_MOSAIC_FILTER_H
14 #define LTI_MOSAIC_FILTER_H
15 
16 // lt_lib_mrsid_core
17 #include "lti_imageStage.h"
19 #include "lti_imageStageManager.h"
20 #include "lti_sceneBuffer.h"
21 
22 
23 
25 
26 class LTIRTree;
27 class LTIEmbeddedImage;
28 class LTIPipelineBuilder;
29 
40 #ifdef SWIG
41 class LTIMosaicFilter : public LTIImageStage
42 #else
44  <LTIOverridePixelProps
45  <LTIOverrideBackgroundPixel
46  <LTIOverrideGeoCoord
47  <LTIOverrideMagnification
48  <LTIOverrideIsSelective
49  <LTIOverrideStripHeight
50  <LTIOverrideDelegates
51  <LTIOverridePixelLookupTables
52  <LTIOverrideMetadata
53  <LTIImageStage> > > > > > > > > >
54 #endif
55 {
57 public:
58  enum AlphaMode
59  {
63  };
64 
88  LT_STATUS initialize(LTIImageStageManager *imageStageManager,
89  const LTIPixel* backgroundPixel,
90  bool useMultires,
91  bool mergeMetadata = true,
92  AlphaMode alphaMode = DoNothing);
93 
105  bool useMultires);
106 
107  // LTIImage
108  LT_STATUS getDimsAtMag(double mag,
109  lt_uint32 &width,
110  lt_uint32 &height) const;
111  lt_uint32 getModifications(const LTIScene &scene) const;
112  LT_STATUS getMetadataBlob(const char *type, LTIOStreamInf *&stream) const;
113 
114  // LTIImageStage
115  lt_int64 getEncodingCost(const LTIScene& scene) const;
116  bool getReaderScene(const LTIScene &decodeScene,
117  LTIScene &readerScene) const;
118  LTIMaskSource *getMask() const;
119  bool getPipelineInfo(LTIPipelineInfo info) const;
120 
126  void setFillMethod(LTIPixelFillMethod method,
127  double fuzzyThreshold /*= LTISceneBuffer::DefaultFuzzyThreshold*/);
128 
132  LTIPixelFillMethod getFillMethod(void) const;
133  double getFuzzyThreshold(void) const;
134 
139  void setResampleMethod(LTIResampleMethod resampleMethod);
140 
141  void setMagSnapThreshold(double threshold);
142 
147 
148  void setResamplePixelCenter(bool usePixelCenter);
149 
150  // for LizardTech internal use only
151  bool getReaderScene(lt_uint32 child,
152  const LTIScene &decodeScene,
153  LTIScene &mosaicScene,
154  LTIScene &readerScene) const;
155  // for LizardTech internal use only
156  bool getOverviewReaderScene(const LTIScene &decodeScene,
157  LTIScene &mosaicScene,
158  LTIScene &readerScene) const;
159 
160  // for LizardTech internal use only
162  {
163  public:
164  virtual LT_STATUS found(const LTIScene &scene,
165  lt_uint32 imageNum,
166  LTIEmbeddedImage &embedded,
167  LTIImageStage &image) = 0;
168  };
169 
170  // for LizardTech internal use only
172  InSceneCallback &callback);
173 
174  // for LizardTech internal use only
175  void setDeleteImages(bool deleteImages);
176  // for LizardTech internal use only
177  bool getDeleteImages(void) const;
178 
179  // for LizardTech internal use only
181  LTIEmbeddedImage *&embedded,
182  LTIImageStage *&raw);
183  // for LizardTech internal use only
185 
186  // for LizardTech internal use only
187  // does not take ownship of pipelineBuilder
188  // don't call this function in inside a decodeBegin()/decodeStrip()/decodeEnd() loop
189  LT_STATUS setPipelineBuilder(LTIPipelineBuilder *pipelineBuilder);
190 
191  // for LizardTech internal use only
192  const LTIRTree &getRTree(void) const;
193  // for LizardTech internal use only
195 
196  // for LizardTech internal use only
197  bool hasOverviewImage(void) const;
198  // for LizardTech internal use only
199  double getOverviewMag(void) const;
200 
201 protected:
202  LT_STATUS decodeBegin(const LTIPixel &pixelProps,
203  const LTIScene &fullScene);
204  LT_STATUS decodeStrip(LTISceneBuffer &stripBuffer,
205  const LTIScene &stripScene);
206  LT_STATUS decodeEnd(void);
207 
208 private:
209  class ListImageStagesInSceneCallback;
210  struct TileInfo;
211 
212  LT_STATUS setupPixelProps(TileInfo *tiles, lt_uint32 numTiles,
213  const LTIPixel *background,
214  bool mergeMetadata);
215 
216  LT_STATUS setupGeoProps(TileInfo *tiles, lt_uint32 numTiles,
217  bool useMultires);
218 
219  LT_STATUS setupBuffers(lt_uint32 numTiles);
220  LT_STATUS setupOverview(void);
221 
222  LTIImageStageManager *m_imageStageManager;
223 
224  LTIRTree *m_rtree;
225 
226  // open image book keeping
227  LTIImageStage **m_rImage;
228  LTIEmbeddedImage **m_fImage;
229  int *m_sImage;
230  LTIPixelFillMethod m_fillMethod;
231  double m_fuzzyThreshold;
232  AlphaMode m_alphaMode;
233  LTIResampleMethod m_resampleMethod;
234  bool m_usePixelCenter;
235  double m_magSnapThreshold;
236  bool m_deleteImages;
237 
238  LTIPipelineBuilder *m_pipelineBuilder;
239 
240  // imageInScene
241  lt_uint32 *m_inSceneList;
242 
243  LTIEmbeddedImage *m_overview;
244  double m_overviewMag;
245 };
246 
247 #ifndef DOXYGEN_EXCLUDE
248 
249 class LTIPipelineBuilder
250 {
251 public:
252  virtual LT_STATUS buildPipeline(lt_uint32 imageNumber,
253  LTIImageStage *&pipeline) = 0;
254 };
255 
256 #endif
257 
259 
260 
261 #endif // LTI_MOSAIC_FILTER_H
void setFillMethod(LTIPixelFillMethod method, double fuzzyThreshold)
Set the fill method which controls how noData pixels are matched.
LT_STATUS loadImage(lt_uint32 i, LTIEmbeddedImage *&embedded, LTIImageStage *&raw)
LT_STATUS decodeEnd(void)
finish strip-based read
LTIImageStageManager & getImageStageManager(void) const
void setMagSnapThreshold(double threshold)
LT_STATUS closeImage(lt_uint32 i)
LTIPixelFillMethod getFillMethod(void) const
Get the fill method.
LT_STATUS forEachImageStageInScene(const LTIScene &scene, InSceneCallback &callback)
void setResampleMethod(LTIResampleMethod resampleMethod)
Set resampling method.
LTIMaskSource * getMask() const
LTIResampleMethod
constants representing resampling methods
Definition: lti_types.h:176
LT_STATUS setPipelineBuilder(LTIPipelineBuilder *pipelineBuilder)
representation of a scene
Definition: lti_scene.h:64
bool hasOverviewImage(void) const
lt_uint32 LT_STATUS
An integral status code.
Definition: lt_status.h:39
abstract class for managing a list of image stages
double getOverviewMag(void) const
LT_STATUS initialize(LTIImageStageManager *imageStageManager, const LTIPixel *backgroundPixel, bool useMultires, bool mergeMetadata=true, AlphaMode alphaMode=DoNothing)
initializer
LTIPixelFillMethod
constants representing pixel filling methods
Definition: lti_types.h:187
void setResamplePixelCenter(bool usePixelCenter)
LTIPipelineInfo
Definition: lti_types.h:228
LT_STATUS decodeBegin(const LTIPixel &pixelProps, const LTIScene &fullScene)
start strip-based read
#define LT_BEGIN_NAMESPACE(theNameSpace)
compiler does not support namespaces
Definition: lt_define.h:84
LT_STATUS getDimsAtMag(double mag, lt_uint32 &width, lt_uint32 &height) const
get image width and height at given magnification
unsigned int lt_uint32
unsigned 32-bit integer
Definition: lt_types.h:54
bool getPipelineInfo(LTIPipelineInfo info) const
lt_int64 getEncodingCost(const LTIScene &scene) const
get the cost to encode this scene
class to hold data passed between image stages
bool getOverviewReaderScene(const LTIScene &decodeScene, LTIScene &mosaicScene, LTIScene &readerScene) const
create a larger frame for the image
bool getDeleteImages(void) const
abstract class for decoding from an image
lt_uint32 getModifications(const LTIScene &scene) const
get the modification bitfield for this image
void setDeleteImages(bool deleteImages)
bool getReaderScene(const LTIScene &decodeScene, LTIScene &readerScene) const
get the underlying scene to be used
virtual LT_STATUS found(const LTIScene &scene, lt_uint32 imageNum, LTIEmbeddedImage &embedded, LTIImageStage &image)=0
double getFuzzyThreshold(void) const
basic properties of a pixel
Definition: lti_pixel.h:36
const LTIRTree & getRTree(void) const
Abstract definition of a stream.
#define LT_END_NAMESPACE(theNameSpace)
compiler does not support namespaces
Definition: lt_define.h:85
LTIResampleMethod getResampleMethod(void) const
Get the fill method.
static LT_STATUS checkResolutionConformance(LTIImageStageManager *imageStageManager, bool useMultires)
Check if a set of images can be mosaicked together.
#define LTI_REFERENCE_COUNTED_BOILERPLATE(classname)
create a single mosaicked image from a set of images
LT_STATUS decodeStrip(LTISceneBuffer &stripBuffer, const LTIScene &stripScene)
read a strip from the image
LT_STATUS getMetadataBlob(const char *type, LTIOStreamInf *&stream) const
extract the metadata associated with the image of the given type

LizardTech