Struct rgb::RGB [−][src]
#[repr(C)]pub struct RGB<ComponentType> {
pub r: ComponentType,
pub g: ComponentType,
pub b: ComponentType,
}
Expand description
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
r: ComponentType
Red
g: ComponentType
Green
b: ComponentType
Blue
Implementations
Trait Implementations
px + px
px + 1
Reinterpret the slice as a read-only/shared slice of pixels. Multiple consecutive elements in the slice are intepreted as a single pixel (depending on format, e.g. 3 for RGB, 4 for RGBA). Read more
impl<'de, ComponentType> Deserialize<'de> for RGB<ComponentType> where
ComponentType: Deserialize<'de>,
impl<'de, ComponentType> Deserialize<'de> for RGB<ComponentType> where
ComponentType: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
px / 1
Assumes 255 is opaque
Assumes 65535 is opaque
Assumes 255 is opaque
Assumes 65535 is opaque
Assumes 255 is opaque
Assumes 65535 is opaque
Assumes 255 is opaque
Assumes 65535 is opaque
Takes exactly 3 elements from the iterator and creates a new instance. Panics if there are fewer elements in the iterator.
px * 1
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
px - px
px - 1
Auto Trait Implementations
impl<ComponentType> RefUnwindSafe for RGB<ComponentType> where
ComponentType: RefUnwindSafe,
impl<ComponentType> UnwindSafe for RGB<ComponentType> where
ComponentType: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more