ScummVM API documentation
Ultima::Ultima4::U4ImageDecoder Class Reference

#include <imageloader.h>

Inheritance diagram for Ultima::Ultima4::U4ImageDecoder:
Image::ImageDecoder Ultima::Ultima4::FMTOWNSImageDecoder Ultima::Ultima4::U4LzwImageDecoder Ultima::Ultima4::U4RawImageDecoder Ultima::Ultima4::U4RleImageDecoder

Public Member Functions

 U4ImageDecoder (int width, int height, int bpp)
 
void destroy () override
 
const Graphics::SurfacegetSurface () const override
 
const byte * getPalette () const override
 
uint16 getPaletteColorCount () const override
 
- Public Member Functions inherited from Image::ImageDecoder
virtual bool loadStream (Common::SeekableReadStream &stream)=0
 
virtual bool hasPalette () const
 
virtual bool hasTransparentColor () const
 
virtual uint32 getTransparentColor () const
 

Protected Member Functions

void setFromRawData (const byte *rawData)
 
Graphics::PixelFormat getPixelFormatForBpp () const
 

Protected Attributes

Graphics::Surface_surface
 
const byte * _palette
 
uint16 _paletteColorCount
 
int _width
 
int _height
 
int _bpp
 

Detailed Description

A common base for all Ultima 4 image loaders.

Member Function Documentation

◆ destroy()

void Ultima::Ultima4::U4ImageDecoder::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* Ultima::Ultima4::U4ImageDecoder::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* Ultima::Ultima4::U4ImageDecoder::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 Ultima::Ultima4::U4ImageDecoder::getPaletteColorCount ( ) const
inlineoverridevirtual

Return the number of colors in the palette.

Reimplemented from Image::ImageDecoder.

◆ setFromRawData()

void Ultima::Ultima4::U4ImageDecoder::setFromRawData ( const byte *  rawData)
protected

Fill in the image pixel data from an uncompressed string of bytes.

◆ getPixelFormatForBpp()

Graphics::PixelFormat Ultima::Ultima4::U4ImageDecoder::getPixelFormatForBpp ( ) const
protected

Get the expected pixel format based on the value of _bpp.


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