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

#include <iff.h>

Inheritance diagram for Image::IFFDecoder:
Collaboration diagram for Image::IFFDecoder:

List of all members.

Classes

struct  Header
struct  PaletteRange

Public Types

enum  Type { TYPE_UNKNOWN = 0, TYPE_ILBM, TYPE_PBM }

Public Member Functions

 IFFDecoder ()
virtual ~IFFDecoder ()
void destroy ()
 Destroy this decoder's surface and palette.
bool loadStream (Common::SeekableReadStream &stream)
 Load an image from the specified stream.
const HeadergetHeader () const
const Graphics::SurfacegetSurface () const
 Get the decoded surface.
const bytegetPalette () const
 Get the decoded palette.
const Common::Array
< PaletteRange > & 
getPaletteRanges () const
uint16 getPaletteColorCount () const
 Return the number of colors in the palette.
void setNumRelevantPlanes (const uint8 numRelevantPlanes)
 The number of planes to decode, also determines the pixel packing if _packPixels is true.
void setPixelPacking (const bool pixelPacking)
 Enables pixel packing, the amount of packing is determined by _numRelevantPlanes 1 == decode first plane, pack 8 pixels in 1 byte.

Private Member Functions

void loadHeader (Common::SeekableReadStream &stream)
void loadPalette (Common::SeekableReadStream &stream, const uint32 size)
void loadPaletteRange (Common::SeekableReadStream &stream, const uint32 size)
void loadBitmap (Common::SeekableReadStream &stream)
void packPixels (byte *scanlines, byte *data, const uint16 scanlinePitch, const uint16 outPitch)

Private Attributes

Header _header
Graphics::Surface_surface
byte_palette
Common::Array< PaletteRange_paletteRanges
Type _type
uint16 _paletteColorCount
uint8 _numRelevantPlanes
bool _pixelPacking

Detailed Description

Definition at line 51 of file iff.h.


Member Enumeration Documentation

Enumerator:
TYPE_UNKNOWN 
TYPE_ILBM 
TYPE_PBM 

Definition at line 70 of file iff.h.


Constructor & Destructor Documentation

Image::IFFDecoder::IFFDecoder (  ) 

Definition at line 31 of file iff.cpp.

Image::IFFDecoder::~IFFDecoder (  )  [virtual]

Definition at line 42 of file iff.cpp.


Member Function Documentation

void Image::IFFDecoder::destroy (  )  [virtual]

Destroy this decoder's surface and palette.

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

Implements Image::ImageDecoder.

Definition at line 46 of file iff.cpp.

const Header* Image::IFFDecoder::getHeader (  )  const [inline]

Definition at line 82 of file iff.h.

const byte* Image::IFFDecoder::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 from Image::ImageDecoder.

Definition at line 84 of file iff.h.

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

Return the number of colors in the palette.

Reimplemented from Image::ImageDecoder.

Definition at line 86 of file iff.h.

const Common::Array<PaletteRange>& Image::IFFDecoder::getPaletteRanges (  )  const [inline]

Definition at line 85 of file iff.h.

const Graphics::Surface* Image::IFFDecoder::getSurface (  )  const [inline, 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

Implements Image::ImageDecoder.

Definition at line 83 of file iff.h.

void Image::IFFDecoder::loadBitmap ( Common::SeekableReadStream stream  )  [private]

Definition at line 158 of file iff.cpp.

void Image::IFFDecoder::loadHeader ( Common::SeekableReadStream stream  )  [private]

Definition at line 120 of file iff.cpp.

void Image::IFFDecoder::loadPalette ( Common::SeekableReadStream stream,
const uint32  size 
) [private]

Definition at line 140 of file iff.cpp.

void Image::IFFDecoder::loadPaletteRange ( Common::SeekableReadStream stream,
const uint32  size 
) [private]

Definition at line 146 of file iff.cpp.

bool Image::IFFDecoder::loadStream ( Common::SeekableReadStream stream  )  [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

Implements Image::ImageDecoder.

Definition at line 64 of file iff.cpp.

void Image::IFFDecoder::packPixels ( byte scanlines,
byte data,
const uint16  scanlinePitch,
const uint16  outPitch 
) [private]

Definition at line 212 of file iff.cpp.

void Image::IFFDecoder::setNumRelevantPlanes ( const uint8  numRelevantPlanes  )  [inline]

The number of planes to decode, also determines the pixel packing if _packPixels is true.

8 == decode all planes, map 1 pixel in 1 byte. (default, no packing even if _packPixels is true)

NOTE: this property must be reset manually, and is not reset by a call to destroy().

Definition at line 94 of file iff.h.

void Image::IFFDecoder::setPixelPacking ( const bool  pixelPacking  )  [inline]

Enables pixel packing, the amount of packing is determined by _numRelevantPlanes 1 == decode first plane, pack 8 pixels in 1 byte.

This makes _surface->w 1/8th of _header.width 2 == decode first 2 planes, pack 4 pixels in 1 byte. This makes _surface->w 1/4th of _header.width 4 == decode first 4 planes, pack 2 pixels in 1 byte. This makes _surface->w half of _header.width Packed bitmaps won't have a proper surface format since there is no way to tell it to use 1, 2 or 4 bits per pixel

NOTE: this property must be reset manually, and is not reset by a call to destroy().

Definition at line 105 of file iff.h.


Member Data Documentation

Definition at line 108 of file iff.h.

Definition at line 114 of file iff.h.

Definition at line 110 of file iff.h.

Definition at line 113 of file iff.h.

Definition at line 111 of file iff.h.

Definition at line 115 of file iff.h.

Definition at line 109 of file iff.h.

Definition at line 112 of file iff.h.


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


Generated on Sat Mar 16 2019 05:06:29 for ResidualVM by doxygen 1.7.1
curved edge   curved edge