Skip to main content

Crate j2k_metal

Crate j2k_metal 

Source
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.
J2kScratchPool
Caller-owned reusable scratch for j2k.
MetalBackendSession
Placeholder Metal session for non-macOS builds.
MetalEncodeStageAccelerator
Encode-stage accelerator for JPEG 2000 Metal work.
MetalEncodedJ2k
Placeholder Metal codestream type for non-macOS builds.
MetalLosslessBufferEncodeBatchOutcome
Resident Metal lossless J2K/HTJ2K tile batch output and batch-level metrics.
MetalLosslessBufferEncodeOutcome
Metal lossless encode report for buffer-backed codestream output.
MetalLosslessEncodeBatchRequest
Batched lossless encode request over Metal-resident tiles.
MetalLosslessEncodeBatchStats
Resolved resident Metal lossless J2K/HTJ2K tile batch encode metrics.
MetalLosslessEncodeConfig
Tuning knobs for resident Metal lossless J2K/HTJ2K tile batch encode.
MetalLosslessEncodeOutcome
Lossless Metal encode output with host codestream bytes and timings.
MetalLosslessEncodeResidency
Residency decisions used by a lossless Metal encode.
MetalLosslessEncodeStageStats
Optional resident Metal encode stage timings.
MetalLosslessEncodeTile
Placeholder lossless encode tile type for non-macOS builds.
MetalSession
Shared batching session used by J2K Metal submit APIs.
MetalTileBatch
Convenience wrapper for submitting a group of J2K/HTJ2K tiles to one decoder session.
SubmittedJ2kLosslessMetalBufferEncodeBatch
Placeholder submitted Metal-buffer encode for non-macOS builds.
SubmittedJ2kLosslessMetalEncodeBatch
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.
MetalEncodeInputStaging
How tile samples reach the encoder’s padded staging layout.
SurfaceResidency
Where a decoded J2K surface is currently resident.

Functions§

encode_lossless_batch_with_report
Return Error::MetalUnavailable for reported batch encode on non-macOS.
submit_lossless_batch
Return Error::MetalUnavailable for submitted host-byte batch encode on non-macOS.
submit_lossless_batch_to_metal
Return Error::MetalUnavailable for submitted Metal-buffer batch encode on non-macOS.
validate_lossless_roundtrip_on_metal
Return Error::MetalUnavailable for Metal roundtrip validation on non-macOS.
validate_lossless_roundtrip_on_metal_with_session
Return Error::MetalUnavailable for session validation on non-macOS.