13#include <peak_common_c/detail/peak_common_defines.h>
14#include <peak_icv_c/painting/peak_icv_painter.h>
64 Black = PEAK_ICV_COLOR_BLACK,
70 Red = PEAK_ICV_COLOR_RED,
76 Red8 = PEAK_ICV_COLOR_RED_8,
82 Red10 = PEAK_ICV_COLOR_RED_10,
88 Red12 = PEAK_ICV_COLOR_RED_12,
94 Green = PEAK_ICV_COLOR_GREEN,
100 Green8 = PEAK_ICV_COLOR_GREEN_8,
106 Green10 = PEAK_ICV_COLOR_GREEN_10,
112 Green12 = PEAK_ICV_COLOR_GREEN_12,
118 Blue = PEAK_ICV_COLOR_BLUE,
124 Blue8 = PEAK_ICV_COLOR_BLUE_8,
130 Blue10 = PEAK_ICV_COLOR_BLUE_10,
136 Blue12 = PEAK_ICV_COLOR_BLUE_12
168 constexpr explicit Color(uint64_t colorCodeRaw)
169 : m_colorCode{ colorCodeRaw }
181 constexpr Color(uint16_t red, uint16_t green, uint16_t blue)
182 :
Color(PEAK_ICV_COLOR_CODE(red, green, blue))
195 constexpr Color(uint8_t red, uint8_t green, uint8_t blue, uint8_t numBitsPerPixels)
196 :
Color(PEAK_ICV_COLOR_CODE(red * ((1 << numBitsPerPixels) - 1) / 255, green * ((1 << numBitsPerPixels) - 1) / 255,
197 blue * ((1 << numBitsPerPixels) - 1) / 255))
208 : m_colorCode{ static_cast<uint64_t>(colorCode) }
216 PEAK_COMMON_NO_DISCARD
constexpr uint16_t
GetRed()
const
218 return static_cast<uint16_t
>(PEAK_ICV_COLOR_RED_FROM_CODE(m_colorCode));
226 PEAK_COMMON_NO_DISCARD
constexpr uint16_t
GetGreen()
const
228 return static_cast<uint16_t
>(PEAK_ICV_COLOR_GREEN_FROM_CODE(m_colorCode));
236 PEAK_COMMON_NO_DISCARD
constexpr uint16_t
GetBlue()
const
238 return static_cast<uint16_t
>(PEAK_ICV_COLOR_BLUE_FROM_CODE(m_colorCode));
246 PEAK_COMMON_NO_DISCARD
constexpr std::tuple<red_t, green_t, blue_t>
GetRGB()
const
256 PEAK_COMMON_NO_DISCARD
constexpr uint64_t
GetRaw()
const
268 return m_colorCode == rhs.m_colorCode;
278 return !(rhs == *
this);
288 return m_colorCode ==
static_cast<uint64_t
>(rhs);
298 return !(*
this == rhs);
302 uint64_t m_colorCode{};
Holds a color code composed of red, green, and blue components.
constexpr uint16_t GetGreen() const
constexpr uint16_t GetRed() const
constexpr Color(uint16_t red, uint16_t green, uint16_t blue)
Constructs a Color from separate red, green, and blue values.
constexpr Color(ColorConstant colorCode)
Constructs a Color from a predefined ColorConstant.
constexpr uint64_t GetRaw() const
constexpr Color(uint8_t red, uint8_t green, uint8_t blue, uint8_t numBitsPerPixels)
Constructs a Color from separate red, green, and blue values.
constexpr bool operator!=(const ColorConstant &rhs) const
constexpr std::tuple< red_t, green_t, blue_t > GetRGB() const
constexpr bool operator==(const ColorConstant &rhs) const
constexpr uint16_t GetBlue() const
constexpr bool operator!=(const Color &rhs) const
constexpr bool operator==(const Color &rhs) const
constexpr Color()=default
Constructs a default Color initialized to black.
constexpr Color(uint64_t colorCodeRaw)
Constructs a Color from a raw 64-bit color code containing RGB values.
uint16_t red_t
Represents the red component of a color.
uint16_t green_t
Represents the green component of a color.
ColorConstant
Represents predefined color constants.
uint16_t blue_t
Represents the blue component of a color.
@ Green8
Represents green with 8-bit intensity.
@ Blue8
Represents blue with 8-bit intensity.
@ Green10
Represents green with 10-bit intensity.
@ Red10
Represents red with 10-bit intensity.
@ Blue12
Represents blue with 12-bit intensity.
@ Red8
Represents red with 8-bit intensity.
@ Green12
Represents green with 12-bit intensity.
@ Blue
Represents blue with 8-bit intensity.
@ Red12
Represents red with 12-bit intensity.
@ Blue10
Represents blue with 10-bit intensity.
@ Green
Represents green with 8-bit intensity.
@ Black
Represents black with 8-bit intensity.
@ Red
Represents red with 8-bit intensity.