roo_display
API Documentation for roo_display
Loading...
Searching...
No Matches
blending.cpp
Go to the documentation of this file.
2
3namespace roo_display {
4namespace {
5
6const char* ToString(BlendingMode mode) {
7 switch (mode) {
9 return "BlendingMode::kSource";
11 return "BlendingMode::kSourceOver";
13 return "BlendingMode::kSourceIn";
15 return "BlendingMode::kSourceAtop";
17 return "BlendingMode::kDestination";
19 return "BlendingMode::kDestinationOver";
21 return "BlendingMode::kDestinationIn";
23 return "BlendingMode::kDestinationAtop";
25 return "BlendingMode::kClear";
27 return "BlendingMode::kSourceOut";
29 return "BlendingMode::kDestinationOut";
31 return "BlendingMode::kXor";
33 return "BlendingMode::kSourceOverOpaque";
35 return "BlendingMode::kDestinationOverOpaque";
36 }
37 return "BlendingMode::(unknown)";
38}
39
40const char* ToString(TransparencyMode mode) {
41 switch (mode) {
43 return "TransparencyMode::kNone";
45 return "TransparencyMode::kCrude";
47 return "TransparencyMode::kFull";
48 }
49 return "TransparencyMode::(unknown)";
50}
51
52} // namespace
53
54roo_logging::Stream& operator<<(roo_logging::Stream& os, BlendingMode mode) {
55 return os << ToString(mode);
56}
57
58roo_logging::Stream& operator<<(roo_logging::Stream& os,
59 TransparencyMode mode) {
60 return os << ToString(mode);
61}
62
63} // namespace roo_display
Defines 140 opaque HTML named colors.
BlendingMode
Porter-Duff style blending modes.
Definition blending.h:17
@ kDestinationOver
Destination is placed over the source.
@ kDestinationIn
Destination which overlaps the source, replaces the source.
@ kDestinationOut
Destination is placed, where it falls outside of the source.
@ kSourceOverOpaque
Similar to kSourceOver, but assumes that the destination is opaque.
@ kXor
The non-overlapping regions of source and destination are combined.
@ kDestination
Only the destination will be present.
@ kSource
The new ARGB8888 value completely replaces the old one.
@ kDestinationAtop
Destination which overlaps the source replaces the source. Source is placed elsewhere.
@ kSourceIn
The source that overlaps the destination, replaces the destination.
@ kSourceAtop
Source which overlaps the destination, replaces the destination. Destination is placed elsewhere.
@ kDestinationOverOpaque
Similar to kDestinationOver, but assumes that the source is opaque.
@ kClear
No regions are enabled.
@ kSourceOver
Source is placed (alpha-blended) over the destination. This is the default blending mode.
@ kSourceOut
Source is placed, where it falls outside of the destination.
TransparencyMode
Transparency information for a stream or color mode.
Definition blending.h:103
@ kNone
All colors are fully opaque.
@ kCrude
Colors are either fully opaque or fully transparent.
@ kFull
Colors may include partial transparency (alpha channel).
roo_logging::Stream & operator<<(roo_logging::Stream &os, BlendingMode mode)
Definition blending.cpp:54