Skip to main content

Crate j2k_metal

Crate j2k_metal 

Source
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.
J2kScratchPool
Caller-owned reusable scratch for j2k.
MetalBackendSession
Placeholder Metal session for non-macOS builds.
MetalBatchDecodeResult
Successful groups, indexed preparation failures, and homogeneous execution failures.
MetalBatchDecoder
Persistent Metal batch decoder.
MetalBatchGroup
One successfully decoded homogeneous Metal-resident output group.
MetalBatchGroupCompletion
Codec metadata released only after a caller-owned Metal group destination has completed and its device status has been validated.
MetalBatchGroupError
Failure while executing one homogeneous Metal group.
MetalDecodeRequest
Single-image J2K Metal decode request.
MetalEncodeStageAccelerator
Encode-stage accelerator for JPEG 2000 Metal work.
MetalEncodedJ2k
Placeholder Metal codestream type for non-macOS builds.
MetalLosslessEncodeBatchRequest
Batched lossless encode request over Metal-resident tiles.
MetalLosslessEncodeConfig
Tuning knobs for resident Metal lossless J2K/HTJ2K tile batch encode.
MetalLosslessEncodeResidency
Residency decisions used by a lossless Metal encode.
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.
NativeBackendError
Opaque, Metal-adapter-owned source for native codec failures.
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.
MetalDecodeOp
Geometry operation for a single J2K Metal decode request.
MetalDirectFallbackReason
Structured fallback class for Metal direct decode routing.
MetalEncodeInputStaging
How tile samples reach the encoder’s padded staging layout.
MetalKernelRetryClass
Conservative retry class for Metal kernel failures.
SurfaceResidency
Residency of an accelerator-visible surface or buffer.

Functions§

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.

Type Aliases§

MetalBatchGroupParts
Owned parts returned when consuming one homogeneous Metal batch group.