Table of Contents

Class Bc1Decoder

Decodes BC1 (DXT1) blocks to RGBA8888 for tests and cache-format migration.

public static class Bc1Decoder
Inheritance
object
Bc1Decoder

Remarks

Handles both four-color (opaque) and three-color plus transparent-black modes. Alpha is always 255: this project's encoder never emits alpha.

Fields

BlockBytes

BC1 block size, 8 bytes.

public const int BlockBytes = 8

Field Value

int

BlockPixels

Texels along one edge of a block, 4.

public const int BlockPixels = 4

Field Value

int

Methods

Decode(byte[], int, int, int, byte[], int)

Decodes a whole mip level of BC1 blocks to RGBA8888.

public static void Decode(byte[] blocks, int offset, int width, int height, byte[] outRgba, int outOffset)

Parameters

blocks byte[]

Compressed blocks, RequiredBlockBufferBytes(int, int) readable from offset.

offset int

Start of this level in blocks, in bytes.

width int

Level width in texels, a positive multiple of 4.

height int

Level height in texels, a positive multiple of 4.

outRgba byte[]

Destination, widthheight4 RGBA8888 bytes row-major from outOffset.

outOffset int

Start write index in outRgba, in bytes.

DecodeBlock(byte[], int, byte[], int)

Decodes one 4x4 BC1 block to 64 bytes of RGBA8888.

public static void DecodeBlock(byte[] blocks, int offset, byte[] outRgba, int outOffset)

Parameters

blocks byte[]

At least BlockBytes readable from offset.

offset int

Start of this block in blocks, in bytes.

outRgba byte[]

One 4x4 texel block, 64 bytes RGBA8888 row-major from outOffset.

outOffset int

Start write index in outRgba, in bytes.