MrSID Decode SDK for Raster Reference Manual  9.5.4.4709
LTIImageWriter Class Referenceabstract

abstract class for implementing an image writer More...

#include <lti_imageWriter.h>

Inheritance diagram for LTIImageWriter:
LTIGeoFileImageWriter BMPImageWriter JpegImageWriter LTIRawImageWriter PNGImageWriter TIFFImageWriter LTIBBBImageWriter GeoTIFFImageWriter

Public Member Functions

virtual ~LTIImageWriter ()
 
virtual LT_STATUS write (const LTIScene &scene)
 write (encode) a scene to the output format More...
 
virtual LT_STATUS writeBegin (const LTIScene &scene)=0
 begin an encode (write) operation More...
 
virtual LT_STATUS writeStrip (LTISceneBuffer &stripBuffer, const LTIScene &stripScene)=0
 encode one strip of the scene More...
 
virtual LT_STATUS writeEnd (void)=0
 complete an encode (write) operation More...
 
virtual LT_STATUS deleteOutput (void)=0
 clean up a failed encode (write) operation More...
 
LT_STATUS setStripHeight (lt_uint32 stripHeight)
 set the stripheight for the encode More...
 
lt_uint32 getStripHeight (void) const
 get the stripheight for the encode More...
 
virtual lt_uint32 getDefaultStripHeight (void) const
 get the preferred stripheight for the encode More...
 
virtual lt_int64 getEncodingCost (const LTIScene &scene) const
 get the cost to encode the scene More...
 
void setProgressDelegate (LTIProgressDelegate *delegate)
 set progress delegate More...
 
void setInterruptDelegate (LTIInterruptDelegate *delegate)
 set interrupt delegate More...
 
const LTIImageStagegetSourceImageStage (void) const
 get the source image stage More...
 
LTIProgressDelegategetProgressDelegate (void) const
 get progress delegate More...
 
LTIInterruptDelegategetInterruptDelegate (void) const
 get interrupt delegate More...
 
virtual LT_STATUS setEncodingApplication (const char *name, const char *version, const char *comment=NULL)
 set name and version of the creating application More...
 

Protected Member Functions

 LTIImageWriter (void)
 
LT_STATUS init (LTIImageStage *imageStage)
 initialization function More...
 
LT_STATUS writeCleanup (LT_STATUS sts)
 

Protected Attributes

LTIImageStagem_image
 

Detailed Description

The LTIImageWriter abstract class is used to output pixels from an image pipeline to an actual image format. The classes MG3ImageWriter, TIFFImageWriter, etc, derive from this class.

Definition at line 31 of file lti_imageWriter.h.

Constructor & Destructor Documentation

virtual LTIImageWriter::~LTIImageWriter ( )
virtual
LTIImageWriter::LTIImageWriter ( void  )
protected

Member Function Documentation

virtual LT_STATUS LTIImageWriter::deleteOutput ( void  )
pure virtual

This function should delete any output files that were create during the calls to writeBegin() and writeStrip().

This function is called by write(). Derived classes must implement this function.

Returns
status code indicating the failure of operation

Implemented in LTIGeoFileImageWriter, and LTIBBBImageWriter.

virtual lt_uint32 LTIImageWriter::getDefaultStripHeight ( void  ) const
virtual

Returns the preferred stripheight for the encoder. By default, this is just the stripheight of the underlying image pipeline. A derived class may override this to reflect specific needs of an encoder implementation, however.

Returns
the preferred stripheight setting of the encoder
virtual lt_int64 LTIImageWriter::getEncodingCost ( const LTIScene scene) const
virtual

Returns the cost to encode this scene, for application using the usage metering system. See LTIImageStage::getEncodingCost() for details.

Parameters
scenethe scene to determine the cost for
Returns
the cost for the scene
LTIInterruptDelegate* LTIImageWriter::getInterruptDelegate ( void  ) const

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 write() methods so that they can determine if the user has requested that the write operation should be aborted.

Returns
a pointer to the delegate object (or NULL if no delegate has been set)
LTIProgressDelegate* LTIImageWriter::getProgressDelegate ( void  ) const

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 write() methods so that they can inform the user of the progress of the write operation.

Returns
a pointer to the delegate object (or NULL if no delegate has been set)
const LTIImageStage* LTIImageWriter::getSourceImageStage ( void  ) const

Note this may not be the same image stage that was passed to the the initialize() method.

lt_uint32 LTIImageWriter::getStripHeight ( void  ) const

Returns the number of rows which will be encoded at a time.

Returns
the stripheight setting of the encoder
LT_STATUS LTIImageWriter::init ( LTIImageStage imageStage)
protected

Note that the pointer to the input image stage may not be NULL. The writer does not take ownership of the image stage.

Parameters
imageStagethe source of image data to be written
Examples:
DerivedImageWriter.cpp.
virtual LT_STATUS LTIImageWriter::setEncodingApplication ( const char *  name,
const char *  version,
const char *  comment = NULL 
)
virtual

This function allows the application to identify itself in the metadata of the output file if the format supports it.

Parameters
namethe name of the encoding application
versiona string indicating the detailed version information
commentany additional information about the encoding app
void LTIImageWriter::setInterruptDelegate ( LTIInterruptDelegate delegate)

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

Passing NULL to this function should remove the LTIImageWriter'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 writer
void LTIImageWriter::setProgressDelegate ( LTIProgressDelegate delegate)

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

Passing NULL to this function should remove the LTIImageWriter'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 writer
LT_STATUS LTIImageWriter::setStripHeight ( lt_uint32  stripHeight)

This function sets the stripheight to be used when encoding a scene, i.e. the number of rows to process at one time. This value is used to control the decode requests from the image pipeline.

Parameters
stripHeightthe number of rows to encode at one time
Returns
status code indicating success or failure
virtual LT_STATUS LTIImageWriter::write ( const LTIScene scene)
virtual

This function writes the given scene to the implemented image format.

The write() function just calls writeBegin() for the given scene(), then calls writeStrip() repeatedly for each strip in the scene(), then calls writeEnd().

A derived classes should not override this function, unless it has special requirements for interacting with the rest of the image pipeline.

Parameters
scenethe scene to decode and output
Returns
status code indicating success or failure

Reimplemented in PNGImageWriter.

Examples:
GeoScene.cpp.
virtual LT_STATUS LTIImageWriter::writeBegin ( const LTIScene scene)
pure virtual

This function implements the logic for beginning the encoding of the given scene.

The scene must be a valid scene for the underlying image pipeline.

This function is called by write(). Derived classes must implement this function.

Parameters
scenethe scene to decode and output
Returns
status code indicating success or failure

Implemented in PNGImageWriter, TIFFImageWriter, JpegImageWriter, LTIRawImageWriter, BMPImageWriter, LTIGeoFileImageWriter, and LTIBBBImageWriter.

LT_STATUS LTIImageWriter::writeCleanup ( LT_STATUS  sts)
protected
virtual LT_STATUS LTIImageWriter::writeEnd ( void  )
pure virtual

This function implements the logic for completing the encoding of the given scene.

This function is called by write(). Derived classes must implement this function.

Returns
status code indicating success or failure

Implemented in PNGImageWriter, TIFFImageWriter, JpegImageWriter, BMPImageWriter, and LTIGeoFileImageWriter.

virtual LT_STATUS LTIImageWriter::writeStrip ( LTISceneBuffer stripBuffer,
const LTIScene stripScene 
)
pure virtual

This function implements the logic for actually encoding a given strip of the given scene.

This function is called by write(). Derived classes must implement this function.

Parameters
stripBufferthe pixels for the current strip
stripScenethe scene representing the strip being written
Returns
status code indicating success or failure

Implemented in PNGImageWriter, TIFFImageWriter, JpegImageWriter, LTIRawImageWriter, BMPImageWriter, and LTIGeoFileImageWriter.

Member Data Documentation

LTIImageStage* LTIImageWriter::m_image
protected

Definition at line 254 of file lti_imageWriter.h.


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

LizardTech