Archon::Utilities::Image::Format Struct Reference

This class represents one single image format. More...

#include <archon/util/image.H>

Inheritance diagram for Archon::Utilities::Image::Format:

Inheritance graph
[legend]
List of all members.

Public Member Functions

virtual string getSpecifier () const =0
 Must return the unique specifier for this image format.
virtual bool checkSignature (Ref< Stream::Reader >) const =0
 Check if the initial characters from the passed stream identifies the stream contents as being of this format.
virtual bool checkSuffix (string suffix) const =0
 Check if the passed suffix is a proper file name suffix for this format.
virtual Image load (Ref< Stream::Reader >, ProgressTracker *, Logger *) const =0 throw (InvalidFormatException, IOException, UnexpectedException)
virtual void save (Image, Ref< Stream::Writer >, ProgressTracker *, Logger *) const =0 throw (IOException, UnexpectedException)
virtual ~Format ()
 Ensures proper destruction of derived classes.

Protected Member Functions

char * getPixelBufferNoLeak (const Image &i) const
 A backdoor allowing loaders to get hold of a non-const pointer to the pixel buffer without putting the Rep object into the leaked state which would result in an otherwise redundant copying of the image data.

Detailed Description

This class represents one single image format.

It could be PNG or it could be JPEG or it could be anything else.

It is an abstract base class or interface listing the methods required for interaction with the image loader and image saver. Objects of this type are offered for service through the Context object.

Definition at line 360 of file image.H.


Member Function Documentation

virtual bool Archon::Utilities::Image::Format::checkSuffix string  suffix  )  const [pure virtual]
 

Check if the passed suffix is a proper file name suffix for this format.

Parameters:
suffix Is always converted to lowercase before passed to this method.

Implemented in Archon::Utilities::FormatLibgif, Archon::Utilities::FormatLibjpeg, and Archon::Utilities::FormatLibpng.

char* Archon::Utilities::Image::Format::getPixelBufferNoLeak const Image i  )  const [inline, protected]
 

A backdoor allowing loaders to get hold of a non-const pointer to the pixel buffer without putting the Rep object into the leaked state which would result in an otherwise redundant copying of the image data.

Please do not use this member function for any other purpose.

Definition at line 406 of file image.H.

References Archon::Utilities::Image::getPixelBuffer().

Referenced by Archon::Utilities::FormatLibpng::load(), Archon::Utilities::FormatLibjpeg::load(), Archon::Utilities::FormatLibpng::save(), and Archon::Utilities::FormatLibjpeg::save().

virtual string Archon::Utilities::Image::Format::getSpecifier  )  const [pure virtual]
 

Must return the unique specifier for this image format.

The specifier is the sub-field of the MIME type. That is, the part of the MIME type after "image/". This will normally correspond to the file name suffix, but not always.

Implemented in Archon::Utilities::FormatLibgif, Archon::Utilities::FormatLibjpeg, and Archon::Utilities::FormatLibpng.


The documentation for this struct was generated from the following file:
Generated on Sun Jul 30 22:57:25 2006 for Archon by  doxygen 1.4.4