Expand description
A library for handling YUV video frames and planes.
v_frame provides data structures and utilities for working with YUV video data,
originally extracted from the rav1e video encoder. The library supports various
chroma subsampling formats (YUV420, YUV422, YUV444, and Monochrome) and both 8-bit
and high bit-depth (9-16 bit) pixel data.
§Core Components
Pixel: Trait abstracting over pixel data types (u8andu16)Plane: A single plane of pixel data with optional paddingFrame: A complete YUV frame containing Y, U, and V planesChromaSubsampling: Enum specifying chroma subsampling format
§Example
use v_frame::frame::FrameBuilder;
use v_frame::chroma::ChromaSubsampling;
use std::num::{NonZeroU8, NonZeroUsize};
// Create a 1920x1080 YUV420 8-bit frame
let width = NonZeroUsize::new(1920).unwrap();
let height = NonZeroUsize::new(1080).unwrap();
let bit_depth = NonZeroU8::new(8).unwrap();
let frame = FrameBuilder::new(width, height, ChromaSubsampling::Yuv420, bit_depth)
.build::<u8>()
.unwrap();