Skip to main content

Module texture_decode

Module texture_decode 

Source
Expand description

Bounded, caller-buffered PNG/JPEG decode from verified external texture resources. Bounded cold-path image decoding for renderer resources.

Decoders write into caller-owned RGBA8 and scratch buffers. Image payloads remain external to the semantic arena; this module only enforces per-image decode limits before GPU admission.

Structs§

DecodedTextureInfo
TextureDecodeLimits
TextureTranscodeRequest

Enums§

TextureColorSpace
Transfer-function information carried across a decode/transcode boundary.
TextureDecodeError
TextureDecodePlan
Allocation-free HMC admission result. A transcode request is not reported as a decoded image; callers can preserve the source and attach a device/worker-specific refinement later.
TextureFallback
TextureRefinementState
TextureTranscodeTarget
A transcode target with an explicit transfer function. Unknown is intentional for Basis payloads whose color metadata has not been interpreted by this crate.

Functions§

decode_hmc_texture_rgba8
Bounded cold-path convenience for asset loaders that own the destination allocation. The maximum output and scratch sizes are established from codec metadata before either vector is allocated; use the _into form when the caller already has workspace buffers.
decode_hmc_texture_rgba8_into
Decode a verified HMC texture to tightly packed RGBA8.
inspect_hmc_texture_plan
Inspect a resource for HMC without collapsing a known compressed/Basis source into a generic decode failure. This is the capability/refinement boundary: only the returned DecodeRgba8 branch may be admitted as CPU RGBA8, while the other branch preserves the verified source.
inspect_hmc_texture_requirements
Validate codec metadata and report exact RGBA8 output and decoder scratch requirements without allocating or decoding the image. Asset admission can use this to plan texture residency before materializing pixel buffers.