-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.cpp
More file actions
27 lines (20 loc) · 705 Bytes
/
main.cpp
File metadata and controls
27 lines (20 loc) · 705 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
#include "include/image.h"
#include "include/image_qt.h"
int main(int argc, char *argv[])
{
if(argc != 4) {
printf("./Color_Transferring target.png source.png out.png\n");
return 1;
}
struct img_rgb_t *target = QImage_to_img_rgb(new QImage(argv[1]));
struct img_rgb_t *source = QImage_to_img_rgb(new QImage(argv[2]));
int wnd_ht = 25; // size of local windows
int wnd_wt = 25; // size of local windows
struct img_rgb_t *out = transfer_color(target, source, wnd_ht, wnd_wt);
QImage outImg = img_rgb_to_QImage(out);
outImg.save(argv[3], "PNG");
img_rgb_destruct(target);
img_rgb_destruct(source);
img_rgb_destruct(out);
return 0;
}