From: b Date: Fri, 21 Oct 2022 22:20:23 +0000 (+0000) Subject: move towards generalised tool, first steps, create core. X-Git-Url: http://bicyclesonthemoon.info/git-projects/?a=commitdiff_plain;h=4b3b328472430d1fb7ec45862398152273d34035;p=ott%2Fenhance move towards generalised tool, first steps, create core. --- diff --git a/core.c b/core.c new file mode 100644 index 0000000..9eadad4 --- /dev/null +++ b/core.c @@ -0,0 +1,124 @@ +/* +core.c +The tool with multiple enhancements and manipulations of pictures +21.10.2022 + +Copyright (C) 2014, 2015, 2022 Balthasar Szczepański + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as +published by the Free Software Foundation, either version 3 of the +License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see . + + +Requires Dev Image Library (libdevil) (http://openil.sourceforge.net/) +on Pentium III libdevil must be recompiled with +--disable-ssl2 --disable-ssl3 +(https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=572954) +*/ + +#include +#include +#include +#include + +#include "core.h" + + +uint_fast16_t n_pictures = 0; +struct Picture * picture; + +void init (void) +{ + ilInit(); + ilEnable(IL_FILE_OVERWRITE); +} + +void finish (int const returnvalue, char const * const returntext) +{ + clear_pictures(); + fputs(returntext, stderr); + exit(returnvalue); +} + +void create_picture (uint_fast16_t id) +{ + if (id. + + +Requires Dev Image Library (libdevil) (http://openil.sourceforge.net/) +on Pentium III libdevil must be recompiled with +--disable-ssl2 --disable-ssl3 +(https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=572954) +*/ + +// #include +#include +// #include +// #include + +#include "IL/il.h" + +struct Picture { + uint_fast8_t open; + ILuint handle; +}; + +void finish (int const returnvalue, char const * const returntext); +void init (void); + +void create_picture (uint_fast16_t id); +void create_pictures (uint_fast16_t n); +void close_picture (uint_fast16_t id); +void close_pictures (void); +void clear_pictures (void); +int reserve_pictures (uint_fast16_t n); diff --git a/enhance b/enhance new file mode 100755 index 0000000..e44ecb2 Binary files /dev/null and b/enhance differ diff --git a/enhance.c b/enhance.c new file mode 100644 index 0000000..0f42ae8 --- /dev/null +++ b/enhance.c @@ -0,0 +1,39 @@ +/* +enhance.c +The tool with multiple enhancements and manipulations of pictures +21.10.2022 + +Copyright (C) 2022 Balthasar Szczepański + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as +published by the Free Software Foundation, either version 3 of the +License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see . + + +Requires Dev Image Library (libdevil) (http://openil.sourceforge.net/) +on Pentium III libdevil must be recompiled with +--disable-ssl2 --disable-ssl3 +(https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=572954) +*/ + +#include +#include "core.h" + +int main (int argc, char **argv) +{ + if (argc < 2) + finish(EINVAL, "No mode selected.\n"); + + init(); + + finish(0, "Ok.\n"); +} \ No newline at end of file diff --git a/makefile b/makefile index 4dafd73..7566ab3 100644 --- a/makefile +++ b/makefile @@ -1,48 +1,52 @@ -CC=g++ +CC=gcc CF=-g -Wall LF=-lIL -LF2=-lcgi - -all: 403 npb npbd npb-ong1 npbd-ong1 bluenh bluenhd insert extract seediff insertframe mremapt-1 compare nofading nofadingd - -npb: npb-ong1.cpp makefile - $(CC) $(CF) $(LF) -o npb-ong1 npb-ong1.cpp - -npb: npb.cpp makefile - $(CC) $(CF) $(LF) -o npb npb.cpp - -403: 403.cpp makefile - $(CC) $(CF) $(LF) -o 403 403.cpp - -npbd-ong1: npb npbd-ong1.cpp makefile - $(CC) $(CF) -o npbd-ong1 npbd-ong1.cpp $(LF2) - -npbd: npb npbd.cpp makefile - $(CC) $(CF) -o npbd npbd.cpp $(LF2) - -bluenh: bluenh.cpp makefile - $(CC) $(CF) $(LF) -o bluenh bluenh.cpp - -bluenhd: bluenhd.cpp makefile - $(CC) $(CF) -o bluenhd bluenhd.cpp $(LF2) - -insert: insert.c makefile - $(CC) $(CF) $(LF) -o insert insert.c - -extract: extract.c makefile - $(CC) $(CF) $(LF) -o extract extract.c - -seediff: seediff.c makefile - $(CC) $(CF) $(LF) -o seediff seediff.c - -insertframe: insertframe.c makefile - $(CC) $(CF) -o insertframe insertframe.c $(LF2) - -remapt-1: remapt-1.c makefile - $(CC) $(CF) $(LF) -o remapt-1 remapt-1.c - -compare: compare.c makefile - $(CC) $(CF) $(LF) -o compare compare.c +#LF2=-lcgi + +#all: 403 npb npbd npb-ong1 npbd-ong1 bluenh bluenhd insert extract seediff insertframe mremapt-1 compare nofading nofadingd +all: enhance + +enhance: enhance.c core.h core.c + $(CC) $(CF) -o enhance enhance.c core.c $(LF) + +#npb-ong1: npb-ong1.cpp makefile +# $(CC) $(CF) $(LF) -o npb-ong1 npb-ong1.cpp +# +#npb: npb.cpp makefile +# $(CC) $(CF) $(LF) -o npb npb.cpp +# +#403: 403.cpp makefile +# $(CC) $(CF) $(LF) -o 403 403.cpp +# +#npbd-ong1: npb npbd-ong1.cpp makefile +# $(CC) $(CF) -o npbd-ong1 npbd-ong1.cpp $(LF2) +# +#npbd: npb npbd.cpp makefile +# $(CC) $(CF) -o npbd npbd.cpp $(LF2) +# +#bluenh: bluenh.cpp makefile +# $(CC) $(CF) $(LF) -o bluenh bluenh.cpp +# +#bluenhd: bluenhd.cpp makefile +# $(CC) $(CF) -o bluenhd bluenhd.cpp $(LF2) +# +#insert: insert.c makefile +# $(CC) $(CF) $(LF) -o insert insert.c +# +#extract: extract.c makefile +# $(CC) $(CF) $(LF) -o extract extract.c +# +#seediff: seediff.c makefile +# $(CC) $(CF) $(LF) -o seediff seediff.c +# +#insertframe: insertframe.c makefile +# $(CC) $(CF) -o insertframe insertframe.c $(LF2) +# +#remapt-1: remapt-1.c makefile +# $(CC) $(CF) $(LF) -o remapt-1 remapt-1.c +# +#compare: compare.c makefile +# $(CC) $(CF) $(LF) -o compare compare.c nofading: nofading.c makefile $(CC) $(CF) $(LF) -o nofading nofading.c