IDS peak ICV v1.2.0
Loading...
Searching...
No Matches
peak_icv_painter.hpp
Go to the documentation of this file.
1
11#pragma once
12
13#include <peak_common_c/detail/peak_common_defines.h>
18#include <peak_icv_c/painting/peak_icv_painter.h>
19
20namespace peak
21{
22namespace icv
23{
24
45{
46public:
54 explicit Painter(Image& image);
55
65 void SetColor(const Color& color);
66
76 void SetOpacity(const Opacity& opacity);
77
83 PEAK_COMMON_NO_DISCARD Color GetColor() const;
84
90 PEAK_COMMON_NO_DISCARD Opacity GetOpacity() const;
91
104 void Draw(const IDrawable& drawable) const;
105
106private:
107 detail::DrawingOptions m_drawingOptions;
108 Image& m_image;
109};
110
111inline void Painter::SetColor(const Color& color)
112{
113 m_drawingOptions.SetColor(color);
114}
115
116inline void Painter::SetOpacity(const Opacity& opacity)
117{
118 m_drawingOptions.SetOpacity(opacity);
119}
120
122{
123 return m_drawingOptions.GetColor();
124}
125
127{
128 return m_drawingOptions.GetOpacity();
129}
130
132 : m_image(image)
133{}
134
135inline void Painter::Draw(const IDrawable& drawable) const
136{
137 drawable.Draw(m_image, m_drawingOptions);
138}
139
140} /* namespace icv */
141} /* namespace peak */
Holds a color code composed of red, green, and blue components.
Base class for all drawables.
For detailed information about the use of ids_peak_icv Image refer to the Image Guide.
Holds an opacity value representing the transparency level of an object or pixel.
Provides functionality for painting drawable objects on images.
void SetColor(const Color &color)
Sets the color for painting.
Painter(Image &image)
Constructs a Painter with the target image.
void SetOpacity(const Opacity &opacity)
Sets the opacity for painting.
void Draw(const IDrawable &drawable) const
Draws the specified drawable object onto the image.
Opacity GetOpacity() const
constexpr Color GetColor() const
Get the color for drawing.
void SetColor(const Color &color)
Set the color for drawing.
void SetOpacity(const Opacity &opacity)
Set the opacity for drawing.
Opacity GetOpacity() const
Get the opacity for drawing.