xoreos  0.0.5
Classes | Public Member Functions | Protected Types | Static Protected Member Functions | Protected Attributes | List of all members
Graphics::ImageDecoder Class Reference

A generic interface for image decoders. More...

#include <decoder.h>

Inheritance diagram for Graphics::ImageDecoder:
Inheritance graph
[legend]
Collaboration diagram for Graphics::ImageDecoder:
Collaboration graph
[legend]

Classes

struct  MipMap
 A mip map. More...
 

Public Member Functions

 ImageDecoder ()
 
 ImageDecoder (const ImageDecoder &image)
 
virtual ~ImageDecoder ()
 
ImageDecoderoperator= (const ImageDecoder &image)
 
bool isCompressed () const
 Is the image data compressed? More...
 
bool hasAlpha () const
 Does the image data have alpha? . More...
 
PixelFormat getFormat () const
 Return the image data's general format. More...
 
PixelFormatRaw getFormatRaw () const
 Return the image data's raw format. More...
 
PixelDataType getDataType () const
 Return the image data pixel's type. More...
 
size_t getMipMapCount () const
 Return the number of mip maps contained in the image. More...
 
size_t getLayerCount () const
 Return the number of layers contained in the image. More...
 
bool isCubeMap () const
 Is this image a cube map? More...
 
const MipMapgetMipMap (size_t mipMap, size_t layer=0) const
 Return a mip map. More...
 
void decompress ()
 Manually decompress the texture image data. More...
 
const TXIgetTXI () const
 Return the texture information TXI, which may be embedded in the image. More...
 
bool dumpTGA (const Common::UString &fileName) const
 Dump the image into a TGA. More...
 

Protected Types

typedef Common::PtrVector< MipMapMipMaps
 

Static Protected Member Functions

static void decompress (MipMap &out, const MipMap &in, PixelFormatRaw format)
 

Protected Attributes

bool _compressed
 
bool _hasAlpha
 
PixelFormat _format
 
PixelFormatRaw _formatRaw
 
PixelDataType _dataType
 
size_t _layerCount
 Number of layers in this image. More...
 
bool _isCubeMap
 Is this image a cube map? A cube map always needs to have 6 layers! More...
 
MipMaps _mipMaps
 
TXI _txi
 

Detailed Description

A generic interface for image decoders.

Definition at line 48 of file decoder.h.

Member Typedef Documentation

◆ MipMaps

Definition at line 117 of file decoder.h.

Constructor & Destructor Documentation

◆ ImageDecoder() [1/2]

Graphics::ImageDecoder::ImageDecoder ( )

Definition at line 129 of file decoder.cpp.

◆ ImageDecoder() [2/2]

Graphics::ImageDecoder::ImageDecoder ( const ImageDecoder image)

Definition at line 135 of file decoder.cpp.

◆ ~ImageDecoder()

Graphics::ImageDecoder::~ImageDecoder ( )
virtual

Definition at line 139 of file decoder.cpp.

Member Function Documentation

◆ decompress() [1/2]

void Graphics::ImageDecoder::decompress ( )

◆ decompress() [2/2]

void Graphics::ImageDecoder::decompress ( MipMap out,
const MipMap in,
PixelFormatRaw  format 
)
staticprotected

◆ dumpTGA()

bool Graphics::ImageDecoder::dumpTGA ( const Common::UString fileName) const

Dump the image into a TGA.

Definition at line 260 of file decoder.cpp.

References _compressed, _mipMaps, decompress(), and Graphics::dumpTGA().

Here is the call graph for this function:

◆ getDataType()

PixelDataType Graphics::ImageDecoder::getDataType ( ) const

Return the image data pixel's type.

Definition at line 184 of file decoder.cpp.

References _dataType.

Referenced by Graphics::CubeMapCombiner::CubeMapCombiner().

Here is the caller graph for this function:

◆ getFormat()

PixelFormat Graphics::ImageDecoder::getFormat ( ) const

Return the image data's general format.

Definition at line 176 of file decoder.cpp.

References _format.

Referenced by Graphics::CubeMapCombiner::CubeMapCombiner(), and Graphics::dumpTGA().

Here is the caller graph for this function:

◆ getFormatRaw()

PixelFormatRaw Graphics::ImageDecoder::getFormatRaw ( ) const

Return the image data's raw format.

Definition at line 180 of file decoder.cpp.

References _formatRaw.

Referenced by Graphics::CubeMapCombiner::CubeMapCombiner(), Graphics::Aurora::ModelNode_DragonAge::fixTexturesAlpha(), and Graphics::Aurora::ModelNode_DragonAge::fixTexturesHair().

Here is the caller graph for this function:

◆ getLayerCount()

size_t Graphics::ImageDecoder::getLayerCount ( ) const

Return the number of layers contained in the image.

Definition at line 194 of file decoder.cpp.

References _layerCount.

Referenced by Graphics::CubeMapCombiner::CubeMapCombiner(), Graphics::dumpTGA(), and Graphics::TPC::fixupCubeMap().

Here is the caller graph for this function:

◆ getMipMap()

const ImageDecoder::MipMap & Graphics::ImageDecoder::getMipMap ( size_t  mipMap,
size_t  layer = 0 
) const

◆ getMipMapCount()

size_t Graphics::ImageDecoder::getMipMapCount ( ) const

◆ getTXI()

const TXI & Graphics::ImageDecoder::getTXI ( ) const

Return the texture information TXI, which may be embedded in the image.

Definition at line 164 of file decoder.cpp.

References _txi.

◆ hasAlpha()

bool Graphics::ImageDecoder::hasAlpha ( ) const

Does the image data have alpha? .

Definition at line 172 of file decoder.cpp.

References _hasAlpha.

Referenced by Graphics::CubeMapCombiner::CubeMapCombiner().

Here is the caller graph for this function:

◆ isCompressed()

bool Graphics::ImageDecoder::isCompressed ( ) const

◆ isCubeMap()

bool Graphics::ImageDecoder::isCubeMap ( ) const

Is this image a cube map?

Definition at line 198 of file decoder.cpp.

References _isCubeMap, and _layerCount.

Referenced by Graphics::Aurora::ModelNode_Witcher::buildMaterial(), Graphics::Aurora::ModelNode::buildMaterial(), and Graphics::TPC::fixupCubeMap().

Here is the caller graph for this function:

◆ operator=()

ImageDecoder & Graphics::ImageDecoder::operator= ( const ImageDecoder image)

Definition at line 142 of file decoder.cpp.

References _compressed, _dataType, _format, _formatRaw, _hasAlpha, _isCubeMap, _layerCount, _mipMaps, _txi, and Common::PtrVector< T, Deallocator >::clear().

Here is the call graph for this function:

Member Data Documentation

◆ _compressed

bool Graphics::ImageDecoder::_compressed
protected

◆ _dataType

PixelDataType Graphics::ImageDecoder::_dataType
protected

◆ _format

PixelFormat Graphics::ImageDecoder::_format
protected

◆ _formatRaw

PixelFormatRaw Graphics::ImageDecoder::_formatRaw
protected

◆ _hasAlpha

bool Graphics::ImageDecoder::_hasAlpha
protected

◆ _isCubeMap

bool Graphics::ImageDecoder::_isCubeMap
protected

Is this image a cube map? A cube map always needs to have 6 layers!

Definition at line 129 of file decoder.h.

Referenced by Graphics::TPC::checkCubeMap(), Graphics::CubeMapCombiner::CubeMapCombiner(), isCubeMap(), operator=(), and Graphics::TGA::TGA().

◆ _layerCount

size_t Graphics::ImageDecoder::_layerCount
protected

◆ _mipMaps

MipMaps Graphics::ImageDecoder::_mipMaps
protected

◆ _txi

TXI Graphics::ImageDecoder::_txi
protected

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