Expand description
Pixel operations — scalar, bounds-checked, and the oracle for every faster twin.
The conversions and downscales a camera pipeline needs moved to
rusty_esp_dsp::pixel (D0, 2026-09-02) and are re-exported here at the
paths this crate always had, so a caller sees no change; the crop and
rotate helpers, which only this crate uses, stay. Colour conversion is
BT.601 full-range (the JFIF convention), fixed-point with an 8-bit
fraction — the same arithmetic on every platform.
Functions§
- crop
- Crop a packed frame to the rectangle at (
x,y) of sizew×h. - downscale2x_
gray8 - 2× box downscale of a Gray8 image; odd trailing rows/columns are dropped. Returns the output geometry.
- downscale2x_
rgb565 - 2× box downscale of an RGB565 (LE) image, per channel.
- pack_
rgb565 - Pack an RGB888 pixel as little-endian RGB565.
- rgb565_
to_ rgb888 - RGB565 (LE) → RGB888.
srcholdspixels × 2bytes,dstpixels × 3. - rgb888_
to_ rgb565 - RGB888 → RGB565 (LE).
- rotate90_
gray8 - Rotate a Gray8 image 90° clockwise. Output is
height×width. - rotate180
- Rotate a packed image 180° in place-compatible fashion (into
dst). - unpack_
rgb565 - Unpack a little-endian RGB565 pixel to RGB888, replicating the top bits into the low bits so white stays white.
- yuv_
to_ rgb - BT.601 full-range YCbCr → RGB888, fixed-point.
- yuyv_
to_ gray8 - YUYV → Gray8: the luma bytes.
- yuyv_
to_ rgb565 - YUYV → RGB565 (LE).
- yuyv_
to_ rgb888 - YUYV (Y0 U Y1 V) → RGB888.
srcholdspixels × 2bytes (pixels even).