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

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.
More...

#include <tga.h>

Inheritance diagram for Image::TGADecoder:
Collaboration diagram for Image::TGADecoder:

List of all members.

Public Member Functions

 TGADecoder ()
virtual ~TGADecoder ()
virtual void destroy ()
 Destroy this decoder's surface and palette.
virtual const Graphics::SurfacegetSurface () const
 Get the decoded surface.
virtual const bytegetPalette () const
 Get the decoded palette.
virtual uint16 getPaletteColorCount () const
 Return the number of colors in the palette.
virtual bool loadStream (Common::SeekableReadStream &stream)
 Load an image from the specified stream.

Private Types

enum  {
  TYPE_CMAP = 1, TYPE_TRUECOLOR = 2, TYPE_BW = 3, TYPE_RLE_CMAP = 9,
  TYPE_RLE_TRUECOLOR = 10, TYPE_RLE_BW = 11
}

Private Member Functions

bool readHeader (Common::SeekableReadStream &tga, byte &imageType, byte &pixelDepth)
bool readData (Common::SeekableReadStream &tga, byte imageType, byte pixelDepth)
bool readDataColorMapped (Common::SeekableReadStream &tga, byte imageType, byte indexDepth)
bool readDataRLE (Common::SeekableReadStream &tga, byte imageType, byte pixelDepth)
bool readColorMap (Common::SeekableReadStream &tga, byte imageType, byte pixelDepth)

Private Attributes

bool _colorMapSize
byte_colorMap
int16 _colorMapOrigin
int16 _colorMapLength
byte _colorMapEntryLength
bool _originTop
Graphics::PixelFormat _format
Graphics::Surface _surface

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.

Definition at line 58 of file tga.h.


Member Enumeration Documentation

anonymous enum [private]
Enumerator:
TYPE_CMAP 
TYPE_TRUECOLOR 
TYPE_BW 
TYPE_RLE_CMAP 
TYPE_RLE_TRUECOLOR 
TYPE_RLE_BW 

Definition at line 70 of file tga.h.


Constructor & Destructor Documentation

Image::TGADecoder::TGADecoder (  ) 

Definition at line 37 of file tga.cpp.

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

Definition at line 45 of file tga.cpp.


Member Function Documentation

void Image::TGADecoder::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 49 of file tga.cpp.

virtual const byte* Image::TGADecoder::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 64 of file tga.h.

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

Return the number of colors in the palette.

Reimplemented from Image::ImageDecoder.

Definition at line 65 of file tga.h.

virtual const Graphics::Surface* Image::TGADecoder::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 63 of file tga.h.

bool Image::TGADecoder::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 54 of file tga.cpp.

bool Image::TGADecoder::readColorMap ( Common::SeekableReadStream tga,
byte  imageType,
byte  pixelDepth 
) [private]

Definition at line 185 of file tga.cpp.

bool Image::TGADecoder::readData ( Common::SeekableReadStream tga,
byte  imageType,
byte  pixelDepth 
) [private]

Definition at line 222 of file tga.cpp.

bool Image::TGADecoder::readDataColorMapped ( Common::SeekableReadStream tga,
byte  imageType,
byte  indexDepth 
) [private]

Definition at line 293 of file tga.cpp.

bool Image::TGADecoder::readDataRLE ( Common::SeekableReadStream tga,
byte  imageType,
byte  pixelDepth 
) [private]

Definition at line 320 of file tga.cpp.

bool Image::TGADecoder::readHeader ( Common::SeekableReadStream tga,
byte imageType,
byte pixelDepth 
) [private]

Definition at line 86 of file tga.cpp.


Member Data Documentation

Definition at line 81 of file tga.h.

Definition at line 84 of file tga.h.

Definition at line 83 of file tga.h.

Definition at line 82 of file tga.h.

Definition at line 80 of file tga.h.

Definition at line 89 of file tga.h.

Definition at line 87 of file tga.h.

Definition at line 90 of file tga.h.


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


Generated on Sat Nov 16 2019 05:03:24 for ResidualVM by doxygen 1.7.1
curved edge   curved edge