Class Etc2Decoder
- Namespace
- LansMap.Core.TileCodecs.Etc2
Decodes ETC1 individual-mode blocks (the subset Etc2Encoder emits) to RGBA8888 for tests and cache-format migration.
public static class Etc2Decoder
- Inheritance
-
objectEtc2Decoder
Remarks
Differential mode and the T/H/planar ETC2 modes are never written by this project's encoder, so this decoder only inverts individual mode. Alpha is always 255.
Fields
BlockBytes
ETC2 RGB block size, 8 bytes.
public const int BlockBytes = 8
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 ETC2 individual-mode 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 ETC2 individual-mode 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.