MrSID Decode SDK for Raster Reference Manual 9.5.4.4709

- Main Page
- Namespaces
- Classes
- Files
- Examples

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Protected Member Functions | List of all members
LTIImageStage Class Referenceabstract

abstract class for decoding from an image More...

`#include <lti_imageStage.h>`

Inheritance diagram for LTIImageStage:
[legend]
Collaboration diagram for LTIImageStage:
[legend]

## Public Member Functions
virtual void | setProgressDelegate (LTIProgressDelegate *delegate)=0
| set progress delegate More...
virtual LTIProgressDelegate * | getProgressDelegate () const =0
| get progress delegate More...
virtual void | setInterruptDelegate (LTIInterruptDelegate *delegate)=0
| set interrupt delegate More...
virtual LTIInterruptDelegate * | getInterruptDelegate () const =0
| get interrupt delegate More...
LT_STATUS | read (const LTIScene &scene, LTISceneBuffer &buffer)
| read (decode) a scene from the image More...
virtual LT_STATUS | readBegin (const LTIPixel &pixelProps, const LTIScene &fullScene)
| start strip-based read More...
virtual LT_STATUS | readStrip (LTISceneBuffer &buffer, const LTIScene &stripScene)
| read a strip from the image More...
virtual LT_STATUS | readEnd ()
| finish strip-based read More...
virtual lt_uint32 | getStripHeight () const =0
| get strip height More...
virtual LT_STATUS | setStripHeight (lt_uint32 stripHeight)=0
| set the strip height More...
virtual lt_int64 | getEncodingCost (const LTIScene &scene) const =0
| get the cost to encode this scene More...
virtual bool | getReaderScene (const LTIScene &decodeScene, LTIScene &readerScene) const =0
| get the underlying scene to be used More...
lt_uint32 | getNumStrips () const
| get number of strips in scene More...
LTIScene | getStripScene (lt_uint32 stripNumber) const
| get a strip for current scene More...
virtual LT_STATUS | overrideBackgroundPixel (const LTIPixel *backgroundPixel)=0
| override the background color of the image More...
virtual LT_STATUS | overrideNoDataPixel (const LTIPixel *nodataPixel)=0
| override the "no data" (transparency) color of the image More...
virtual LT_STATUS | overrideGeoCoord (const LTIGeoCoord &geoCoord)=0
| override the geographic coordinates of the image More...
virtual LT_STATUS | overrideDynamicRange (const LTIPixel &drmin, const LTIPixel &drmax)=0
| override the dynamic range of the image More...
virtual LT_STATUS | overridePixelBPS (lt_uint8)=0
| override the bits-per-sample of the image's (sample's) datatype More...
virtual LT_STATUS | overridePixelLookupTable (const LTIPixelLookupTable *pixelLookupTable)=0
| override the CLUT of the image More...
virtual LT_STATUS | overrideMetadata (const LTIMetadataDatabase &metadata)=0
| override the metadata of the image More...
virtual LTIMaskSource * | getMask () const =0
virtual bool | getPipelineInfo (LTIPipelineInfo info) const =0
Public Member Functions inherited from LTIImage
virtual lt_uint32 | getWidth () const =0
| get image width More...
virtual lt_uint32 | getHeight () const =0
| get image height More...
virtual LT_STATUS | getDimsAtMag (double mag, lt_uint32 &width, lt_uint32 &height) const =0
| get image width and height at given magnification More...
lt_uint16 | getNumBands () const
| get number of bands More...
lt_uint16 | getNumBandsWithoutAlpha () const
| get number of bands without alpha More...
LTIColorSpace | getColorSpace () const
| get colorspace More...
LTIDataType | getDataType () const
| get data type More...
virtual const LTIPixel & | getPixelProps () const =0
| get the pixel properties of the image More...
virtual const LTIPixel * | getBackgroundPixel () const =0
| get the values of the background pixel More...
virtual const LTIPixel * | getNoDataPixel () const =0
| get the values of the "no data" (transparency) pixel More...
virtual const LTIPixelLookupTable * | getPixelLookupTable () const =0
| get the color lookup table, if any More...
virtual const LTIPixel & | getMinDynamicRange () const =0
| get the minimum dynamic range value of image More...
virtual const LTIPixel & | getMaxDynamicRange () const =0
| get the maximum dynamic range value of image More...
bool | isNaturalDynamicRange () const
| check if the range is "complete" or not More...
virtual const LTIGeoCoord & | getGeoCoord () const =0
| get the geographic coordinates of the image More...
virtual bool | isGeoCoordImplicit () const =0
| is geo information "real" or not More...
virtual const LTIMetadataDatabase & | getMetadata () const =0
| get the metadata associated with the image More...
virtual double | getMinMagnification () const =0
| get the minimum magnification More...
virtual double | getMaxMagnification () const =0
| get the maximum magnification More...
virtual bool | isSelective () const =0
| check if image supports "random access" decoding More...
virtual lt_uint32 | getModifications (const LTIScene &scene) const =0
| get the modification bitfield for this image More...
virtual LT_STATUS | getMetadataBlob (const char *type, LTIOStreamInf *&stream) const =0
| extract the metadata associated with the image of the given type More...
lt_int64 | getNominalImageSizeWithoutAlpha () const
| get the nominal size of the image, not considering the alpha band More...
lt_int64 | getNominalImageSizeWithAlpha () const
| get the nominal size of the image, including the alpha band More...
void | getGeoPoint (LTIPosition position, double &x, double &y) const
| get position of a named point More...
LTIPixel * | createBackgroundPixel () const
| return new background pixel More...
Public Member Functions inherited from LTIReferenceCountedObject
virtual void | retain (void) const
| increment reference counter More...
virtual void | release (void) const
| decrement the reference counter and delete the object when the counter is zero More...

## Protected Member Functions
| LTIImageStage (void)
virtual | ~LTIImageStage (void)
LT_STATUS | fillBackground (const LTIScene &scene, LTISceneBuffer &buffer)
| fill the background of the scene More...
LT_STATUS | fillBackground (const LTIScene &scene, LTISceneBuffer &buffer, const LTIPixel &color)
| fill the scene to given pixel More...
bool | isBandSelected (const LTIPixel &pixelProps) const
virtual LT_STATUS | decodeBegin (const LTIPixel &pixelProps, const LTIScene &fullScene)=0
| start strip-based read More...
virtual LT_STATUS | decodeStrip (LTISceneBuffer &stripBuffer, const LTIScene &stripScene)=0
| read a strip from the image More...
virtual LT_STATUS | decodeEnd (void)=0
| finish strip-based read More...
const LTIScene & | getFullScene () const
| get full scene More...
Protected Member Functions inherited from LTIImage
| LTIImage (void)
virtual | ~LTIImage (void)
Protected Member Functions inherited from LTIReferenceCountedObject
| LTIReferenceCountedObject (void)
virtual | ~LTIReferenceCountedObject (void)

## Detailed Description

The LTIImageStage abstract class extends the LTIImage class by adding decode functionality, including read methods and progress and interrupt functions.

Examples:
  DerivedImageFilter.cpp, and DerivedImageWriter.cpp.

Definition at line 28 of file lti_imageStage.h.

## Constructor & Destructor Documentation

LTIImageStage::LTIImageStage | ( | void | ) |  |
| protected

virtual LTIImageStage::~LTIImageStage | ( | void | ) |  |
| protected virtual

## Member Function Documentation

virtual LT_STATUS LTIImageStage::decodeBegin | ( | const LTIPixel & | pixelProps,
|  | const LTIScene & | fullScene
| ) |  |
| protected pure virtual

This function is called by readBegin() to start the actual class-specific work for decoding a scene.

Derived classes must implement this function.

This function should never be called directly.

Parameters

  pixelProps | the band selection
  fullScene | the full scene to be read

Returns
  status code indicating success or failure

Implemented in LTIMosaicFilter, LTIRawImageReader, LTIBandSelectFilter, LTIEmbeddedImage, LTIDynamicRangeFilter, LTIMultiResFilter, LTIImageFilter, LTIColorTransformer, and LTIWatermarkFilter.

Examples:
  DerivedImageReader.cpp.

virtual LT_STATUS LTIImageStage::decodeEnd | ( | void | ) |  |
| protected pure virtual

This function is called by readEnd() to complete the actual class-specific work for decoding a scene.

Derived classes must implement this function.

This function should never be called directly.

Returns
  status code indicating success or failure

Implemented in LTIMosaicFilter, LTIRawImageReader, LTIBandSelectFilter, LTIEmbeddedImage, LTIDynamicRangeFilter, LTIMultiResFilter, LTIImageFilter, LTIColorTransformer, and LTIWatermarkFilter.

Examples:
  DerivedImageReader.cpp.

virtual LT_STATUS LTIImageStage::decodeStrip | ( | LTISceneBuffer & | stripBuffer,
|  | const LTIScene & | stripScene
| ) |  |
| protected pure virtual

This function is called by readStrip() to implement the actual class-specific work for decoding a strip of the scene.

Derived classes must implement this function.

This function should never be called directly.

Parameters

  stripBuffer | the buffer to read the pixels into
  stripScene | the scene for this strip being decoded

Returns
  status code indicating success or failure

Implemented in LTIMosaicFilter, LTIRawImageReader, LTIBandSelectFilter, LTIEmbeddedImage, LTIDynamicRangeFilter, LTIMultiResFilter, LTIImageFilter, LTIColorTransformer, and LTIWatermarkFilter.

Examples:
  DerivedImageReader.cpp.

LT_STATUS LTIImageStage::fillBackground | ( | const LTIScene & | scene,
|  | LTISceneBuffer & | buffer
| ) |  |
| protected

This function sets the buffer to the background pixel if there is one, otherwise, the nodata pixel if there is one otherwise the background will be filled with black.

Parameters

  scene | the region (and scale) of the image to be read
  buffer | the buffer to read the pixels into

Returns
  status code indicating success or failure

LT_STATUS LTIImageStage::fillBackground | ( | const LTIScene & | scene,
|  | LTISceneBuffer & | buffer,
|  | const LTIPixel & | color
| ) |  |
| protected

This function sets the buffer to the given color.

Parameters

  scene | the region (and scale) of the image to be read
  buffer | the buffer to read the pixels into
  color | the fill color

Returns
  status code indicating success or failure

virtual lt_int64 LTIImageStage::getEncodingCost | ( | const LTIScene & | scene) |  | const
| pure virtual

Returns the "cost" to encode this scene, for use by those image writers which have usage metering enabled. The typical cost is equal to the nominal image size (width * height * numBands * bytesPerSample), but this is overridden for special situations, e.g. the mosaic filter.

Parameters

  scene | the scene to be charged for

Returns
  the cost to encode the given scene

Implemented in MrSIDSingleImageReaderBase, J2KImageReader, LTIBandSelectFilter, LTIMosaicFilter, LTIDynamicRangeFilter, LTIEmbeddedImage, LTIMultiResFilter, MrSIDImageReader, LTIImageFilter, and LTIImageReader.

const LTIScene& LTIImageStage::getFullScene | ( | ) |  | const
| protected

This function returns the object's scene that was passed to readBegin(). Only use this function in decode{Begin, Strip, End}().

Returns
  the scene

virtual LTIInterruptDelegate* LTIImageStage::getInterruptDelegate | ( | ) |  | const
| pure virtual

This function returns the object's interrupt delegate.

The function will return NULL if no delegate has been set.

Derived classes should call this method from within their read() methods so that they can determine if the user has requested that the read operation should be aborted.

Returns
  a pointer to the delegate object (or NULL if no delegate has been set)

Implemented in LTIOverrideDelegates< LTIOverridePixelLookupTables< LTIOverrideMetadata< LTIImageStage > > >, and LTIImageFilter.

virtual LTIMaskSource* LTIImageStage::getMask | ( | ) |  | const
| pure virtual

Implemented in LTIMosaicFilter, LTIImageFilter, and LTIImageReader.

lt_uint32 LTIImageStage::getNumStrips | ( | ) |  | const

After readBegin() has been called, this will return the number of strips in the given scene.

Returns
  number of strips in the current scene

virtual bool LTIImageStage::getPipelineInfo | ( | LTIPipelineInfo | info) |  | const
| pure virtual

Implemented in LTIMosaicFilter, LTIMultiResFilter, LTIImageFilter, and LTIImageReader.

virtual LTIProgressDelegate* LTIImageStage::getProgressDelegate | ( | ) |  | const
| pure virtual

This function returns the object's progress delegate.

The function will return NULL if no delegate has been set.

Derived classes should call this method from within their read() methods so that they can inform the user of the progress of the read operation.

Returns
  a pointer to the delegate object (or NULL if no delegate has been set)

Implemented in LTIOverrideDelegates< LTIOverridePixelLookupTables< LTIOverrideMetadata< LTIImageStage > > >, and LTIImageFilter.

virtual bool LTIImageStage::getReaderScene | ( | const LTIScene & | decodeScene,
|  | LTIScene & | readerScene
| ) |  | const
| pure virtual

Get the scene that will be sent to the underlying LTIImageReader. This is useful in some complex pipelines.

Parameters

  decodeScene | the scene that would be given to read()
  readerScene | the scene that is the actual scene passed the underlying image reader

Returns
  true if readerScene is not empty

Implemented in LTIMosaicFilter, LTIEmbeddedImage, LTIMultiResFilter, LTIImageFilter, and LTIImageReader.

virtual lt_uint32 LTIImageStage::getStripHeight | ( | ) |  | const
| pure virtual

Returns the strip height used in read() calls.

Reader classes should set this. Filter classes should inherit the stripheight of their pipeline predecessor. A writer class will force the stripheight of the pipeline to match its stripheight.

Returns
  the strip height

Implemented in LTIOverrideStripHeight< LTIOverrideDelegates< LTIOverridePixelLookupTables< LTIOverrideMetadata< LTIImageStage > > > >, LTIOverrideStripHeight< LTIImageFilter >, LTIBandSelectFilter, and LTIImageFilter.

LTIScene LTIImageStage::getStripScene | ( | lt_uint32 | stripNumber) |  | const

After readBegin() has been called, this function can be used to return the scene corresponding to the given strip number for the current scene being decoded.

Parameters

  stripNumber | the strip to compute the scene for

Returns
  the scene representing the strip

bool LTIImageStage::isBandSelected | ( | const LTIPixel & | pixelProps) |  | const
| protected

virtual LT_STATUS LTIImageStage::overrideBackgroundPixel | ( | const LTIPixel * | backgroundPixel) |  |
| pure virtual

This function is used to set the background color of the image.

Parameters

  backgroundPixel | the data for the background color

Returns
  status code indicating success or failure

Implemented in LTIOverrideBackgroundPixel< LTIOverrideGeoCoord< LTIOverrideMagnification< LTIOverrideIsSelective< LTIOverrideStripHeight< LTIOverrideDelegates< LTIOverridePixelLookupTables< LTIOverrideMetadata< LTIImageStage > > > > > > > >, LTIOverrideBackgroundPixel< LTIOverrideGeoCoord< LTIImageFilter > >, LTIOverrideBackgroundPixel< LTIImageFilter >, LTIOverrideBackgroundPixel< LTIOverrideMetadata< LTIImageFilter > >, and LTIImageFilter.

virtual LT_STATUS LTIImageStage::overrideDynamicRange | ( | const LTIPixel & | drmin,
|  | const LTIPixel & | drmax
| ) |  |
| pure virtual

Implemented in LTIOverridePixelProps< LTIOverrideBackgroundPixel< LTIOverrideGeoCoord< LTIOverrideMagnification< LTIOverrideIsSelective< LTIOverrideStripHeight< LTIOverrideDelegates< LTIOverridePixelLookupTables< LTIOverrideMetadata< LTIImageStage > > > > > > > > >, LTIOverridePixelProps< LTIOverrideBackgroundPixel< LTIOverrideMetadata< LTIImageFilter > > >, LTIOverridePixelProps< LTIOverrideBackgroundPixel< LTIImageFilter > >, LTIOverridePixelProps< LTIOverrideBackgroundPixel< LTIOverrideGeoCoord< LTIImageFilter > > >, and LTIImageFilter.

virtual LT_STATUS LTIImageStage::overrideGeoCoord | ( | const LTIGeoCoord & | geoCoord) |  |
| pure virtual

This function is used to set the geographic coordinates of the image.

Parameters

  geoCoord | the geographic coordinate information

Returns
  status code indicating success or failure

Implemented in LTIOverrideGeoCoord< LTIOverrideMagnification< LTIOverrideStripHeight< LTIImageFilter > > >, LTIOverrideGeoCoord< LTIOverrideMagnification< LTIOverrideIsSelective< LTIOverrideStripHeight< LTIOverrideDelegates< LTIOverridePixelLookupTables< LTIOverrideMetadata< LTIImageStage > > > > > > >, LTIOverrideGeoCoord< LTIImageFilter >, and LTIImageFilter.

virtual LT_STATUS LTIImageStage::overrideMetadata | ( | const LTIMetadataDatabase & | metadata) |  |
| pure virtual

Implemented in LTIImageFilter, LTIOverrideMetadata< LTIImageStage >, and LTIOverrideMetadata< LTIImageFilter >.

virtual LT_STATUS LTIImageStage::overrideNoDataPixel | ( | const LTIPixel * | nodataPixel) |  |
| pure virtual

This function is used to set the "no data" or transparency color of the image.

Parameters

  nodataPixel | the data for the transparency color

Returns
  status code indicating success or failure

Implemented in LTIOverrideBackgroundPixel< LTIOverrideGeoCoord< LTIOverrideMagnification< LTIOverrideIsSelective< LTIOverrideStripHeight< LTIOverrideDelegates< LTIOverridePixelLookupTables< LTIOverrideMetadata< LTIImageStage > > > > > > > >, LTIOverrideBackgroundPixel< LTIOverrideGeoCoord< LTIImageFilter > >, LTIOverrideBackgroundPixel< LTIImageFilter >, LTIOverrideBackgroundPixel< LTIOverrideMetadata< LTIImageFilter > >, and LTIImageFilter.

virtual LT_STATUS LTIImageStage::overridePixelBPS | ( | lt_uint8 | ) |  |
| pure virtual

Implemented in LTIOverridePixelProps< LTIOverrideBackgroundPixel< LTIOverrideGeoCoord< LTIOverrideMagnification< LTIOverrideIsSelective< LTIOverrideStripHeight< LTIOverrideDelegates< LTIOverridePixelLookupTables< LTIOverrideMetadata< LTIImageStage > > > > > > > > >, LTIOverridePixelProps< LTIOverrideBackgroundPixel< LTIOverrideMetadata< LTIImageFilter > > >, LTIOverridePixelProps< LTIOverrideBackgroundPixel< LTIImageFilter > >, LTIOverridePixelProps< LTIOverrideBackgroundPixel< LTIOverrideGeoCoord< LTIImageFilter > > >, and LTIImageFilter.

virtual LT_STATUS LTIImageStage::overridePixelLookupTable | ( | const LTIPixelLookupTable * | pixelLookupTable) |  |
| pure virtual

Implemented in LTIOverridePixelLookupTables< LTIOverrideMetadata< LTIImageStage > >, and LTIImageFilter.

LT_STATUS LTIImageStage::read | ( | const LTIScene & | scene,
|  | LTISceneBuffer & | buffer
| ) |  |

This function decodes a scene from the image and puts the pixels into the given buffer.

The scene may NOT extend beyond the boundaries of the image.

This function calls readBegin(), then calls readStrip() repeatedly until all the rows of the scene are done, then calls readEnd().

Derived classes should not override this method.

Parameters

  scene | the region (and scale) of the image to be read
  buffer | the buffer to read the pixels into

Returns
  status code indicating success or failure

Examples:
  DecodeJP2ToMemory.cpp, DecodeMrSIDBandSelection.cpp, DecodeMrSIDToMemory.cpp, InterruptDelegate.cpp, ProgressDelegate.cpp, and SceneBuffer.cpp.

virtual LT_STATUS LTIImageStage::readBegin | ( | const LTIPixel & | pixelProps,
|  | const LTIScene & | fullScene
| ) |  |
| virtual

This function is called by read() before readStrip() is called. It should not be called directly except in certain rare circumstances.

Derived classes should not override.

Parameters

  pixelProps | the band selection
  fullScene | the full scene to be read

Returns
  status code indicating success or failure

Reimplemented in LTIImageReader.

virtual LT_STATUS LTIImageStage::readEnd | ( | ) |  |
| virtual

This function is called by read() after readStrip() is called. It should not be called directly except in certain rare circumstances.

Derived classes should not override.

Returns
  status code indicating success or failure

Reimplemented in LTIImageReader.

virtual LT_STATUS LTIImageStage::readStrip | ( | LTISceneBuffer & | buffer,
|  | const LTIScene & | stripScene
| ) |  |
| virtual

This function decodes a scene from the image and puts the pixels into the given buffer. It is called by read(), and should not be called directly except in certain rare circumstances.

The scene must lie within the boundaries of the image.

Derived classes should not override this method.

Derived classes should use the progress and interrupt delegates when the read operation can be expected to take a significant amount of time to complete.

Parameters

  buffer | the buffer to read the pixels into
  stripScene | the scene for this strip being decoded

Returns
  status code indicating success or failure

Reimplemented in LTIImageReader.

virtual void LTIImageStage::setInterruptDelegate | ( | LTIInterruptDelegate * | delegate) |  |
| pure virtual

This function sets the interrupt delegate, which is used in a callback-like fashion by the calling application to asynchronously indicate that a read() operation should be halted without completing.

Passing NULL to this function should remove the LTIImageStage's current delegate, if any.

Note this function does not take ownership of the delegate object.

Parameters

  delegate | a pointer to the delegate object to be used by the image reader

Implemented in LTIOverrideDelegates< LTIOverridePixelLookupTables< LTIOverrideMetadata< LTIImageStage > > >, and LTIImageFilter.

virtual void LTIImageStage::setProgressDelegate | ( | LTIProgressDelegate * | delegate) |  |
| pure virtual

This function sets the progress delegate, which is used in a callback-like fashion to report percent-complete of a read() operation back to the calling application.

Passing NULL to this function should remove the LTIImageStage's current delegate, if any.

Note this function does not take ownership of the delegate object.

Parameters

  delegate | a pointer to the delegate object to be used by the image reader

Implemented in LTIOverrideDelegates< LTIOverridePixelLookupTables< LTIOverrideMetadata< LTIImageStage > > >, and LTIImageFilter.

virtual LT_STATUS LTIImageStage::setStripHeight | ( | lt_uint32 | stripHeight) |  |
| pure virtual

Sets the strip height to be used in decoding. This is the number of rows to be decoded in each strip of the read() sequence.

Reader classes should implement this directly. (LTIImageFilter implements this as a call to setStripHeight() on the previous stage.)

Parameters

  stripHeight | the number of rows to decode at one time

Returns
  status code indicating success or failure

Implemented in LTIOverrideStripHeight< LTIOverrideDelegates< LTIOverridePixelLookupTables< LTIOverrideMetadata< LTIImageStage > > > >, LTIOverrideStripHeight< LTIImageFilter >, LTIBandSelectFilter, and LTIImageFilter.

The documentation for this class was generated from the following file:

- lti_imageStage.h

LizardTech