tiny-skia-cpp
A C++20 2D rendering library (port of tiny-skia)
Loading...
Searching...
No Matches
BlendMode.h
Go to the documentation of this file.
1#pragma once
2
5
6#include <optional>
7
8#include "tiny_skia/Color.h"
9
10namespace tiny_skia {
11
14enum class BlendMode {
15 // Porter-Duff modes.
16 Clear,
17 Source,
21 SourceIn,
23 SourceOut,
27 Xor,
28 Plus,
29 Modulate,
30 // Advanced blend modes.
31 Screen,
32 Overlay,
33 Darken,
34 Lighten,
36 ColorBurn,
37 HardLight,
38 SoftLight,
40 Exclusion,
41 Multiply,
42 Hue,
44 Color,
46};
47
49[[nodiscard]] bool shouldPreScaleCoverage(BlendMode blendMode);
51[[nodiscard]] std::optional<pipeline::Stage> toStage(BlendMode blendMode);
52
53} // namespace tiny_skia
BlendMode
Blend mode for compositing source over destination. Includes Porter-Duff modes and advanced (separabl...
Definition BlendMode.h:14
@ SoftLight
Soft version of hard light.
@ Destination
Output is destination only.
@ Lighten
Maximum of source and destination.
@ Exclusion
Similar to Difference but lower contrast.
@ Difference
Absolute difference.
@ Saturation
Source saturation, destination hue and luminosity.
@ Screen
Inverse multiply.
@ Plus
Sum (clamped).
@ SourceOut
Source where destination is transparent.
@ DestinationOut
Destination where source is transparent.
@ DestinationIn
Destination where source is opaque.
@ Luminosity
Source luminosity, destination hue and saturation.
@ Overlay
Multiply or screen based on destination.
@ SourceIn
Source where destination is opaque.
@ Xor
Source XOR destination.
@ DestinationOver
Destination over source.
@ SourceAtop
Source atop destination.
@ DestinationAtop
Destination atop source.
@ ColorBurn
Darken destination toward source.
@ SourceOver
Source over destination (default).
@ Modulate
Component-wise multiply.
@ HardLight
Multiply or screen based on source.
@ Clear
Output is transparent.
@ Multiply
Component-wise multiply (with alpha handling).
@ ColorDodge
Brighten destination toward source.
@ Source
Output is source only.
@ Darken
Minimum of source and destination.
@ Hue
Source hue, destination saturation and luminosity.
Color types (8-bit and floating-point, straight and premultiplied).
Floating-point RGBA color [0,1] (straight alpha).
Definition Color.h:88