IDS peak ICV v1.0.0
Loading...
Searching...
No Matches
peak_icv_painter.hpp
Go to the documentation of this file.
1
11#pragma once
12
18#include <peak_icv_c/painting/peak_icv_painter.h>
19
20namespace peak
21{
22namespace icv
23{
24namespace experimental
25{
49{
50public:
57 explicit Painter(Image& image);
58
68 void SetColor(const Color& color);
69
79 void SetOpacity(const Opacity& opacity);
80
87 PEAK_ICV_NO_DISCARD Color GetColor() const;
88
95 PEAK_ICV_NO_DISCARD Opacity GetOpacity() const;
96
108 void Draw(const IDrawable& drawable) const;
109
110private:
111 detail::DrawingOptions m_drawingOptions;
112 Image& m_image;
113};
114
115inline void Painter::SetColor(const Color& color)
116{
117 m_drawingOptions.SetColor(color);
118}
119
120inline void Painter::SetOpacity(const Opacity& opacity)
121{
122 m_drawingOptions.SetOpacity(opacity);
123}
124
126{
127 return m_drawingOptions.GetColor();
128}
129
131{
132 return m_drawingOptions.GetOpacity();
133}
134
136 : m_image(image)
137{}
138
139inline void Painter::Draw(const IDrawable& drawable) const
140{
141 drawable.Draw(m_image, m_drawingOptions);
142}
143
144} /* namespace experimental */
145} /* namespace icv */
146} /* namespace peak */
For detailed information about the use of ids_peak_icv Image refer to the Image Guide.
void SetColor(const experimental::Color &color)
Set the color for drawing.
void SetOpacity(const experimental::Opacity &opacity)
Set the opacity for drawing.
experimental::Opacity GetOpacity() const
Get the opacity for drawing.
constexpr experimental::Color GetColor() const
Get the color for drawing.
Color class holding the actual color codes.
Base class for all drawables.
Opacity refers to the transparency or the degree to which an object or pixel allows the background to...
Class for painting simple things (e.g. a region) on images.
Color GetColor() const
Retrieve the current color for painting.
void SetColor(const Color &color)
Set the color for painting.
Painter(Image &image)
Constructs a Painter object.
void SetOpacity(const Opacity &opacity)
Sets the opacity for painting.
void Draw(const IDrawable &drawable) const
Draws the drawable onto the image, the painter was initialized with. For more info,...
Opacity GetOpacity() const
Retrieve the current opacity for painting.