Files
batomorph/demo.c
2025-09-23 15:35:26 +01:00

28 lines
420 B
C

#include "ff.h"
#include <math.h>
#include <unistd.h>
#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;
}