#[repr(C)]pub struct Rgba8 {
pub r: u8,
pub g: u8,
pub b: u8,
pub a: u8,
}Expand description
Re-export every public type from the color crate, including all
arithmetic helpers from color::convert.
Downstream modules within this crate can import everything they need with
a single use crate::types::*.
8-bit RGBA, 4 bytes/pixel, wire layout [R, G, B, A].
This is the working format for transparency groups. The MODE constant is
set to PixelMode::Xbgr8 as an intentional approximation: the rasterizer
internally uses this struct for transparency groups and the mode field is
only used for external dispatch (e.g. choosing a blitter). The actual byte
layout is [R, G, B, A], not [X, B, G, R]; callers that perform
memory-layout-sensitive operations must use the struct fields directly
rather than relying on the MODE variant.
Fields§
§r: u8Red channel, 0 = minimum, 255 = full intensity.
g: u8Green channel, 0 = minimum, 255 = full intensity.
b: u8Blue channel, 0 = minimum, 255 = full intensity.
a: u8Alpha channel, 0 = fully transparent, 255 = fully opaque.
Trait Implementations§
impl Copy for Rgba8
impl Eq for Rgba8
impl Pod for Rgba8
impl StructuralPartialEq for Rgba8
Auto Trait Implementations§
impl Freeze for Rgba8
impl RefUnwindSafe for Rgba8
impl Send for Rgba8
impl Sync for Rgba8
impl Unpin for Rgba8
impl UnsafeUnpin for Rgba8
impl UnwindSafe for Rgba8
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
bits
as &Self.