3 The online interface for the fading enhancement tool
6 Copyright (C) 2015, 2022 Balthasar Szczepański
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.
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.
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/>.
21 Requires cgilib (http://www.infodrom.org/projects/cgilib/)
34 #include "online-core.h"
38 char *inpix, char *outpix,
40 uint_fast8_t individual_channels,
41 uint_fast8_t enhance_alpha,
42 uint_fast8_t remove_alpha
45 int main (int argc, char *argv[])
53 uint_fast8_t individual_channels, enhance_alpha, remove_alpha;
61 make_tmp_path(in_tmp, 256, 0, "");
62 make_tmp_path(out_tmp, 256, 1, ".png");
66 r = get_file(cgi,"inpix", in_tmp, &in_path);
70 individual_channels = (cgiGetValue(cgi, "c")!=NULL) ? 0 : 1;
71 enhance_alpha = (cgiGetValue(cgi, "a")!=NULL) ? 1 : 0;
72 remove_alpha = (cgiGetValue(cgi, "n")!=NULL) ? 1 : 0;
74 t = cgiGetValue(cgi, "f");
76 sscanf(t,"%"SCNuFAST32, &border);
83 individual_channels, enhance_alpha, remove_alpha
87 r1 = send_file(out_tmp, "image/png", 0);
91 r1 = send_data(nf, nf_size, "image/png", 500);
105 char *inpix, char *outpix,
106 uint_fast32_t border,
107 uint_fast8_t individual_channels,
108 uint_fast8_t enhance_alpha,
109 uint_fast8_t remove_alpha
116 snprintf(s_border, 11, "%"PRIuFAST32, border);
122 NOFADING_PATH, NOFADING_PATH,
123 individual_channels ? "-c" : "-0",
124 enhance_alpha ? "-a" : "-0",
125 remove_alpha ? "-n" : "-0",