pub struct ScopeAnalyzer;Expand description
Scope analysis utilities for decoded video frames.
All methods are associated functions (no instance state).
Implementations§
Source§impl ScopeAnalyzer
impl ScopeAnalyzer
Sourcepub fn waveform(frame: &VideoFrame) -> Vec<Vec<f32>>
pub fn waveform(frame: &VideoFrame) -> Vec<Vec<f32>>
Compute waveform monitor data for frame.
Returns a Vec of length frame.width(). Each inner Vec contains
the normalised Y (luma) values [0.0, 1.0] of every pixel in that column,
ordered top-to-bottom.
Only yuv420p, yuv422p, and yuv444p pixel formats are supported.
Returns an empty Vec for unsupported formats or if Y-plane data is
unavailable.
Sourcepub fn vectorscope(frame: &VideoFrame) -> Vec<(f32, f32)>
pub fn vectorscope(frame: &VideoFrame) -> Vec<(f32, f32)>
Compute vectorscope data for frame.
Returns a Vec of (cb, cr) pairs, one per chroma sample, with both
values normalised to [-0.5, 0.5].
Chroma dimensions vary by format:
yuv420p—(width/2) × (height/2)samplesyuv422p—(width/2) × heightsamplesyuv444p—width × heightsamples
Returns an empty Vec for unsupported formats or if chroma plane data
is unavailable.
Sourcepub fn rgb_parade(frame: &VideoFrame) -> RgbParade
pub fn rgb_parade(frame: &VideoFrame) -> RgbParade
Compute RGB parade data for frame.
Each pixel is converted from YUV to RGB using the BT.601 full-range matrix
before sampling. Returns an RgbParade whose r, g, and b fields
each have the same column-major shape as ScopeAnalyzer::waveform.
Only yuv420p, yuv422p, and yuv444p pixel formats are supported.
Returns RgbParade { r: vec![], g: vec![], b: vec![] } for unsupported
formats or if plane data is unavailable.
Sourcepub fn histogram(frame: &VideoFrame) -> Histogram
pub fn histogram(frame: &VideoFrame) -> Histogram
Compute a 256-bin histogram for each channel and for luminance.
For YUV frames luma is read directly from the Y plane; R, G, and B are
computed via BT.601 full-range conversion. Bins are indexed by the raw
8-bit value [0, 255].
Only yuv420p, yuv422p, and yuv444p pixel formats are supported.
Returns a zeroed Histogram for unsupported formats or if plane data
is unavailable.