Expand description
Apple Metal GPU adapters for Rust JPEG 2000 / HTJ2K decode and encode paths.
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
Encode Stage Accelerator - Encode-stage accelerator for JPEG 2000 Metal work.
- Metal
Encoded J2k - Placeholder Metal codestream type for non-macOS builds.
- Metal
Lossless Buffer Encode Batch Outcome - Resident Metal lossless J2K/HTJ2K tile batch output and batch-level metrics.
- Metal
Lossless Buffer Encode Outcome - Metal lossless encode report for buffer-backed codestream output.
- Metal
Lossless Encode Batch Request - Batched lossless encode request over Metal-resident tiles.
- Metal
Lossless Encode Batch Stats - Resolved resident Metal lossless J2K/HTJ2K tile batch encode metrics.
- Metal
Lossless Encode Config - Tuning knobs for resident Metal lossless J2K/HTJ2K tile batch encode.
- Metal
Lossless Encode Outcome - Lossless Metal encode output with host codestream bytes and timings.
- Metal
Lossless Encode Residency - Residency decisions used by a lossless Metal encode.
- Metal
Lossless Encode Stage Stats - Optional resident Metal encode stage timings.
- 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.
- 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
Encode Input Staging - How tile samples reach the encoder’s padded staging layout.
- Surface
Residency - Where a decoded J2K surface is currently resident.
Functions§
- encode_
lossless_ batch_ with_ report - Return
Error::MetalUnavailablefor reported batch encode on non-macOS. - 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.