| 15 | // --- Helper: create solid-color RGBA test image --- |
| 16 | |
| 17 | static std::vector<uint8_t> solidRGBA(int w, int h, uint8_t r, uint8_t g, uint8_t b, uint8_t a) |
| 18 | { |
| 19 | std::vector<uint8_t> data(w * h * 4); |
| 20 | for (int i = 0; i < w * h; ++i) |
| 21 | { |
| 22 | data[i * 4 + 0] = r; |
| 23 | data[i * 4 + 1] = g; |
| 24 | data[i * 4 + 2] = b; |
| 25 | data[i * 4 + 3] = a; |
| 26 | } |
| 27 | return data; |
| 28 | } |
| 29 | |
| 30 | // --- Helper: gradient RGBA test image --- |
| 31 |