File tree Expand file tree Collapse file tree 3 files changed +80
-0
lines changed Expand file tree Collapse file tree 3 files changed +80
-0
lines changed Original file line number Diff line number Diff line change 1+ = `gf::ColorMap` type
2+ v0.1
3+ include::bits/attributes.adoc[]
4+ :toc: right
5+
6+ A color map can compute a color by interpolating of predefined colors.
7+
8+ xref:core_color.adoc[< Back to `core` Color]
9+
10+ == Description
11+
12+ [source]
13+ ----
14+ #include <gf2/core/ColorMap.h>
15+ class ColorMap;
16+ ----
17+
18+ == Member Functions
19+
20+ === `add_color_stop`
21+
22+ [source]
23+ ----
24+ void add_color_stop(float offset, const Color& color);
25+ ----
26+
27+ Add a reference color with a predefined offset.
28+
29+ See also: <<compute_color>>
30+
31+ === `clear`
32+
33+ [source]
34+ ----
35+ void clear();
36+ ----
37+
38+ Clear the color map.
39+
40+ See also: <<empty>>
41+
42+
43+ === `compute_color`
44+
45+ [source]
46+ ----
47+ Color compute_color(float offset) const;
48+ ----
49+
50+ Compute a color associated to the given offset.
51+
52+ See also: <<add_color_stop>>
53+
54+
55+ === `empty`
56+
57+ [source]
58+ ----
59+ bool empty() const;
60+ ----
61+
62+ Tell if the color map is empty.
63+
64+ See also: <<clear>>
Original file line number Diff line number Diff line change @@ -198,6 +198,17 @@ struct Color;
198198
199199A color in the link:https://en.wikipedia.org/wiki/RGB_color_model[RGB color model]. xref:Color.adoc[*Read more...*].
200200
201+ [#color_map]
202+ === `gf::ColorMap`
203+
204+ [source]
205+ ----
206+ #include <gf2/core/ColorMap.h>
207+ class ColorMap;
208+ ----
209+
210+ A color map can compute a color by interpolating of predefined colors. xref:ColorMap.adoc[*Read more...*].
211+
201212[#image]
202213=== `gf::Image`
203214
Original file line number Diff line number Diff line change @@ -12,6 +12,11 @@ namespace gf {
1212
1313 class GF_CORE_API ColorRamp {
1414 public:
15+ void clear ()
16+ {
17+ m_mapping.clear ();
18+ }
19+
1520 bool empty () const
1621 {
1722 return m_mapping.empty ();
You can’t perform that action at this time.
0 commit comments