| 5 | #include <assert.h> |
| 6 | |
| 7 | static void test_agg(void) |
| 8 | { |
| 9 | const int WIDTH = 640; |
| 10 | const int HEIGHT = 480; |
| 11 | const int DEPTH = 4; |
| 12 | const int STRIDE = WIDTH * DEPTH; |
| 13 | |
| 14 | std::vector<uint8_t> data(STRIDE * HEIGHT, 255); |
| 15 | |
| 16 | Agg2D painter; |
| 17 | painter.attach(&data[0], WIDTH, HEIGHT, STRIDE); |
| 18 | painter.line(0, 0, WIDTH, HEIGHT); |
| 19 | |
| 20 | stbi_write_png("/tmp/test.png", WIDTH, HEIGHT, 4, &data[0], STRIDE); |
| 21 | } |
| 22 | |
| 23 | int main(int argc, const char* argv[]) |
| 24 | { |