Struct image::Luma [] [src]

pub struct Luma<T: Primitive> {
    pub data: [T; 1],
}

Grayscale colors

Fields

data: [T; 1]

Trait Implementations

impl<T: Hash + Primitive> Hash for Luma<T>
[src]

fn hash<__HT: Hasher>(&self, __arg_0: &mut __HT)

Feeds this value into the state given, updating the hasher as necessary.

fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher
1.3.0

Feeds a slice of this type into the state provided.

impl<T: Copy + Primitive> Copy for Luma<T>
[src]

impl<T: Debug + Primitive> Debug for Luma<T>
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl<T: Clone + Primitive> Clone for Luma<T>
[src]

fn clone(&self) -> Luma<T>

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl<T: Eq + Primitive> Eq for Luma<T>
[src]

impl<T: PartialEq + Primitive> PartialEq for Luma<T>
[src]

fn eq(&self, __arg_0: &Luma<T>) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, __arg_0: &Luma<T>) -> bool

This method tests for !=.

impl<T: Primitive + 'static> Pixel for Luma<T>
[src]

type Subpixel = T

The underlying subpixel type.

fn channel_count() -> u8

Returns the number of channels of this pixel type.

fn color_model() -> &'static str

Returns a string that can help to interprete the meaning each channel See gimp babl. Read more

fn color_type() -> ColorType

Returns the ColorType for this pixel format

fn channels(&self) -> &[T]

Returns the components as a slice.

fn channels_mut(&mut self) -> &mut [T]

Returns the components as a mutable slice

fn channels4(&self) -> (T, T, T, T)

Returns the channels of this pixel as a 4 tuple. If the pixel has less than 4 channels the remainder is filled with the maximum value Read more

fn from_channels(a: T, b: T, c: T, d: T) -> Luma<T>

Construct a pixel from the 4 channels a, b, c and d. If the pixel does not contain 4 channels the extra are ignored. Read more

fn from_slice<'a>(slice: &'a [T]) -> &'a Luma<T>

Returns a view into a slice. Read more

fn from_slice_mut<'a>(slice: &'a mut [T]) -> &'a mut Luma<T>

Returns mutable view into a mutable slice. Read more

fn to_rgb(&self) -> Rgb<T>

Convert this pixel to RGB

fn to_rgba(&self) -> Rgba<T>

Convert this pixel to RGB with an alpha channel

fn to_luma(&self) -> Luma<T>

Convert this pixel to luma

fn to_luma_alpha(&self) -> LumaA<T>

Convert this pixel to luma with an alpha channel

fn map<F>(&self, f: F) -> Luma<T> where F: Fn(T) -> T

Apply the function f to each channel of this pixel.

fn apply<F>(&mut self, f: F) where F: Fn(T) -> T

Apply the function f to each channel of this pixel.

fn map_with_alpha<F, G>(&self, f: F, g: G) -> Luma<T> where F: Fn(T) -> T, G: Fn(T) -> T

Apply the function f to each channel except the alpha channel. Apply the function g to the alpha channel. Read more

fn apply_with_alpha<F, G>(&mut self, f: F, g: G) where F: Fn(T) -> T, G: Fn(T) -> T

Apply the function f to each channel except the alpha channel. Apply the function g to the alpha channel. Works in-place. Read more

fn map2<F>(&self, other: &Self, f: F) -> Luma<T> where F: Fn(T, T) -> T

Apply the function f to each channel of this pixel and other pairwise. Read more

fn apply2<F>(&mut self, other: &Luma<T>, f: F) where F: Fn(T, T) -> T

Apply the function f to each channel of this pixel and other pairwise. Works in-place. Read more

fn invert(&mut self)

Invert this pixel

fn blend(&mut self, other: &Luma<T>)

Blend the color of a given pixel into ourself, taking into account alpha channels

impl<T: Primitive> Index<usize> for Luma<T>
[src]

type Output = T

The returned type after indexing

fn index<'a>(&'a self, _index: usize) -> &'a T

The method for the indexing (Foo[Bar]) operation

impl<T: Primitive> IndexMut<usize> for Luma<T>
[src]

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

The method for the indexing (Foo[Bar]) operation