Struct rgb::RGBA [] [src]

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

Fields

Red

Green

Blue

Alpha

Methods

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

Copy RGB components out of the RGBA struct

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

Trait Implementations

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

Convenience function (equivalent of self.iter().map().collect()) for applying the same formula to every component. Read more

impl<T> ComponentBytes<T> for RGBA<T>
[src]

The components interpreted as an array, e.g. RGB gives 3-element slice. The red component is first.

The components interpreted as raw bytes, in machine's native endian. Bytes of the red component are first.

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

Creates a value from an iterator. Read more

impl<T: Display> Display for RGBA<T>
[src]

Formats the value using the given formatter.

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

The resulting type after applying the + operator

The method for the + operator

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

The resulting type after applying the - operator

The method for the - operator

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

The resulting type after applying the + operator

The method for the + operator

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

The resulting type after applying the * operator

The method for the * operator

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

Performs the conversion.

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

Performs the conversion.

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

Performs the conversion.

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

Performs the conversion.

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

Performs the conversion.

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

Performs the conversion.

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

Performs the conversion.

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

Performs the conversion.

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

Performs the conversion.

impl<ComponentType: Copy> Copy for RGBA<ComponentType>
[src]

impl<ComponentType: Clone> Clone for RGBA<ComponentType>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<ComponentType: Debug> Debug for RGBA<ComponentType>
[src]

Formats the value using the given formatter.

impl<ComponentType: Eq> Eq for RGBA<ComponentType>
[src]

impl<ComponentType: PartialEq> PartialEq for RGBA<ComponentType>
[src]

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

This method tests for !=.

impl<ComponentType: Ord> Ord for RGBA<ComponentType>
[src]

This method returns an Ordering between self and other. Read more

impl<ComponentType: PartialOrd> PartialOrd for RGBA<ComponentType>
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<ComponentType: Hash> Hash for RGBA<ComponentType>
[src]

Feeds this value into the state given, updating the hasher as necessary.

Feeds a slice of this type into the state provided.