-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathml6.h
58 lines (48 loc) · 978 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
49
50
51
52
53
54
55
56
57
58
/*========== 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
=========================*/
/*
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 color;
*/
#ifndef ML6_H
#define ML6_H
#define XRES 400
#define YRES 400
#define MAX_COLOR 255
/*
Every point has an individual int for
each color value
*/
struct point {
int red;
int green;
int blue;
};
/*
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 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 screen[XRES][YRES];
#endif