-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimage_editor.c
40 lines (29 loc) · 915 Bytes
/
image_editor.c
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
#include <stdio.h>
#include <stdlib.h>
/*
* Include the function prototypes of all those functions implemented in image_processing.c.
* Do not remove or modify them in any way.
*/
void remove_red();
void convert_to_black_and_white();
void instagram_square();
int main(int argc, char *argv[]) {
/* Task 1 needs to be completed here: Make sure that the command line arguments are correct. In case an error exists,
* print the error message and terminate the program. Otherwise, invoke the corresponding
* image processing function. */
int request = strtol(argv[1], NULL, 10);
if (request == 1){
remove_red();
}
else if (request == 2){
convert_to_black_and_white();
}
else if (request == 3){
instagram_square();
}
else {
fprintf(stderr, "You have made an invalid request, you did not enter either 1, 2, or 3\n");
return 1;
}
return 0;
}