xoreos  0.0.5
Public Member Functions | Private Member Functions | Static Private Member Functions | List of all members
Graphics::TXB Class Reference

Another one of BioWare's own texture formats, TXB. More...

#include <txb.h>

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

Public Member Functions

 TXB (Common::SeekableReadStream &txb)
 
 ~TXB ()
 
- Public Member Functions inherited from Graphics::ImageDecoder
 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...
 

Private Member Functions

void load (Common::SeekableReadStream &txb)
 
void readHeader (Common::SeekableReadStream &txb, byte &encoding, uint32 &dataSize)
 
void readData (Common::SeekableReadStream &txb, byte encoding)
 
void readTXI (Common::SeekableReadStream &txb)
 

Static Private Member Functions

static void deSwizzle (byte *dst, const byte *src, uint32 width, uint32 height, uint8 bpp)
 

Additional Inherited Members

- Protected Types inherited from Graphics::ImageDecoder
typedef Common::PtrVector< MipMapMipMaps
 
- Static Protected Member Functions inherited from Graphics::ImageDecoder
static void decompress (MipMap &out, const MipMap &in, PixelFormatRaw format)
 
- Protected Attributes inherited from Graphics::ImageDecoder
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

Another one of BioWare's own texture formats, TXB.

This format is used by Jade Empire.

Even though the Xbox versions of the Knights of the Old Republic games features textures with a .txb extension, these are actually in the TPC format, not this TXB format.

Definition at line 44 of file txb.h.

Constructor & Destructor Documentation

◆ TXB()

Graphics::TXB::TXB ( Common::SeekableReadStream txb)

Definition at line 40 of file txb.cpp.

References load().

Here is the call graph for this function:

◆ ~TXB()

Graphics::TXB::~TXB ( )

Definition at line 44 of file txb.cpp.

Member Function Documentation

◆ deSwizzle()

void Graphics::TXB::deSwizzle ( byte dst,
const byte src,
uint32  width,
uint32  height,
uint8  bpp 
)
staticprivate

Definition at line 166 of file txb.cpp.

References Graphics::deSwizzleOffset().

Referenced by readData().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ load()

void Graphics::TXB::load ( Common::SeekableReadStream txb)
private

Definition at line 47 of file txb.cpp.

References Common::StackException::add(), readData(), readHeader(), readTXI(), and Common::SeekableReadStream::seek().

Referenced by TXB().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readData()

void Graphics::TXB::readData ( Common::SeekableReadStream txb,
byte  encoding 
)
private

Definition at line 177 of file txb.cpp.

References Graphics::ImageDecoder::_mipMaps, deSwizzle(), Common::ScopedPtrBase< T, Deallocator >::get(), kEncodingBGRA, kEncodingGray, Common::kReadError, Common::ReadStream::read(), and Common::ScopedPtrBase< T, Deallocator >::swap().

Referenced by load().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readHeader()

void Graphics::TXB::readHeader ( Common::SeekableReadStream txb,
byte encoding,
uint32 dataSize 
)
private

◆ readTXI()

void Graphics::TXB::readTXI ( Common::SeekableReadStream txb)
private

Definition at line 220 of file txb.cpp.

References Graphics::ImageDecoder::_txi, Graphics::TXI::load(), Common::SeekableReadStream::pos(), Common::ReadStream::readStream(), and Common::SeekableReadStream::size().

Referenced by load().

Here is the call graph for this function:
Here is the caller graph for this function:

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