11#include "../enum_metadata.hpp"
14namespace hi::inline
v1 {
27constexpr auto subpixel_orientation_metadata = enum_metadata{
28 subpixel_orientation::unknown,
"unknown",
29 subpixel_orientation::horizontal_rgb,
"horizontal RGB",
30 subpixel_orientation::horizontal_bgr,
"horizontal BGR",
31 subpixel_orientation::vertical_rgb,
"vertical RGB",
32 subpixel_orientation::vertical_bgr,
"vertical BGR",
40 switch (orientation) {
41 case subpixel_orientation::vertical_rgb:
42 case subpixel_orientation::vertical_bgr:
return extent2{1.0f, 1.0f / 3.0f};
43 case subpixel_orientation::horizontal_bgr:
44 case subpixel_orientation::horizontal_rgb:
return extent2{1.0f / 3.0f, 1.0f};
45 default:
return extent2{1.0f, 1.0f};
51template<
typename CharT>
52struct std::formatter<
hi::subpixel_orientation, CharT> : std::formatter<std::string_view, CharT> {
53 auto format(hi::subpixel_orientation
const &t,
auto &fc)
55 return std::formatter<std::string_view, CharT>::format(hi::subpixel_orientation_metadata[t], fc);
Defined the geo::extent, extent2 and extent3 types.
geo::extent< float, 2 > extent2
A 2D extent.
Definition extent.hpp:503
DOXYGEN BUG.
Definition algorithm.hpp:15
constexpr extent2 sub_pixel_size(subpixel_orientation orientation) noexcept
Get the size of a sub-pixel based on the sub-pixel orientation.
Definition subpixel_orientation.hpp:38
subpixel_orientation
The orientation of the RGB sub-pixels of and LCD/LED panel.
Definition subpixel_orientation.hpp:18
geometry/margins.hpp
Definition assert.hpp:18