Expand description
Metal-backed JPEG 2000 and HTJ2K decode and encode adapters.
This crate wraps the CPU/native J2K implementation with optional
Metal-resident decode surfaces, batch decode sessions, and lossless encode
helpers on macOS. Non-macOS builds keep the same API surface and return
Error::MetalUnavailable for explicit Metal-only requests.
Structs§
- Codec
- J2K codec marker used by J2K’s generic decode traits.
- J2kContext
- Reusable JPEG 2000 decode context and cache state.
- J2kDecoder
- JPEG 2000 decoder that can return host or Metal-resident surfaces.
- J2kScratch
Pool - Caller-owned reusable scratch for
j2k. - Metal
Backend Session - Placeholder Metal session for non-macOS builds.
- Metal
Batch Decode Result - Successful groups, indexed preparation failures, and homogeneous execution failures.
- Metal
Batch Decoder - Persistent Metal batch decoder.
- Metal
Batch Group - One successfully decoded homogeneous Metal-resident output group.
- Metal
Batch Group Completion - Codec metadata released only after a caller-owned Metal group destination has completed and its device status has been validated.
- Metal
Batch Group Error - Failure while executing one homogeneous Metal group.
- Metal
Decode Request - Single-image J2K Metal decode request.
- Metal
Encode Stage Accelerator - Encode-stage accelerator for JPEG 2000 Metal work.
- Metal
Encoded J2k - Placeholder Metal codestream type for non-macOS builds.
- Metal
Lossless Encode Batch Request - Batched lossless encode request over Metal-resident tiles.
- Metal
Lossless Encode Config - Tuning knobs for resident Metal lossless J2K/HTJ2K tile batch encode.
- Metal
Lossless Encode Residency - Residency decisions used by a lossless Metal encode.
- Metal
Lossless Encode Tile - Placeholder lossless encode tile type for non-macOS builds.
- Metal
Session - Shared batching session used by J2K Metal submit APIs.
- Metal
Tile Batch - Convenience wrapper for submitting a group of J2K/HTJ2K tiles to one decoder session.
- Native
Backend Error - Opaque, Metal-adapter-owned source for native codec failures.
- Submitted
J2kLossless Metal Buffer Encode Batch - Placeholder submitted Metal-buffer encode for non-macOS builds.
- Submitted
J2kLossless Metal Encode Batch - Placeholder submitted multi-tile encode for non-macOS builds.
- Surface
- Decoded J2K image surface returned by the Metal backend.
Enums§
- Error
- Errors returned by the Metal J2K backend.
- Metal
Decode Op - Geometry operation for a single J2K Metal decode request.
- Metal
Direct Fallback Reason - Structured fallback class for Metal direct decode routing.
- Metal
Encode Input Staging - How tile samples reach the encoder’s padded staging layout.
- Metal
Kernel Retry Class - Conservative retry class for Metal kernel failures.
- Surface
Residency - Residency of an accelerator-visible surface or buffer.
Functions§
- submit_
lossless_ batch - Return
Error::MetalUnavailablefor submitted host-byte batch encode on non-macOS. - submit_
lossless_ batch_ to_ metal - Return
Error::MetalUnavailablefor submitted Metal-buffer batch encode on non-macOS. - validate_
lossless_ roundtrip_ on_ metal - Return
Error::MetalUnavailablefor Metal roundtrip validation on non-macOS. - validate_
lossless_ roundtrip_ on_ metal_ with_ session - Return
Error::MetalUnavailablefor session validation on non-macOS.
Type Aliases§
- Metal
Batch Group Parts - Owned parts returned when consuming one homogeneous Metal batch group.