Skia
2D Graphics Library
SkBlendMode.h
Go to the documentation of this file.
1 /*
2  * Copyright 2016 Google Inc.
3  *
4  * Use of this source code is governed by a BSD-style license that can be
5  * found in the LICENSE file.
6  */
7 
8 #ifndef SkBlendMode_DEFINED
9 #define SkBlendMode_DEFINED
10 
11 #include "include/core/SkTypes.h"
12 
13 enum class SkBlendMode {
14  kClear,
15  kSrc,
16  kDst,
17  kSrcOver,
18  kDstOver,
19  kSrcIn,
20  kDstIn,
21  kSrcOut,
22  kDstOut,
23  kSrcATop,
24  kDstATop,
25  kXor,
26  kPlus,
27  kModulate,
28  kScreen,
30  kOverlay,
31  kDarken,
32  kLighten,
33  kColorDodge,
34  kColorBurn,
35  kHardLight,
36  kSoftLight,
37  kDifference,
38  kExclusion,
39  kMultiply,
41  kHue,
42  kSaturation,
43  kColor,
44  kLuminosity,
46 };
47 
54 enum class SkBlendModeCoeff {
55  kZero,
56  kOne,
57  kSC,
58  kISC,
59  kDC,
60  kIDC,
61  kSA,
62  kISA,
63  kDA,
64  kIDA,
67 };
68 
74 
75 
80 SK_API const char* SkBlendMode_Name(SkBlendMode blendMode);
81 
82 #endif
SkBlendMode::kSaturation
@ kSaturation
saturation of source with hue and luminosity of destination
SkBlendMode::kDstIn
@ kDstIn
destination trimmed by source
SkBlendModeCoeff::kOne
@ kOne
0
SkBlendModeCoeff::kDC
@ kDC
inverse src color (i.e.
SkBlendMode::kLastMode
@ kLastMode
last valid value
SkBlendModeCoeff::kISA
@ kISA
src alpha
SkBlendModeCoeff::kSA
@ kSA
inverse dst color (i.e.
SkBlendMode::kLighten
@ kLighten
lighter of source and destination
SkTypes.h
SkBlendMode::kDstOver
@ kDstOver
destination over source
SkBlendMode::kColorBurn
@ kColorBurn
darken destination to reflect source
SkBlendMode::kDst
@ kDst
preserves destination
SkBlendMode
SkBlendMode
Definition: SkBlendMode.h:13
SkBlendMode::kLastCoeffMode
@ kLastCoeffMode
last porter duff blend mode
SkBlendModeCoeff::kIDC
@ kIDC
dst color
SkBlendModeCoeff
SkBlendModeCoeff
For Porter-Duff SkBlendModes (those <= kLastCoeffMode), these coefficients describe the blend equatio...
Definition: SkBlendMode.h:54
SkBlendMode::kLuminosity
@ kLuminosity
luminosity of source with hue and saturation of destination
SkBlendMode::kDarken
@ kDarken
darker of source and destination
SkBlendMode::kDstATop
@ kDstATop
destination inside source blended with source
SkBlendMode::kHardLight
@ kHardLight
multiply or screen, depending on source
SkBlendMode::kSrcOut
@ kSrcOut
source trimmed outside destination
SkBlendModeCoeff::kIDA
@ kIDA
dst alpha
SkBlendMode_Name
SK_API const char * SkBlendMode_Name(SkBlendMode blendMode)
Returns name of blendMode as null-terminated C string.
SkBlendMode::kExclusion
@ kExclusion
subtract darker from lighter with lower contrast
SkBlendMode::kModulate
@ kModulate
product of premultiplied colors; darkens destination
SkBlendMode::kColor
@ kColor
hue and saturation of source with luminosity of destination
SK_API
#define SK_API
Definition: SkTypes.h:181
SkBlendModeCoeff::kISC
@ kISC
src color
SkBlendModeCoeff::kSC
@ kSC
1
SkBlendMode::kSoftLight
@ kSoftLight
lighten or darken, depending on source
SkBlendModeCoeff::kCoeffCount
@ kCoeffCount
inverse dst alpha (i.e.
SkBlendMode::kClear
@ kClear
replaces destination with zero: fully transparent
SkBlendMode::kXor
@ kXor
each of source and destination trimmed outside the other
SkBlendMode::kMultiply
@ kMultiply
multiply source with destination, darkening image
SkBlendMode::kSrcATop
@ kSrcATop
source inside destination blended with destination
SkBlendMode::kSrc
@ kSrc
replaces destination
SkBlendMode::kHue
@ kHue
hue of source with saturation and luminosity of destination
SkBlendMode::kSrcOver
@ kSrcOver
source over destination
SkBlendMode::kScreen
@ kScreen
multiply inverse of pixels, inverting result; brightens destination
SkBlendModeCoeff::kDA
@ kDA
inverse src alpha (i.e.
SkBlendMode::kDifference
@ kDifference
subtract darker from lighter with higher contrast
SkBlendMode::kPlus
@ kPlus
sum of colors
SkBlendMode::kColorDodge
@ kColorDodge
brighten destination to reflect source
SkBlendModeCoeff::kZero
@ kZero
SkBlendMode::kLastSeparableMode
@ kLastSeparableMode
last blend mode operating separately on components
SkBlendMode::kOverlay
@ kOverlay
multiply or screen, depending on destination
SkBlendMode::kDstOut
@ kDstOut
destination trimmed outside source
SkBlendMode_AsCoeff
SK_API bool SkBlendMode_AsCoeff(SkBlendMode mode, SkBlendModeCoeff *src, SkBlendModeCoeff *dst)
Returns true if 'mode' is a coefficient-based blend mode (<= kLastCoeffMode).
SkBlendMode::kSrcIn
@ kSrcIn
source trimmed inside destination