MrSID Decode SDK for Raster Reference Manual  9.1.0.4045
lti_sceneBuffer.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_SCENEBUFFER_H
14 #define LTI_SCENEBUFFER_H
15 
16 // lt_lib_mrsid_core
17 #include "lti_types.h"
18 
19 
20 LT_BEGIN_NAMESPACE(LizardTech)
21 
22 
58 {
59  LT_DISALLOW_COPY_CONSTRUCTOR(LTISceneBuffer);
60 public:
61  static const double DefaultFuzzyThreshold;
62 
68  ~LTISceneBuffer();
69 
85  LTISceneBuffer(const LTIPixel &pixelProps,
86  lt_uint32 numCols,
87  lt_uint32 numRows,
88  void **bsqData,
89  lt_uint32 totalNumCols = 0);
90 
111  LTISceneBuffer(const LTIPixel &pixelProps,
112  lt_uint32 totalNumCols,
113  lt_uint32 totalNumRows,
114  lt_uint32 colOffset,
115  lt_uint32 rowOffset,
116  lt_uint32 numCols,
117  lt_uint32 numRows,
118  void **bsqData);
119 
135  LTISceneBuffer(const LTISceneBuffer &original,
136  lt_uint32 colOffset,
137  lt_uint32 rowOffset,
138  lt_uint32 numCols,
139  lt_uint32 numRows);
140 
153  LTISceneBuffer(const LTISceneBuffer &original,
154  lt_uint32 colOffset,
155  lt_uint32 rowOffset);
156 
163 
171  lt_int32 getNumCols() const;
172 
180  lt_int32 getNumRows() const;
181 
190  lt_int32 getTotalNumCols() const;
191 
192 
202  lt_int32 getNumPixels() const;
203 
211  const LTIPixel &getPixelProps() const;
212 
222  lt_uint16 getNumBands() const;
223 
224  lt_uint16 getSourceBandIndex(lt_uint16 dstBand) const;
225 
226  // return -1 for not wanted
227  int getDestinationBandIndex(lt_uint16 srcBand) const;
234 
235 
244  void **getBSQData() const;
245 
254  void *getBandData(lt_uint16 band) const;
255 
267  void *getSample(lt_uint32 x, lt_uint32 y, lt_uint16 band) const;
268 
280 
290  LT_STATUS importData(const LTISceneBuffer &sourceData);
291 
303  LT_STATUS importDataBand(lt_uint16 dstBand,
304  const LTISceneBuffer& sourceData,
305  lt_uint16 srcBand);
306 
325  LT_STATUS mergeData(LTIPixelFillMethod fillMethod,
326  const LTISceneBuffer& srcBuf,
327  const LTIPixel *srcNodata,
328  const LTIPixel *dstNodata,
329  double mag,
330  double fuzzyThreshold,
331  bool blend);
332 
343  LT_STATUS importDataBSQ(void** data);
344 
354  LT_STATUS importDataBSQ(void* data);
355 
365  LT_STATUS importDataBIP(void* data);
366 
376  LT_STATUS importDataBSQ(LTIOStreamInf& stream);
377 
387  LT_STATUS importDataBIP(LTIOStreamInf& stream);
390  // for LizardTech internal use only
391  LT_STATUS importData(const LTIMask *binaryMask,
392  const LTISceneBuffer &sourceData,
393  bool blend);
394 
395  // for LizardTech internal use only
396  LT_STATUS importDataBand(lt_uint16 dstBand,
397  const LTISceneBuffer& sourceData,
398  lt_uint16 srcBand,
399  const LTIMask *binaryMask);
400 
401  // for LizardTech internal use only
402  LT_STATUS mergeData(LTIPixelFillMethod fillMethod,
403  const LTISceneBuffer& srcBuf,
404  const LTIPixel *srcNodata,
405  const LTIPixel *dstNodata,
406  LTIMaskSource *mask,
407  LTIScene &scene,
408  double fuzzyThreshold,
409  bool blend);
410 
420 
435  LT_STATUS exportDataBSQ(void**& data) const;
436 
451  LT_STATUS exportDataBSQ(void*& data) const;
452 
467  LT_STATUS exportDataBIP(void*& data) const;
468 
478  LT_STATUS exportDataBSQ(LTIOStreamInf& stream) const;
479 
489  LT_STATUS exportDataBIP(LTIOStreamInf& stream) const;
490 
509  LT_STATUS exportData(void* data,
510  lt_uint32 pixelBytes,
511  lt_uint32 rowBytes,
512  lt_uint32 bandBytes) const;
515  void byteSwap();
516 
517  // for LizardTech internal use only
518  LT_STATUS applyMask(const LTIMask &mask, const LTIPixel &color);
519  void applyMask(const LTIMask &mask, const LTIPixel &color, lt_uint16 band);
520 
521  LT_STATUS fill(const LTIPixel &color);
522  void fill(const LTIPixel &color, lt_uint16 band);
523 
524  void zero(void);
525  void zero(lt_uint16 band);
526 
527 
543  static lt_uint32 addAlignment(lt_uint32 value, lt_uint32 byteAlignment);
544 
545  // for LizardTech internal use only
546  static LT_STATUS buildMask(LTIPixelFillMethod fillMethod,
547  double mag, double fuzzyThreshold, bool blend,
548  const LTISceneBuffer &dstBuffer,
549  const LTIPixel *dstNodata,
550  const LTISceneBuffer &srcBuffer,
551  const LTIPixel *srcNodata,
552  LTIMask &binaryMask);
553 
554 
555 #if !defined(SWIG) && 1
556 #define DEPRECATE(OLD, NEW) LT_DEPRECATED(NEW) OLD { return NEW; }
557  DEPRECATE(lt_int32 getTotalNumRows() const, getNumRows());
558  DEPRECATE(lt_int32 getWindowColOffset() const, 0);
559  DEPRECATE(lt_int32 getWindowRowOffset() const, 0);
560  DEPRECATE(lt_int32 getWindowNumCols() const, getNumCols());
561  DEPRECATE(lt_int32 getWindowNumRows() const, getNumRows());
562  DEPRECATE(lt_int32 getTotalNumPixels() const, getNumPixels());
563  DEPRECATE(lt_int32 getWindowNumPixels() const, getNumPixels());
564  DEPRECATE(void** getTotalBSQData() const, getBSQData());
565  DEPRECATE(void* getTotalBandData(lt_uint16 band) const, getBandData(band));
566  DEPRECATE(void** getWindowBSQData() const, getBSQData());
567  DEPRECATE(void* getWindowBandData(lt_uint16 band) const, getBandData(band));
568  DEPRECATE(void* getTotalSample(lt_uint32 x, lt_uint32 y, lt_uint16 band) const, getSample(x, y, band));
569  DEPRECATE(void* getWindowSample(lt_uint32 x, lt_uint32 y, lt_uint16 band) const, getSample(x, y, band));
570  DEPRECATE(bool inWindow(lt_int32 x, lt_int32 y) const, (x < getNumCols() && y < getNumRows()));
571 #undef DEPRECATE
572 #endif
573 protected:
577  LT_STATUS checkImpedance(const LTIPixel &p) const;
578 
579 private:
580  void init(const LTIPixel& pixelProps,
581  lt_uint32 colOffset,
582  lt_uint32 rowOffset,
583  lt_uint32 numCols,
584  lt_uint32 numRows,
585  void **bsqData,
586  lt_uint32 totalNumCols,
587  lt_uint32 totalNumRows);
588 
589  lt_uint16 m_numBands;
590  LTIPixel *m_pixelProps;
591 
592  lt_uint32 m_numCols;
593  lt_uint32 m_numRows;
594  lt_uint32 m_totalNumCols;
595 
596  void **m_data;
597  bool m_ownsData;
598 
599 
600  bool operator==(const LTISceneBuffer&) const;
601  bool operator!=(const LTISceneBuffer&) const;
602 };
603 
604 LT_END_NAMESPACE(LizardTech)
605 
606 #endif // LTI_SCENEBUFFER_H
class to hold data passed between image stages
unsigned int lt_uint32
unsigned 32-bit integer
Definition: lt_types.h:54
This file contains a number of enums, typedefs, etc, that are used throughout the MrSID SDK...
static const double DefaultFuzzyThreshold
#define LT_BEGIN_NAMESPACE(theNameSpace)
compiler does not support namespaces
Definition: lt_define.h:84
representation of a scene
Definition: lti_scene.h:64
#define DEPRECATE(OLD, NEW)
lt_uint32 LT_STATUS
An integral status code.
Definition: lt_status.h:39
signed int lt_int32
signed 32-bit integer
Definition: lt_types.h:52
unsigned short lt_uint16
unsigned 16-bit integer
Definition: lt_types.h:50
#define LT_END_NAMESPACE(theNameSpace)
compiler does not support namespaces
Definition: lt_define.h:85
LTIPixelFillMethod
constants representing pixel filling methods
Definition: lti_types.h:187
Abstract definition of a stream.
basic properties of a pixel
Definition: lti_pixel.h:36

LizardTech