blob: b62132ad8ba30ae375b57b7ee7b6539b35691096 [file] [log] [blame]
reed374772b2016-10-05 17:33:02 -07001/*
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
Cary Clark7651c162018-07-13 08:21:59 -04008/* Generated by tools/bookmaker from include/core/SkBlendMode.h and docs/SkBlendMode_Reference.bmh
9 on 2018-07-13 08:15:10. Additional documentation and examples can be found at:
10 https://skia.org/user/api/SkBlendMode_Reference
11
12 You may edit either file directly. Structural changes to public interfaces require
13 editing both files. After editing docs/SkBlendMode_Reference.bmh, run:
14 bookmaker -b docs -i include/core/SkBlendMode.h -p
15 to create an updated version of this file.
16 */
17
reed374772b2016-10-05 17:33:02 -070018#ifndef SkBlendMode_DEFINED
19#define SkBlendMode_DEFINED
20
Mike Reedd5870c22016-11-16 13:13:16 -050021#include "SkTypes.h"
22
reed374772b2016-10-05 17:33:02 -070023enum class SkBlendMode {
Cary Clark7651c162018-07-13 08:21:59 -040024 kClear, //!< replaces destination with zero: fully transparent
25 kSrc, //!< replaces destination
26 kDst, //!< preserves destination
27 kSrcOver, //!< source over destination
28 kDstOver, //!< destination over source
29 kSrcIn, //!< source trimmed inside destination
30 kDstIn, //!< destination trimmed by source
31 kSrcOut, //!< source trimmed outside destination
32 kDstOut, //!< destination trimmed outside source
33 kSrcATop, //!< source inside destination blended with destination
34 kDstATop, //!< destination inside source blended with source
35 kXor, //!< each of source and destination trimmed outside the other
36 kPlus, //!< sum of colors
37 kModulate, //!< product of premultiplied colors; darkens destination
38 kScreen, //!< multiply inverse of pixels, inverting result; brightens destination
39 kLastCoeffMode = kScreen, //!< last porter duff blend mode
40 kOverlay, //!< multiply or screen, depending on destination
41 kDarken, //!< darker of source and destination
42 kLighten, //!< lighter of source and destination
43 kColorDodge, //!< brighten destination to reflect source
44 kColorBurn, //!< darken destination to reflect source
45 kHardLight, //!< multiply or screen, depending on source
46 kSoftLight, //!< lighten or darken, depending on source
47 kDifference, //!< subtract darker from lighter with higher contrast
48 kExclusion, //!< subtract darker from lighter with lower contrast
49 kMultiply, //!< multiply source with destination, darkening image
50 kLastSeparableMode = kMultiply, //!< last blend mode operating separately on components
51 kHue, //!< hue of source with saturation and luminosity of destination
52 kSaturation, //!< saturation of source with hue and luminosity of destination
53 kColor, //!< hue and saturation of source with luminosity of destination
54 kLuminosity, //!< luminosity of source with hue and saturation of destination
55 kLastMode = kLuminosity, //!< last valid value
reed374772b2016-10-05 17:33:02 -070056};
57
Cary Clark7651c162018-07-13 08:21:59 -040058/** Returns name of blendMode as null-terminated C string.
59
60 @param blendMode one of:
Cary Clark82456492018-10-31 10:54:50 -040061 SkBlendMode::kClear, SkBlendMode::kSrc, SkBlendMode::kDst,
62 SkBlendMode::kSrcOver, SkBlendMode::kDstOver, SkBlendMode::kSrcIn,
63 SkBlendMode::kDstIn, SkBlendMode::kSrcOut, SkBlendMode::kDstOut,
64 SkBlendMode::kSrcATop, SkBlendMode::kDstATop, SkBlendMode::kXor,
65 SkBlendMode::kPlus, SkBlendMode::kModulate, SkBlendMode::kScreen,
66 SkBlendMode::kOverlay, SkBlendMode::kDarken, SkBlendMode::kLighten,
67 SkBlendMode::kColorDodge, SkBlendMode::kColorBurn, SkBlendMode::kHardLight,
68 SkBlendMode::kSoftLight, SkBlendMode::kDifference, SkBlendMode::kExclusion,
69 SkBlendMode::kMultiply, SkBlendMode::kHue, SkBlendMode::kSaturation,
70 SkBlendMode::kColor, SkBlendMode::kLuminosity
Cary Clark7651c162018-07-13 08:21:59 -040071 @return C string
72*/
Cary Clark224c7002018-06-27 11:00:21 -040073SK_API const char* SkBlendMode_Name(SkBlendMode blendMode);
Mike Reedd5870c22016-11-16 13:13:16 -050074
reed374772b2016-10-05 17:33:02 -070075#endif