Expand description
Apple Metal GPU-backed JPEG decode and encode adapters for j2k-jpeg.
The crate exposes the same CPU-visible JPEG decode surface as
j2k-jpeg, with optional Metal-resident surfaces and batch submission
helpers on macOS. Non-macOS builds keep the public API available but return
Error::MetalUnavailable for explicit Metal-only work.
Modules§
- viewport
- Viewport planning and composition helpers for JPEG decode surfaces.
Structs§
- Codec
- JPEG codec marker used by J2K’s generic decode traits.
- Decoder
- JPEG decoder that can return host or Metal-resident surfaces.
- Decoder
Context - Shared decode context for WSI tile batches.
- Info
- Header-derived image metadata. Populated by
Decoder::inspectand byDecoder::new.scan_countis the number of SOS markers observed in the input — for sequential this is always 1; for progressive it is the count of refinement passes. - Jpeg
Baseline Metal Encode Tile - Placeholder encode tile type for non-macOS builds.
- Jpeg
Rect Public - Inclusive axis-aligned rectangle in image coordinates.
- Jpeg
Tile Batch - Convenience wrapper for submitting a group of JPEG tiles to one decoder session.
- Metal
Backend Session - Placeholder Metal session for non-macOS builds.
- Metal
Session - Shared batching session used by
JpegTileBatchand submit APIs. - Scratch
Pool - Pool of decoder-internal scratch buffers, reusable across many
Decoder::decode_into_with_scratch/decode_rows_with_scratchcalls. - Surface
- Decoded image surface returned by the JPEG Metal backend.
Enums§
- Error
- Errors returned by the Metal JPEG backend.
- Jpeg
Downscale - Power-of-two downscale requested during decode.
- Jpeg
Pixel Format - Concrete interleaved pixel format.
- Surface
Residency - Where a decoded surface is currently resident.
Functions§
- encode_
jpeg_ baseline_ batch_ from_ metal_ buffers - Return
Error::MetalUnavailablefor batch Metal encode requests on non-macOS hosts. - encode_
jpeg_ baseline_ from_ metal_ buffer - Return
Error::MetalUnavailablefor Metal encode requests on non-macOS hosts.