pub enum PixelFormat {
Gray8,
GrayA8,
Rgb8,
Rgba8,
Gray16,
GrayA16,
Rgb16,
Rgba16,
RgbF32,
RgbaF32,
}Expand description
Pixel format for input images.
Variants§
Gray8
Grayscale, 8-bit.
GrayA8
Grayscale with alpha, 8-bit.
Rgb8
RGB, 8-bit per channel.
Rgba8
RGBA, 8-bit per channel.
Gray16
Grayscale, 16-bit.
GrayA16
Grayscale with alpha, 16-bit.
Rgb16
RGB, 16-bit per channel.
Rgba16
RGBA, 16-bit per channel.
RgbF32
RGB, 32-bit float per channel.
RgbaF32
RGBA, 32-bit float per channel.
Implementations§
Source§impl PixelFormat
impl PixelFormat
Sourcepub fn num_channels(self) -> usize
pub fn num_channels(self) -> usize
Returns the number of channels.
Sourcepub fn bytes_per_sample(self) -> usize
pub fn bytes_per_sample(self) -> usize
Returns the bytes per sample.
Sourcepub fn bytes_per_pixel(self) -> usize
pub fn bytes_per_pixel(self) -> usize
Returns the total bytes per pixel.
Sourcepub fn is_grayscale(self) -> bool
pub fn is_grayscale(self) -> bool
Returns true if this is a grayscale format.
Trait Implementations§
Source§impl Clone for PixelFormat
impl Clone for PixelFormat
Source§fn clone(&self) -> PixelFormat
fn clone(&self) -> PixelFormat
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PixelFormat
impl Debug for PixelFormat
Source§impl PartialEq for PixelFormat
impl PartialEq for PixelFormat
impl Copy for PixelFormat
impl Eq for PixelFormat
impl StructuralPartialEq for PixelFormat
Auto Trait Implementations§
impl Freeze for PixelFormat
impl RefUnwindSafe for PixelFormat
impl Send for PixelFormat
impl Sync for PixelFormat
impl Unpin for PixelFormat
impl UnsafeUnpin for PixelFormat
impl UnwindSafe for PixelFormat
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more