]> bicyclesonthemoon.info Git - ott/enhance/blob - enhance.c
Fixed the diff tool
[ott/enhance] / enhance.c
1 /*
2 enhance.c
3 The tool with multiple enhancements and manipulations of pictures
4 29.11.2022
5
6 Copyright (C) 2022  Balthasar SzczepaƄski
7
8 This program is free software: you can redistribute it and/or modify
9 it under the terms of the GNU Affero General Public License as
10 published by the Free Software Foundation, either version 3 of the
11 License, or (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 GNU Affero General Public License for more details.
17
18 You should have received a copy of the GNU Affero General Public License
19 along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
21
22 Requires Dev Image Library (libdevil) (http://openil.sourceforge.net/)
23 on Pentium III libdevil must be recompiled with
24 --disable-ssl2 --disable-ssl3
25 (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=572954)
26 */
27
28 #include <errno.h>
29 #include <string.h>
30
31 #include "core.h"
32 #include "info.h"
33 #include "nofading.h"
34 #include "bluenh.h"
35 #include "reveal.h"
36 #include "diff.h"
37
38 int main (int argc, char **argv)
39 {
40         int r;
41         char *error_text = NO_STR;
42         SUBTOOL_F *f;
43         
44         
45         if (argc < 2)
46                 finish(EINVAL, "No mode selected.\n");
47         
48         r = init();
49         if (r !=0)
50                 finish(r, INIT_FAILED);
51         
52         if (strcmp(argv[1], "nofading")==0)
53                 f = &subtool_nofading;
54         else if (strcmp(argv[1], "info")==0)
55                 f = &subtool_info;
56         else if (strcmp(argv[1], "bluenh")==0)
57                 f = &subtool_bluenh;
58         else if (strcmp(argv[1], "reveal")==0)
59                 f = &subtool_reveal;
60         else if (strcmp(argv[1], "diff")==0)
61                 f = &subtool_diff;
62         else
63                 finish(EINVAL, "Unknown mode.\n");
64         
65         r = f(argc, argv, 2, &error_text);
66         
67         if (r!=0)
68                 finish(r, error_text);
69         
70         finish(0, "");
71 }