Skip to main content

ScopeAnalyzer

Struct ScopeAnalyzer 

Source
pub struct ScopeAnalyzer;
Expand description

Scope analysis utilities for decoded video frames.

All methods are associated functions (no instance state).

Implementations§

Source§

impl ScopeAnalyzer

Source

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.

Source

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) samples
  • yuv422p(width/2) × height samples
  • yuv444pwidth × height samples

Returns an empty Vec for unsupported formats or if chroma plane data is unavailable.

Source

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.

Source

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.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.