From c7f5780d3b67da9c57d658994bcff298e6a1cac9 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sun, 29 Mar 2026 09:15:37 +0300 Subject: chore: Rework file layout and add make script --- RGBImage/RGBImage.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 RGBImage/RGBImage.h (limited to 'RGBImage/RGBImage.h') diff --git a/RGBImage/RGBImage.h b/RGBImage/RGBImage.h new file mode 100644 index 0000000..8980f7b --- /dev/null +++ b/RGBImage/RGBImage.h @@ -0,0 +1,35 @@ +#ifndef _RGBIMAGE +#define _RGBIMAGE + +#include "../global.h" +#include + +typedef uint8_t byte; +typedef uint32_t color; + +typedef struct ARGB { + byte a; + byte r; + byte g; + byte b; +} ARGB; + +void ARGB_merge(ARGB* bottom, color top); +void ARGB_mergeARGB(ARGB* bottom, ARGB top); +void ARGB_set(ARGB* rgb, color color); + +typedef struct RGBImage { + u32 width; + u32 height; + ARGB* img; +} RGBImage; + +RGBImage RGBImage_new(u32 width, u32 height); +void RGBImage_free(RGBImage img); +void RGBImage_delete(RGBImage* img); +ARGB* RGBImage_at(RGBImage img, int row, int col); + +int ppm6_write(FILE* f, RGBImage img); +RGBImage ppm_read(FILE* f); + +#endif /* _RGBIMAGE */ -- cgit v1.2.3