28 #ifndef YCL_INC_VIDEO_H_
29 #define YCL_INC_VIDEO_H_ 1
37 typedef std::uint16_t
SDst;
44 # define YCL_PIXEL_FORMAT_AXYZ1555
58 return px & 1 << 15 ? 0xFF : 0;
76 FetchPixel(std::uint8_t r, std::uint8_t g, std::uint8_t b)
78 return r >> 3 | std::uint16_t(g >> 3) << 5 | std::uint16_t(b >> 3) << 10;
81 # define DefColorH_(hex, name) name = \
82 (FetchPixel(((hex) >> 16) & 0xFF, ((hex) >> 8) & 0xFF, (hex) & 0xFF) \
96 std::uint8_t rgbGreen;
98 std::uint8_t rgbReserved;
108 return px.rgbReserved;
118 return {px.rgbBlue, px.rgbGreen, px.rgbRed, 0xFF};
126 FetchPixel(std::uint8_t r, std::uint8_t g, std::uint8_t b)
128 return r | g << 8 | std::uint32_t(b) << 16;
137 # define DefColorH_(hex, name) name = (FetchPixel((((hex) >> 16) & 0xFF), \
138 (((hex) >> 8) & 0xFF), ((hex) & 0xFF)) << 8 | 0xFF)
140 # error Unsupported platform found!
151 #define HexAdd0x(hex) 0x##hex
152 #define DefColorH(hex_, name) DefColorH_(HexAdd0x(hex_), name)
161 typedef enum : std::uint32_t
215 : r(0), g(0), b(0), a(0)
224 : r(px << 3 & 248), g(px >> 2 & 248), b(px >> 7 & 248),
227 : r(px.rgbRed), g(px.rgbGreen), b(px.rgbBlue), a(px.rgbReserved)
229 # error Unsupport platform found!
239 : r((cs & 0xFF00) >> 8), g((cs & 0xFF0000) >> 16),
240 b((cs & 0xFF000000) >> 24), a(0xFF)
249 : r(r_), g(g_), b(b_), a(a_)
256 template<
typename _tScalar>
270 return int(a != 0) << 15 |
FetchPixel(r, g, b);
274 # error Unsupport platform found!
380 namespace platform_ex