-
Notifications
You must be signed in to change notification settings - Fork 0
/
ml6.h
48 lines (39 loc) · 835 Bytes
/
ml6.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*========== ml6.h ==========
Header file for fucntions we will use in ml6
Sets the maximum XYES and YRES for images as well
as the maximum color value you want to use.
Creates the point structure in order to represent
a pixel as a color triple
=========================*/
#ifndef ML6_H
#define ML6_H
#define XRES 500
#define YRES 500
#define MAX_COLOR 255
/*
Every point has an individual int for
each color value
*/
struct point_t {
int red;
int green;
int blue;
} point_t;
/*
We can now use color as a data type representing a point.
eg:
color c;
c.red = 0;
c.green = 45;
c.blue = 187;
*/
typedef struct point_t color;
/*
Likewise, we can use screen as a data type representing
an XRES x YRES array of colors.
eg:
screen s;
s[0][0] = c;
*/
typedef struct point_t screen[XRES][YRES];
#endif