10#include "../geometry/geometry.hpp"
11#include "../utility/utility.hpp"
12#include "../macros.hpp"
15hi_export_module(hikogui.settings.subpixel_orientation);
17hi_export
namespace hi::inline
v1 {
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",
43 switch (orientation) {
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};
56struct std::formatter<
hi::subpixel_orientation, char> : std::formatter<std::string_view, char> {
57 auto format(hi::subpixel_orientation
const &t,
auto &fc)
const
59 return std::formatter<std::string_view, char>::format(hi::subpixel_orientation_metadata[t], fc);
The HikoGUI namespace.
Definition array_generic.hpp:20
DOXYGEN BUG.
Definition algorithm_misc.hpp:20
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