pub type PackedBgra<P = u32> = Packed<Bgra, P>;
Expand description
A packed representation of RGBA in BGRA order.
Aliased Type§
struct PackedBgra<P = u32> {
pub color: P,
pub channel_order: PhantomData<Bgra>,
}
Fields§
§color: P
The color packed into a type P
, such as u32
or [u8; 4]
.
channel_order: PhantomData<Bgra>
The channel order for the color components in the packed data. See
ComponentOrder
.
Implementations
source§impl<O, P> Packed<O, P>
impl<O, P> Packed<O, P>
sourcepub fn pack<C>(color: C) -> Packed<O, P>where
O: ComponentOrder<C, P>,
pub fn pack<C>(color: C) -> Packed<O, P>where
O: ComponentOrder<C, P>,
Transform a color value into a packed memory representation.
sourcepub fn unpack<C>(self) -> Cwhere
O: ComponentOrder<C, P>,
pub fn unpack<C>(self) -> Cwhere
O: ComponentOrder<C, P>,
Transform a packed color into a regular color value.