Skip to main content

Crate j2k_jpeg

Crate j2k_jpeg 

Source
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§

CacheStats
Cache hit/miss counters reported by codec contexts.
DecodeOptions
Public decode options for JPEG reads.
DecodeOutcome
Non-fatal outcome of a successful decode. See spec Section 2.
DecodeRequest
Owned-output JPEG decode request.
DecodedTile
Result for one successful prepared JPEG tile decode.
Decoder
A borrowed view of a JPEG stream ready to decode. Constructed via Decoder::new or Decoder::from_view. Decoder<'a>: Send + Sync.
DecoderContext
Shared decode context for WSI tile batches.
DeviceBatchSummary
Lightweight summary used for batching without materializing scan bytes.
EncodedJpeg
Encoded baseline JPEG bytes and the backend that produced them.
Info
Header-derived image metadata. Populated by Decoder::inspect and by Decoder::new. scan_count is the number of SOS markers observed in the input — for sequential this is always 1; for progressive it is the count of refinement passes.
JpegBackendEligibility
Backend eligibility result with a stable rejection reason.
JpegBatchSession
Reusable JPEG tile-batch runtime for WSI viewport loops.
JpegCapabilityReport
Parsed JPEG metadata and backend eligibility for one request.
JpegCapabilityRequest
Capability request for a JPEG decode route.
JpegCodec
JPEG codec marker type for j2k-core trait integrations.
JpegDecodeRequest
Complete JPEG decode request used by backend path resolution.
JpegEncodeOptions
Options controlling baseline JPEG encoding.
JpegOutputBuffer
Caller-owned reusable host pixel buffer.
JpegResolvedDecode
Parsed JPEG metadata plus the selected backend path.
JpegScanRanges
Byte ranges around the first Start-of-Scan marker.
JpegSegment
One marker segment in a JPEG byte stream.
JpegSegmentIter
Iterator over marker segments in a JPEG byte stream.
JpegSofInfo
Parsed Start-of-Frame facts.
JpegTilePrepareOptions
Options for preparing TIFF/WSI JPEG tile payloads.
JpegView
A parsed borrowed view of a JPEG stream.
McuGeometry
Minimum coded unit geometry derived from SOF sampling factors.
PassthroughCandidate
A borrowed compressed frame/tile that may be copied unchanged.
PassthroughRequirements
Destination requirements for copying compressed bytes unchanged.
PreparedJpegTileJob
One decode request for a JPEG tile already normalized by prepare_tiff_jpeg_tile.
Rect
Inclusive axis-aligned rectangle in image coordinates.
RestartIndex
Restart-marker index for a single-scan JPEG stream.
RestartSegment
One restart-addressable entropy segment in the original JPEG byte stream.
SamplingFactors
Per-component (H, V) sampling factors, stored in declaration order.
ScratchPool
Pool of decoder-internal scratch buffers, reusable across many Decoder::decode_into_with_scratch / decode_rows_with_scratch calls.
TileBatchOptions
Worker configuration for CPU tile batches.
TileDecodeOutput
Caller-owned output target for one context-reused tile decode helper.

Enums§

BatchDecodeError
Error returned by a fallible batch boundary.
BatchInfrastructureError
Failure in batch scheduling, allocation, or worker-result collection.
BuilderConflictReason
Invalid decoder-builder input configuration.
ColorSpace
Declared input color space after APP14 detection.
ColorTransform
Override for APP14 color-transform detection.
CompressedPayloadKind
Encapsulation shape of the compressed bytes.
CompressedTransferSyntax
Compressed syntax carried by a source frame or accepted by a destination.
DecodeRowsError
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.
DuplicateTablePolicy
Duplicate JPEG table handling policy.
HuffmanFailure
Huffman entropy decoder failure category.
JpegBackend
JPEG encoder backend selector.
JpegDecodeOp
JPEG decode operation shape for capability routing.
JpegEncodeError
Errors produced by baseline JPEG encoding.
JpegError
Fatal JPEG decode or API error.
JpegResolvedDecodePath
Normalized JPEG decode path selected for a request.
JpegSamples
Borrowed input samples for baseline JPEG encoding.
JpegSubsampling
JPEG baseline chroma subsampling mode.
MarkerKind
A category of JPEG marker. Carried in JpegError::UnexpectedMarker and related variants so callers can branch on marker class without parsing the raw byte.
PassthroughDecision
Result of a passthrough eligibility check.
PassthroughRejectReason
First reason a compressed payload was rejected for byte-preserving copy.
PixelFormat
Concrete interleaved pixel format.
PixelLayout
Channel layout independent of sample width.
PreparedJpeg
Prepared JPEG bytes, borrowed when unchanged and owned when normalized.
ProgressiveScanStateError
Cross-scan progressive coefficient-state violation.
ProgressiveScanTerminationError
Entropy condition that made a progressive scan terminator invalid.
SampleType
Integer sample width used by a pixel format or row sink.
SamplingFactorsError
Error returned when constructing SamplingFactors from caller input.
SofKind
Start-of-frame variant. Determines the decode pipeline.
TableKind
JPEG table class used in diagnostics.
UnsupportedReason
Reason an otherwise recognized SOF marker cannot be decoded.
Warning
Non-fatal notices emitted during decode. See spec Section 6.

Traits§

CodecContext
Reusable codec state cached across decode calls.
ComponentRowWriter
Receives decoded component rows before they are packed into the final interleaved pixel format.
ImageCodec
Common associated types shared by image codecs.
ImageDecode
Borrowed-image decode API for codecs that parse compressed bytes directly.
ImageDecodeRows
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.
TileBatchDecode
Stateless tile-batch decode helpers that reuse caller-owned context.
TileDecompress
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 input with the first SOF dimensions rewritten.

Type Aliases§

PreparedTileBatchError
Allocation, scheduling, or collection failure for a prepared JPEG batch.
TileBatchError
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.
TileDecodeJob
One tile decode request for decode_tiles_into.
TileRegionScaledDecodeJob
One ROI+scaled tile decode request for decode_tiles_region_scaled_into.
TileScaledDecodeJob
One scaled tile decode request for decode_tiles_scaled_into.