pub struct Pixel<C: Color>(_, _);
Expand description
Normalized image data
Implementations§
source§impl<C: Color> Pixel<C>
impl<C: Color> Pixel<C>
sourcepub fn with_color<D: Color>(self) -> Pixel<D>
pub fn with_color<D: Color>(self) -> Pixel<D>
Update the colorspace associated with a pixel without performing any conversion
sourcepub fn is_alpha(&self, index: Channel) -> bool
pub fn is_alpha(&self, index: Channel) -> bool
Returns true when the provided channel index matches the alpha channel index
sourcepub fn with_alpha(&mut self, value: f64) -> &mut Self
pub fn with_alpha(&mut self, value: f64) -> &mut Self
Set alpha value
sourcepub fn convert_to<D: Color>(&self, dest: &mut Pixel<D>)
pub fn convert_to<D: Color>(&self, dest: &mut Pixel<D>)
Convert pixel color type to an existing pixel
sourcepub fn copy_from_slice<T: Type>(&mut self, data: impl AsRef<[T]>) -> &mut Self
pub fn copy_from_slice<T: Type>(&mut self, data: impl AsRef<[T]>) -> &mut Self
Copy values from an existing slice
sourcepub fn copy_from_data<T: Type>(&mut self, data: &Data<'_, T, C>) -> &mut Self
pub fn copy_from_data<T: Type>(&mut self, data: &Data<'_, T, C>) -> &mut Self
Copy values from an existing slice
sourcepub fn convert_from_data<T: Type, D: Color>(&mut self, data: &Data<'_, T, D>)
pub fn convert_from_data<T: Type, D: Color>(&mut self, data: &Data<'_, T, D>)
Convert color and copy to slice
sourcepub fn convert_to_data<T: Type, D: Color>(&self, data: &mut DataMut<'_, T, D>)
pub fn convert_to_data<T: Type, D: Color>(&self, data: &mut DataMut<'_, T, D>)
Convert color and copy to slice
sourcepub fn copy_to_slice<T: Type>(&self, data: impl AsMut<[T]>)
pub fn copy_to_slice<T: Type>(&self, data: impl AsMut<[T]>)
Copy values to an existing slice
sourcepub fn blend_alpha(&mut self) -> &mut Self
pub fn blend_alpha(&mut self) -> &mut Self
Blend alpha value
sourcepub fn map(&mut self, f: impl Fn(f64) -> f64) -> &mut Self
pub fn map(&mut self, f: impl Fn(f64) -> f64) -> &mut Self
Create a new pixel by applying f
over an existing pixel
sourcepub fn map2(&mut self, other: &Pixel<C>, f: impl Fn(f64, f64) -> f64) -> &mut Self
pub fn map2(&mut self, other: &Pixel<C>, f: impl Fn(f64, f64) -> f64) -> &mut Self
Zip two pixels, apply f
and return a new pixel with the results
sourcepub fn iter(&self) -> impl Iterator<Item = &f64>
pub fn iter(&self) -> impl Iterator<Item = &f64>
Get iterator over pixel data, ignoring alpha channel
Trait Implementations§
source§impl<'a, C: Color> AddAssign<&'a Pixel<C>> for Pixel<C>
impl<'a, C: Color> AddAssign<&'a Pixel<C>> for Pixel<C>
source§fn add_assign(&mut self, other: &'a Pixel<C>)
fn add_assign(&mut self, other: &'a Pixel<C>)
Performs the
+=
operation. Read moresource§impl<C: Color> AddAssign<Pixel<C>> for Pixel<C>
impl<C: Color> AddAssign<Pixel<C>> for Pixel<C>
source§fn add_assign(&mut self, other: Pixel<C>)
fn add_assign(&mut self, other: Pixel<C>)
Performs the
+=
operation. Read moresource§impl<T: Type, C: Color> AddAssign<T> for Pixel<C>
impl<T: Type, C: Color> AddAssign<T> for Pixel<C>
source§fn add_assign(&mut self, other: T)
fn add_assign(&mut self, other: T)
Performs the
+=
operation. Read moresource§impl<'de, C: Color> Deserialize<'de> for Pixel<C>
impl<'de, C: Color> Deserialize<'de> for Pixel<C>
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<'a, C: Color> DivAssign<&'a Pixel<C>> for Pixel<C>
impl<'a, C: Color> DivAssign<&'a Pixel<C>> for Pixel<C>
source§fn div_assign(&mut self, other: &'a Pixel<C>)
fn div_assign(&mut self, other: &'a Pixel<C>)
Performs the
/=
operation. Read moresource§impl<C: Color> DivAssign<Pixel<C>> for Pixel<C>
impl<C: Color> DivAssign<Pixel<C>> for Pixel<C>
source§fn div_assign(&mut self, other: Pixel<C>)
fn div_assign(&mut self, other: Pixel<C>)
Performs the
/=
operation. Read moresource§impl<T: Type, C: Color> DivAssign<T> for Pixel<C>
impl<T: Type, C: Color> DivAssign<T> for Pixel<C>
source§fn div_assign(&mut self, other: T)
fn div_assign(&mut self, other: T)
Performs the
/=
operation. Read moresource§impl<T: Type, C: Color> FromIterator<T> for Pixel<C>
impl<T: Type, C: Color> FromIterator<T> for Pixel<C>
source§fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
Creates a value from an iterator. Read more
source§impl<C: Color> IntoIterator for Pixel<C>
impl<C: Color> IntoIterator for Pixel<C>
source§impl<'a, C: Color> MulAssign<&'a Pixel<C>> for Pixel<C>
impl<'a, C: Color> MulAssign<&'a Pixel<C>> for Pixel<C>
source§fn mul_assign(&mut self, other: &'a Pixel<C>)
fn mul_assign(&mut self, other: &'a Pixel<C>)
Performs the
*=
operation. Read moresource§impl<C: Color> MulAssign<Pixel<C>> for Pixel<C>
impl<C: Color> MulAssign<Pixel<C>> for Pixel<C>
source§fn mul_assign(&mut self, other: Pixel<C>)
fn mul_assign(&mut self, other: Pixel<C>)
Performs the
*=
operation. Read moresource§impl<T: Type, C: Color> MulAssign<T> for Pixel<C>
impl<T: Type, C: Color> MulAssign<T> for Pixel<C>
source§fn mul_assign(&mut self, other: T)
fn mul_assign(&mut self, other: T)
Performs the
*=
operation. Read moresource§impl<C: PartialEq + Color> PartialEq<Pixel<C>> for Pixel<C>
impl<C: PartialEq + Color> PartialEq<Pixel<C>> for Pixel<C>
source§impl<C: PartialOrd + Color> PartialOrd<Pixel<C>> for Pixel<C>
impl<C: PartialOrd + Color> PartialOrd<Pixel<C>> for Pixel<C>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl<'a, C: Color> RemAssign<&'a Pixel<C>> for Pixel<C>
impl<'a, C: Color> RemAssign<&'a Pixel<C>> for Pixel<C>
source§fn rem_assign(&mut self, other: &'a Pixel<C>)
fn rem_assign(&mut self, other: &'a Pixel<C>)
Performs the
%=
operation. Read moresource§impl<C: Color> RemAssign<Pixel<C>> for Pixel<C>
impl<C: Color> RemAssign<Pixel<C>> for Pixel<C>
source§fn rem_assign(&mut self, other: Pixel<C>)
fn rem_assign(&mut self, other: Pixel<C>)
Performs the
%=
operation. Read moresource§impl<T: Type, C: Color> RemAssign<T> for Pixel<C>
impl<T: Type, C: Color> RemAssign<T> for Pixel<C>
source§fn rem_assign(&mut self, other: T)
fn rem_assign(&mut self, other: T)
Performs the
%=
operation. Read moresource§impl<'a, C: Color> SubAssign<&'a Pixel<C>> for Pixel<C>
impl<'a, C: Color> SubAssign<&'a Pixel<C>> for Pixel<C>
source§fn sub_assign(&mut self, other: &'a Pixel<C>)
fn sub_assign(&mut self, other: &'a Pixel<C>)
Performs the
-=
operation. Read moresource§impl<C: Color> SubAssign<Pixel<C>> for Pixel<C>
impl<C: Color> SubAssign<Pixel<C>> for Pixel<C>
source§fn sub_assign(&mut self, other: Pixel<C>)
fn sub_assign(&mut self, other: Pixel<C>)
Performs the
-=
operation. Read moresource§impl<T: Type, C: Color> SubAssign<T> for Pixel<C>
impl<T: Type, C: Color> SubAssign<T> for Pixel<C>
source§fn sub_assign(&mut self, other: T)
fn sub_assign(&mut self, other: T)
Performs the
-=
operation. Read more