-
Notifications
You must be signed in to change notification settings - Fork 68
/
pgm.h
43 lines (32 loc) · 844 Bytes
/
pgm.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
// Source: https://sun.iwu.edu/~shelley/sie/zoo/journal/pgm.h.html
#ifndef PGM_H
#define PGM_H
/*max size of an image*/
#define MAX 800
#ifdef __cplusplus
extern "C" {
#endif
/*
#define LOW_VALUE 0
#define HIGH_VALUE 255
*/
/*RGB color struct with integral types*/
typedef struct { unsigned char red;
unsigned char green;
unsigned char blue;
} RGB_INT;
struct PGMstructure {
int maxVal;
int width;
int height;
RGB_INT data[MAX][MAX];
};
typedef struct PGMstructure PGMImage;
/***prototypes**********************************************************/
/***********************************************************************/
void getPGMfile(const char *filename, PGMImage *img);
void savePGMfile(const char *filename, PGMImage *img);
#ifdef __cplusplus
}
#endif
#endif