move test.h to libkmstest
[android/external-libkmsxx.git] / libkmstest / color.h
1 #pragma once
3 #include <cstdint>
5 namespace kms
6 {
7 struct YUV;
9 struct RGB
10 {
11         RGB();
12         RGB(uint8_t r, uint8_t g, uint8_t b);
14         uint16_t rgb565() const;
15         YUV yuv() const;
17         union {
18                 struct
19                 {
20                         uint8_t b;
21                         uint8_t g;
22                         uint8_t r;
23                         uint8_t a;
24                 };
26                 uint32_t raw;
27         };
28 };
30 struct YUV
31 {
32         YUV();
33         YUV(uint8_t y, uint8_t u, uint8_t v);
34         YUV(const RGB& rgb);
36         union {
37                 struct
38                 {
39                         uint8_t v;
40                         uint8_t u;
41                         uint8_t y;
42                         uint8_t a;
43                 };
45                 uint32_t raw;
46         };
47 };
48 }