Expand description
§ASTC Encoding
This is a library to encode images as ASTC for use on a GPU with hardware compression support.
It is implemented as bindings to ARM’s official astc-encoder
library.
In order to use the images generated by this library directly on the GPU, you need ensure that
the GPU you’re running on has support for ASTC, which can be queried with the Vulkan
textureCompressionASTC_*
flags (one flag for each of the modes in Profile
).
Structs§
- Config
- Configuration for initializing
Context
, seeConfigBuilder
for more information. - Config
Builder - Builder for the context configuration.
- Context
- The core context. All configuration should be done through this.
- Extents
- A 3-dimensional set of width, height and depth. ASTC supports 3D images, so we always have to specify the depth of an image.
- Flags
- Configuration flags for the context.
- Image
- The 3D image type. Each pixel should be RGBA. The data can be anything that dereferences to a
flat array of color components, as long as the color components are in one of the supported
formats. For HDR images,
f32
orhalf::f16
must be used. - Preset
- The performance preset, higher settings take more time but provide higher quality. It will not provide better compression at higher settings, compression is decided only by the block size.
- Swizzle
- A component selection swizzle. The image must always be in RGBA order, even if the G, B and/or A components are never used.
Enums§
- Error
- An error during initialization, compression or decompression.
- Profile
- The color profile. HDR and LDR SRGB require the image to use floats for its individual colors.
- Selector
- An individual component of a swizzle.
- Type
- Which of the supported subpixel types the image data’s subpixels should be interpreted as. Floating-point types must be used for HDR data.
Constants§
- PRESET_
EXHAUSTIVE - The exhaustive, highest quality, search preset.
- PRESET_
FAST - The fast search preset.
- PRESET_
FASTEST - The fastest, lowest quality, search preset.
- PRESET_
MEDIUM - The medium quality search preset.
- PRESET_
THOROUGH - The thorough quality search preset.
- PRESET_
VERY_ THOROUGH - The thorough quality search preset.
Traits§
- Data
Type - A valid type for a subpixel.