| 73 | } |
| 74 | |
| 75 | static void rgbaToRGB565(const uint8_t* src, uint8_t* dst, int w, int h) |
| 76 | { |
| 77 | auto* out = reinterpret_cast<uint16_t*>(dst); |
| 78 | for (int i = 0; i < w * h; ++i) |
| 79 | { |
| 80 | uint8_t r = src[i * 4 + 0] >> 3; |
| 81 | uint8_t g = src[i * 4 + 1] >> 2; |
| 82 | uint8_t b = src[i * 4 + 2] >> 3; |
| 83 | out[i] = (r << 11) | (g << 5) | b; |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | static void rgbaToAI88(const uint8_t* src, uint8_t* dst, int w, int h) |
| 88 | { |