Kicking it Olde Sküül! Burgerlib on Github Follow Olde Sküül on Twitter Burgerbecky on LinkedIn Burgerbecky on LinkedIn
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
Burger::Dxt5Packet_t Struct Reference

Data structure for a DXT5 compressed texture block. More...

Public Member Functions

void Decompress (RGBAWord8_t *pOutput, uintptr_t uStride=sizeof(RGBAWord8_t) *4) const
 Decompress a single 4x4 block compressed with DXT5.
 
void Compress (const RGBAWord8_t *pInput, uintptr_t uStride=sizeof(RGBAWord8_t) *4)
 

Public Attributes

uint8_t m_uAlpha1
 First alpha endpoint in 8 bit intensity.
 
uint8_t m_uAlpha2
 Second alpha endpoint in 8 bit intensity.
 
uint8_t m_uAlphaIndexes [2][3]
 Two 24 bit little endian values that contain 3 bits per pixel indexes for the 4x4 tile.
 
uint16_t m_uRGB565Color1
 First color endpoint in R5:G6:B5 little endian format.
 
uint16_t m_uRGB565Color2
 Second color endpoint in R5:G6:B5 little endian format.
 
uint8_t m_uColorIndexes [4]
 2 bits per pixel color indexes for 4x4 tile
 

Detailed Description

Data structure for a DXT5 compressed texture block.


This structure is a 1:1 mapping of a 16 byte DXT5 encoded data block used by many modern video cards. The first 8 bytes represent the alpha for the 4x4 block and the next 8 bytes represent the color for the 4x4 block.

The data compressor and decompresser are designed to be able to use frame buffers as input and output to reduce the need for intermediate buffers for speed.

See also
Burger::Dxt1Packet_t and Burger::Dxt3Packet_t

Member Function Documentation

◆ Compress()

void Burger::Dxt5Packet_t::Compress ( const RGBAWord8_t * pInput,
uintptr_t uStride = sizeof(RGBAWord8_t) *4 )

◆ Decompress()

void Burger::Dxt5Packet_t::Decompress ( RGBAWord8_t * pOutput,
uintptr_t uStride = sizeof(RGBAWord8_t)*4 ) const

Decompress a single 4x4 block compressed with DXT5.


Given a 16 byte block of DXT5 compressed data, extract the 4x4 RGBA color block.

Parameters
pOutputPointer to the start of an array of sixteen RGBAWord8_t encoded 32 bit pixels
uStrideByte width of each scan line for the block of uncompressed data. The default is sizeof(RGBAWord8_t)*4 to create a single array of 16 RGBAWord8_t pixels in a linear row.

Member Data Documentation

◆ m_uAlpha1

uint8_t Burger::Dxt5Packet_t::m_uAlpha1

First alpha endpoint in 8 bit intensity.

◆ m_uAlpha2

uint8_t Burger::Dxt5Packet_t::m_uAlpha2

Second alpha endpoint in 8 bit intensity.

◆ m_uAlphaIndexes

uint8_t Burger::Dxt5Packet_t::m_uAlphaIndexes[2][3]

Two 24 bit little endian values that contain 3 bits per pixel indexes for the 4x4 tile.

◆ m_uColorIndexes

uint8_t Burger::Dxt5Packet_t::m_uColorIndexes[4]

2 bits per pixel color indexes for 4x4 tile

◆ m_uRGB565Color1

uint16_t Burger::Dxt5Packet_t::m_uRGB565Color1

First color endpoint in R5:G6:B5 little endian format.

◆ m_uRGB565Color2

uint16_t Burger::Dxt5Packet_t::m_uRGB565Color2

Second color endpoint in R5:G6:B5 little endian format.