Expand description
JPEG decoder optimized for whole-slide images.
See the top-level README for project positioning. The primary entry point
is Decoder — start with Decoder::inspect for header-only parsing.
Structs§
- Cache
Stats - Cache hit/miss counters reported by codec contexts.
- Decode
Options - Public decode options for JPEG reads.
- Decode
Outcome - Non-fatal outcome of a successful decode. See spec Section 2.
- Decode
Request - Owned-output JPEG decode request.
- Decoded
Tile - Result for one successful prepared JPEG tile decode.
- Decoder
- A borrowed view of a JPEG stream ready to decode. Constructed via
Decoder::neworDecoder::from_view.Decoder<'a>: Send + Sync. - Decoder
Context - Shared decode context for WSI tile batches.
- Device
Batch Summary - Lightweight summary used for batching without materializing scan bytes.
- Encoded
Jpeg - Encoded baseline JPEG bytes and the backend that produced them.
- Info
- Header-derived image metadata. Populated by
Decoder::inspectand byDecoder::new.scan_countis the number of SOS markers observed in the input — for sequential this is always 1; for progressive it is the count of refinement passes. - Jpeg
Backend Eligibility - Backend eligibility result with a stable rejection reason.
- Jpeg
Batch Session - Reusable JPEG tile-batch runtime for WSI viewport loops.
- Jpeg
Capability Report - Parsed JPEG metadata and backend eligibility for one request.
- Jpeg
Capability Request - Capability request for a JPEG decode route.
- Jpeg
Codec - JPEG codec marker type for
j2k-coretrait integrations. - Jpeg
Decode Request - Complete JPEG decode request used by backend path resolution.
- Jpeg
Encode Options - Options controlling baseline JPEG encoding.
- Jpeg
Output Buffer - Caller-owned reusable host pixel buffer.
- Jpeg
Resolved Decode - Parsed JPEG metadata plus the selected backend path.
- Jpeg
Scan Ranges - Byte ranges around the first Start-of-Scan marker.
- Jpeg
Segment - One marker segment in a JPEG byte stream.
- Jpeg
Segment Iter - Iterator over marker segments in a JPEG byte stream.
- Jpeg
SofInfo - Parsed Start-of-Frame facts.
- Jpeg
Tile Prepare Options - Options for preparing TIFF/WSI JPEG tile payloads.
- Jpeg
View - A parsed borrowed view of a JPEG stream.
- McuGeometry
- Minimum coded unit geometry derived from SOF sampling factors.
- Passthrough
Candidate - A borrowed compressed frame/tile that may be copied unchanged.
- Passthrough
Requirements - Destination requirements for copying compressed bytes unchanged.
- Prepared
Jpeg Tile Job - One decode request for a JPEG tile already normalized by
prepare_tiff_jpeg_tile. - Rect
- Inclusive axis-aligned rectangle in image coordinates.
- Restart
Index - Restart-marker index for a single-scan JPEG stream.
- Restart
Segment - One restart-addressable entropy segment in the original JPEG byte stream.
- Sampling
Factors - Per-component (H, V) sampling factors, stored in declaration order.
- Scratch
Pool - Pool of decoder-internal scratch buffers, reusable across many
Decoder::decode_into_with_scratch/decode_rows_with_scratchcalls. - Tile
Batch Options - Worker configuration for CPU tile batches.
- Tile
Decode Output - Caller-owned output target for one context-reused tile decode helper.
Enums§
- Batch
Decode Error - Error returned by a fallible batch boundary.
- Batch
Infrastructure Error - Failure in batch scheduling, allocation, or worker-result collection.
- Builder
Conflict Reason - Invalid decoder-builder input configuration.
- Color
Space - Declared input color space after APP14 detection.
- Color
Transform - Override for APP14 color-transform detection.
- 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.
- Duplicate
Table Policy - Duplicate JPEG table handling policy.
- Huffman
Failure - Huffman entropy decoder failure category.
- Jpeg
Backend - JPEG encoder backend selector.
- Jpeg
Decode Op - JPEG decode operation shape for capability routing.
- Jpeg
Encode Error - Errors produced by baseline JPEG encoding.
- Jpeg
Error - Fatal JPEG decode or API error.
- Jpeg
Resolved Decode Path - Normalized JPEG decode path selected for a request.
- Jpeg
Samples - Borrowed input samples for baseline JPEG encoding.
- Jpeg
Subsampling - JPEG baseline chroma subsampling mode.
- Marker
Kind - A category of JPEG marker. Carried in
JpegError::UnexpectedMarkerand related variants so callers can branch on marker class without parsing the raw byte. - 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.
- Prepared
Jpeg - Prepared JPEG bytes, borrowed when unchanged and owned when normalized.
- Progressive
Scan State Error - Cross-scan progressive coefficient-state violation.
- Progressive
Scan Termination Error - Entropy condition that made a progressive scan terminator invalid.
- Sample
Type - Integer sample width used by a pixel format or row sink.
- Sampling
Factors Error - Error returned when constructing
SamplingFactorsfrom caller input. - SofKind
- Start-of-frame variant. Determines the decode pipeline.
- Table
Kind - JPEG table class used in diagnostics.
- Unsupported
Reason - Reason an otherwise recognized SOF marker cannot be decoded.
- Warning
- Non-fatal notices emitted during decode. See spec Section 6.
Traits§
- Codec
Context - Reusable codec state cached across decode calls.
- Component
RowWriter - Receives decoded component rows before they are packed into the final interleaved pixel format.
- Image
Codec - Common associated types shared by image codecs.
- Image
Decode - Borrowed-image decode API for codecs that parse compressed bytes directly.
- Image
Decode Rows - Row-streaming decode API for large images or stripe-oriented callers.
- RowSink
- Destination for row-streaming decode output.
- Sample
- Supported integer sample type for row-oriented APIs.
- Tile
Batch Decode - Stateless tile-batch decode helpers that reuse caller-owned context.
- Tile
Decompress - Tile payload decompression API for container codecs such as Deflate, Zstd, LZW, and uncompressed data.
Functions§
- decode_
prepared_ jpeg_ tiles_ rgb8 - Decode prepared TIFF/WSI JPEG tiles into caller-owned RGB8 output buffers.
- decode_
tile_ into - One-shot parse-plus-decode of an independent JPEG tile into the caller’s
buffer, reusing a pre-allocated
ScratchPool. This is the primitive WSI tile-batch readers want: one function call per tile, with all heap state external. - decode_
tiles_ into - Decode independent JPEG tiles into caller-owned output buffers using a scoped CPU worker pool.
- decode_
tiles_ region_ scaled_ into - Decode independent JPEG tile regions at reduced resolution into caller-owned output buffers using a scoped CPU worker pool.
- decode_
tiles_ scaled_ into - Decode independent JPEG tiles at reduced resolution into caller-owned output buffers using a scoped CPU worker pool.
- encode_
jpeg_ baseline - Encode grayscale or RGB samples as a baseline JPEG codestream.
- find_
scan_ ranges - Find the first SOS header and scan data ranges.
- is_
sof_ marker - Return true for JPEG SOF marker classes.
- iter_
segments - Iterate over JPEG marker segments.
- parse_
dri - Parse a Define Restart Interval payload.
- parse_
sof_ info - Parse a Start-of-Frame payload.
- prepare_
tiff_ jpeg_ tile - Prepare a TIFF/WSI JPEG tile for decode.
- rewrite_
sof_ dimensions - Return a copy of
inputwith the first SOF dimensions rewritten.
Type Aliases§
- Prepared
Tile Batch Error - Allocation, scheduling, or collection failure for a prepared JPEG batch.
- Tile
Batch Error - Error returned by
decode_tiles_into, annotated with the failing tile index from the caller’s input order when a codec error occurs, or carrying a typed infrastructure error when no tile index applies. - Tile
Decode Job - One tile decode request for
decode_tiles_into. - Tile
Region Scaled Decode Job - One ROI+scaled tile decode request for
decode_tiles_region_scaled_into. - Tile
Scaled Decode Job - One scaled tile decode request for
decode_tiles_scaled_into.