FsCompositeOperation
The FsCompositeOperationState structure represents a composite operation used to combine a source pixel and a destination pixel into a final pixel.
Syntax
struct FsCompositeOperationState {
int srcRGB;
int dstRGB;
int srcAlpha;
int dstAlpha;
};Members
| Member | Description |
|---|---|
srcRGB | RGB source pixel, one of the constants listed below. |
dstRGB | RGB destination pixel, one of the constants listed below. |
srcAlpha | Alpha source pixel, one of the constants listed below. |
dstAlpha | Alpha destination pixel, one of the constants listed below. |
Remarks
The members of the struct can take one of the following blend factor constants (these are bit flags, defined as 1 << n):
| Constant | Value | RGB Blend Factors(Sr, Sg, Sb) or (Dr, Dg, Db) | Alpha Blend Factor(Sa) or (Da) |
|---|---|---|---|
FS_ZERO | 1 | (0, 0, 0) | 0 |
FS_ONE | 2 | (1, 1, 1) | 1 |
FS_SRC_COLOR | 4 | (Rs, Gs, Bs) | As |
FS_ONE_MINUS_SRC_COLOR | 8 | (1, 1, 1) - (Rs, Gs, Bs) | 1 - As |
FS_DST_COLOR | 16 | (Rd, Gd, Bd) | Ad |
FS_ONE_MINUS_DST_COLOR | 32 | (1, 1, 1) - (Rd, Gd, Bd) | 1 - Ad |
FS_SRC_ALPHA | 64 | (As, As, As) | As |
FS_ONE_MINUS_SRC_ALPHA | 128 | (1, 1, 1) - (As, As, As) | 1 - As |
FS_DST_ALPHA | 256 | (Ad, Ad, Ad) | Ad |
FS_ONE_MINUS_DST_ALPHA | 512 | (1, 1, 1) - (Ad, Ad, Ad) | 1 - Ad |
FS_SRC_ALPHA_SATURATE | 1024 | (f, f, f)💡︎ | 1 |
NOTE -
FS_SRC_ALPHA_SATURATEf = min(As, 1 - Ad), as in the OpenGL blend function this table is modelled on.
