MrSID Decode SDK for Raster Reference Manual  9.5.1.4427
LTIImageStage Class Referenceabstract

abstract class for decoding from an image More...

#include <lti_imageStage.h>

Inheritance diagram for LTIImageStage:
LTIImage LTIReferenceCountedObject LTIImageFilter LTIOverrideMetadata< LTIImageStage > J2KImageReader LTIOverrideBackgroundPixel< LTIImageFilter > LTIOverrideGeoCoord< LTIImageFilter > LTIOverrideMetadata< LTIImageFilter > LTIOverrideStripHeight< LTIImageFilter > LTIViewerImageFilter LTIWatermarkFilter MrSIDImageReader LTIOverridePixelLookupTables< LTIOverrideMetadata< LTIImageStage > >

Public Member Functions

virtual void setProgressDelegate (LTIProgressDelegate *delegate)=0
 set progress delegate More...
 
virtual LTIProgressDelegategetProgressDelegate () const =0
 get progress delegate More...
 
virtual void setInterruptDelegate (LTIInterruptDelegate *delegate)=0
 set interrupt delegate More...
 
virtual LTIInterruptDelegategetInterruptDelegate () 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...
 
LTIColorSpace getColorSpace () const
 get colorspace More...
 
LTIDataType getDataType () const
 get data type More...
 
virtual const LTIPixelgetPixelProps () const =0
 get the pixel properties of the image More...
 
virtual const LTIPixelgetBackgroundPixel () const =0
 get the values of the background pixel More...
 
virtual const LTIPixelgetNoDataPixel () const =0
 get the values of the "no data" (transparency) pixel More...
 
virtual const LTIPixelLookupTablegetPixelLookupTable () const =0
 get the color lookup table, if any More...
 
virtual const LTIPixelgetMinDynamicRange () const =0
 get the minimum dynamic range value of image More...
 
virtual const LTIPixelgetMaxDynamicRange () 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 LTIGeoCoordgetGeoCoord () const =0
 get the geographic coordinates of the image More...
 
virtual bool isGeoCoordImplicit () const =0
 is geo information "real" or not More...
 
virtual const LTIMetadataDatabasegetMetadata () 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...
 
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...
 
LTIPixelcreateBackgroundPixel () 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 LTIScenegetFullScene () 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  )
protectedvirtual

Member Function Documentation

virtual LT_STATUS LTIImageStage::decodeBegin ( const LTIPixel pixelProps,
const LTIScene fullScene 
)
protectedpure 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
pixelPropsthe band selection
fullScenethe 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  )
protectedpure 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 
)
protectedpure 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
stripBufferthe buffer to read the pixels into
stripScenethe 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
scenethe region (and scale) of the image to be read
bufferthe 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
scenethe region (and scale) of the image to be read
bufferthe buffer to read the pixels into
colorthe 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
scenethe 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
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
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
decodeScenethe scene that would be given to read()
readerScenethe 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
stripNumberthe 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
virtual LT_STATUS LTIImageStage::overrideGeoCoord ( const LTIGeoCoord geoCoord)
pure virtual
virtual LT_STATUS LTIImageStage::overrideMetadata ( const LTIMetadataDatabase metadata)
pure virtual
virtual LT_STATUS LTIImageStage::overrideNoDataPixel ( const LTIPixel nodataPixel)
pure virtual
virtual LT_STATUS LTIImageStage::overridePixelLookupTable ( const LTIPixelLookupTable pixelLookupTable)
pure virtual
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
scenethe region (and scale) of the image to be read
bufferthe 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
pixelPropsthe band selection
fullScenethe 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
bufferthe buffer to read the pixels into
stripScenethe 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
delegatea 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
delegatea 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
stripHeightthe 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:

LizardTech