Struct lodepng::RGBA [] [src]

#[repr(C)]
pub struct RGBA<ComponentType, AlphaComponentType = ComponentType> { pub r: ComponentType, pub g: ComponentType, pub b: ComponentType, pub a: AlphaComponentType, }

The RGBA pixel

The component type can be u8 (aliased as RGBA8), u16 (aliased as RGBA16), or any other type (but simple copyable types are recommended.)

You can specify a different type for alpha, but it's only for special cases (e.g. if you use a newtype like RGBA<LinearLight<u16>, u16>).

Fields

Red

Green

Blue

Alpha

Methods

impl<T> RGBA<T, T> where
    T: Clone
[src]

[src]

impl<T> RGBA<T, T> where
    T: Clone
[src]

[src]

Iterate over all components (length=4)

impl<T, A> RGBA<T, A> where
    T: Clone
[src]

[src]

Copy RGB components out of the RGBA struct

impl<T, A> RGBA<T, A>
[src]

[src]

Provide a mutable view of only RGB components (leaving out alpha). Useful to change color without changing opacity.

impl<T, A> RGBA<T, A> where
    A: Clone,
    T: Copy
[src]

[src]

Create new RGBA with the same alpha value, but different RGB values

Trait Implementations

impl<T> ComponentSlice<T> for RGBA<T, T>
[src]

[src]

[src]

impl<ComponentType, AlphaComponentType> Ord for RGBA<ComponentType, AlphaComponentType> where
    AlphaComponentType: Ord,
    ComponentType: Ord
[src]

[src]

impl<ComponentType, AlphaComponentType> Copy for RGBA<ComponentType, AlphaComponentType> where
    AlphaComponentType: Copy,
    ComponentType: Copy
[src]

impl<ComponentType, AlphaComponentType> Hash for RGBA<ComponentType, AlphaComponentType> where
    AlphaComponentType: Hash,
    ComponentType: Hash
[src]

[src]

impl<ComponentType, AlphaComponentType> Clone for RGBA<ComponentType, AlphaComponentType> where
    AlphaComponentType: Clone,
    ComponentType: Clone
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<ComponentType, AlphaComponentType> Eq for RGBA<ComponentType, AlphaComponentType> where
    AlphaComponentType: Eq,
    ComponentType: Eq
[src]

impl<T> From<BGRA<T, T>> for RGBA<T, T>
[src]

[src]

Performs the conversion.

impl From<RGBA<u16, u16>> for RGBA<f32, f32>
[src]

[src]

Performs the conversion.

impl<T> From<BGR<T>> for RGBA<T, u8> where
    T: Copy
[src]

Assumes 255 is opaque

[src]

Performs the conversion.

impl From<RGBA<i16, i16>> for RGBA<f32, f32>
[src]

[src]

Performs the conversion.

impl From<RGBA<u8, u8>> for RGBA<f64, f64>
[src]

[src]

Performs the conversion.

impl From<RGBA<u16, u16>> for RGBA<i32, i32>
[src]

[src]

Performs the conversion.

impl From<RGBA<u8, u8>> for RGBA<f32, f32>
[src]

[src]

Performs the conversion.

impl From<RGBA<f32, f32>> for RGBA<f64, f64>
[src]

[src]

Performs the conversion.

impl From<RGBA<i16, i16>> for RGBA<f64, f64>
[src]

[src]

Performs the conversion.

impl From<RGBA<i32, i32>> for RGBA<f64, f64>
[src]

[src]

Performs the conversion.

impl<T> From<RGB<T>> for RGBA<T, u8> where
    T: Copy
[src]

Assumes 255 is opaque

[src]

Performs the conversion.

impl From<RGBA<u16, u16>> for RGBA<f64, f64>
[src]

[src]

Performs the conversion.

impl<ComponentType, AlphaComponentType> PartialEq<RGBA<ComponentType, AlphaComponentType>> for RGBA<ComponentType, AlphaComponentType> where
    AlphaComponentType: PartialEq<AlphaComponentType>,
    ComponentType: PartialEq<ComponentType>, 
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl<T> Add<T> for RGBA<T, T> where
    T: Copy + Add<T, Output = T> + Clone + Add<T>, 
[src]

[src]

impl<T> Add<RGBA<T, T>> for RGBA<T, T> where
    T: Add<T>, 
[src]

[src]

impl<ComponentType, AlphaComponentType> Debug for RGBA<ComponentType, AlphaComponentType> where
    AlphaComponentType: Debug,
    ComponentType: Debug
[src]

[src]

Formats the value using the given formatter.

impl<T> Mul<T> for RGBA<T, T> where
    T: Copy + Mul<T, Output = T> + Clone + Mul<T>, 
[src]

[src]

impl<T> FromIterator<T> for RGBA<T, T>
[src]

[src]

Takes exactly 4 elements from the iterator and creates a new instance. Panics if there are fewer elements in the iterator.

impl<T, A> Display for RGBA<T, A> where
    A: Display,
    T: Display
[src]

[src]

Formats the value using the given formatter. Read more

impl<T> Sub<RGBA<T, T>> for RGBA<T, T> where
    T: Sub<T>, 
[src]

[src]

impl<ComponentType, AlphaComponentType> Default for RGBA<ComponentType, AlphaComponentType> where
    AlphaComponentType: Default,
    ComponentType: Default
[src]

[src]

Returns the "default value" for a type. Read more

impl<T, B> ComponentMap<RGBA<B, B>, T, B> for RGBA<T, T> where
    T: Copy
[src]

[src]

impl<ComponentType, AlphaComponentType> PartialOrd<RGBA<ComponentType, AlphaComponentType>> for RGBA<ComponentType, AlphaComponentType> where
    AlphaComponentType: PartialOrd<AlphaComponentType>,
    ComponentType: PartialOrd<ComponentType>, 
[src]

[src]

[src]

[src]

[src]

[src]