Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
S3tcBlock Class Reference

Public Member Functions

 S3tcBlock (size_t dxt, const u8 *RESTRICT block)
 
void WritePixel (size_t pixel_idx, u8 *RESTRICT out) const
 

Private Types

enum  RGBA { R , G , B , A }
 

Private Member Functions

void PrecalculateAlpha (size_t dxt, const u8 *RESTRICT a_block)
 
void PrecalculateColor (size_t dxt, const u8 *RESTRICT c_block)
 

Static Private Member Functions

static void mix_2_3 (size_t dst[4], size_t c0[4], size_t c1[4])
 
static void mix_avg (size_t dst[4], size_t c0[4], size_t c1[4])
 
template<typename T >
static size_t access_bit_tbl (T tbl, size_t idx, size_t bit_width)
 
static size_t unpack_to_8 (u16 c, size_t bits_below, size_t num_bits)
 

Private Attributes

size_t c [4][4]
 
u8 dxt5_a_tbl [8]
 
u64 a_bits
 
u32 c_selectors
 
size_t m_Dxt
 

Member Enumeration Documentation

◆ RGBA

enum S3tcBlock::RGBA
private
Enumerator

Constructor & Destructor Documentation

◆ S3tcBlock()

S3tcBlock::S3tcBlock ( size_t  dxt,
const u8 *RESTRICT  block 
)
inline

Member Function Documentation

◆ access_bit_tbl()

template<typename T >
static size_t S3tcBlock::access_bit_tbl ( T  tbl,
size_t  idx,
size_t  bit_width 
)
inlinestaticprivate

◆ mix_2_3()

static void S3tcBlock::mix_2_3 ( size_t  dst[4],
size_t  c0[4],
size_t  c1[4] 
)
inlinestaticprivate

◆ mix_avg()

static void S3tcBlock::mix_avg ( size_t  dst[4],
size_t  c0[4],
size_t  c1[4] 
)
inlinestaticprivate

◆ PrecalculateAlpha()

void S3tcBlock::PrecalculateAlpha ( size_t  dxt,
const u8 *RESTRICT  a_block 
)
inlineprivate

◆ PrecalculateColor()

void S3tcBlock::PrecalculateColor ( size_t  dxt,
const u8 *RESTRICT  c_block 
)
inlineprivate

◆ unpack_to_8()

static size_t S3tcBlock::unpack_to_8 ( u16  c,
size_t  bits_below,
size_t  num_bits 
)
inlinestaticprivate

◆ WritePixel()

void S3tcBlock::WritePixel ( size_t  pixel_idx,
u8 *RESTRICT  out 
) const
inline

Member Data Documentation

◆ a_bits

u64 S3tcBlock::a_bits
private

◆ c

size_t S3tcBlock::c[4][4]
private

◆ c_selectors

u32 S3tcBlock::c_selectors
private

◆ dxt5_a_tbl

u8 S3tcBlock::dxt5_a_tbl[8]
private

◆ m_Dxt

size_t S3tcBlock::m_Dxt
private

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