|
@@ -8,7 +8,7 @@
|
|
|
namespace simple::graphical
|
|
|
{
|
|
|
|
|
|
- // TODO: this is to customize for YUV so this really needs to return a vector not just a number
|
|
|
+ // TODO: this really needs to return a vector not just a number, for individual limits per component
|
|
|
// better to support both probably
|
|
|
template <typename T>
|
|
|
class default_color_limits
|
|
@@ -23,6 +23,7 @@ namespace simple::graphical
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+ // TODO: rename to rgb_vector, with some generaliztions in vector might even be able to squezze sub byte types here (like rgb565), but things like yuv will need their own type.
|
|
|
template<typename Type, size_t Size, typename RGBA_Order = std::make_index_sequence<Size>, typename Limits = default_color_limits<Type>,
|
|
|
std::enable_if_t<Size == 3 || Size == 4>* = nullptr>
|
|
|
struct color_vector : public geom::vector<Type, Size, RGBA_Order>
|
|
@@ -34,6 +35,7 @@ namespace simple::graphical
|
|
|
return Limits::get();
|
|
|
}
|
|
|
|
|
|
+ // FIXME: got to somehow disable implicit convertions inherited from vector
|
|
|
using base::base;
|
|
|
|
|
|
// TODO: workaround for clang bug, that prevents inheriting the default constructor
|
|
@@ -156,6 +158,7 @@ namespace simple::graphical
|
|
|
|
|
|
};
|
|
|
|
|
|
+ // TODO: rename to rgb[a]_byte, rgb[a]_float
|
|
|
using rgb_pixel = color_vector<uint8_t, 3>;
|
|
|
using rgba_pixel = color_vector<uint8_t, 4>;
|
|
|
using rgb_vector = color_vector<float, 3>;
|