Class Astc4x4Decoder
- Namespace
- LansMap.Core.TileCodecs.Astc4x4
Decodes the two ASTC 4x4 block shapes Astc4x4Encoder emits, for tests and for cache-format migration.
public static class Astc4x4Decoder
- Inheritance
-
objectAstc4x4Decoder
Remarks
Not a general ASTC decoder. Anything other than an LDR void-extent block or the single-partition CEM-12 QUANT_4/QUANT_256 block throws NotSupportedException.
Fields
BlockBytes
ASTC 4x4 block size, 16 bytes.
public const int BlockBytes = 16
Field Value
BlockPixels
Texels along one edge of a block, 4.
public const int BlockPixels = 4
Field Value
Methods
Decode(byte[], int, int, int, byte[], int)
Decodes a whole mip level of ASTC 4x4 blocks to RGBA8888.
public static void Decode(byte[] blocks, int offset, int width, int height, byte[] outRgba, int outOffset)
Parameters
blocksbyte[]Compressed blocks, RequiredBlockBufferBytes(int, int) readable from
offset.offsetintStart of this level in
blocks, in bytes.widthintLevel width in texels, a positive multiple of 4.
heightintLevel height in texels, a positive multiple of 4.
outRgbabyte[]Destination, widthheight4 RGBA8888 bytes row-major from
outOffset.outOffsetintStart write index in
outRgba, in bytes.
DecodeBlock(byte[], int, byte[], int)
Decodes one 4x4 ASTC block to 64 bytes of RGBA8888.
public static void DecodeBlock(byte[] blocks, int offset, byte[] outRgba, int outOffset)
Parameters
blocksbyte[]At least BlockBytes readable from
offset.offsetintStart of this block in
blocks, in bytes.outRgbabyte[]One 4x4 texel block, 64 bytes RGBA8888 row-major from
outOffset.outOffsetintStart write index in
outRgba, in bytes.