Struct Luma

#[repr(transparent)]
pub struct Luma<T>(pub [T; 1]);

Grayscale colors.

Fields

0: [T; 1]

Trait Implementations

impl PixelWithColorType for Luma<u16>

const COLOR_TYPE: ExtendedColorType = ExtendedColorType::L16;

impl PixelWithColorType for Luma<u8>

const COLOR_TYPE: ExtendedColorType = ExtendedColorType::L8;

impl<T> From<[T; 1]> for Luma<T>

fn from(c: [T; 1]) -> Self

impl<T> Index<usize> for Luma<T>

type Output = T;
fn index(&self, _index: usize) -> &T

impl<T> IndexMut<usize> for Luma<T>

fn index_mut(&mut self, _index: usize) -> &mut T

impl<T: Clone> Clone for Luma<T>

fn clone(&self) -> Self

impl<T: Copy> Copy for Luma<T>

impl<T: Debug> Debug for Luma<T>

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

impl<T: Eq> Eq for Luma<T>

impl<T: Hash> Hash for Luma<T>

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

impl<T: PartialEq> PartialEq for Luma<T>

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

impl<T: PartialEq> StructuralPartialEq for Luma<T>

impl<T: Primitive> Pixel for Luma<T>

type Subpixel = T;
const CHANNEL_COUNT: u8 = 1;
fn channels(&self) -> &[T]
fn channels_mut(&mut self) -> &mut [T]
const COLOR_MODEL: &'static str = "Y";
const HAS_ALPHA: bool = _;
fn alpha(&self) -> Self::Subpixel
fn channels4(&self) -> (T, T, T, T)
fn from_channels(a: T, b: T, c: T, d: T) -> Luma<T>
fn from_slice(slice: &[T]) -> &Luma<T>
fn from_slice_mut(slice: &mut [T]) -> &mut Luma<T>
fn to_rgb(&self) -> Rgb<T>
fn to_rgba(&self) -> Rgba<T>
fn to_luma(&self) -> Luma<T>
fn to_luma_alpha(&self) -> LumaA<T>
fn map<F>(&self, f: F) -> Luma<T>
where
    F: FnMut(T) -> T,
fn apply<F>(&mut self, f: F)
where
    F: FnMut(T) -> T,
fn map_with_alpha<F, G>(&self, f: F, g: G) -> Luma<T>
where
    F: FnMut(T) -> T,
    G: FnMut(T) -> T,
fn apply_with_alpha<F, G>(&mut self, f: F, g: G)
where
    F: FnMut(T) -> T,
    G: FnMut(T) -> T,
fn map2<F>(&self, other: &Self, f: F) -> Luma<T>
where
    F: FnMut(T, T) -> T,
fn apply2<F>(&mut self, other: &Luma<T>, f: F)
where
    F: FnMut(T, T) -> T,
fn invert(&mut self)
fn blend(&mut self, other: &Luma<T>)

Auto Trait Implementations

impl<T> Freeze for Luma<T> where [T; 1]: Freeze,

impl<T> RefUnwindSafe for Luma<T> where [T; 1]: RefUnwindSafe,

impl<T> Send for Luma<T> where [T; 1]: Send,

impl<T> Sync for Luma<T> where [T; 1]: Sync,

impl<T> Unpin for Luma<T> where [T; 1]: Unpin,

impl<T> UnsafeUnpin for Luma<T> where [T; 1]: UnsafeUnpin,

impl<T> UnwindSafe for Luma<T> where [T; 1]: UnwindSafe,

Blanket Implementations

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for Luma<T> where ST: ?Sized, DT: ?Sized,

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for Luma<T> where ST: ?Sized, DT: ?Sized,

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

fn type_id(&self) -> TypeId

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

fn borrow(&self) -> &T

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

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

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

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

impl<T> From<T> for Luma<T>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> IntoEither for Luma<T>

impl<T> Pointable for Luma<T>

const ALIGN: usize = _;
type Init = T;
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> Read<Exclusive, BecauseExclusive> for Luma<T> where T: ?Sized,

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

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

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

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

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

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