#include <lti_imageWriter.h>
Public Member Functions | |
virtual | ~LTIImageWriter () |
virtual LT_STATUS | write (const LTIScene &scene) |
write (encode) a scene to the output format | |
virtual LT_STATUS | writeBegin (const LTIScene &scene)=0 |
begin an encode (write) operation | |
virtual LT_STATUS | writeStrip (LTISceneBuffer &stripBuffer, const LTIScene &stripScene)=0 |
encode one strip of the scene | |
virtual LT_STATUS | writeEnd (void)=0 |
complete an encode (write) operation | |
virtual LT_STATUS | deleteOutput (void)=0 |
clean up a failed encode (write) operation | |
LT_STATUS | setStripHeight (lt_uint32 stripHeight) |
set the stripheight for the encode | |
lt_uint32 | getStripHeight (void) const |
get the stripheight for the encode | |
virtual lt_uint32 | getDefaultStripHeight (void) const |
get the preferred stripheight for the encode | |
virtual lt_int64 | getEncodingCost (const LTIScene &scene) const |
get the cost to encode the scene | |
void | setProgressDelegate (LTIProgressDelegate *delegate) |
set progress delegate | |
void | setInterruptDelegate (LTIInterruptDelegate *delegate) |
set interrupt delegate | |
const LTIImageStage * | getSourceImageStage (void) const |
get the source image stage | |
LTIProgressDelegate * | getProgressDelegate (void) const |
get progress delegate | |
LTIInterruptDelegate * | getInterruptDelegate (void) const |
get interrupt delegate | |
virtual LT_STATUS | setEncodingApplication (const char *name, const char *version, const char *comment=NULL) |
set name and version of the creating application | |
Protected Member Functions | |
LTIImageWriter (void) | |
LT_STATUS | init (LTIImageStage *imageStage) |
initialization function | |
LT_STATUS | writeCleanup (LT_STATUS sts) |
Protected Attributes | |
LTIImageStage * | m_image |
Definition at line 31 of file lti_imageWriter.h.
virtual LTIImageWriter::~LTIImageWriter | ( | ) | [virtual] |
LTIImageWriter::LTIImageWriter | ( | void | ) | [protected] |
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.
scene | the scene to decode and output |
Reimplemented in PNGImageWriter.
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.
scene | the scene to decode and output |
Implemented in BMPImageWriter, JpegImageWriter, LTIBBBImageWriter, LTIGeoFileImageWriter, LTIRawImageWriter, PNGImageWriter, and TIFFImageWriter.
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.
stripBuffer | the pixels for the current strip | |
stripScene | the scene representing the strip being written |
Implemented in BMPImageWriter, JpegImageWriter, LTIGeoFileImageWriter, LTIRawImageWriter, PNGImageWriter, and TIFFImageWriter.
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.
Implemented in BMPImageWriter, JpegImageWriter, LTIGeoFileImageWriter, PNGImageWriter, and TIFFImageWriter.
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.
Implemented in LTIBBBImageWriter, and LTIGeoFileImageWriter.
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.
stripHeight | the number of rows to encode at one time |
lt_uint32 LTIImageWriter::getStripHeight | ( | void | ) | const |
Returns the number of rows which will be encoded at a time.
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.
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.
scene | the scene to determine the cost for |
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.
delegate | a pointer to the delegate object to be used by the image writer |
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.
delegate | a pointer to the delegate object to be used by the image writer |
const LTIImageStage* LTIImageWriter::getSourceImageStage | ( | void | ) | const |
Note this may not be the same image stage that was passed to the the initialize() method.
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.
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.
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.
name | the name of the encoding application | |
version | a string indicating the detailed version information | |
comment | any additional information about the encoding app |
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.
imageStage | the source of image data to be written |
LTIImageStage* LTIImageWriter::m_image [protected] |
Definition at line 254 of file lti_imageWriter.h.
LizardTech |