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) -> Channels

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: &Channels) -> Ordering

impl PartialEq for Channels

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

impl PartialOrd for Channels

fn partial_cmp(&self, other: &Channels) -> 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,

fn type_id(&self) -> TypeId

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

fn borrow(&self) -> &T

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

fn borrow_mut(&mut self) -> &mut T

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

unsafe fn clone_to_uninit(&self, dest: *mut u8)

impl<T> From<T> for Channels

fn from(t: T) -> T

Returns the argument unchanged.

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

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

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

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

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

type Error = never;
fn try_from(value: U) -> Result<T, never>

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

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>