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§
- Marker
Entry - Parsed marker with position information.
- Marker
Segment - A raw marker segment preserving the original bytes.
- SosParams
- Spectral selection and successive approximation parameters from an SOS header.
Constants§
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.