Struct plasma::PixelRgb

source ·
pub struct PixelRgb {
    pub r: f32,
    pub g: f32,
    pub b: f32,
}
Expand description

A struct representing one or more pixels in the linear RGB color space.

If a “use-simd” feature is enabled this class is being implemented for SIMD f32x8 instead of f32. In that case the single instance holds a value of 8 pixels at once instead of a one.

Fields§

§r: f32§g: f32§b: f32

Implementations§

source§

impl PixelRgb

source

pub fn new(r: f32, g: f32, b: f32) -> PixelRgb

Creates an instance of PixelRgb from RGB color components.

source§

impl PixelRgb

source

pub fn iter_rgb_values(self) -> RgbIter

Creates a RgbIter from this instance of PixelRgb.

source

pub fn iter_rgba_values(self, alpha: f32) -> RgbaIter

Creates a RgbaIter from this instance of PixelRgb.

source

pub fn from_hsv(hue: f32, sat: f32, val: f32) -> PixelRgb

Creates an instance of a PixelRgb from HSV color components.

hue should be in the range: [0, 2) and will be normalized. sat and val should be in the range: [0, 1] and won’t be normalized.

Trait Implementations§

source§

impl Add for PixelRgb

source§

type Output = PixelRgb

The resulting type after applying the + operator.
source§

fn add(self, rhs: PixelRgb) -> PixelRgb

Performs the + operation. Read more
source§

impl AddAssign for PixelRgb

source§

fn add_assign(&mut self, rhs: PixelRgb)

Performs the += operation. Read more
source§

impl Clone for PixelRgb

source§

fn clone(&self) -> PixelRgb

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for PixelRgb

source§

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

Formats the value using the given formatter. Read more
source§

impl Default for PixelRgb

source§

fn default() -> PixelRgb

Returns the “default value” for a type. Read more
source§

impl<__RhsT: Copy> Div<__RhsT> for PixelRgb
where f32: Div<__RhsT, Output = f32>,

source§

type Output = PixelRgb

The resulting type after applying the / operator.
source§

fn div(self, rhs: __RhsT) -> PixelRgb

Performs the / operation. Read more
source§

impl<__RhsT: Copy> DivAssign<__RhsT> for PixelRgb
where f32: DivAssign<__RhsT>,

source§

fn div_assign(&mut self, rhs: __RhsT)

Performs the /= operation. Read more
source§

impl<__RhsT: Copy> Mul<__RhsT> for PixelRgb
where f32: Mul<__RhsT, Output = f32>,

source§

type Output = PixelRgb

The resulting type after applying the * operator.
source§

fn mul(self, rhs: __RhsT) -> PixelRgb

Performs the * operation. Read more
source§

impl<__RhsT: Copy> MulAssign<__RhsT> for PixelRgb
where f32: MulAssign<__RhsT>,

source§

fn mul_assign(&mut self, rhs: __RhsT)

Performs the *= operation. Read more
source§

impl Neg for PixelRgb

source§

type Output = PixelRgb

The resulting type after applying the - operator.
source§

fn neg(self) -> PixelRgb

Performs the unary - operation. Read more
source§

impl PartialEq for PixelRgb

source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<__RhsT: Copy> Rem<__RhsT> for PixelRgb
where f32: Rem<__RhsT, Output = f32>,

source§

type Output = PixelRgb

The resulting type after applying the % operator.
source§

fn rem(self, rhs: __RhsT) -> PixelRgb

Performs the % operation. Read more
source§

impl<__RhsT: Copy> RemAssign<__RhsT> for PixelRgb
where f32: RemAssign<__RhsT>,

source§

fn rem_assign(&mut self, rhs: __RhsT)

Performs the %= operation. Read more
source§

impl Sub for PixelRgb

source§

type Output = PixelRgb

The resulting type after applying the - operator.
source§

fn sub(self, rhs: PixelRgb) -> PixelRgb

Performs the - operation. Read more
source§

impl SubAssign for PixelRgb

source§

fn sub_assign(&mut self, rhs: PixelRgb)

Performs the -= operation. Read more
source§

impl Copy for PixelRgb

source§

impl StructuralPartialEq for PixelRgb

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

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

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

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

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

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

Performs the conversion.