Enum Channels

#[repr(u8)]
pub enum Channels

Number of 8-bit channels in a pixel.

Variants

Rgb = 3

Three 8-bit channels (RGB)

Rgba = 4

Four 8-bit channels (RGBA)

Implementations

impl Channels

const fn is_rgb(self) -> bool

Returns true if there are 3 channels (RGB).

const fn is_rgba(self) -> bool

Returns true if there are 4 channels (RGBA).

const fn as_u8(self) -> u8

Converts to an integer (3 if RGB, 4 if RGBA).

Trait Implementations

impl Clone for Channels

fn clone(&self) -> Self

impl Copy for Channels

impl Debug for Channels

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl Default for Channels

fn default() -> Self

impl Eq for Channels

impl Hash for Channels

fn hash<__H: Hasher>(&self, state: &mut __H)

impl Ord for Channels

fn cmp(&self, other: &Self) -> Ordering

impl PartialEq for Channels

fn eq(&self, other: &Self) -> bool

impl PartialOrd for Channels

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

impl StructuralPartialEq for Channels

impl TryFrom<u8> for Channels

type Error = Error;
fn try_from(channels: u8) -> Result<Self>

Auto Trait Implementations

impl Freeze for Channels

impl RefUnwindSafe for Channels

impl Send for Channels

impl Sync for Channels

impl Unpin for Channels

impl UnsafeUnpin for Channels

impl UnwindSafe for Channels

Blanket Implementations

impl<T> Any for Channels where T: 'static + ?Sized,

impl<T> Borrow<T> for Channels where T: ?Sized,

impl<T> BorrowMut<T> for Channels where T: ?Sized,

impl<T> CloneToUninit for Channels where T: Clone,

impl<T> From<T> for Channels

impl<T> ToOwned for Channels where T: Clone,

impl<T, U> Into<U> for Channels where U: From<T>,

impl<T, U> TryFrom<U> for Channels where U: Into<T>,

impl<T, U> TryInto<U> for Channels where U: TryFrom<T>,