Expand description
Shared traits and value types for the j2k workspace.
Codec crates use this crate to expose common pixel formats, decode outcomes, row sinks, caller-owned scratch pools, and CPU/GPU backend selection contracts without depending on each other.
Re-exports§
pub use accelerator::AcceleratorSession;pub use accelerator::DeviceMemoryRange;pub use accelerator::ExecutionStats;pub use accelerator::SurfaceMetadata;pub use accelerator::SurfaceResidency;
Modules§
- accelerator
- Shared accelerator runtime contracts.
Structs§
- Backend
Capabilities - Backend availability for a codec/runtime combination.
- Cache
Stats - Cache hit/miss counters reported by codec contexts.
- Coded
Unit Layout - Regular coded-unit grid layout for formats with independently coded units.
- CpuFeatures
- CPU SIMD feature flags detected for the current host.
- Decode
Outcome - Successful decode metadata plus non-fatal warnings.
- Decoder
Context - Wrapper that owns codec context state for repeated decode calls.
- Info
- Basic image metadata returned by inspect/parse operations.
- NotImplemented
- Error for a valid request that is not implemented yet.
- Passthrough
Candidate - A borrowed compressed frame/tile that may be copied unchanged.
- Passthrough
Requirements - Destination requirements for copying compressed bytes unchanged.
- Rect
- Rectangle in source pixel coordinates.
- Tile
Batch Error - Error returned by tile batches, annotated with the failing input index.
- Tile
Batch Options - Worker configuration for CPU tile batches.
- Tile
Decode Job - One full-tile decode request.
- Tile
Layout - Regular tile grid layout for a compressed image.
- Tile
Region Decode Job - One region tile decode request.
- Tile
Region Scaled Decode Job - One region+scaled tile decode request.
- Tile
Region Scaled Device Decode Request - One region+scaled tile device decode request.
- Tile
Scaled Decode Job - One scaled tile decode request.
- Unsupported
- Error for input or options unsupported by the current codec.
Enums§
- Adapter
Error Kind - Backend-adapter-local error classification.
- Backend
Kind - Runtime backend that executes codec work.
- Backend
Request - Caller preference for backend selection.
- Batch
Decode Error - Error returned by a fallible batch boundary.
- Batch
Infrastructure Error - Failure in batch scheduling, allocation, or worker-result collection.
- Buffer
Error - Buffer validation and copy errors.
- Colorspace
- Color interpretation of decoded samples.
- Compressed
Payload Kind - Encapsulation shape of the compressed bytes.
- Compressed
Transfer Syntax - Compressed syntax carried by a source frame or accepted by a destination.
- Decode
Rows Error - Error wrapper used by row-streaming decode when either the codec or the caller-provided row sink can fail.
- Downscale
- Power-of-two downscale requested during decode.
- Input
Error - Generic malformed or truncated input errors.
- Passthrough
Decision - Result of a passthrough eligibility check.
- Passthrough
Reject Reason - First reason a compressed payload was rejected for byte-preserving copy.
- Pixel
Format - Concrete interleaved pixel format.
- Pixel
Layout - Channel layout independent of sample width.
- Sample
Type - Integer sample width used by a pixel format or row sink.
Constants§
- DEFAULT_
MAX_ HOST_ ALLOCATION_ BYTES - Default cap for host-side codec-owned allocations.
Traits§
- Adapter
Error Parts - Variant mapping supplied by GPU adapter error enums.
- Codec
Context - Reusable codec state cached across decode calls.
- Codec
Error - Shared error classification used by facade traits.
- Device
Submission - Submitted device decode operation that can be waited on for completion.
- Device
Surface - Decoded image data resident on a specific backend.
- Image
Codec - Common associated types shared by image codecs.
- Image
Decode - Borrowed-image decode API for codecs that parse compressed bytes directly.
- Image
Decode Device - Synchronous device-output decode API.
- Image
Decode Rows - Row-streaming decode API for large images or stripe-oriented callers.
- Image
Decode Submit - Decode API for implementations that can submit work to a device backend.
- RowSink
- Destination for row-streaming decode output.
- Sample
- Supported integer sample type for row-oriented APIs.
- Scratch
Pool - Caller-owned reusable scratch allocations for codec implementations.
- Tile
Batch Decode - Stateless tile-batch decode helpers that reuse caller-owned context.
- Tile
Batch Decode Device - Tile-batch helpers that return synchronous device surfaces.
- Tile
Batch Decode Many Device - Full-tile batch helpers that decode many independent tiles to device surfaces.
- Tile
Batch Decode Submit - Tile-batch helpers that queue device submissions.
- Tile
Decompress - Tile payload decompression API for container codecs such as Deflate, Zstd, LZW, and uncompressed data.