diff options
| author | Syndamia <kamen@syndamia.com> | 2026-03-15 12:23:21 +0200 |
|---|---|---|
| committer | Syndamia <kamen@syndamia.com> | 2026-03-15 12:23:21 +0200 |
| commit | 2202e87c466803eeaddd974006aa9950d8e0d067 (patch) | |
| tree | 55cac9843e5789ac6ff29345ecd4fc44775c6b31 /RGBImage.h | |
| parent | 47e28b44615b9b068776f61b8741ea8692461c1d (diff) | |
| download | ppm_graphics-master.tar ppm_graphics-master.tar.gz ppm_graphics-master.zip | |
Diffstat (limited to 'RGBImage.h')
| -rw-r--r-- | RGBImage.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/RGBImage.h b/RGBImage.h new file mode 100644 index 0000000..ba32785 --- /dev/null +++ b/RGBImage.h @@ -0,0 +1,35 @@ +#ifndef _RGBIMAGE +#define _RGBIMAGE + +#include "global.h" +#include <stdio.h> + +typedef uint8_t byte; +typedef uint16_t byte2; +typedef uint32_t byte4; + +typedef struct ARGB { + byte a; + byte r; + byte g; + byte b; +} ARGB; + +void ARGB_set(ARGB* rgb, byte4 color); +void ARGB_merge(ARGB* bottom, ARGB top); + +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 */ |
