PNGImageFormat Class Reference

A type of ImageFileFormat for reading and writing PNG files. More...

Inherits ImageFileFormat.

List of all members.

Public Member Functions

 PNGImageFormat ()
 ~PNGImageFormat ()
const String getFormatName ()
 Returns a description of this file format.
bool canUnderstand (InputStream &input)
 Returns true if the given stream seems to contain data that this format understands.
ImagedecodeImage (InputStream &input)
 Tries to decode and return an image from the given stream.
bool writeImageToStream (const Image &sourceImage, OutputStream &destStream)
 Attempts to write an image to a stream.

Detailed Description

A type of ImageFileFormat for reading and writing PNG files.

See also:
ImageFileFormat, JPEGImageFormat

Constructor & Destructor Documentation

PNGImageFormat::PNGImageFormat (  ) 
PNGImageFormat::~PNGImageFormat (  ) 

Member Function Documentation

const String PNGImageFormat::getFormatName (  )  [virtual]

Returns a description of this file format.

E.g. "JPEG", "PNG"

Implements ImageFileFormat.

bool PNGImageFormat::canUnderstand ( InputStream input  )  [virtual]

Returns true if the given stream seems to contain data that this format understands.

The format class should only read the first few bytes of the stream and sniff for header bytes that it understands.

See also:
decodeImage

Implements ImageFileFormat.

Image* PNGImageFormat::decodeImage ( InputStream input  )  [virtual]

Tries to decode and return an image from the given stream.

This will be called for an image format after calling its canUnderStand() method to see if it can handle the stream.

Parameters:
input the stream to read the data from. The stream will be positioned at the start of the image data (but this may not necessarily be position 0)
Returns:
the image that was decoded, or 0 if it fails. It's the caller's responsibility to delete this image when no longer needed.
See also:
loadFrom

Implements ImageFileFormat.

bool PNGImageFormat::writeImageToStream ( const Image sourceImage,
OutputStream destStream 
) [virtual]

Attempts to write an image to a stream.

To specify extra information like encoding quality, there will be appropriate parameters in the subclasses of the specific file types.

Returns:
true if it nothing went wrong.

Implements ImageFileFormat.


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Mon Apr 26 11:42:15 2010 for JUCE by  doxygen 1.6.3