Enum ColorSpace

#[repr(u8)]
pub enum ColorSpace

Image color space.

Note: the color space is purely informative. Although it is saved to the file header, it does not affect encoding/decoding in any way.

Variants

Srgb = 0

sRGB with linear alpha

Linear = 1

All channels are linear

Implementations

impl ColorSpace

const fn is_srgb(self) -> bool

Returns true if the color space is sRGB with linear alpha.

const fn is_linear(self) -> bool

Returns true is all channels are linear.

const fn as_u8(self) -> u8

Converts to an integer (0 if sRGB, 1 if all linear).

Trait Implementations

impl Clone for ColorSpace

fn clone(&self) -> ColorSpace

impl Copy for ColorSpace

impl Debug for ColorSpace

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

impl Default for ColorSpace

fn default() -> Self

impl Eq for ColorSpace

impl Hash for ColorSpace

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

impl Ord for ColorSpace

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

impl PartialEq for ColorSpace

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

impl PartialOrd for ColorSpace

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

impl StructuralPartialEq for ColorSpace

impl TryFrom<u8> for ColorSpace

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

Auto Trait Implementations

impl Freeze for ColorSpace

impl RefUnwindSafe for ColorSpace

impl Send for ColorSpace

impl Sync for ColorSpace

impl Unpin for ColorSpace

impl UnsafeUnpin for ColorSpace

impl UnwindSafe for ColorSpace

Blanket Implementations

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

fn type_id(&self) -> TypeId

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

fn borrow(&self) -> &T

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

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

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

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

impl<T> From<T> for ColorSpace

fn from(t: T) -> T

Returns the argument unchanged.

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

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

impl<T, U> Into<U> for ColorSpace 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 ColorSpace where U: Into<T>,

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

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

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