ScummVM API documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Image::DoodleDecoder Class Reference
Inheritance diagram for Image::DoodleDecoder:
Image::ImageDecoder

Public Member Functions

 DoodleDecoder (const byte *palette)
 
bool loadStream (Common::SeekableReadStream &stream) override
 
void destroy () override
 
const Graphics::SurfacegetSurface () const override
 
const byte * getPalette () const override
 
uint16 getPaletteColorCount () const override
 
bool loadStreams (Common::SeekableReadStream &highresStream, Common::SeekableReadStream &colorStream1, Common::SeekableReadStream &colorStream2)
 
- 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
 

Constructor & Destructor Documentation

◆ DoodleDecoder()

Image::DoodleDecoder::DoodleDecoder ( const byte *  palette)

Constructor for the DoodleDecoder

Parameters
palettePointer to RGB palette data (16 colors * 3 components)

Member Function Documentation

◆ loadStream()

bool Image::DoodleDecoder::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.

◆ destroy()

void Image::DoodleDecoder::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.

◆ getSurface()

const Graphics::Surface* Image::DoodleDecoder::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 byte* Image::DoodleDecoder::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.

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

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

Reimplemented from Image::ImageDecoder.

◆ getPaletteColorCount()

uint16 Image::DoodleDecoder::getPaletteColorCount ( ) const
inlineoverridevirtual

Return the number of colors in the palette.

Reimplemented from Image::ImageDecoder.

◆ loadStreams()

bool Image::DoodleDecoder::loadStreams ( Common::SeekableReadStream highresStream,
Common::SeekableReadStream colorStream1,
Common::SeekableReadStream colorStream2 
)

Load a C64 doodle image from its component streams

Parameters
highresStreamStream containing high-resolution pixel data
colorStream1Stream containing first color data file
colorStream2Stream containing second color data file
Returns
Whether loading succeeded

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