pub struct PlanarImage<T: Pixel> {
pub width: usize,
pub height: usize,
pub bit_depth: BitDepth,
pub planes: [Vec<T>; 4],
}Fields§
§width: usize§height: usize§bit_depth: BitDepth§planes: [Vec<T>; 4]Implementations§
Source§impl<T: Pixel> PlanarImage<T>
impl<T: Pixel> PlanarImage<T>
Sourcepub fn from_interleaved_rgb(
width: usize,
height: usize,
bit_depth: BitDepth,
rgb: &[T],
) -> Result<Self, EncodeError>
pub fn from_interleaved_rgb( width: usize, height: usize, bit_depth: BitDepth, rgb: &[T], ) -> Result<Self, EncodeError>
Build from interleaved RGB samples (r,g,b,r,g,b,...).
AV1 identity matrix mapping: plane0=G, plane1=B, plane2=R. No alpha.
Sourcepub fn from_interleaved_rgba(
width: usize,
height: usize,
bit_depth: BitDepth,
rgba: &[T],
) -> Result<Self, EncodeError>
pub fn from_interleaved_rgba( width: usize, height: usize, bit_depth: BitDepth, rgba: &[T], ) -> Result<Self, EncodeError>
Build from interleaved RGBA samples (r,g,b,a,r,g,b,a,...) in a single
pass: plane0=G, plane1=B, plane2=R, plane3=A. This is the deinterleave
the *_with_alpha paths use — the color planes and the alpha plane are
split once, with no intermediate RGB buffer.
Sourcepub fn from_luma(
width: usize,
height: usize,
bit_depth: BitDepth,
luma: &[T],
) -> Result<Self, EncodeError>
pub fn from_luma( width: usize, height: usize, bit_depth: BitDepth, luma: &[T], ) -> Result<Self, EncodeError>
Build a monochrome image from a single luma plane. No alpha.
Sourcepub fn from_interleaved_gray_alpha(
width: usize,
height: usize,
bit_depth: BitDepth,
gray_alpha: &[T],
) -> Result<Self, EncodeError>
pub fn from_interleaved_gray_alpha( width: usize, height: usize, bit_depth: BitDepth, gray_alpha: &[T], ) -> Result<Self, EncodeError>
Build a monochrome-plus-alpha image from interleaved gray/alpha samples
(l,a,l,a,...) in a single pass: plane0=luma, plane3=alpha (planes 1/2
stay empty). Mirrors Self::from_interleaved_rgba for the 2-channel
gray+alpha case.
Sourcepub fn to_interleaved_rgb(&self) -> Vec<T>
pub fn to_interleaved_rgb(&self) -> Vec<T>
Reconstruct interleaved RGB from the GBR planes (alpha is dropped).
Auto Trait Implementations§
impl<T> Freeze for PlanarImage<T>
impl<T> RefUnwindSafe for PlanarImage<T>where
T: RefUnwindSafe,
impl<T> Send for PlanarImage<T>
impl<T> Sync for PlanarImage<T>
impl<T> Unpin for PlanarImage<T>where
T: Unpin,
impl<T> UnsafeUnpin for PlanarImage<T>
impl<T> UnwindSafe for PlanarImage<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more