Skia
2D Graphics Library
SkBlendMode.h File Reference
Include dependency graph for SkBlendMode.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  SkBlendMode {
  SkBlendMode::kClear, SkBlendMode::kSrc, SkBlendMode::kDst, SkBlendMode::kSrcOver,
  SkBlendMode::kDstOver, SkBlendMode::kSrcIn, SkBlendMode::kDstIn, SkBlendMode::kSrcOut,
  SkBlendMode::kDstOut, SkBlendMode::kSrcATop, SkBlendMode::kDstATop, SkBlendMode::kXor,
  SkBlendMode::kPlus, SkBlendMode::kModulate, SkBlendMode::kScreen, SkBlendMode::kLastCoeffMode = kScreen,
  SkBlendMode::kOverlay, SkBlendMode::kDarken, SkBlendMode::kLighten, SkBlendMode::kColorDodge,
  SkBlendMode::kColorBurn, SkBlendMode::kHardLight, SkBlendMode::kSoftLight, SkBlendMode::kDifference,
  SkBlendMode::kExclusion, SkBlendMode::kMultiply, SkBlendMode::kLastSeparableMode = kMultiply, SkBlendMode::kHue,
  SkBlendMode::kSaturation, SkBlendMode::kColor, SkBlendMode::kLuminosity, SkBlendMode::kLastMode = kLuminosity
}
 
enum  SkBlendModeCoeff {
  SkBlendModeCoeff::kZero, SkBlendModeCoeff::kOne, SkBlendModeCoeff::kSC, SkBlendModeCoeff::kISC,
  SkBlendModeCoeff::kDC, SkBlendModeCoeff::kIDC, SkBlendModeCoeff::kSA, SkBlendModeCoeff::kISA,
  SkBlendModeCoeff::kDA, SkBlendModeCoeff::kIDA, SkBlendModeCoeff::kCoeffCount
}
 For Porter-Duff SkBlendModes (those <= kLastCoeffMode), these coefficients describe the blend equation used. More...
 

Functions

SK_API bool SkBlendMode_AsCoeff (SkBlendMode mode, SkBlendModeCoeff *src, SkBlendModeCoeff *dst)
 Returns true if 'mode' is a coefficient-based blend mode (<= kLastCoeffMode). More...
 
SK_API const char * SkBlendMode_Name (SkBlendMode blendMode)
 Returns name of blendMode as null-terminated C string. More...
 

Enumeration Type Documentation

◆ SkBlendMode

enum SkBlendMode
strong
Enumerator
kClear 

replaces destination with zero: fully transparent

kSrc 

replaces destination

kDst 

preserves destination

kSrcOver 

source over destination

kDstOver 

destination over source

kSrcIn 

source trimmed inside destination

kDstIn 

destination trimmed by source

kSrcOut 

source trimmed outside destination

kDstOut 

destination trimmed outside source

kSrcATop 

source inside destination blended with destination

kDstATop 

destination inside source blended with source

kXor 

each of source and destination trimmed outside the other

kPlus 

sum of colors

kModulate 

product of premultiplied colors; darkens destination

kScreen 

multiply inverse of pixels, inverting result; brightens destination

kLastCoeffMode 

last porter duff blend mode

kOverlay 

multiply or screen, depending on destination

kDarken 

darker of source and destination

kLighten 

lighter of source and destination

kColorDodge 

brighten destination to reflect source

kColorBurn 

darken destination to reflect source

kHardLight 

multiply or screen, depending on source

kSoftLight 

lighten or darken, depending on source

kDifference 

subtract darker from lighter with higher contrast

kExclusion 

subtract darker from lighter with lower contrast

kMultiply 

multiply source with destination, darkening image

kLastSeparableMode 

last blend mode operating separately on components

kHue 

hue of source with saturation and luminosity of destination

kSaturation 

saturation of source with hue and luminosity of destination

kColor 

hue and saturation of source with luminosity of destination

kLuminosity 

luminosity of source with hue and saturation of destination

kLastMode 

last valid value

◆ SkBlendModeCoeff

enum SkBlendModeCoeff
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.

Enumerator
kZero 
kOne 

0

kSC 

1

kISC 

src color

kDC 

inverse src color (i.e.

1 - sc)

kIDC 

dst color

kSA 

inverse dst color (i.e.

1 - dc)

kISA 

src alpha

kDA 

inverse src alpha (i.e.

1 - sa)

kIDA 

dst alpha

kCoeffCount 

inverse dst alpha (i.e.

1 - da)

Function Documentation

◆ SkBlendMode_AsCoeff()

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'.

◆ SkBlendMode_Name()

SK_API const char* SkBlendMode_Name ( SkBlendMode  blendMode)

Returns name of blendMode as null-terminated C string.

Returns
C string