MrSID Decode SDK for Raster Reference Manual 9.5.4.4709

- Main Page
- Namespaces
- Classes
- Files
- Examples

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | List of all members
PNGImageWriter Class Reference

writes an image stage to a PNG file More...

`#include <PNGImageWriter.h>`

Inheritance diagram for PNGImageWriter:
[legend]
Collaboration diagram for PNGImageWriter:
[legend]

## Public Types
enum | ScanlineFilter { NoFilters = 0x00, FilterNone = 0x08, FilterSub = 0x10, FilterUp = 0x20, FilterAvg = 0x40, FilterPaeth = 0x80, FilterAll = 0xf8 }
| Set the compression filter method. More...

## Public Member Functions
| PNGImageWriter (void)
| ~PNGImageWriter (void)
LT_STATUS | initialize (LTIImageStage *imageStage)
void | setCompressionLevel (lt_int16 level)
| Set the library compression level. More...
void | setScanlineFilter (ScanlineFilter filters)
LT_STATUS | setWriteTransparencyColor (bool write)
| If true, and the image has a transparency/nodata value, then this pixel value will be flagged as such in the PNG output image. More...
LT_STATUS | setAddAlphaBand (bool addAlpha)
| If true, use the nodata pixel to build a alpha band. More...
LT_STATUS | setPaletteSize (lt_uint32 size)
| Will cause input buffer to have its colors quantized to the specified number of output colors. More...
LT_STATUS | write (const LTIScene &scene)
LT_STATUS | writeBegin (const LTIScene &scene)
LT_STATUS | writeStrip (LTISceneBuffer &stripBuffer, const LTIScene &stripScene)
LT_STATUS | writeEnd ()
Public Member Functions inherited from LTIGeoFileImageWriter
virtual | ~LTIGeoFileImageWriter ()
virtual LT_STATUS | deleteOutput (void)
| clean up a failed encode (write) operation More...
virtual LT_STATUS | setOutputFileSpec (const LTFileSpec &fileSpec)
| set output file name More...
virtual LT_STATUS | setOutputFileSpec (const char *fileSpec)
| set output file name More...
virtual LT_STATUS | setOutputStream (LTIOStreamInf *stream)
| set output file stream More...
virtual void | setWriteWorldFile (bool enabled)
| enable writing of world file More...
Public Member Functions inherited from LTIImageWriter
virtual | ~LTIImageWriter ()
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 LTIImageStage * | getSourceImageStage (void) const
| get the source image stage More...
LTIProgressDelegate * | getProgressDelegate (void) const
| get progress delegate More...
LTIInterruptDelegate * | getInterruptDelegate (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...

## Additional Inherited Members
Protected Member Functions inherited from LTIGeoFileImageWriter
| LTIGeoFileImageWriter (bool supportsStreams)
| constructor More...
LTIOStreamInf * | getStream () const
| get underlying stream More...
LTFileSpec * | getFileSpec () const
| get target filename More...
Protected Attributes inherited from LTIImageWriter
LTIImageStage * | m_image

## Detailed Description

This class writes an image stage to a PNG file.

Definition at line 36 of file PNGImageWriter.h.

## Member Enumeration Documentation

enum PNGImageWriter::ScanlineFilter

These filters process each scanline to prepare it for optimal compression. Valid values are as enumerated by the ScanlineFilter type, corresponding directly to filters defined in the PNG spec. Specifying more than one filter (by bitwise OR) will cause libpng to select the best-performing filter on a scanline-by- scanline basis (by trying them).

Enumerator
NoFilters |
FilterNone |
FilterSub |
FilterUp |
FilterAvg |
FilterPaeth |
FilterAll |

Definition at line 66 of file PNGImageWriter.h.

## Constructor & Destructor Documentation

PNGImageWriter::PNGImageWriter | ( | void | ) |  |

PNGImageWriter::~PNGImageWriter | ( | void | ) |  |

## Member Function Documentation

LT_STATUS PNGImageWriter::initialize | ( | LTIImageStage * | imageStage) |  |

LT_STATUS PNGImageWriter::setAddAlphaBand | ( | bool | addAlpha) |  |

Note
  - call this before writing the image, after initialize()

void PNGImageWriter::setCompressionLevel | ( | lt_int16 | level) |  |

Currently, valid values range from 0 - 9, corresponding directly to the zlib compression levels 0 - 9 (0 - no compression, 9 - "maximal" compression). Note that tests have shown that zlib compression levels 3-6 usually perform as well as level 9 for PNG images, and do considerably fewer caclulations. In the future, these values may not correspond directly to the zlib compression levels.

Note
  - call this before writing the image, after initialize()
  - default is no compression (0)

LT_STATUS PNGImageWriter::setPaletteSize | ( | lt_uint32 | size) |  |

If the palette size is 256 or less, the output PNG will be a natively palettized image. Sizes greater than 256 will simply quantize the input colors to enhance its compressibility.

Note
  - call this before writing the image, after initialize()
  - the default palette size is 0, indicating that the colors will be left unquantized (true color)

void PNGImageWriter::setScanlineFilter | ( | ScanlineFilter | filters) |  |

LT_STATUS PNGImageWriter::setWriteTransparencyColor | ( | bool | write) |  |

Note
  - call this before writing the image, after initialize()

LT_STATUS PNGImageWriter::write | ( | const LTIScene & | scene) |  |
| virtual

See Also
  LTIImageWriter

Reimplemented from LTIImageWriter.

LT_STATUS PNGImageWriter::writeBegin | ( | const LTIScene & | scene) |  |
| virtual

See Also
  LTIGeoFileImageWriter

Reimplemented from LTIGeoFileImageWriter.

LT_STATUS PNGImageWriter::writeEnd | ( | ) |  |
| virtual

See Also
  LTIGeoFileImageWriter

Reimplemented from LTIGeoFileImageWriter.

LT_STATUS PNGImageWriter::writeStrip | ( | LTISceneBuffer & | stripBuffer,
|  | const LTIScene & | stripScene
| ) |  |
| virtual

See Also
  LTIGeoFileImageWriter

Implements LTIGeoFileImageWriter.

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

- PNGImageWriter.h

LizardTech