[][src]Crate astcenc_rs

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, see ConfigBuilder for more information.

ConfigBuilder

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 or half::f16 must be used.

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.

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.

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.

Traits

DataType

A valid type for a subpixel.