forked from vchukanov/cppimagefilterbase
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
35 lines (31 loc) · 789 Bytes
/
main.cpp
File metadata and controls
35 lines (31 loc) · 789 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
#include <iostream>
#include "png_toolkit.h"
#include "filter.h"
#include "parseconfig.h"
#include <vector>
int main( int argc, char *argv[] )
{
// toolkit filter_name base_pic_name sudent_tool student_pic_name limitPix limitMSE
// toolkit near test images!
try
{
if (argc != 4)
throw "Not enough arguments";
png_toolkit studTool;
ParseConfig parse;
vector<configData> data;
data = parse.readConfig(argv[1]);
studTool.load(argv[2]);
image_data imgData = studTool.getPixelData();
Filters filters;
for (auto elem : data)
filters.doFilter(elem, imgData);
studTool.save(argv[3]);
}
catch (const char *str)
{
std::cout << "Error: " << str << std::endl;
return 1;
}
return 0;
}