Enum ColorType

enum ColorType

An enumeration over supported color types and bit depths

Variants

L8

Pixel is 8-bit luminance

La8

Pixel is 8-bit luminance with an alpha channel

Rgb8

Pixel contains 8-bit R, G and B channels

Rgba8

Pixel is 8-bit RGB with an alpha channel

L16

Pixel is 16-bit luminance

La16

Pixel is 16-bit luminance with an alpha channel

Rgb16

Pixel is 16-bit RGB

Rgba16

Pixel is 16-bit RGBA

Rgb32F

Pixel is 32-bit float RGB

Rgba32F

Pixel is 32-bit float RGBA

Implementations

impl ColorType

fn bytes_per_pixel(self: Self) -> u8

Returns the number of bytes contained in a pixel of ColorType c

fn has_alpha(self: Self) -> bool

Returns if there is an alpha channel.

fn has_color(self: Self) -> bool

Returns false if the color scheme is grayscale, true otherwise.

fn bits_per_pixel(self: Self) -> u16

Returns the number of bits contained in a pixel of ColorType c (which will always be a multiple of 8).

fn channel_count(self: Self) -> u8

Returns the number of color channels that make up this pixel

impl Clone for ColorType

fn clone(self: &Self) -> ColorType

impl Copy for ColorType

impl Debug for ColorType

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

impl Eq for ColorType

impl Freeze for ColorType

impl Hash for ColorType

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

impl PartialEq for ColorType

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

impl RefUnwindSafe for ColorType

impl Send for ColorType

impl StructuralPartialEq for ColorType

impl Sync for ColorType

impl Unpin for ColorType

impl UnsafeUnpin for ColorType

impl UnwindSafe for ColorType

impl<T> Any for ColorType

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for ColorType

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for ColorType

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

impl<T> CloneToUninit for ColorType

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

impl<T> From for ColorType

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Pointable for ColorType

unsafe fn init(init: <T as Pointable>::Init) -> usize
unsafe fn deref<'a>(ptr: usize) -> &'a T
unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
unsafe fn drop(ptr: usize)

impl<T> ToOwned for ColorType

fn to_owned(self: &Self) -> T
fn clone_into(self: &Self, target: &mut T)

impl<T, U> Into for ColorType

fn into(self: 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 for ColorType

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for ColorType

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