ScummVM API documentation
Image::IFFDecoder Class Reference
Inheritance diagram for Image::IFFDecoder:
Image::ImageDecoder

Classes

struct  Header
 
struct  PaletteRange
 

Public Types

enum  Type { TYPE_UNKNOWN = 0, TYPE_ILBM, TYPE_PBM }
 

Public Member Functions

void destroy () override
 
bool loadStream (Common::SeekableReadStream &stream) override
 
const HeadergetHeader () const
 
const Graphics::SurfacegetSurface () const override
 
const Graphics::PalettegetPalette () const override
 
const Common::Array< PaletteRange > & getPaletteRanges () const
 
void setNumRelevantPlanes (const uint8 numRelevantPlanes)
 
void setPixelPacking (const bool pixelPacking)
 
- Public Member Functions inherited from Image::ImageDecoder
virtual bool hasPalette () const
 
virtual bool hasTransparentColor () const
 
virtual uint32 getTransparentColor () const
 
virtual const Graphics::SurfacegetMask () const
 
virtual bool hasMask () const
 

Member Function Documentation

◆ destroy()

void Image::IFFDecoder::destroy ( )
overridevirtual

Destroy this decoder's surface and palette.

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

Implements Image::ImageDecoder.

◆ loadStream()

bool Image::IFFDecoder::loadStream ( Common::SeekableReadStream stream)
overridevirtual

Load an image from the specified stream.

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

Parameters
streamInput stream.
Returns
Whether loading the file succeeded.
See also
getSurface
getPalette

Implements Image::ImageDecoder.

◆ getSurface()

const Graphics::Surface* Image::IFFDecoder::getSurface ( ) const
inlineoverridevirtual

Get the decoded surface.

This surface is owned by this ImageDecoder and remains valid until destroy() or loadStream() is called, or until the destructor of this ImageDecoder is called.

Returns
The decoded surface, or 0 if no surface is present.

Implements Image::ImageDecoder.

◆ getPalette()

const Graphics::Palette& Image::IFFDecoder::getPalette ( ) const
inlineoverridevirtual

Get the decoded palette.

This palette is owned by this ImageDecoder and remains valid until destroy() or loadStream() is called, or until the destructor of this ImageDecoder is called.

Returns
The decoded palette, or empty if no palette is present.

Implements Image::ImageDecoder.

◆ setNumRelevantPlanes()

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().

◆ setPixelPacking()

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().


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