Crate bcndecode [] [src]

Decoder for DXTn-compressed data

This crate provides methods to decompress DXTn-compressed image data.

The following formats are currently supported:

  • Bc1: 565 color, 1-bit alpha (dxt1)
  • Bc2: 565 color, 4-bit alpha (dxt3)
  • Bc3: 565 color, 2-endpoint 8-bit interpolated alpha (dxt5)
  • Bc4: 1-channel 8-bit via 1 BC3 alpha block
  • Bc5: 2-channel 8-bit via 2 BC3 alpha blocks
  • Bc6: 3-channel 16-bit float

The following formats are not implemented:

  • Bc7: 4-channel 8-bit via everything

Format documentation for BC1-BC5 http://oss.sgi.com/projects/ogl-sample/registry/EXT/texture_compression_s3tc.txt

BC6 and BC7 are described here: https://www.opengl.org/registry/specs/ARB/texture_compression_bptc.txt

The decompression code was based on the original C code used in the Python Pillow Imaging package

Enums

BcnDecoderFormat

Specifies the pixel format of the output data

BcnEncoding

Encoding type of the source data.

Error

The error type for all bcn decoding operations.

Functions

decode

Decodes the given BCN encoded image data. On success, the decoded data as a byte vector is returned.