Flutter Engine
The Flutter Engine
|
#include "include/core/SkTypes.h"
Go to the source code of this file.
Enumerations | |
enum class | SkBlendMode { kClear , kSrc , kDst , kSrcOver , kDstOver , kSrcIn , kDstIn , kSrcOut , kDstOut , kSrcATop , kDstATop , kXor , kPlus , kModulate , kScreen , kOverlay , kDarken , kLighten , kColorDodge , kColorBurn , kHardLight , kSoftLight , kDifference , kExclusion , kMultiply , kHue , kSaturation , kColor , kLuminosity , kLastCoeffMode = kScreen , kLastSeparableMode = kMultiply , kLastMode = kLuminosity } |
enum class | SkBlendModeCoeff { kZero , kOne , kSC , kISC , kDC , kIDC , kSA , kISA , kDA , kIDA , kCoeffCount } |
Functions | |
SK_API bool | SkBlendMode_AsCoeff (SkBlendMode mode, SkBlendModeCoeff *src, SkBlendModeCoeff *dst) |
SK_API const char * | SkBlendMode_Name (SkBlendMode blendMode) |
Variables | |
static constexpr int | kSkBlendModeCount = static_cast<int>(SkBlendMode::kLastMode) + 1 |
|
strong |
Blends are operators that take in two colors (source, destination) and return a new color. Many of these operate the same on all 4 components: red, green, blue, alpha. For these, we just document what happens to one component, rather than naming each one separately.
Different SkColorTypes have different representations for color components: 8-bit: 0..255 6-bit: 0..63 5-bit: 0..31 4-bit: 0..15 floats: 0...1
The documentation is expressed as if the component values are always 0..1 (floats).
For brevity, the documentation uses the following abbreviations s : source d : destination sa : source alpha da : destination alpha
Results are abbreviated r : if all 4 components are computed in the same manner ra : result alpha component rc : result "color": red, green, blue components
Definition at line 38 of file SkBlendMode.h.
|
strong |
For Porter-Duff SkBlendModes (those <= kLastCoeffMode), these coefficients describe the blend equation used. Coefficient-based blend modes specify an equation: ('dstCoeff' * dst + 'srcCoeff' * src), where the coefficient values are constants, functions of the src or dst alpha, or functions of the src or dst color.
Definition at line 84 of file SkBlendMode.h.
SK_API bool SkBlendMode_AsCoeff | ( | SkBlendMode | mode, |
SkBlendModeCoeff * | src, | ||
SkBlendModeCoeff * | dst | ||
) |
Returns true if 'mode' is a coefficient-based blend mode (<= kLastCoeffMode). If true is returned, the mode's src and dst coefficient functions are set in 'src' and 'dst'.
Definition at line 57 of file SkBlendMode.cpp.
SK_API const char * SkBlendMode_Name | ( | SkBlendMode | blendMode | ) |
Returns name of blendMode as null-terminated C string.
Definition at line 167 of file SkBlendMode.cpp.
|
staticconstexpr |
Definition at line 76 of file SkBlendMode.h.