diff --git a/demo.c b/demo.c new file mode 100644 index 0000000..078f417 --- /dev/null +++ b/demo.c @@ -0,0 +1,27 @@ +#include "ff.h" + +#include +#include + +#define W 800 +#define H 600 + +int main() +{ + pix_t pix[W * H] = {}; + img_t img = { .w = W, .h = H, .pix = pix }; + + for (unsigned y = 0; y < H; ++y) { + for (unsigned x = 0; x < W; ++x) { + pix_t *out = pix + (W * y + x); + out->r = 0xffff * x / W; + out->g = 0; + out->b = 0xffff * y / H; + out->a = 0xffff; + } + } + + ff_write(STDOUT_FILENO, img); + + return 0; +}