elata_rppg/lib.rs
1//! Remote photoplethysmography (rPPG) core for the Elata SDK.
2//!
3//! This crate contains the Rust-side processing pipeline used to estimate
4//! pulse-related metrics from RGB intensity samples captured over time.
5//!
6//! # Main entry points
7//!
8//! - [`RppgPipeline`] buffers timestamped samples and computes windowed metrics
9//! - [`harmonic_probability_check`] provides harmonic validation helpers
10//! - [`SubjectModel`] and [`ParticleFilter`] expose supporting estimation tools
11//!
12//! # Example
13//!
14//! ```rust
15//! use elata_rppg::RppgPipeline;
16//!
17//! let mut pipeline = RppgPipeline::new(30.0, 8.0);
18//!
19//! for i in 0..300 {
20//! let t_ms = i * 33;
21//! pipeline.push_sample_rgb(t_ms, 0.52, 0.61, 0.47, 0.95);
22//! }
23//!
24//! let metrics = pipeline.get_metrics();
25//! let _ = metrics.bpm;
26//! ```
27//!
28//! This crate is intended to be embedded by higher-level WASM, FFI, or native
29//! application layers rather than used as an end-user camera capture API.
30
31pub mod benchmark;
32pub mod dsp;
33pub mod harmonic;
34pub mod pipeline;
35pub mod subject_model;
36pub mod tracker;
37
38pub use harmonic::{harmonic_probability_check, HarmonicCheckResult};
39pub use pipeline::RppgPipeline;
40pub use subject_model::SubjectModel;
41pub use tracker::ParticleFilter;