10#include "../geometry/module.hpp"
11#include "../utility/utility.hpp"
12#include "../macros.hpp"
15hi_export_module(hikogui.settings.subpixel_orientation);
30constexpr auto subpixel_orientation_metadata = enum_metadata{
31 subpixel_orientation::unknown,
"unknown",
32 subpixel_orientation::horizontal_rgb,
"horizontal RGB",
33 subpixel_orientation::horizontal_bgr,
"horizontal BGR",
34 subpixel_orientation::vertical_rgb,
"vertical RGB",
35 subpixel_orientation::vertical_bgr,
"vertical BGR",
44 case subpixel_orientation::vertical_rgb:
45 case subpixel_orientation::vertical_bgr:
return extent2{1.0f, 1.0f / 3.0f};
46 case subpixel_orientation::horizontal_bgr:
47 case subpixel_orientation::horizontal_rgb:
return extent2{1.0f / 3.0f, 1.0f};
48 default:
return extent2{1.0f, 1.0f};
54template<
typename CharT>
55struct std::formatter<
hi::subpixel_orientation, CharT> : std::formatter<std::string_view, CharT> {
56 auto format(hi::subpixel_orientation
const &t,
auto &fc)
const
58 return std::formatter<std::string_view, CharT>::format(hi::subpixel_orientation_metadata[t], fc);
DOXYGEN BUG.
Definition algorithm.hpp:16
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:41
subpixel_orientation
The orientation of the RGB sub-pixels of and LCD/LED panel.
Definition subpixel_orientation.hpp:21
geometry/margins.hpp
Definition lookahead_iterator.hpp:5
constexpr Out narrow_cast(In const &rhs) noexcept
Cast numeric values without loss of precision.
Definition cast.hpp:377