Skip to main content

Module codecs

Module codecs 

Source
Expand description

Image codecs: PNG (encode + decode) and JPEG (decode only).

Pure-Rust, permissive-licensed backends: the png crate and jpeg-decoder. All entry points return packed RGB8 and fail closed to a crate::specialized_libs::computer_vision::cv::error::CvError on malformed input — no panics, no unwrap on the decode/encode paths.

Modules§

jpeg_decode
JPEG decode → packed RGB8. Cold path (Vec allowed).
png_decode
PNG decode → packed RGB8. Cold path (Vec allowed).
png_encode
RGB8 view → PNG byte stream. Cold path (Vec allowed).

Functions§

decode_jpeg
Decode a JPEG byte stream into packed RGB8 plus dimensions.
decode_png
Decode a PNG byte stream into packed RGB8 plus dimensions.
encode_png
Encode a packed RGB8 RgbView as a PNG, returning the encoded bytes.