-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimage.h
27 lines (20 loc) · 948 Bytes
/
image.h
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
27
#ifndef IMAGE_H
#define IMAGE_H
#include <stdint.h>
#define MAX(x, y) (((x) > (y)) ? (x) : (y))
#define MIN(x, y) (((x) < (y)) ? (x) : (y))
#define BYTES_PER_PIXEL 3
typedef uint8_t BYTE;
typedef struct {
BYTE Red;
BYTE Green;
BYTE Blue;
} Pixel_t;
// Prototypes
void colorPixel(int width, int height, Pixel_t image[width][height], int x, int y, int r, int g, int b);
void colorBackground(int width, int height, Pixel_t image[width][height], int r, int g, int b);
void drawLine(int width, int height, Pixel_t image[width][height], int x1, int y1, int x2, int y2, int r, int g, int b);
void colorCircle(int width, int height, Pixel_t image[width][height], int xc, int yc, int x, int y, int r, int g, int b);
void drawCircle(int width, int height, Pixel_t image[width][height], int xc, int yc, int radius, int r, int g, int b);
void saveImage(int width, int height, Pixel_t image[width][height], char* filename);
#endif // IMAGE_H