mediaframe/source/bayer.rs
1//! 8-bit Bayer (`AV_PIX_FMT_BAYER_BGGR8` / `RGGB8` / `GRBG8` /
2//! `GBRG8`) — single-plane mosaic source marker.
3//!
4//! # Design note
5//!
6//! The walker function (`colconv::raw::bayer_to`) and the row borrow
7//! type (`colconv::raw::BayerRow`) live in `colconv::raw` because they
8//! require demosaic parameters (`BayerDemosaic`, `WhiteBalance`,
9//! `ColorCorrectionMatrix`) that are colconv processing-layer types.
10//! Only the zero-sized [`Bayer`] marker lives here so that:
11//!
12//! - `Bayer` can implement `mediaframe::SourceFormat` (which uses a
13//! `pub(crate)` seal), and
14//! - downstream crates that need to name the source format type do not
15//! need to depend on `colconv`.
16
17marker! {
18 /// Zero-sized marker for the 8-bit Bayer mosaic source format
19 /// (`AV_PIX_FMT_BAYER_BGGR8`, `RGGB8`, `GRBG8`, `GBRG8`).
20 ///
21 /// Used as the `F` type parameter on `colconv::sinker::MixedSinker`
22 /// and as a [`crate::SourceFormat`] bound on Bayer-specific sinks.
23 #[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash)]
24 struct Bayer;
25}