Struct lodepng::RGB[][src]

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

The RGB pixel

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

Fields

Red

Green

Blue

Methods

impl<T> RGB<T> where
    T: Clone
[src]

Convenience function for creating a new pixel

Important traits for Cloned<I>

Iterate over color components (R, G, and B)

Trait Implementations

impl<ComponentType> Copy for RGB<ComponentType> where
    ComponentType: Copy
[src]

impl<ComponentType> Ord for RGB<ComponentType> where
    ComponentType: Ord
[src]

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

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

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

px * 1

The resulting type after applying the * operator.

Performs the * operation.

impl<T> AsMut<[T]> for RGB<T>
[src]

Important traits for &'a [u8]

Performs the conversion.

impl<ComponentType> Debug for RGB<ComponentType> where
    ComponentType: Debug
[src]

Formats the value using the given formatter. Read more

impl<ComponentType> Default for RGB<ComponentType> where
    ComponentType: Default
[src]

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

impl<T> Display for RGB<T> where
    T: Display
[src]

Formats the value using the given formatter. Read more

impl<ComponentType> Clone for RGB<ComponentType> where
    ComponentType: Clone
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

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

px - px

The resulting type after applying the - operator.

Performs the - operation.

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

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

impl<ComponentType> Hash for RGB<ComponentType> where
    ComponentType: Hash
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl<ComponentType> PartialOrd<RGB<ComponentType>> for RGB<ComponentType> where
    ComponentType: PartialOrd<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<T> Add<RGB<T>> for RGB<T> where
    T: Add<T>, 
[src]

px + px

The resulting type after applying the + operator.

Performs the + operation.

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

px + 1

The resulting type after applying the + operator.

Performs the + operation.

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

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

impl<T> Into<(T, T, T)> for RGB<T>
[src]

Performs the conversion.

impl<T> From<RGB<T>> for BGR<T>
[src]

Performs the conversion.

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

Performs the conversion.

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

Assumes 65535 is opaque

Performs the conversion.

impl From<RGB<u8>> for RGB<i16>
[src]

Performs the conversion.

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

Performs the conversion.

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

Performs the conversion.

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

Performs the conversion.

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

Assumes 255 is opaque

Performs the conversion.

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

Performs the conversion.

impl<T> From<(T, T, T)> for RGB<T>
[src]

Performs the conversion.

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

Performs the conversion.

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

Performs the conversion.

impl<T> From<RGB<T>> for BGRA<T, u16> where
    T: Copy
[src]

Assumes 255 is opaque

Performs the conversion.

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

Performs the conversion.

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

Assumes 255 is opaque

Performs the conversion.

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

Performs the conversion.

impl<T> From<Gray<T>> for RGB<T> where
    T: Clone
[src]

Performs the conversion.

impl<T> From<BGR<T>> for RGB<T>
[src]

Performs the conversion.

impl<T> ComponentSlice<T> for RGB<T>
[src]

Important traits for &'a [u8]

The components interpreted as an array, e.g. one RGB expands to 3 elements. Read more

Important traits for &'a [u8]

impl<ComponentType> PartialEq<RGB<ComponentType>> for RGB<ComponentType> where
    ComponentType: PartialEq<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> Eq for RGB<ComponentType> where
    ComponentType: Eq
[src]

impl<T> AsRef<[T]> for RGB<T>
[src]

Important traits for &'a [u8]

Performs the conversion.

Auto Trait Implementations

impl<ComponentType> Send for RGB<ComponentType> where
    ComponentType: Send

impl<ComponentType> Sync for RGB<ComponentType> where
    ComponentType: Sync