diff options
| author | Syndamia <kamen@syndamia.com> | 2026-03-29 09:15:37 +0300 |
|---|---|---|
| committer | Syndamia <kamen@syndamia.com> | 2026-03-29 09:15:37 +0300 |
| commit | c7f5780d3b67da9c57d658994bcff298e6a1cac9 (patch) | |
| tree | 8d7d5bcc76d1df2cf02f34524fb678cf8489c1dc /RGBImage/RGBImage.h | |
| parent | e3412d642f75fdd0e558f4403cf21dcae4d38766 (diff) | |
| download | ppm_graphics-c7f5780d3b67da9c57d658994bcff298e6a1cac9.tar ppm_graphics-c7f5780d3b67da9c57d658994bcff298e6a1cac9.tar.gz ppm_graphics-c7f5780d3b67da9c57d658994bcff298e6a1cac9.zip | |
chore: Rework file layout and add make script
Diffstat (limited to 'RGBImage/RGBImage.h')
| -rw-r--r-- | RGBImage/RGBImage.h | 35 |
1 files changed, 35 insertions, 0 deletions
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 <stdio.h> + +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 */ |
