rusty_esp_image_core/lib.rs
1#![cfg_attr(not(feature = "std"), no_std)]
2#![forbid(unsafe_code)]
3//! `rusty_esp_image-core` — the pure heart of `rusty_esp_image`.
4//!
5//! esp32-camera and Espressif's JPEG components, remade: what a camera on an
6//! ESP32 needs *above* the DMA engine, with no driver in sight.
7//!
8//! | Module | Holds |
9//! |---|---|
10//! | [`source`] | [`ImageSource`] — capture **into caller memory**; a `TestPattern` source for host and smoke tests |
11//! | [`pool`] | [`FramePool`] — N fixed slots over one caller buffer: the DMA ring in user clothes |
12//! | [`jpeg`] | [`jpeg::probe`] — geometry, precision and progressive flag from a JPEG header, no decode; `find_eoi` to trim DMA over-read |
13//! | [`ops`] | pixel kernels (RGB565 ↔ RGB888, YUYV → RGB/gray, 2× downscale, crop, rotate) — scalar, tested; the oracles for any later PIE twin |
14//! | [`sensor`] | sensor identity and register tables **as data** (`SensorDesc`, `Register`, the OV2640 / OV5640 tables derived from esp32-camera) |
15//! | [`sccb`] | [`Sccb`] — the camera control bus (I²C without repeated start) over `embedded-hal` 1.0 |
16//!
17//! Rules (from the package plan): every buffer is caller-owned; nothing here
18//! allocates on a hot path; `forbid(unsafe)`; the scalar path is the oracle.
19//! The DVP / MIPI capture engines and the hardware JPEG codecs live in
20//! `rusty_esp_image-esp`; the software JPEG codec is `rusty_jpeg`, behind a
21//! feature once its encoder is `no_std`.
22
23#[cfg(feature = "alloc")]
24extern crate alloc;
25
26pub mod jpeg;
27pub mod ops;
28pub mod pool;
29pub mod sccb;
30pub mod sensor;
31pub mod source;
32
33pub use pool::{FramePool, SlotId};
34pub use rusty_esp_core as esp_core;
35pub use sccb::{RegWidth, Sccb};
36pub use sensor::{Mode, Register, SensorDesc, SensorId};
37pub use source::{ImageSource, TestPattern};
38
39/// The names a sketch or firmware wants in scope.
40pub mod prelude {
41 pub use crate::jpeg::{JpegInfo, probe};
42 pub use crate::pool::{FramePool, SlotId};
43 pub use crate::sccb::{RegWidth, Sccb};
44 pub use crate::sensor::{Mode, Register, SensorDesc, SensorId};
45 pub use crate::source::{ImageSource, TestPattern};
46 pub use rusty_esp_core::prelude::*;
47}
48
49/// Crate version, for capability manifests and logs.
50pub const VERSION: &str = env!("CARGO_PKG_VERSION");