#include "grid.h" #include #include struct Grid grid_new(int width, int height) { struct Grid grid = {width, height, NULL}; grid.data = calloc(width * height, sizeof(uint8_t)); return grid; } void grid_free(struct Grid grid) { free(grid.data); }