V-Gears 0
Free Final Fantasy VII engine.
VGears::TexFile Class Reference

Handles TEX files. More...

#include <VGearsTexFile.h>

Collaboration diagram for VGears::TexFile:

Classes

struct  BitData
 Bit data in a TEX file. More...
 
struct  Header
 A TEX file header. More...
 
struct  ImageData
 Texture image data. More...
 
struct  PaletteData
 Colour palette data. More...
 
struct  PixelFormat
 Pixel format structure. More...
 
struct  RGBAData
 RGBA colour data. More...
 
struct  TextureFormat
 Texture format. More...
 

Public Types

enum  PaletteType { PF_A8R8G8B8 = 0x00 , PF_FLOAT32_ARGB = 0x01 , PF_B8G8R8A8 = 0x02 }
 
typedef Ogre::int32 TexEntry
 
typedef ColorA8R8G8B8 Color
 
typedef std::vector< ColorPalette
 
typedef std::vector< ColorTexImageData
 

Public Member Functions

 TexFile ()
 Constructor. More...
 
virtual ~TexFile ()
 Destructor. More...
 
void Read (Ogre::DataStreamPtr &input)
 Reads texture data. More...
 
void ReadHeader (Ogre::DataStreamPtr &input)
 Reads the TEX file header and sets the instance data. More...
 
void ReadPalleted (Ogre::DataStreamPtr &input)
 Reads texture data and matches it with the color palette. More...
 
Ogre::MemoryDataStream * GetPixelData () const
 Retrieves pixel information from the texture image. More...
 
Ogre::ImageCodec::ImageData * GetImageData () const
 Retrieves image data from the texture. More...
 

Public Attributes

struct VGears::TexFile::Header header_
 
Palette palette
 The texture palette. More...
 
TexImageData image_data_
 The texture image data. More...
 

Private Member Functions

void FlipEndian (void *data, size_t size, size_t count) const
 Flips the endian mode of data. More...
 
void FlipEndian (void *data, size_t size) const
 Flips the endian mode of data. More...
 

Private Attributes

Palette palettes_ [8]
 Colour palettes in the TEXT file. More...
 

Static Private Attributes

static const Ogre::uint8 USE_REFERENCE_ALPHA
 

Detailed Description

Handles TEX files.

TEX files contain texture data for the PC version of Final Fantasy VII.

Member Typedef Documentation

◆ Color

◆ Palette

typedef std::vector<Color> VGears::TexFile::Palette

◆ TexEntry

◆ TexImageData

typedef std::vector<Color> VGears::TexFile::TexImageData

Member Enumeration Documentation

◆ PaletteType

Enumerator
PF_A8R8G8B8 

Palette type: ARGB, 8 bit per component.

PF_FLOAT32_ARGB 
PF_B8G8R8A8 

Constructor & Destructor Documentation

◆ TexFile()

TexFile::TexFile ( )

Constructor.

◆ ~TexFile()

TexFile::~TexFile ( )
virtual

Destructor.

Member Function Documentation

◆ FlipEndian() [1/2]

void TexFile::FlipEndian ( void *  data,
size_t  size 
) const
private

Flips the endian mode of data.

If the data was big endian, it will be conterted to little endian. If it was little endian, it will be converted to big endian.

Parameters
[in,out]dataData to flip.
[in]sizeSize of data.

◆ FlipEndian() [2/2]

void TexFile::FlipEndian ( void *  data,
size_t  size,
size_t  count 
) const
private

Flips the endian mode of data.

If the data was big endian, it will be conterted to little endian. If it was little endian, it will be converted to big endian.

Parameters
[in,out]dataData to flip.
[in]sizeSize of data.
[in]countHow much data to flip.

◆ GetImageData()

ImageCodec::ImageData * TexFile::GetImageData ( ) const

Retrieves image data from the texture.

Returns
The texture image.

◆ GetPixelData()

MemoryDataStream * TexFile::GetPixelData ( ) const

Retrieves pixel information from the texture image.

Returns
Pixel data.

◆ Read()

void TexFile::Read ( Ogre::DataStreamPtr &  input)

Reads texture data.

Parameters
[in]inputThe contents of the TEX file.

◆ ReadHeader()

void TexFile::ReadHeader ( Ogre::DataStreamPtr &  input)

Reads the TEX file header and sets the instance data.

Parameters
[in]inputThe contents of the TEX file.

◆ ReadPalleted()

void TexFile::ReadPalleted ( Ogre::DataStreamPtr &  input)

Reads texture data and matches it with the color palette.

Parameters
[in]inputThe contents of the TEX file.

Member Data Documentation

◆ header_

struct VGears::TexFile::Header VGears::TexFile::header_

◆ image_data_

TexImageData VGears::TexFile::image_data_

The texture image data.

◆ palette

Palette VGears::TexFile::palette

The texture palette.

◆ palettes_

Palette VGears::TexFile::palettes_[8]
private

Colour palettes in the TEXT file.

◆ USE_REFERENCE_ALPHA

const Ogre::uint8 TexFile::USE_REFERENCE_ALPHA
staticprivate
Todo:
Understand and document.

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