From 4b3b328472430d1fb7ec45862398152273d34035 Mon Sep 17 00:00:00 2001 From: b Date: Fri, 21 Oct 2022 22:20:23 +0000 Subject: [PATCH] move towards generalised tool, first steps, create core. --- core.c | 124 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ core.h | 48 +++++++++++++++++++++ enhance | Bin 0 -> 13176 bytes enhance.c | 39 +++++++++++++++++ makefile | 90 ++++++++++++++++++++------------------- 5 files changed, 258 insertions(+), 43 deletions(-) create mode 100644 core.c create mode 100644 core.h create mode 100755 enhance create mode 100644 enhance.c 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 0000000000000000000000000000000000000000..e44ecb29394f8333b5c3e15617b53d6c613db6fd GIT binary patch literal 13176 zcmeHOeQ=yddEfWmdrx=zILVT1OSVHUwh|j`og`a0!q|=^pJgkSKS&g6Cn=}X-Fv#j zr@P}m6xlJ2O9GfFlaP<0CS@R$l%_Kb3B_*HNgO*&NL!LJ&PO{C7;uxi1PG340~QH` z`upv^dwO*?X{OUZIvv)2?%Cfy&p!L??z{W$?z_5e>&TE{7(xeAtP(`WeM0myF%0qw zt5<|X0J0TgIpz7*dLcCVp+fRHgsd_z^OHizK+@h!>=*pzWyE2K+OgdYh?u->CQ^{~K7hVUE)M*808*JNkgBU)t@N4^wXWtXK@f-0& z_Z`2!>z-{7(hkd^E$T2(pY>v3oHmH*)2BqJM??mXFl{l2Z8^C0pI;LX_rChrEB73F z;-x=W`n`|rUAFi2KRs~E=*IgXz9_t=8W*y&3lP8Gg<0P2Dm+w$Z?D42bCnnZb61%5{#J?PFY#qA9723e6@JKtmm~fP zDC4wG6WYf@fzuVdShQ7PZx#OOy!?v=v%2&Ds!A@R!=pQ+3AClHFuHR~CYQBG zW8)cHM57avxoospiWN%Hs8YS8Vmh-mD|4hX5j$g-?BU7Sgk2Qr%y2ec0^4S1og{l2 z33V7>1-^MK1k0n z4­ld&{16>M7|ad?E|p@-2pW9voKPQ*$vWEn3ORStKY^^y`hn~-sbgNbb;!-HF* zYs0;0G#NZ{TyShKrpAm$RPbP2x&LvT8RC18aLh5Zrqd17yA1sz1LhEpE3d;N=rH0D zhmSfuiWQs0Uw!!Q4cSLElP_ao9$VfxV2pMu-qO zCfE-0S|L`EW0$I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lNN8kFM~t<=ky?xx#nBC?X{JP29;z z8N&(?m$cN&BazgBxDNUiupS9ok9#gsNGpMBy$IsJ!Z&T&I|dz6KjL~@Lp{i#_lBK2%Q z51*zgHr#qI0I-c|k86AWUBQf#1}5{c{yzY*da_)sQTebXfOTM*q<;lzJ+Ac<(7ROo z{TO;or#-F_Gtj$K|Gwtf>jr0_-bxjfzbuRNOAu`3Wg>p=h2A<1z^TK)57;_R{516X z8F7M^wN~l*upr*dhqOvBRHYYLgf*o$0$m*qSLyv69}y4n;cDP(P0e0D. + + +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 -- 2.30.2