pub struct Pixel<C: Color>(_, _);
Expand description
Normalized image data
Implementations
sourceimpl<C: Color> Pixel<C>
impl<C: Color> Pixel<C>
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
sourceimpl<'a, C: Color> AddAssign<&'a Pixel<C>> for Pixel<C>
impl<'a, C: Color> AddAssign<&'a Pixel<C>> for Pixel<C>
sourcefn add_assign(&mut self, other: &'a Pixel<C>)
fn add_assign(&mut self, other: &'a Pixel<C>)
Performs the +=
operation. Read more
sourceimpl<C: Color> AddAssign<Pixel<C>> for Pixel<C>
impl<C: Color> AddAssign<Pixel<C>> for Pixel<C>
sourcefn add_assign(&mut self, other: Pixel<C>)
fn add_assign(&mut self, other: Pixel<C>)
Performs the +=
operation. Read more
sourceimpl<T: Type, C: Color> AddAssign<T> for Pixel<C>
impl<T: Type, C: Color> AddAssign<T> for Pixel<C>
sourcefn add_assign(&mut self, other: T)
fn add_assign(&mut self, other: T)
Performs the +=
operation. Read more
sourceimpl<'de, C: Color> Deserialize<'de> for Pixel<C>
impl<'de, C: Color> Deserialize<'de> for Pixel<C>
sourcefn 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
sourceimpl<'a, C: Color> DivAssign<&'a Pixel<C>> for Pixel<C>
impl<'a, C: Color> DivAssign<&'a Pixel<C>> for Pixel<C>
sourcefn div_assign(&mut self, other: &'a Pixel<C>)
fn div_assign(&mut self, other: &'a Pixel<C>)
Performs the /=
operation. Read more
sourceimpl<C: Color> DivAssign<Pixel<C>> for Pixel<C>
impl<C: Color> DivAssign<Pixel<C>> for Pixel<C>
sourcefn div_assign(&mut self, other: Pixel<C>)
fn div_assign(&mut self, other: Pixel<C>)
Performs the /=
operation. Read more
sourceimpl<T: Type, C: Color> DivAssign<T> for Pixel<C>
impl<T: Type, C: Color> DivAssign<T> for Pixel<C>
sourcefn div_assign(&mut self, other: T)
fn div_assign(&mut self, other: T)
Performs the /=
operation. Read more
sourceimpl<T: Type, C: Color> FromIterator<T> for Pixel<C>
impl<T: Type, C: Color> FromIterator<T> for Pixel<C>
sourcefn 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
sourceimpl<C: Color> IntoIterator for Pixel<C>
impl<C: Color> IntoIterator for Pixel<C>
sourceimpl<'a, C: Color> MulAssign<&'a Pixel<C>> for Pixel<C>
impl<'a, C: Color> MulAssign<&'a Pixel<C>> for Pixel<C>
sourcefn mul_assign(&mut self, other: &'a Pixel<C>)
fn mul_assign(&mut self, other: &'a Pixel<C>)
Performs the *=
operation. Read more
sourceimpl<C: Color> MulAssign<Pixel<C>> for Pixel<C>
impl<C: Color> MulAssign<Pixel<C>> for Pixel<C>
sourcefn mul_assign(&mut self, other: Pixel<C>)
fn mul_assign(&mut self, other: Pixel<C>)
Performs the *=
operation. Read more
sourceimpl<T: Type, C: Color> MulAssign<T> for Pixel<C>
impl<T: Type, C: Color> MulAssign<T> for Pixel<C>
sourcefn mul_assign(&mut self, other: T)
fn mul_assign(&mut self, other: T)
Performs the *=
operation. Read more
sourceimpl<C: PartialOrd + Color> PartialOrd<Pixel<C>> for Pixel<C>
impl<C: PartialOrd + Color> PartialOrd<Pixel<C>> for Pixel<C>
sourcefn partial_cmp(&self, other: &Pixel<C>) -> Option<Ordering>
fn partial_cmp(&self, other: &Pixel<C>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl<'a, C: Color> RemAssign<&'a Pixel<C>> for Pixel<C>
impl<'a, C: Color> RemAssign<&'a Pixel<C>> for Pixel<C>
sourcefn rem_assign(&mut self, other: &'a Pixel<C>)
fn rem_assign(&mut self, other: &'a Pixel<C>)
Performs the %=
operation. Read more
sourceimpl<C: Color> RemAssign<Pixel<C>> for Pixel<C>
impl<C: Color> RemAssign<Pixel<C>> for Pixel<C>
sourcefn rem_assign(&mut self, other: Pixel<C>)
fn rem_assign(&mut self, other: Pixel<C>)
Performs the %=
operation. Read more
sourceimpl<T: Type, C: Color> RemAssign<T> for Pixel<C>
impl<T: Type, C: Color> RemAssign<T> for Pixel<C>
sourcefn rem_assign(&mut self, other: T)
fn rem_assign(&mut self, other: T)
Performs the %=
operation. Read more
sourceimpl<'a, C: Color> SubAssign<&'a Pixel<C>> for Pixel<C>
impl<'a, C: Color> SubAssign<&'a Pixel<C>> for Pixel<C>
sourcefn sub_assign(&mut self, other: &'a Pixel<C>)
fn sub_assign(&mut self, other: &'a Pixel<C>)
Performs the -=
operation. Read more
sourceimpl<C: Color> SubAssign<Pixel<C>> for Pixel<C>
impl<C: Color> SubAssign<Pixel<C>> for Pixel<C>
sourcefn sub_assign(&mut self, other: Pixel<C>)
fn sub_assign(&mut self, other: Pixel<C>)
Performs the -=
operation. Read more
sourceimpl<T: Type, C: Color> SubAssign<T> for Pixel<C>
impl<T: Type, C: Color> SubAssign<T> for Pixel<C>
sourcefn sub_assign(&mut self, other: T)
fn sub_assign(&mut self, other: T)
Performs the -=
operation. Read more
impl<C: Color> StructuralPartialEq for Pixel<C>
Auto Trait Implementations
impl<C> RefUnwindSafe for Pixel<C> where
C: RefUnwindSafe,
impl<C> Send for Pixel<C>
impl<C> Sync for Pixel<C>
impl<C> Unpin for Pixel<C>
impl<C> UnwindSafe for Pixel<C> where
C: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more