Struct Premultiplied
Stores premultiplied linear-light sRGB and its alpha.
struct Premultiplied(Color)
if (isSupportedPremultipliedColor!Color);
Use this representation for compositing. It is deliberately distinct from
straight Alpha!Color so the two forms cannot be mixed accidentally.
Direct construction does not perform premultiplication: callers must supply
coordinates that are already multiplied by the associated alpha. The natural
state is detectably invalid because its floating components are NaN.
Fields
| Name | Type | Description |
|---|---|---|
alpha
|
Premultiplied | Raw alpha value associated with the premultiplied coordinates. |
color
|
Color | Wrapped premultiplied color coordinates. |
Properties
| Name | Type | Description |
|---|---|---|
isValidAlpha[get]
|
bool | Reports whether alpha is a usable opacity from 0 through 1. |
Aliases
| Name | Description |
|---|---|
Scalar
|
Scalar component type shared with the wrapped color. |
Example
const value = Premultiplied!LinearSRgbf(
LinearSRgbf(0.1f, 0.2f, 0.4f),
0.5f
);
assert(value .color == LinearSRgbf(0.1f, 0.2f, 0.4f));
assert(value .alpha == 0.5f);
assert(value .isValidAlpha);