Skip to main content

Crate j2k_jpeg_metal

Crate j2k_jpeg_metal 

Source
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.
DecoderContext
Shared decode context for WSI tile batches.
Info
Header-derived image metadata. Populated by Decoder::inspect and by Decoder::new. scan_count is the number of SOS markers observed in the input — for sequential this is always 1; for progressive it is the count of refinement passes.
JpegBaselineMetalEncodeTile
Placeholder encode tile type for non-macOS builds.
JpegRectPublic
Inclusive axis-aligned rectangle in image coordinates.
JpegTileBatch
Convenience wrapper for submitting a group of JPEG tiles to one decoder session.
MetalBackendSession
Placeholder Metal session for non-macOS builds.
MetalSession
Shared batching session used by JpegTileBatch and submit APIs.
ScratchPool
Pool of decoder-internal scratch buffers, reusable across many Decoder::decode_into_with_scratch / decode_rows_with_scratch calls.
Surface
Decoded image surface returned by the JPEG Metal backend.

Enums§

Error
Errors returned by the Metal JPEG backend.
JpegDownscale
Power-of-two downscale requested during decode.
JpegPixelFormat
Concrete interleaved pixel format.
SurfaceResidency
Where a decoded surface is currently resident.

Functions§

encode_jpeg_baseline_batch_from_metal_buffers
Return Error::MetalUnavailable for batch Metal encode requests on non-macOS hosts.
encode_jpeg_baseline_from_metal_buffer
Return Error::MetalUnavailable for Metal encode requests on non-macOS hosts.