-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathimage_processor.cpp
More file actions
27 lines (24 loc) · 810 Bytes
/
Copy pathimage_processor.cpp
File metadata and controls
27 lines (24 loc) · 810 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
//
// created by kacchan on 2024/3/27
//
#include <iostream>
#include "parser/arg_parser.h"
#include "objects/Image/image.h"
#include "filters/filter_apply.cpp"
#include "reader/reader.h"
#include "writer/writer.h"
int main(int argc, char** argv) {
try {
ArgParser parsed_args(argc, argv);
const char* filename = parsed_args.input_file_;
Reader reader(filename);
Image image = reader.Read();
std::vector<ArgParser::FilterInfo> filters = parsed_args.filters_;
ApplyFilters(filters, image);
Writer::WriteFile(parsed_args.output_file_, image);
std::cout << "Image saved as " << parsed_args.output_file_ << std::endl;
} catch (std::exception& error) {
std::cerr << "Error: " << error.what() << std::endl;
return 1;
}
}