]> bicyclesonthemoon.info Git - ott/enhance/blob - enhance.c
reveal online
[ott/enhance] / enhance.c
1 /*
2 enhance.c
3 The tool with multiple enhancements and manipulations of pictures
4 03.12.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 #include "npb.h"
38 #include "pal_mix.h"
39 #include "pal_unmix.h"
40 #include "pal_mixdiff.h"
41 #include "remap_t_1.h"
42
43 int main (int argc, char **argv)
44 {
45         int r;
46         char *error_text = NO_STR;
47         SUBTOOL_F *f;
48         
49         
50         if (argc < 2)
51                 finish(EINVAL, "No mode selected.\n");
52         
53         r = init();
54         if (r !=0)
55                 finish(r, INIT_FAILED);
56         
57         if (strcmp(argv[1], "nofading")==0)
58                 f = &subtool_nofading;
59         else if (strcmp(argv[1], "info")==0)
60                 f = &subtool_info;
61         else if (strcmp(argv[1], "bluenh")==0)
62                 f = &subtool_bluenh;
63         else if (strcmp(argv[1], "reveal")==0)
64                 f = &subtool_reveal;
65         else if (strcmp(argv[1], "diff")==0)
66                 f = &subtool_diff;
67         else if (strcmp(argv[1], "npb")==0)
68                 f = &subtool_npb;
69         else if (strcmp(argv[1], "pal_mix")==0)
70                 f = &subtool_pal_mix;
71         else if (strcmp(argv[1], "pal_unmix")==0)
72                 f = &subtool_pal_unmix;
73         else if (strcmp(argv[1], "pal_mixdiff")==0)
74                 f = &subtool_pal_mixdiff;
75         else if (strcmp(argv[1], "remap_t_1")==0)
76                 f = &subtool_remap_t_1;
77         else
78                 finish(EINVAL, "Unknown mode.\n");
79         
80         r = f(argc, argv, 2, &error_text);
81         
82         if (r!=0)
83                 finish(r, error_text);
84         
85         finish(0, "");
86 }