Struct pix::el::Pix3

source ·
#[repr(C)]
pub struct Pix3<C, M, A, G>where C: Channel, M: ColorModel, A: Alpha, G: Gamma,{ /* private fields */ }
Expand description

Pixel with three channels in its color model.

Implementations§

source§

impl<C, M, A, G> Pix3<C, M, A, G>where C: Channel, M: ColorModel, A: Alpha, G: Gamma,

source

pub fn new<H>(one: H, two: H, three: H) -> Selfwhere C: From<H>,

Create a three-channel color.

Example
use pix::rgb::Rgb8;

let rgb = Rgb8::new(128, 200, 255);

Trait Implementations§

source§

impl<C, M, A, G> Clone for Pix3<C, M, A, G>where C: Channel + Clone, M: ColorModel + Clone, A: Alpha + Clone, G: Gamma + Clone,

source§

fn clone(&self) -> Pix3<C, M, A, G>

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<C, M, A, G> Debug for Pix3<C, M, A, G>where C: Channel + Debug, M: ColorModel + Debug, A: Alpha + Debug, G: Gamma + Debug,

source§

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

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

impl<C, M, A, G> Default for Pix3<C, M, A, G>where C: Channel + Default, M: ColorModel + Default, A: Alpha + Default, G: Gamma + Default,

source§

fn default() -> Pix3<C, M, A, G>

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

impl<C, M, A, G> PartialEq<Pix3<C, M, A, G>> for Pix3<C, M, A, G>where C: Channel + PartialEq, M: ColorModel + PartialEq, A: Alpha + PartialEq, G: Gamma + PartialEq,

source§

fn eq(&self, other: &Pix3<C, M, A, G>) -> bool

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

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

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

impl<C, M, A, G> Pixel for Pix3<C, M, A, G>where C: Channel, M: ColorModel, A: Alpha, G: Gamma,

§

type Chan = C

Channel type
§

type Model = M

Color model
§

type Alpha = A

Alpha mode
§

type Gamma = G

Gamma mode
source§

fn from_channels(ch: &[C]) -> Self

Make a pixel from a slice of channels.
source§

fn from_bit_depth<P>(p: P) -> Selfwhere P: Pixel, Self::Chan: From<P::Chan>,

Convert from a pixel with a different bit depth.
source§

fn channels(&self) -> &[Self::Chan]

Get the channels.
source§

fn channels_mut(&mut self) -> &mut [Self::Chan]

Get the channels mutably.
source§

fn one(self) -> Self::Chan

Get the first channel.
source§

fn one_mut(&mut self) -> &mut Self::Chan

Get a mutable reference to the first channel
source§

fn two(self) -> Self::Chan

Get the second channel.
source§

fn two_mut(&mut self) -> &mut Self::Chan

Get a mutable reference to the second channel
source§

fn three(self) -> Self::Chan

Get the third channel.
source§

fn three_mut(&mut self) -> &mut Self::Chan

Get a mutable reference to the third channel
source§

fn four(self) -> Self::Chan

Get the fourth channel.
source§

fn four_mut(&mut self) -> &mut Self::Chan

Get a mutable reference to the fourth channel
source§

fn alpha(self) -> Self::Chan

Get the alpha channel. Read more
source§

fn alpha_mut(&mut self) -> &mut Self::Chan

Get a mutable reference to the alpha channel. Read more
source§

fn convert<D>(self) -> Dwhere D: Pixel, D::Chan: From<Self::Chan>,

Convert a pixel to another format Read more
source§

fn copy_color(dst: &mut [Self], clr: &Self)

Copy a color to a pixel slice
source§

fn copy_slice(dst: &mut [Self], src: &[Self])

Copy a slice to another
source§

impl<C, M, A, G> Copy for Pix3<C, M, A, G>where C: Channel + Copy, M: ColorModel + Copy, A: Alpha + Copy, G: Gamma + Copy,

source§

impl<C, M, A, G> Eq for Pix3<C, M, A, G>where C: Channel + Eq, M: ColorModel + Eq, A: Alpha + Eq, G: Gamma + Eq,

source§

impl<C, M, A, G> StructuralEq for Pix3<C, M, A, G>where C: Channel, M: ColorModel, A: Alpha, G: Gamma,

source§

impl<C, M, A, G> StructuralPartialEq for Pix3<C, M, A, G>where C: Channel, M: ColorModel, A: Alpha, G: Gamma,

Auto Trait Implementations§

§

impl<C, M, A, G> RefUnwindSafe for Pix3<C, M, A, G>where A: RefUnwindSafe, C: RefUnwindSafe, G: RefUnwindSafe, M: RefUnwindSafe,

§

impl<C, M, A, G> Send for Pix3<C, M, A, G>where A: Send, C: Send, G: Send, M: Send,

§

impl<C, M, A, G> Sync for Pix3<C, M, A, G>where A: Sync, C: Sync, G: Sync, M: Sync,

§

impl<C, M, A, G> Unpin for Pix3<C, M, A, G>where A: Unpin, C: Unpin, G: Unpin, M: Unpin,

§

impl<C, M, A, G> UnwindSafe for Pix3<C, M, A, G>where A: UnwindSafe, C: UnwindSafe, G: UnwindSafe, M: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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 Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.