Struct image_buffer::color::Alpha2
[−]
[src]
pub struct Alpha2<C: Color>(_);
Color with an associated alpha value.
Methods
impl<C: Color> Alpha2<C>
[src]
Trait Implementations
impl<C: Copy + Color> Copy for Alpha2<C> where
C::Subpixel: Copy,
[src]
C::Subpixel: Copy,
impl<C: Clone + Color> Clone for Alpha2<C> where
C::Subpixel: Clone,
[src]
C::Subpixel: Clone,
fn clone(&self) -> Alpha2<C>
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<C: Color> AsRef<<Alpha2<C> as Color>::Storage> for Alpha2<C>
[src]
impl<C: Color> AsMut<<Alpha2<C> as Color>::Storage> for Alpha2<C>
[src]
impl<C: Color> Color for Alpha2<C>
[src]
type Subpixel = C::Subpixel
The underlying subpixel type.
type Storage = [C::Subpixel; 2]
fn channel_count() -> usize
Returns the number of channels of this pixel type.
fn channels(&self) -> &[Self::Subpixel; 2]
Returns the components as a slice.
fn channels_mut(&mut self) -> &mut [Self::Subpixel; 2]
Returns the components as a mutable slice
fn from_channels(other: [Self::Subpixel; 2]) -> Self
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 [Self::Subpixel]) -> &'a Self
Returns a view into a slice. Read more
fn from_slice_mut<'a>(slice: &'a mut [Self::Subpixel]) -> &'a mut Self
Returns mutable view into a mutable slice. Read more
fn apply_with_alpha<F, G>(&mut self, f: F, g: G) where
F: Fn(Self::Subpixel) -> Self::Subpixel,
G: Fn(Self::Subpixel) -> Self::Subpixel,
F: Fn(Self::Subpixel) -> Self::Subpixel,
G: Fn(Self::Subpixel) -> Self::Subpixel,
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 color_model() -> &'static str
Returns a string that can help to interprete the meaning each channel See gimp babl. Read more
fn map<F>(&self, f: F) -> Self where
F: Fn(Self::Subpixel) -> Self::Subpixel,
F: Fn(Self::Subpixel) -> Self::Subpixel,
Apply the function f
to each channel of this pixel.
fn apply<F>(&mut self, f: F) where
F: Fn(Self::Subpixel) -> Self::Subpixel,
F: Fn(Self::Subpixel) -> Self::Subpixel,
Apply the function f
to each channel of this pixel.
fn map_with_alpha<F, G>(&self, f: F, g: G) -> Self where
F: Fn(Self::Subpixel) -> Self::Subpixel,
G: Fn(Self::Subpixel) -> Self::Subpixel,
F: Fn(Self::Subpixel) -> Self::Subpixel,
G: Fn(Self::Subpixel) -> Self::Subpixel,
Apply the function f
to each channel except the alpha channel. Apply the function g
to the alpha channel. Read more
fn map2<F>(&self, other: &Self, f: F) -> Self where
F: Fn(Self::Subpixel, Self::Subpixel) -> Self::Subpixel,
F: Fn(Self::Subpixel, Self::Subpixel) -> Self::Subpixel,
Apply the function f
to each channel of this pixel and other
pairwise. Read more
fn apply2<F>(&mut self, other: &Self, f: F) where
F: Fn(Self::Subpixel, Self::Subpixel) -> Self::Subpixel,
F: Fn(Self::Subpixel, Self::Subpixel) -> Self::Subpixel,
Apply the function f
to each channel of this pixel and other
pairwise. Works in-place. Read more
impl<C: Color> Index<usize> for Alpha2<C>
[src]
type Output = C::Subpixel
The returned type after indexing
fn index<'a>(&'a self, _index: usize) -> &'a C::Subpixel
The method for the indexing (container[index]
) operation
impl<C: Color> IndexMut<usize> for Alpha2<C>
[src]
fn index_mut<'a>(&'a mut self, _index: usize) -> &'a mut C::Subpixel
The method for the mutable indexing (container[index]
) operation
impl<C: Color, T: ColorMathOps<Alpha2<C>>> Add<T> for Alpha2<C>
[src]
type Output = Self
The resulting type after applying the +
operator
fn add(self, rhs: T) -> Self::Output
The method for the +
operator
impl<C: Color> AddAssign for Alpha2<C>
[src]
fn add_assign(&mut self, rhs: Self)
The method for the +=
operator
impl<C: Color> Sub for Alpha2<C>
[src]
type Output = Self
The resulting type after applying the -
operator
fn sub(self, rhs: Self) -> Self::Output
The method for the -
operator
impl<C: Color> SubAssign for Alpha2<C>
[src]
fn sub_assign(&mut self, rhs: Self)
The method for the -=
operator
impl<C: Color> Div for Alpha2<C>
[src]
type Output = Self
The resulting type after applying the /
operator
fn div(self, rhs: Self) -> Self::Output
The method for the /
operator
impl<C: Color> DivAssign for Alpha2<C>
[src]
fn div_assign(&mut self, rhs: Self)
The method for the /=
operator
impl<C: Color> Mul for Alpha2<C>
[src]
type Output = Self
The resulting type after applying the *
operator
fn mul(self, rhs: Self) -> Self::Output
The method for the *
operator
impl<C: Color> MulAssign for Alpha2<C>
[src]
fn mul_assign(&mut self, rhs: Self)
The method for the *=
operator
impl<C: Color> From<C> for Alpha2<C> where
C::Subpixel: ChannelMax,
[src]
C::Subpixel: ChannelMax,
fn from(other: C) -> Self
Performs the conversion.