This content was automatically converted from the project's wiki Markdown to HTML. See the Basis Universal GitHub wiki for the latest content.
The Basis Universal encoder/transcoder libraries contain easy to use functions to unpack the following standard compressed GPU texture formats:
transcoder/basisu_astc_helpers.h
or encoder/3rdparty/android_astc_decomp.h.
Fuzz compared vs. ARM's decoder in astcenc.transcoder/basisu_transcoder_internal.h, low-level function
basist::bc7u::unpack_bc7().Before you can unpack textures, be sure to call
basisu_encoder_init() once at startup.
To unpack individual 4x4 (or 8x4 for FXT1) texel blocks to raw RGBA
pixels, use one of these functions declared in
encoder/basisu_gpu_texture.h:
bool unpack_block(texture_format fmt, const void *pBlock, color_rgba *pPixels, bool astc_srgb);
bool unpack_block_hdr(texture_format fmt, const void* pBlock, vec4F* pPixels);
This doesn't work on PVRTC1 textures, because the decoder needs
access to the surrounding blocks. Alternately, you can create a
basisu::gpu_image object, then call
gpu_image::unpack() or
gpu_image::unpack_hdr(). This works on any supported
format, including PVRTC1.