SkBlendMode.h 4.4 KB

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