MrSID Decode SDK for Raster Reference Manual
9.0.0.3864
|
abstract class for decoding from an image More...
#include <lti_imageStage.h>
Public Member Functions | |
virtual void | setProgressDelegate (LTIProgressDelegate *delegate)=0 |
set progress delegate | |
virtual LTIProgressDelegate * | getProgressDelegate () const =0 |
get progress delegate | |
virtual void | setInterruptDelegate (LTIInterruptDelegate *delegate)=0 |
set interrupt delegate | |
virtual LTIInterruptDelegate * | getInterruptDelegate () 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 LTIScene & | getFullScene () const |
get full scene |
The LTIImageStage abstract class extends the LTIImage class by adding decode functionality, including read methods and progress and interrupt functions.
Definition at line 28 of file lti_imageStage.h.
LTIImageStage::LTIImageStage | ( | void | ) | [protected] |
virtual LTIImageStage::~LTIImageStage | ( | void | ) | [protected, virtual] |
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.
pixelProps | the band selection |
fullScene | the full scene to be read |
Implemented in LTIMosaicFilter, LTIRawImageReader, LTIBandSelectFilter, LTIEmbeddedImage, LTIDynamicRangeFilter, LTIMultiResFilter, LTIImageFilter, LTIColorTransformer, and LTIWatermarkFilter.
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.
Implemented in LTIMosaicFilter, LTIRawImageReader, LTIBandSelectFilter, LTIEmbeddedImage, LTIDynamicRangeFilter, LTIMultiResFilter, LTIImageFilter, LTIColorTransformer, and LTIWatermarkFilter.
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.
stripBuffer | the buffer to read the pixels into |
stripScene | the scene for this strip being decoded |
Implemented in LTIMosaicFilter, LTIRawImageReader, LTIBandSelectFilter, LTIEmbeddedImage, LTIDynamicRangeFilter, LTIMultiResFilter, LTIImageFilter, LTIColorTransformer, and LTIWatermarkFilter.
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.
scene | the region (and scale) of the image to be read |
buffer | the buffer to read the pixels into |
LT_STATUS LTIImageStage::fillBackground | ( | const LTIScene & | scene, |
LTISceneBuffer & | buffer, | ||
const LTIPixel & | color | ||
) | [protected] |
This function sets the buffer to the given color.
scene | the region (and scale) of the image to be read |
buffer | the buffer to read the pixels into |
color | the fill color |
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.
scene | the scene to be charged for |
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}().
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.
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.
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.
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.
decodeScene | the scene that would be given to read() |
readerScene | the scene that is the actual scene passed the underlying image reader |
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.
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.
stripNumber | the strip to compute the scene for |
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.
backgroundPixel | the data for the background color |
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.
geoCoord | the geographic coordinate information |
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.
nodataPixel | the data for the transparency color |
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.
scene | the region (and scale) of the image to be read |
buffer | the buffer to read the pixels into |
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.
pixelProps | the band selection |
fullScene | the full scene to be read |
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.
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.
buffer | the buffer to read the pixels into |
stripScene | the scene for this strip being decoded |
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.
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.
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.)
stripHeight | the number of rows to decode at one time |
Implemented in LTIOverrideStripHeight< LTIOverrideDelegates< LTIOverridePixelLookupTables< LTIOverrideMetadata< LTIImageStage > > > >, LTIOverrideStripHeight< LTIImageFilter >, LTIBandSelectFilter, and LTIImageFilter.