IDS peak ICV v1.0.0
Loading...
Searching...
No Matches
peak_icv_drawing_options.hpp
Go to the documentation of this file.
1
11#pragma once
12
14
18#include <peak_icv_c/painting/peak_icv_color.h>
19#include <peak_icv_c/painting/peak_icv_painter.h>
20#include <peak_icv_c/types/peak_icv_simple_types.h>
21
22namespace peak
23{
24namespace icv
25{
26namespace detail
27{
35{
36public:
42 DrawingOptions() = default;
43
51 PEAK_ICV_NO_DISCARD constexpr experimental::Color GetColor() const;
52
60 PEAK_ICV_NO_DISCARD experimental::Opacity GetOpacity() const;
61
67 void SetColor(const experimental::Color& color);
68
74 void SetOpacity(const experimental::Opacity& opacity);
75
76 bool operator==(const DrawingOptions& other) const;
77
78private:
79 friend peak::common::detail::BackendAccessor<DrawingOptions>;
80
81 explicit operator peak_icv_drawing_options() const;
82
84 experimental::Opacity m_opacity{ 100 };
85 size_t m_reserved{};
86};
87
89{
90 return m_color;
91}
92
94{
95 return m_opacity;
96}
97
99{
100 m_color = color;
101}
102
104{
105 m_opacity = opacity;
106}
107
108inline DrawingOptions::operator peak_icv_drawing_options() const // NOLINT
109{
110 return { m_color.GetRaw(), m_opacity.GetValue(), m_reserved };
111}
112
113inline bool DrawingOptions::operator==(const DrawingOptions& other) const
114{
115 return m_color == other.m_color && m_opacity.GetValue() == other.m_opacity.GetValue();
116}
117
118} // namespace detail
119} /* namespace icv */
120} /* namespace peak */
void SetColor(const experimental::Color &color)
Set the color for drawing.
DrawingOptions()=default
Default Drawing options are red with 100% opacity.
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.
bool operator==(const DrawingOptions &other) const
Color class holding the actual color codes.
Opacity refers to the transparency or the degree to which an object or pixel allows the background to...
constexpr uint32_t GetValue() const
Retrieve the current opacity value.