PMA
A color premultiplied by alpha
This type is safe to @bitCast to and from a [@sizeOf(Color.PMA)]u8.
This also means @ptrCast of []Color.PMA to and from []u8 is safe,
as long as the length is a multiple of @sizeOf(Color.PMA).
The pixel format will always be .rgba_32, but the byte order depends on the endianness of the target.
Fields
- r:u8
- u8
- g:u8
- u8
- b:u8
- u8
- a:u8
- u8
Functions
- toColor
Convert premultiplied alpha color to a
Color.- fromColor
Convert normal color to premultiplied alpha.
- multiply
Multiply two colors component-wise.
- cast
Casts from
Colorby reassigning its fields- castToColor
Casts to
Colorby reassigning its fields- sliceFromRGBA
Alpha multiplies
pixelsin place- sliceToRGBA
Unapplies the alpha multiplication in place, returning the inner slice