Skip to main content

Module marker

Module marker 

Source
Expand description

JPEG marker parsing and iteration.

Walks the marker segments in a JPEG byte stream, extracting headers (DQT, DHT, SOF, DRI, SOS) and preserving unknown markers verbatim. Stops at the SOS marker, returning the byte offset where entropy-coded scan data begins.

Structs§

MarkerEntry
Parsed marker with position information.
MarkerSegment
A raw marker segment preserving the original bytes.
SosParams
Spectral selection and successive approximation parameters from an SOS header.

Constants§

COM
DHT
DQT
DRI
EOI
SOF0
SOF2
SOI
JPEG marker constants.
SOS

Functions§

iterate_markers
Iterate over JPEG markers from a byte slice.
iterate_markers_all
Iterate markers for a progressive JPEG file, handling multiple scans.
parse_dri
Parse DRI (Define Restart Interval) marker data.
parse_sos
Parse an SOS (Start of Scan) header. Returns component selectors: (component_id, dc_table_id, ac_table_id) per scan component.
parse_sos_params
Parse the spectral selection / successive approximation parameters from an SOS header. These are the last 3 bytes of the SOS header data: Ss, Se, Ah_Al.
skip_scan_data
Skip past entropy-coded scan data to find the next marker.