-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathppm.h
82 lines (75 loc) · 2.99 KB
/
ppm.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/********************************************************************
* FILE: ppm.h
* -----------
* This is a library that aims to make importing images in the PPM
* and PGM formats easy to import and parse into appropriate data
* structures. This library depends on the "imgStruct.h" header.
*
* AUTHOR: David N. Robinson
* DATE: 09/17/2012
* LICENSE: GPLv3
*/
#ifndef UTILS_PPM
#define UTILS_PPM
/********************************************************************
* FUNCTION: importPPM(char* path, ColorImage image)
* -------------------------------------------------
* This function imports a PPM image file and parses it into a
* ColorImage struct. Once parsed, the image will be able to be
* manipulated by other functions.
*
* Here is an example, inputImg is a ColorImage, path is a char*
*
* importPPM(path, inputImg);
*/
void importPPM(char* path, ColorImage image);
/********************************************************************
* FUNCTION: importPGM(char* path, ColorImage image)
* -------------------------------------------------
* This function imports a PGM image file and parses it into a
* BWImage struct. Once parsed, the image will be able to be
* manipulated by other functions.
*
* Here is an example, inputImg is a ColorImage, path is a char*
*
* importPGM(path, inputImg);
*/
void importPGM(char* path, BWImage);
/********************************************************************
* FUCNTION: exportRGBPPM(char* path, ColorImage image)
* ----------------------------------------------------
* This function exports a PPM image file from the data contained
* within a ColorImage struct. Outputs to the path passed through
* the parameter. NB: THIS FUNCTION ONLY WORKS WITH AN RGB COLOR
* SPACE.
*
* Here is an example, outputImg is a ColorImage and path is a char*
*
* exportRGBPPM(path, outputImg);
*/
void exportRGBPPM(char* path, ColorImage image);
/********************************************************************
* FUNCTION: exportBinaryPGM(char* path, BinaryImage image)
* --------------------------------------------------------
* This function exports a PGM image file from the data contained
* within a BinaryImage struct. Outputs to the path passed through
* the parameter. This function only works with binary images.
*
* Here is an example, outputImg is a BinaryImage, path is a char*
*
* exportBinaryPGM(path, outputImg);
*/
void exportBinaryPGM(char* path, BinaryImage image);
/********************************************************************
* FUNCTION: exportBWPGM(char* path, BWImage image)
* ------------------------------------------------
* This function exports a PGM image file from the data contained
* within a BWImage struct. Outputs to the path passed through the
* parameter. This function only works with the bw images
*
* Here is an example, outputImg is a BWImage, path is a char*
*
* exportBWPGM(path, outputImg);
*/
void exportBWPGM(char* path, BWImage image);
#endif