aboutsummaryrefslogtreecommitdiff
path: root/include/lib/png.h
blob: ddc1db3a1927ddd38c85adbe26d85ec8f981e6fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#ifndef INC_LIB_PNG_H
#define INC_LIB_PNG_H

#include <stdint.h>
#include <sys/types.h>

#define PixelChannel_t uint8_t
#define PixelSize_t uint8_t
#define PixelDepth_t uint8_t

struct pixel_t {
  PixelChannel_t red;
  PixelChannel_t green;
  PixelChannel_t blue;
};

struct bitmap_t {
  struct pixel_t* image_buffer;
  size_t width;
  size_t height;
};

// Save bitmap to file
void save_png(struct bitmap_t* bitmap, char* fname);

#endif