rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Foundation Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvPNGStreamer Class Reference

Bitmap streamer class. More...

#include <ilviews/bitmaps/png.h>

Inheritance diagram for IlvPNGStreamer:
IlvBitmapStreamer

List of all members.

Public Member Functions

 IlvPNGStreamer ()
 Constructor.
IlBoolean canRead () const
 Indicates that the instance can read from a stream.
IlBoolean canWrite () const
 Indicates that the instance can write to a stream.
IlBoolean checkSignature (const IlUChar *data, IlUInt size)
 Checks the signature of the input stream.
IlUInt getAlphaLevel () const
 Gets the alpha level of the PNG streamer.
IlUInt getCompressionLevel () const
 Gets the compression level of the generated PNG stream.
IlUShort getIndexedColors () const
 Returns the number of colors to quantize to.
IlBoolean hasInterlace () const
 Gets whether the generated PNG stream is interlaced.
IlBoolean isIndexed () const
IlvBitmapDataread (istream &stream)
 Reads a PNG image from a stream.
void setAlphaLevel (IlUInt level)
 Sets the alpha level for the PNG stream.
void setCompressionLevel (IlUInt level)
 Sets the compression level of the generated PNG stream.
void setIndexed (IlBoolean indexed, IlUShort numcols=256)
 Sets whether the generated PNG stream is indexed.
void setInterlace (IlBoolean interlace)
 Sets whether the generated PNG stream is interlaced.
IlBoolean write (IlvBitmapData *data, ostream &stream)
 Writes an IlvBitmapData to a PNG stream.

Detailed Description

Bitmap streamer class.

Library: display

This streamer provides methods to deal with a stream containing a PNG image. It supports reading from all PNG streams. It handles transparent images by mapping alpha values greater than 50 to opaque and others to transparent.
This streamer can read and write.
When writing, it is possible to force indexed output using a specified number of colors. When reading or writing interlaced images, callbacks will be called at each pass. When reading or writing non-interlaced images, callbacks will be called at each scanline.


Member Function Documentation

IlBoolean IlvPNGStreamer::canRead (  )  const [virtual]

Indicates that the instance can read from a stream.

Returns:
IlTrue.

Reimplemented from IlvBitmapStreamer.

IlBoolean IlvPNGStreamer::canWrite (  )  const [virtual]

Indicates that the instance can write to a stream.

Returns:
IlTrue.

Reimplemented from IlvBitmapStreamer.

IlBoolean IlvPNGStreamer::checkSignature ( const IlUChar data,
IlUInt  size 
) [virtual]

Checks the signature of the input stream.

Parameters:
data The data containing the signature of the stream.
size The size of the data containing the signature.
Returns:
IlTrue if the data contains a PNG signature.

Implements IlvBitmapStreamer.

IlUInt IlvPNGStreamer::getAlphaLevel (  )  const

Gets the alpha level of the PNG streamer.

Returns:
The alpha level.
IlUInt IlvPNGStreamer::getCompressionLevel (  )  const

Gets the compression level of the generated PNG stream.

Returns:
The compression level.
IlUShort IlvPNGStreamer::getIndexedColors (  )  const

Returns the number of colors to quantize to.

Returns:
The number of colors.
IlBoolean IlvPNGStreamer::hasInterlace (  )  const

Gets whether the generated PNG stream is interlaced.

Returns:
IlTrue if the generated PNG stream is interlaced.
IlBoolean IlvPNGStreamer::isIndexed (  )  const

Gets whether the generated PNG stream is indexed .

Returns:
IlTrue if the generated PNG stream is indexed.
IlvBitmapData* IlvPNGStreamer::read ( istream &  stream  )  [virtual]

Reads a PNG image from a stream.

Parameters:
stream The stream to read from.
Returns:
An instance of IlvBitmapData.

Reimplemented from IlvBitmapStreamer.

void IlvPNGStreamer::setAlphaLevel ( IlUInt  level  ) 

Sets the alpha level for the PNG stream.

Alpha levels greater than the given argument are converted to a fully opaque value while alpha levels smaller than the given argument are converted to a fully transparent value.

Parameters:
level The alpha level.
void IlvPNGStreamer::setCompressionLevel ( IlUInt  level  ) 

Sets the compression level of the generated PNG stream.

Parameters:
level The compression level:

  • 0: No compression.
  • 1: Best speed compression
  • 2: Best compression.
void IlvPNGStreamer::setIndexed ( IlBoolean  indexed,
IlUShort  numcols = 256 
)

Sets whether the generated PNG stream is indexed.

Parameters:
indexed IlTrue if the stream is generated in indexed mode.
numcols The number of desired colors if quantization is performed.
void IlvPNGStreamer::setInterlace ( IlBoolean  interlace  ) 

Sets whether the generated PNG stream is interlaced.

Parameters:
interlace IlTrue if the stream is interlaced.
IlBoolean IlvPNGStreamer::write ( IlvBitmapData data,
ostream &  stream 
) [virtual]

Writes an IlvBitmapData to a PNG stream.

Parameters:
data The bitmap data to write.
stream The stream to write to.
Returns:
IlTrue if the bitmap data has been written.

Reimplemented from IlvBitmapStreamer.

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

© Copyright 2012, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.