ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

Image::ImageDecoder Class Reference

A representation of an image decoder that maintains ownership of the surface and palette it decodes to. More...

#include <image_decoder.h>

Inheritance diagram for Image::ImageDecoder:

List of all members.

Public Member Functions

virtual ~ImageDecoder ()
virtual bool loadStream (Common::SeekableReadStream &stream)=0
 Load an image from the specified stream.
virtual void destroy ()=0
 Destroy this decoder's surface and palette.
virtual const Graphics::SurfacegetSurface () const =0
 Get the decoded surface.
virtual const bytegetPalette () const
 Get the decoded palette.
virtual bool hasPalette () const
 Query if the decoded image has a palette.
virtual byte getPaletteStartIndex () const
 Return the starting index of the palette.
virtual uint16 getPaletteColorCount () const
 Return the number of colors in the palette.

Detailed Description

A representation of an image decoder that maintains ownership of the surface and palette it decodes to.

This is designed for still frames only.

Definition at line 45 of file image_decoder.h.


Constructor & Destructor Documentation

virtual Image::ImageDecoder::~ImageDecoder (  )  [inline, virtual]

Definition at line 47 of file image_decoder.h.


Member Function Documentation

virtual void Image::ImageDecoder::destroy (  )  [pure virtual]

Destroy this decoder's surface and palette.

This should be called by a loadStream() implementation as well as the destructor.

Implemented in Image::BitmapDecoder, Image::IFFDecoder, Image::PCXDecoder, Image::PICTDecoder, Image::PNGDecoder, and Image::TGADecoder.

virtual const byte* Image::ImageDecoder::getPalette (  )  const [inline, virtual]

Get the decoded palette.

This palette is owned by this ImageDecoder and will remain valid until destroy() or loadStream() is called, or until this ImageDecoder's destructor is called.

The palette's format is the same as PaletteManager's palette (interleaved RGB values).

Returns:
the decoded palette, or undefined if no palette is present

Reimplemented in Image::BitmapDecoder, Image::IFFDecoder, Image::PCXDecoder, Image::PICTDecoder, Image::PNGDecoder, and Image::TGADecoder.

Definition at line 93 of file image_decoder.h.

virtual uint16 Image::ImageDecoder::getPaletteColorCount (  )  const [inline, virtual]

Return the number of colors in the palette.

Reimplemented in Image::BitmapDecoder, Image::IFFDecoder, Image::PCXDecoder, Image::PICTDecoder, Image::PNGDecoder, and Image::TGADecoder.

Definition at line 103 of file image_decoder.h.

virtual byte Image::ImageDecoder::getPaletteStartIndex (  )  const [inline, virtual]

Return the starting index of the palette.

Definition at line 101 of file image_decoder.h.

virtual const Graphics::Surface* Image::ImageDecoder::getSurface (  )  const [pure virtual]

Get the decoded surface.

This surface is owned by this ImageDecoder and will remain valid until destroy() or loadStream() is called, or until this ImageDecoder's destructor is called.

Returns:
the decoded surface, or 0 if no surface is present

Implemented in Image::BitmapDecoder, Image::IFFDecoder, Image::PCXDecoder, Image::PICTDecoder, Image::PNGDecoder, and Image::TGADecoder.

virtual bool Image::ImageDecoder::hasPalette (  )  const [inline, virtual]

Query if the decoded image has a palette.

Definition at line 98 of file image_decoder.h.

virtual bool Image::ImageDecoder::loadStream ( Common::SeekableReadStream stream  )  [pure virtual]

Load an image from the specified stream.

loadStream() should implicitly call destroy() to free the memory of the last loadStream() call.

Parameters:
stream the input stream
Returns:
whether loading the file succeeded
See also:
getSurface
getPalette

Implemented in Image::BitmapDecoder, Image::IFFDecoder, Image::PCXDecoder, Image::PICTDecoder, Image::PNGDecoder, and Image::TGADecoder.


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


Generated on Sat Nov 16 2019 05:03:24 for ResidualVM by doxygen 1.7.1
curved edge   curved edge