MrSID Decode SDK for Raster Reference Manual  9.5.1.4427
LTIImageStage Class Reference

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 > >

List of all members.

Public Member Functions

virtual void setProgressDelegate (LTIProgressDelegate *delegate)=0
 set progress delegate
virtual LTIProgressDelegategetProgressDelegate () const =0
 get progress delegate
virtual void setInterruptDelegate (LTIInterruptDelegate *delegate)=0
 set interrupt delegate
virtual LTIInterruptDelegategetInterruptDelegate () const =0
 get interrupt delegate
LT_STATUS read (const LTIScene &scene, LTISceneBuffer &buffer)
 read (decode) a scene from the image
virtual LT_STATUS readBegin (const LTIPixel &pixelProps, const LTIScene &fullScene)
 start strip-based read
virtual LT_STATUS readStrip (LTISceneBuffer &buffer, const LTIScene &stripScene)
 read a strip from the image
virtual LT_STATUS readEnd ()
 finish strip-based read
virtual lt_uint32 getStripHeight () const =0
 get strip height
virtual LT_STATUS setStripHeight (lt_uint32 stripHeight)=0
 set the strip height
virtual lt_int64 getEncodingCost (const LTIScene &scene) const =0
 get the cost to encode this scene
virtual bool getReaderScene (const LTIScene &decodeScene, LTIScene &readerScene) const =0
 get the underlying scene to be used
lt_uint32 getNumStrips () const
 get number of strips in scene
LTIScene getStripScene (lt_uint32 stripNumber) const
 get a strip for current scene
virtual LT_STATUS overrideBackgroundPixel (const LTIPixel *backgroundPixel)=0
 override the background color of the image
virtual LT_STATUS overrideNoDataPixel (const LTIPixel *nodataPixel)=0
 override the "no data" (transparency) color of the image
virtual LT_STATUS overrideGeoCoord (const LTIGeoCoord &geoCoord)=0
 override the geographic coordinates of the image
virtual LT_STATUS overrideDynamicRange (const LTIPixel &drmin, const LTIPixel &drmax)=0
 override the dynamic range of the image
virtual LT_STATUS overridePixelBPS (lt_uint8)=0
 override the bits-per-sample of the image's (sample's) datatype
virtual LT_STATUS overridePixelLookupTable (const LTIPixelLookupTable *pixelLookupTable)=0
 override the CLUT of the image
virtual LT_STATUS overrideMetadata (const LTIMetadataDatabase &metadata)=0
 override the metadata of the image
virtual LTIMaskSource * getMask () const =0
virtual bool getPipelineInfo (LTIPipelineInfo info) const =0

Protected Member Functions

 LTIImageStage (void)
virtual ~LTIImageStage (void)
LT_STATUS fillBackground (const LTIScene &scene, LTISceneBuffer &buffer)
 fill the background of the scene
LT_STATUS fillBackground (const LTIScene &scene, LTISceneBuffer &buffer, const LTIPixel &color)
 fill the scene to given pixel
bool isBandSelected (const LTIPixel &pixelProps) const
virtual LT_STATUS decodeBegin (const LTIPixel &pixelProps, const LTIScene &fullScene)=0
 start strip-based read
virtual LT_STATUS decodeStrip (LTISceneBuffer &stripBuffer, const LTIScene &stripScene)=0
 read a strip from the image
virtual LT_STATUS decodeEnd (void)=0
 finish strip-based read
const LTIScenegetFullScene () const
 get full scene

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:
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  ) [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:
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]

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.

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]
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: