pub enum SampleForm {
Yuva,
Argb,
}Expand description
The samples that an imported picture keeps (C: WebPPicture::use_argb).
§Examples
use webp::api::encode::{Picture, PixelLayout, PixelRows, SampleForm};
let rgb = [10_u8, 20, 30].repeat(4);
let rows = PixelRows { layout: PixelLayout::Rgb, data: &rgb, width: 2, height: 2, stride: 6 };
let yuva = Picture::import(rows, SampleForm::Yuva)?;
let argb = Picture::import(rows, SampleForm::Argb)?;
assert_eq!(yuva.owned_sample_bytes(), 4 + 1 + 1);
assert_eq!(argb.owned_sample_bytes(), 4 * 4);Variants§
Yuva
Y, U and V planes (4:2:0), and an alpha plane when the rows are not opaque: what the lossy encoder reads. The conversion happens during the import, without sharp YUV or dithering.
Argb
One plane of ARGB pixels: what the lossless encoder reads. A lossy encoding converts it at encoding time, with sharp YUV or dithering when the configuration asks for them.
Trait Implementations§
Source§impl Clone for SampleForm
impl Clone for SampleForm
impl Copy for SampleForm
Source§impl Debug for SampleForm
impl Debug for SampleForm
impl Eq for SampleForm
Source§impl Hash for SampleForm
impl Hash for SampleForm
Source§impl PartialEq for SampleForm
impl PartialEq for SampleForm
impl StructuralPartialEq for SampleForm
Auto Trait Implementations§
impl Forget for SampleForm
impl Freeze for SampleForm
impl Move for SampleForm
impl RefUnwindSafe for SampleForm
impl Send for SampleForm
impl Sync for SampleForm
impl Unpin for SampleForm
impl UnsafeUnpin for SampleForm
impl UnwindSafe for SampleForm
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