-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfilter.c
More file actions
38 lines (31 loc) · 720 Bytes
/
filter.c
File metadata and controls
38 lines (31 loc) · 720 Bytes
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
#include <stdio.h>
#include "lodepng.h"
#include "helpers.h"
void blur(Pixel_array *data);
void blur_parallel(Pixel_array *data);
int main(int argc, char **argv)
{
if (argc != 3)
{
printf ("\nusuage ./filter [imgname] [newname]\n");
return 1;
}
IMG image;
unsigned err = decodeImg(argv[1], &image);
if (err)
{
printf("error %u: %s\n", err, lodepng_error_text(err));
return 1;
}
Pixel_array data;
GetRGB(&image, &data);
blur_parallel(&data);
SetRGB(&data, &image);
err = encodeImg(argv[2], &image);
if (err)
{
printf ("error %d: %s\n", err, lodepng_error_text(err));
return 1;
}
return 0;
}