pub enum PixelLayout {
Rgb,
Rgba,
Rgbx,
Bgr,
Bgra,
Bgrx,
}Expand description
The order of the channels of packed rows, as libwebp’s six importers read
them (C: WebPPictureImportRGB and its siblings).
§Examples
use webp::api::encode::PixelLayout;
assert_eq!(PixelLayout::Bgr.bytes_per_pixel(), 3);
assert_eq!(PixelLayout::Rgbx.bytes_per_pixel(), 4);Variants§
Rgb
Red, green, blue (C: WebPPictureImportRGB).
Rgba
Red, green, blue, straight alpha (C: WebPPictureImportRGBA).
Rgbx
Red, green, blue and an ignored byte (C: WebPPictureImportRGBX).
Bgr
Blue, green, red (C: WebPPictureImportBGR).
Bgra
Blue, green, red, straight alpha (C: WebPPictureImportBGRA).
Bgrx
Blue, green, red and an ignored byte (C: WebPPictureImportBGRX).
Implementations§
Source§impl PixelLayout
impl PixelLayout
Sourcepub const fn bytes_per_pixel(self) -> usize
pub const fn bytes_per_pixel(self) -> usize
The bytes of one pixel: 3 or 4.
§Examples
use webp::api::encode::PixelLayout;
assert_eq!(PixelLayout::Rgba.bytes_per_pixel(), 4);Trait Implementations§
Source§impl Clone for PixelLayout
impl Clone for PixelLayout
impl Copy for PixelLayout
Source§impl Debug for PixelLayout
impl Debug for PixelLayout
impl Eq for PixelLayout
Source§impl Hash for PixelLayout
impl Hash for PixelLayout
Source§impl PartialEq for PixelLayout
impl PartialEq for PixelLayout
impl StructuralPartialEq for PixelLayout
Auto Trait Implementations§
impl Forget for PixelLayout
impl Freeze for PixelLayout
impl Move for PixelLayout
impl RefUnwindSafe for PixelLayout
impl Send for PixelLayout
impl Sync for PixelLayout
impl Unpin for PixelLayout
impl UnsafeUnpin for PixelLayout
impl UnwindSafe for PixelLayout
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