3 The online interface for remapping t-1
6 Copyright (C) 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"
41 char *inpix, char *outpix,
43 uint_fast8_t p0, uint_fast8_t p1
45 int main (int argc, char *argv[])
62 make_tmp_path(in_tmp, 256, 0, "");
63 make_tmp_path(out_tmp, 256, 1, ".png");
67 r = get_file(cgi,"inpix2", in_tmp, &in_path);
69 r = get_file(cgi,"inpix", in_tmp, &in_path);
73 t = cgiGetValue(cgi, "p0");
75 sscanf(t,"%"SCNuFAST8, &p0);
79 t = cgiGetValue(cgi, "p1");
81 sscanf(t,"%"SCNuFAST8, &p1);
85 palette = cgiGetValue(cgi, "b64");
97 r1 = send_file(out_tmp, "image/png", 0);
101 r1 = send_data(t1, t1_size, "image/png", 500);
115 char *inpix, char *outpix,
117 uint_fast8_t p0, uint_fast8_t p1
126 snprintf(s_p0, 4, "%"PRIuFAST8, p0);
127 snprintf(s_p1, 4, "%"PRIuFAST8, p1);
133 REMAP_T_1_PATH, REMAP_T_1_PATH,