ScummVM API documentation
Image::TGADecoder Class Reference

#include <tga.h>

Inheritance diagram for Image::TGADecoder:
Image::ImageDecoder Titanic::CTargaDecode

Public Member Functions

virtual void destroy () override
 
const Graphics::SurfacegetSurface () const override
 
const Graphics::PalettegetPalette () const override
 
virtual bool loadStream (Common::SeekableReadStream &stream) override
 
- 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
 

Detailed Description

TarGa image-decoder The following variations of TGA are supported:

  • Type 1 - Color-mapped images in 16/24/32 bpp with 8 bit indexes
  • Type 2 - 16/24/32 bpp Top AND Bottom origined.
  • Type 3 - Black/White images, 8bpp.
  • Type 9 - RLE-encoded color-mapped images. (8 bit indexes only)
  • Type 10 - RLE-encoded TrueColor, 24/32bpp.
  • Type 11 - RLE-encoded Black/White, 8bpp.

No images are returned with a palette, instead they are converted to 16 bpp for Type 1, or 32 bpp for Black/White-images.

Member Function Documentation

◆ destroy()

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

◆ loadStream()

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


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