pub struct Pipe1<'d, T: Instance> { /* private fields */ }Expand description
Handle to DCMIPP Pipe1 (main ISP + format conversion). Obtained from
Dcmipp::split.
Implementations§
Source§impl<'d, T: Instance> Pipe1<'d, T>
impl<'d, T: Instance> Pipe1<'d, T>
Sourcepub fn configure(&mut self, cfg: &Pipe1Config)
pub fn configure(&mut self, cfg: &Pipe1Config)
Configure Pipe1: input, VC, output format, pitch, optional demosaic, optional crop, optional downsize. Leaves the pipe disabled.
Sourcepub async fn capture(&mut self, buffer: *mut u8) -> Result<(), Error>
pub async fn capture(&mut self, buffer: *mut u8) -> Result<(), Error>
Arm a single-shot capture. buffer must be 16-byte aligned.
Sourcepub async fn wait_frame(&mut self) -> Result<u8, Error>
pub async fn wait_frame(&mut self) -> Result<u8, Error>
Wait for the next frame. Returns the buffer index (0 or 1).
Sourcepub fn set_color_gains(&mut self, gains: ChannelGains)
pub fn set_color_gains(&mut self, gains: ChannelGains)
Program the colour-conversion matrix as a diagonal gain matrix and enable it. Off-diagonal coefficients and the offset column are zeroed. Re-callable while streaming — the new matrix latches at the next frame boundary.
This shares hardware with set_color_matrix; calling either
after the other replaces the previous CCM. Use set_color_matrix
for full 3×3 colour correction (and to keep WB+CCM separate by
applying WB at the sensor / via the demosaic stage instead).
Sourcepub fn set_color_matrix(&mut self, m: ColorMatrix)
pub fn set_color_matrix(&mut self, m: ColorMatrix)
Program the full 3×3 colour-conversion matrix and enable it.
Hardware applies out = M · in + offset, optionally clamped to
8-bit unsigned. Coefficients are encoded in 11-bit signed Q2.8
(range -4.0 ..= +3.996); offsets are 10-bit signed integers
(range -512 ..= 511) added to the matrix product.
Re-callable while streaming — the new matrix latches at the next
frame boundary. Shares hardware with set_color_gains; the
last call wins.
Sourcepub fn disable_color_matrix(&mut self)
pub fn disable_color_matrix(&mut self)
Disable the colour-conversion matrix entirely (skip the stage in
the ISP pipeline). After this call, neither set_color_gains
nor set_color_matrix state is applied until called again.
Sourcepub fn set_gamma_enable(&mut self, enable: bool)
pub fn set_gamma_enable(&mut self, enable: bool)
Enable / disable Pipe1’s gamma stage (a fixed sRGB-2.2 curve in hardware — there is no programmable LUT). Re-callable while streaming.
Sourcepub fn enable_rgb_stats(&mut self, width: u16, height: u16)
pub fn enable_rgb_stats(&mut self, width: u16, height: u16)
Configure the three statistics extractors to compute the per-frame mean of the post-demosaic R, G, B channels over the full Pipe1 output rectangle. Call once before streaming starts; the hardware then refreshes the result registers at every end-of-frame.
Sourcepub fn read_rgb_means(&self) -> (u32, u32, u32)
pub fn read_rgb_means(&self) -> (u32, u32, u32)
Read the most recently latched per-channel means (P1ST{1,2,3}SR.accu).
Returns (mean_r, mean_g, mean_b). Each value is the channel sum
over the configured stats window divided by 256, per the metapac
register description. Call only after enable_rgb_stats and at
least one captured frame.