Module jpeg
Expand description
JPEG encoding of 8-bit frames and decoded images.
Apps keep photographs, camera frames and re-encoded pastes as JPEG. They
encode through these functions rather than the image crate’s generic
encoders, so the encoder is compiled once, in the shared runtime, and not
again into each app’s binary.
Functions§
- encode_
image - Encode
imageas a JPEG ofquality: grey images stay grey, every other colour type becomes 8-bit RGB (alpha dropped, deeper channels narrowed), as the encoder requires. - encode_
rgb8 - Encode
rgb(width * height * 3bytes, row-major) as a JPEG ofquality(1-100). - encode_
rgba8_ opaque - Encode
rgba(width * height * 4bytes) as a JPEG ofquality, dropping its alpha channel: JPEG keeps none. Each pixel keeps its colour values as they are, uncomposited.