From 640debd660fb301f3eb6d94f0047eaf754b0b5b9 Mon Sep 17 00:00:00 2001 From: b Date: Wed, 30 Nov 2022 01:00:49 +0000 Subject: [PATCH] back to npb --- 403.png | Bin 17828 -> 0 bytes core.c | 139 ++++++++++++++++++++++++++++----- core.h | 60 +++++++++------ data/npb-ong1.png | Bin 11994 -> 0 bytes diff.c | 2 +- enhance.c | 1 + f2h.c | 104 +++++++++++++++++++++++++ makefile | 40 ++++++++-- makefile.1.mak | 40 ++++++++-- nofading.c | 10 +-- npb.cpp => npb.c | 190 +++++++++++++++++++++++++++++++++++++++++++--- npb.h | 28 +++++++ npb_403.png | Bin 0 -> 15489 bytes npb_ong1.png | Bin 0 -> 6366 bytes reveal.c | 4 +- 15 files changed, 547 insertions(+), 71 deletions(-) delete mode 100644 403.png delete mode 100644 data/npb-ong1.png create mode 100644 f2h.c rename npb.cpp => npb.c (64%) create mode 100644 npb.h create mode 100644 npb_403.png create mode 100644 npb_ong1.png diff --git a/403.png b/403.png deleted file mode 100644 index c6bc7de1e26456d9df7dc66deaced77519cba0f9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17828 zcmeHv^DZ~QVu00-3^0uHwq{Xl0&zE3PTUwNJxj&AdP^ef*^>r;?O1C zaIS&-Jm)#@Ie)_alOJch_r7Ya^^LWKtEf;?0c0|Sd00|PT0_XhX{ zs{+ds{DEyHr6Pra@$2-3I(s7cb>2osM%~8D33-|YGG%wJ1$s6P6(Hg$DvO%yeX zjGU1CeVcz~U}Rtl<}ISQaD2*ZSiX{LO{Y!TH?-S&+WxLngqlD9Sc=ab9?094daH&^ zo(97-H-2Q!oc8Q`==Xl5o3G{~xFnJCn*7N|7^YSs*h1IF*>Bxa7G)?RrER`7aCALE zHf5Qd;pW@K#KfCX%ts1EH$NqOW+z&yA=?_N zLL@-c3ekAT%;craVq$1`{8~Asv|)|CUfk>ck;KiXr1%ND@iQzHI?U>P8fQiB>di`Y z+FA-b!9Ot96@-f#biISTD|VyF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Kr2m|rYhZJ(=_7U6^~%!| z<(ah$Vc&osTffcp_0HoprGfW7xLPoBc>s#;6ZDuPYX z2-A%%1K)muXMr}D|K}~B*nYpq40=_JUWaY zK>o)?chExujz^(J?*F{95B%y{Sw)~F{m(1NyvC$5%8U!p$xGzy$c1hu#=w4tMhTuZ zdf+1@26bqsHsC~aGp6E~tN#(bb(%F>S05SB-hGJPi|hDW|D49hgogoRaQ^r^OACJB Qzg@vlkX412OFs|#UqJUYQvd(} diff --git a/core.c b/core.c index f79c6ad..4283561 100644 --- a/core.c +++ b/core.c @@ -201,7 +201,7 @@ int reserve_pictures (uint_fast16_t n) void get_flags (struct IL_full_info *info, FLAG_TYPE *flags) { - *flags &= ~(HAS_ALPHA | IS_GRAY | IS_INDEXED | IS_MULTIPLE | IS_OVER_8BIT); + *flags &= ~(HAS_ALPHA | IS_GRAY | IS_INDEXED | IS_MULTIPLE | IS_OVER_8BIT | EFF_ALPHA | EFF_GRAY | EFF_INDEXED); if (info->num_images > 0) *flags |= IS_MULTIPLE; @@ -212,7 +212,7 @@ void get_flags (struct IL_full_info *info, FLAG_TYPE *flags) switch (info->image_format) { case IL_COLOUR_INDEX: - *flags |= IS_INDEXED; + *flags |= IS_INDEXED | EFF_INDEXED; switch (info->palette_type) { case IL_PAL_BGR32: @@ -221,7 +221,7 @@ void get_flags (struct IL_full_info *info, FLAG_TYPE *flags) break; case IL_PAL_BGRA32: case IL_PAL_RGBA32: - *flags |= HAS_ALPHA; + *flags |= HAS_ALPHA | EFF_ALPHA; break; case IL_PAL_RGB24: case IL_PAL_BGR24: @@ -230,13 +230,13 @@ void get_flags (struct IL_full_info *info, FLAG_TYPE *flags) } break; case IL_LUMINANCE_ALPHA: - *flags |= HAS_ALPHA; + *flags |= HAS_ALPHA | EFF_ALPHA; case IL_LUMINANCE: - *flags |= IS_GRAY; + *flags |= IS_GRAY | EFF_GRAY; break; case IL_RGBA: case IL_BGRA: - *flags |= HAS_ALPHA; + *flags |= HAS_ALPHA | EFF_ALPHA; case IL_RGB: case IL_BGR: default: @@ -817,7 +817,7 @@ int perform_action ( if (r!=0) break; - p[i].flags &= ~(IS_GRAY|IS_INDEXED|IS_OVER_8BIT|IS_PALETTE_ONLY); + p[i].flags &= ~(HAS_ALPHA|IS_GRAY|IS_INDEXED|IS_OVER_8BIT|IS_PALETTE_ONLY|EFF_ALPHA|EFF_GRAY|EFF_INDEXED); if (palette_only) p[i].flags |= IS_PALETTE_ONLY; @@ -837,7 +837,7 @@ int perform_action ( switch (p[i].info.image_format) { case IL_COLOUR_INDEX: - p[i].flags |= IS_INDEXED; + p[i].flags |= IS_INDEXED | EFF_INDEXED; r = get_palette(p[i].id, &(p[i].palette), p[i].f_pict); if (r!=0) break; @@ -848,7 +848,7 @@ int perform_action ( p[i].flags |= IS_OVER_8BIT; break; case IL_PAL_BGRA32: - p[i].flags |= HAS_ALPHA; + p[i].flags |= HAS_ALPHA | EFF_ALPHA; p[i].alpha_offset = 3; case IL_PAL_BGR24: p[i].red_offset = 2; @@ -856,7 +856,7 @@ int perform_action ( p[i].blue_offset = 0; break; case IL_PAL_RGBA32: - p[i].flags |= HAS_ALPHA; + p[i].flags |= HAS_ALPHA | EFF_ALPHA; p[i].alpha_offset = 3; case IL_PAL_RGB24: default: @@ -867,14 +867,14 @@ int perform_action ( } break; case IL_LUMINANCE_ALPHA: - p[i].flags |= HAS_ALPHA; + p[i].flags |= HAS_ALPHA | EFF_ALPHA; p[i].alpha_offset = 1 * p[i].info.image_bpc; case IL_LUMINANCE: - p[i].flags |= IS_GRAY; + p[i].flags |= IS_GRAY | EFF_GRAY; p[i].value_offset = 0 * p[i].info.image_bpc; break; case IL_BGRA: - p[i].flags |= HAS_ALPHA; + p[i].flags |= HAS_ALPHA | EFF_ALPHA; p[i].alpha_offset = 3 * p[i].info.image_bpc; case IL_BGR: p[i].red_offset = 2 * p[i].info.image_bpc; @@ -882,7 +882,7 @@ int perform_action ( p[i].blue_offset = 0 * p[i].info.image_bpc; break; case IL_RGBA: - p[i].flags |= HAS_ALPHA; + p[i].flags |= HAS_ALPHA | EFF_ALPHA; p[i].alpha_offset = 3 * p[i].info.image_bpc; case IL_RGB: default: @@ -893,6 +893,17 @@ int perform_action ( } if (p[i].info.image_bpc > 1) p[i].flags |= IS_OVER_8BIT; + + if ((p[i].flags & IS_INDEXED) && (p[i].flags & CANNOT_BE_INDEXED)) + p[i].flags &= ~EFF_INDEXED; + if ((p[i].flags & IS_GRAY) && (p[i].flags & CANNOT_BE_GRAY)) + p[i].flags &= ~EFF_GRAY; + else if (!(p[i].flags & IS_GRAY) && (p[i].flags & MUST_BE_GRAY)) + p[i].flags |= EFF_GRAY; + if ((!(p[i].flags & HAS_ALPHA)) && (p[i].flags & MUST_HAVE_ALPHA)) + p[i].flags |= EFF_ALPHA; + else if ((p[i].flags & HAS_ALPHA) && (p[i].flags & CANNOT_HAVE_ALPHA)) + p[i].flags &= ~EFF_ALPHA; } if (!skip_frame) { @@ -1303,10 +1314,8 @@ int perform_action_palette_mix ( { case IL_PAL_BGR32: case IL_PAL_RGB32: - p[i].flags |= IS_OVER_8BIT; break; case IL_PAL_BGRA32: - p[i].flags |= HAS_ALPHA; p[i].alpha_offset = 3; case IL_PAL_BGR24: p[i].red_offset = 2; @@ -1314,7 +1323,6 @@ int perform_action_palette_mix ( p[i].blue_offset = 0; break; case IL_PAL_RGBA32: - p[i].flags |= HAS_ALPHA; p[i].alpha_offset = 3; case IL_PAL_RGB24: default: @@ -1323,6 +1331,15 @@ int perform_action_palette_mix ( p[i].blue_offset = 2; break; } + + if ((p[i].flags & IS_GRAY) && (p[i].flags & CANNOT_BE_GRAY)) + p[i].flags &= ~EFF_GRAY; + else if (!(p[i].flags & IS_GRAY) && (p[i].flags & MUST_BE_GRAY)) + p[i].flags |= EFF_GRAY; + if ((!(p[i].flags & HAS_ALPHA)) && (p[i].flags & MUST_HAVE_ALPHA)) + p[i].flags |= EFF_ALPHA; + else if ((p[i].flags & HAS_ALPHA) && (p[i].flags & CANNOT_HAVE_ALPHA)) + p[i].flags &= ~EFF_ALPHA; } if (!skip_frame) { @@ -1415,6 +1432,94 @@ ILubyte downscale_value (ILuint x, ILint bytes) return (ILubyte)(x >> (8 * (bytes-1))); } +int copy_pixels (ILuint n, struct PixelInfo *p, void *data) +{ + ILuint max = *((ILuint *)data); + + if (n < 2) + return EINVAL; + + if (p[0].flags & EFF_INDEXED) + { + if (!(p[1].flags & EFF_INDEXED)) + return EINVAL; + p[1].index = p[0].index; + } + else if (p[0].flags & EFF_ALPHA) + { + if (p[0].flags & EFF_GRAY) + { + if (!(p[1].flags & EFF_GRAY)) + return EINVAL; + p[1].value = copy_1p_alpha(p[0].value, p[1].value, p[0].alpha, max); + } + else + { + if (p[1].flags & EFF_GRAY) + return EINVAL; + p[1].red = copy_1p_alpha(p[0].red, p[1].red, p[0].alpha, max); + p[1].green = copy_1p_alpha(p[0].green, p[1].green, p[0].alpha, max); + p[1].blue = copy_1p_alpha(p[0].blue, p[1].blue, p[0].alpha, max); + } + if (p[1].flags & EFF_ALPHA) + p[1].alpha = copy_1p_alpha(max, p[1].alpha, p[0].alpha, max); + } + else + { + if (p[0].flags & EFF_GRAY) + { + if (!(p[1].flags & EFF_GRAY)) + return EINVAL; + p[1].value = p[0].value + } + else + { + if (p[1].flags & EFF_GRAY) + return EINVAL; + p[1].red = p[0].red; + p[1].green = p[0].green; + p[1].blue = p[0].blue; + } + if (p[1].flags & EFF_ALPHA) + p[1].alpha = max; + } + + return 0; +} + +int fill_color (ILuint n, struct PixelInfo *p, void *data) +{ + struct ColorInfo *d = data; + + if (p->flags & EFF_INDEXED) + { + p->index = d->index; + } + else + { + if (p->flags & EFF_ALPHA) + p->alpha = d->alpha; + if (p->flags & EFF_GRAY) + p->value = d->value; + else + { + p->red = d->red; + p->green = d->green; + p->blue = d->blue; + } + } + + return 0; +} + + +ILuint copy_1p_alpha (ILint64 src, ILint64 dst, ILint64 alpha, iILint64 max) +{ + ILint64 v = (src * alpha + dst * (max - alpha)) / max; + return (ILuint)v; +} + + // int action( // ILuint n, struct PixelInfo *info, void *data // ) diff --git a/core.h b/core.h index 144979d..15af406 100644 --- a/core.h +++ b/core.h @@ -34,28 +34,32 @@ on Pentium III libdevil must be recompiled with #define FLAG_TYPE uint_fast32_t -#define MUST_HAVE_ALPHA 0x00001 -#define CANNOT_HAVE_ALPHA 0x00002 -#define MUST_BE_GRAY 0x00004 -#define CANNOT_BE_GRAY 0x00008 -#define MUST_BE_INDEXED 0x00010 -#define CANNOT_BE_INDEXED 0x00020 +#define MUST_HAVE_ALPHA 0x000001 +#define CANNOT_HAVE_ALPHA 0x000002 +#define MUST_BE_GRAY 0x000004 +#define CANNOT_BE_GRAY 0x000008 +#define MUST_BE_INDEXED 0x000010 +#define CANNOT_BE_INDEXED 0x000020 -#define OK_PALETTE_ONLY 0x00040 -#define CAN_BE_MULTIPLE 0x00080 -#define CAN_BE_OVER_8BIT 0x00100 +#define OK_PALETTE_ONLY 0x000040 +#define CAN_BE_MULTIPLE 0x000080 +#define CAN_BE_OVER_8BIT 0x000100 -#define IN_WINDOW 0x00200 +#define IN_WINDOW 0x000200 -#define HAS_ALPHA 0x00400 -#define IS_GRAY 0x00800 -#define IS_INDEXED 0x01000 -#define IS_MULTIPLE 0x02000 -#define IS_OVER_8BIT 0x04000 -#define IS_PALETTE_ONLY 0x08000 +#define HAS_ALPHA 0x000400 +#define IS_GRAY 0x000800 +#define IS_INDEXED 0x001000 +#define IS_MULTIPLE 0x002000 +#define IS_OVER_8BIT 0x004000 +#define IS_PALETTE_ONLY 0x008000 -#define NOT_WRITABLE 0x10000 -#define NOT_READABLE 0x20000 +#define NOT_WRITABLE 0x010000 +#define NOT_READABLE 0x020000 + +#define EFF_ALPHA 0x040000 +#define EFF_GRAY 0x080000 +#define EFF_INDEXED 0x100000 extern char NO_STR[]; extern char INIT_FAILED[]; @@ -167,13 +171,19 @@ struct PixelInfo struct IL_full_info info; }; -typedef int (ACTION_F)(ILuint n, struct PixelInfo *info, void *data); +struct ColorInfo +{ + ILuint red; + ILuint green; + ILuint blue; + ILuint value; + ILuint alpha; + ILuint index; +} +typedef int (ACTION_F)(ILuint n, struct PixelInfo *info, void *data); typedef int (SUBTOOL_F)(int argc, char **argv, int argi, char **err); - - - void finish (int const returnvalue, char const * const returntext); @@ -225,4 +235,8 @@ int perform_action_palette_mix ( void *data ); -//ACTION_F action; \ No newline at end of file + + +int copy_pixels (ILuint n, struct PixelInfo *p, void *data); +ILuint copy_1p_alpha (ILint64 src, ILint64 dst, ILint64 alpha, iILint64 max); +int fill_color (ILuint n, struct PixelInfo *p, void *data); \ No newline at end of file diff --git a/data/npb-ong1.png b/data/npb-ong1.png deleted file mode 100644 index 36db7c7520878132237266eb4d667d6d3b507dae..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 11994 zcmW-ncRX9)`@j>iNlIIM2x=5nd&b_YMT^?2)z&6LY(>;)ORZY9scNdCqgj^L}IUKp#xcK@R``!1oMv%m4r&jC>JjsmUc( zALsf303N_S9ZmD#*`53uzZGniZe{%6z46F`(_*FS45PQ4x8K<+caAy)CcVQp0AG@R z?`<7NuZ{hSfIuj;63@GMHIz3MA{@JacX2_1um-lD3iPyCUVL2RlsYE`^q8{W<_J%C*MkF9{W!E-_}A31*ZMHXtCE8e1^Wkzg4 ziVn9fFG9Icm8v%rn^d&SbgV=9C8P59W>sozB0pb(fEW#hOm)%l80ouxgKtqG@a3bki0h<}ds+tZw1&!zKVU1CKs!P6w!0NcsGZBOPV*S#*2a=7EU4;x z&R~Z#Tbk#>;&kcXtA&C>VUT?P_r+Nz#1>oW!*-zuKY)M2mWsN!cqoZ* ze?ytbxX}ge98L|g@nA=}li?I{WDDI~3@|466vd&SIclPxk{HPbrebuPOe8-uemz_# zFj2tEI(?6OT^EUDL)&#wbdz75g>XzYjhRB2i_5Cer98AUE&*kBdL27>hDQOSB?1my#?eiJ{ zj?v|f8QfY5uob1xV{(ZIU&o&t;oKs_dIs?*g7)z!VbIsn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dK<0%@ot_9>W^?J{!LC!`R9%cAqNq4BY{hG}<>5l9*I*C&N$zt< zk9$V64lMmm`>DOBOsg$6bI@<3{@YXptSNi>Pe_PiO2gcGJ^p=Z9^bjc(^bBk`+VdS zQ}M=-lkKoW?f;ArWn4Znt>mFYvSyf^;Za|9B@3kLs_r4pg`>i7@>*tO)RkdU<#pn` z4{7L%<-mKq9X6v$R{Og7(w3neO1^&iFs~eq{7-8Qt$TMl0-Jvbe`h$JmrEJrHM+a! z>2M7)C`BPf&TCU(4^9gRqq7X|$y9=F`ljphAy^mSeb6E=EN)cWN(NZb;4lAnm@^kRd}* z-l;V{jvO0UGg|xWoW7u|ZvKDePzQQ-9>qb9c4l~>6dAX}fK8dnxNpoz^l>E6b<*vU URrNWUSqI$HeV|jN_2lLM0aOWI#sB~S diff --git a/diff.c b/diff.c index 23b7054..4f44997 100644 --- a/diff.c +++ b/diff.c @@ -276,7 +276,7 @@ int difference (ILuint n, struct PixelInfo *p, void *data) p[2].red = diff_1ch(p[0].red, p[1].red, d->r_a, d->r_b, d->max); p[2].green = diff_1ch(p[0].green, p[1].green, d->g_a, d->g_b, d->max); p[2].blue = diff_1ch(p[0].blue, p[1].blue, d->b_a, d->b_b, d->max); - if (p[2].flags & HAS_ALPHA) + if (p[2].flags & EFF_ALPHA) p[2].alpha = (p[0].alpha + p[1].alpha) / 2; /* no better idea */ return 0; diff --git a/enhance.c b/enhance.c index be6a6b5..7fc3a75 100644 --- a/enhance.c +++ b/enhance.c @@ -34,6 +34,7 @@ on Pentium III libdevil must be recompiled with #include "bluenh.h" #include "reveal.h" #include "diff.h" +#include "npb.h" int main (int argc, char **argv) { diff --git a/f2h.c b/f2h.c new file mode 100644 index 0000000..32fb519 --- /dev/null +++ b/f2h.c @@ -0,0 +1,104 @@ +/* +f2h.c +make file into h +29.11.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 . + +*/ + +#include +#include +#include +#include + +char DEFAULT_NAME[] = "data"; +FILE *infile, *outfile; +uint_fast8_t in_open = 0; +uint_fast8_t out_open = 0; + +int cleanup(int r) +{ + if (out_open) + fclose(outfile); + if (in_open) + fclose(infile); + return r; +} + +int main (int argc, char **argv) +{ + char *name; + uint_fast8_t i; + uint8_t x; + uint_fast64_t size=0; + + if (argc >= 2) + name = argv[1]; + else + name = DEFAULT_NAME; + if (argc >= 3) + { + infile = fopen(argv[2], "rb"); + if (infile==NULL) + return cleanup(EIO); + in_open = 1; + } + else + infile = stdin; + if (argc >= 4) + { + outfile = fopen(argv[3], "wt"); + if (outfile==NULL) + return cleanup(EIO); + out_open = 1; + } + else + outfile = stdout; + + fprintf( + outfile, + "/* %s is autogenerated%s%s. */\n", + out_open ? argv[3] : "File", + in_open ? " from " : "", + in_open ? argv[2] : "" + ); + fputs ("#include \n", outfile); + fprintf( + outfile, + "const uint8_t %s[] = {", + name + ); + for (i=0; fread(&x, 1, 1, infile)!=0;i=(i+1)&7) + { + fprintf( + outfile, + "%s0x%02" PRIX8 ",", + (i==0) ? "\n\t" : " ", + x + ); + ++size + } + fputs ("\n};\n", outfile); + fprintf( + outfile, + "#define %s_size %" PRIu64 "\n", + name, + size + ); + + return cleanup(0); +} diff --git a/makefile b/makefile index 16f61c1..2d65650 100644 --- a/makefile +++ b/makefile @@ -42,28 +42,45 @@ nofading\ info\ bluenh\ reveal\ -diff +diff\ +npb C_STANDALONE=\ standalone-nofading.c\ standalone-info.c\ standalone-bluenh.c\ standalone-reveal.c\ -standalone-diff.c +standalone-diff.c\ +standalone-npb.c C_SUBTOOL=\ nofading.c\ info.c\ bluenh.c\ reveal.c\ -diff.c +diff.c\ +npb.c H_SUBTOOL=\ nofading.h\ info.h\ bluenh.h\ reveal.h\ -diff.h +diff.h\ +npb.h + +H_PNG=\ +npb0.h\ +npb1.h\ +npb2.h\ +npb_ong1.h\ +npb_403.h + +# keep these 2 lists in the same order!: +GENERATE_FROM= + +TO_GENERATE= + #all: 403 npb npbd npb-ong1 npbd-ong1 bluenh bluenhd insert extract seediff insertframe mremapt-1 compare nofading nofadingd @@ -74,21 +91,30 @@ makefile: makefile.1.mak $(CONFIGFILE) $(CONFIGURE_CMD) < makefile.1.mak > makefile -enhance: enhance.c core.h core.c $(H_SUBTOOL) $(C_SUBTOOL) +enhance: enhance.c core.h core.c $(H_SUBTOOL) $(C_SUBTOOL) $(H_PNG) $(CC) $(CF) -o enhance enhance.c core.c $(C_SUBTOOL) $(L_IL) -$(STANDALONE): %: standalone-%.c %.c %.h core.c core.h +$(STANDALONE): %: standalone-%.c %.c %.h core.c core.h $(H_PNG) $(CC) $(CF) -o $@ standalone-$*.c $*.c core.c $(L_IL) $(C_STANDALONE): standalone-%.c: settings-standalone.txt standalone.c $(CONFIGURE) subtool=$* settings-standalone.txt --in standalone.c --out $@ +$(TO_GENERATE): $(GENERATE_FROM) $(CONFIGFILE) + $(CONFIGURE_CMD) --in $(GENERATE_FROM) --out $(TO_GENERATE) + +$(H_PNG): %.h: %.png f2h + ./f2h $* $*.png $@ + +f2h: f2h.c + $(CC) $(CF) -o f2h f2h.c + #test: test.c core.h core.c # $(CC) $(CF) -o test test.c core.c $(LF) clean: - $(RM) -f enhance $(C_STANDALONE) $(STANDALONE) + $(RM) -f enhance $(C_STANDALONE) $(STANDALONE) $(TO_GENERATE) f2h $(H_PNG) PHONY: all clean diff --git a/makefile.1.mak b/makefile.1.mak index fd5f631..169e127 100644 --- a/makefile.1.mak +++ b/makefile.1.mak @@ -42,28 +42,45 @@ nofading\ info\ bluenh\ reveal\ -diff +diff\ +npb C_STANDALONE=\ standalone-nofading.c\ standalone-info.c\ standalone-bluenh.c\ standalone-reveal.c\ -standalone-diff.c +standalone-diff.c\ +standalone-npb.c C_SUBTOOL=\ nofading.c\ info.c\ bluenh.c\ reveal.c\ -diff.c +diff.c\ +npb.c H_SUBTOOL=\ nofading.h\ info.h\ bluenh.h\ reveal.h\ -diff.h +diff.h\ +npb.h + +H_PNG=\ +npb0.h\ +npb1.h\ +npb2.h\ +npb_ong1.h\ +npb_403.h + +# keep these 2 lists in the same order!: +GENERATE_FROM= + +TO_GENERATE= + #all: 403 npb npbd npb-ong1 npbd-ong1 bluenh bluenhd insert extract seediff insertframe mremapt-1 compare nofading nofadingd @@ -74,21 +91,30 @@ makefile: makefile.1.mak $(CONFIGFILE) $(CONFIGURE_CMD) < makefile.1.mak > makefile -enhance: enhance.c core.h core.c $(H_SUBTOOL) $(C_SUBTOOL) +enhance: enhance.c core.h core.c $(H_SUBTOOL) $(C_SUBTOOL) $(H_PNG) $(CC) $(CF) -o enhance enhance.c core.c $(C_SUBTOOL) $(L_IL) -$(STANDALONE): %: standalone-%.c %.c %.h core.c core.h +$(STANDALONE): %: standalone-%.c %.c %.h core.c core.h $(H_PNG) $(CC) $(CF) -o $@ standalone-$*.c $*.c core.c $(L_IL) $(C_STANDALONE): standalone-%.c: settings-standalone.txt standalone.c $(CONFIGURE) subtool=$* settings-standalone.txt --in standalone.c --out $@ +$(TO_GENERATE): $(GENERATE_FROM) $(CONFIGFILE) + $(CONFIGURE_CMD) --in $(GENERATE_FROM) --out $(TO_GENERATE) + +$(H_PNG): %.h: %.png f2h + ./f2h $* $*.png $@ + +f2h: f2h.c + $(CC) $(CF) -o f2h f2h.c + #test: test.c core.h core.c # $(CC) $(CF) -o test test.c core.c $(LF) clean: - $(RM) -f enhance $(C_STANDALONE) $(STANDALONE) + $(RM) -f enhance $(C_STANDALONE) $(STANDALONE) $(TO_GENERATE) f2h $(H_PNG) PHONY: all clean diff --git a/nofading.c b/nofading.c index 877eaf4..acd888f 100644 --- a/nofading.c +++ b/nofading.c @@ -1,7 +1,7 @@ /* nofading.c The tool to remove fading from an image -15.11.2022 +29.11.2022 Copyright (C) 2015, 2022 Balthasar Szczepański @@ -251,7 +251,7 @@ int find_fading_range (ILuint n, struct PixelInfo *p, void *data) d = data; - if (p->flags & IS_GRAY) + if (p->flags & EFF_GRAY) { UPDATE_RANGE(p->value, d->green_low, d->green_high); } @@ -267,7 +267,7 @@ int find_fading_range (ILuint n, struct PixelInfo *p, void *data) UPDATE_RANGE(p->green, d->green_low, d->green_high); UPDATE_RANGE(p->blue, d->green_low, d->green_high); } - if ((p->flags & HAS_ALPHA) && (d->enhance_alpha)) + if ((p->flags & EFF_ALPHA) && (d->enhance_alpha)) { UPDATE_RANGE(p->alpha, d->alpha_low, d->alpha_high); } @@ -292,7 +292,7 @@ int enhance_fading (ILuint n, struct PixelInfo *p, void *data) d = data; - if (p->flags & IS_GRAY) + if (p->flags & EFF_GRAY) p->value = enhance_fading_1ch(p->value, d->green_low, d->green_high, d->max); else if (d->individual_channels) { @@ -306,7 +306,7 @@ int enhance_fading (ILuint n, struct PixelInfo *p, void *data) p->green = enhance_fading_1ch(p->green, d->green_low, d->green_high, d->max); p->blue = enhance_fading_1ch(p->blue , d->green_low, d->green_high, d->max); } - if ((p->flags & HAS_ALPHA) && (d->enhance_alpha)) + if ((p->flags & EFF_ALPHA) && (d->enhance_alpha)) p->alpha = enhance_fading_1ch(p->alpha, d->alpha_low, d->alpha_high, d->max); return 0; diff --git a/npb.cpp b/npb.c similarity index 64% rename from npb.cpp rename to npb.c index a08e577..1c03b99 100644 --- a/npb.cpp +++ b/npb.c @@ -1,11 +1,183 @@ - // //It's NewpixbOTTification Time! - // // Take a picture and add a newpixbot to it! - // // - // // Requires Dev Image Library, -// // //on Pentium III libdevil must be - // // recompiled with --disable-ssl2 --disable-ssl3 - // // - // // ~~bicyclesonthemoon +/* +npb.c +Take a picture and add a newpixbot to it! +29.11.2022 + +Copyright (C) 2013 - 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 "core.h" +#include "npb.h" + +#include "npb0.h" +#include "npb1.h" +#include "npb2.h" +#include "npb_ong1.h" +#include "npb_403.h" + +#define NPB0_L 21 +#define NPB0_R 116 +#define NPB0_T 122 +#define NPB0_B 189 + +#define NPB1_L 22 +#define NPB1_R 154 +#define NPB1_T 69 +#define NPB1_B 162 + + +char NPB_MISSING_ARGS[] = "Missing parameters.\nnpb [-o -4 -r -b -c] inPix outPix\n"; + +int subtool_npb (int argc, char **argv, int argi, char **err) +{ + uint_fast8_t ong1 = 0; + uint_fast8_t t403 = 0; + uint_fast8_t corners = 0; + uint_fast8_t fullsize = 0; + uint_fast8_t fill_white = 0; + uint_fast8_t expand_left = 0; + uint_fast8_t expand_right = 0; + uint_fast8_t expand_up = 0; + uint_fast8_t expand_down = 0; + uint_fast8_t border_outside = 0; + + ILuint cut_border = 0; + ILuint new_border = 2; + ILuint max = 0xFF; //upscale_value(0xFF, info[0].image_bpc); // bpc=1 + ILuint effective_width, effective_height; + const uint8_t *npb_pix; + uint_fast32_t npb_size; + ILuint x_l, x_r, y_t, y_b; + + struct ColorInfo color; + struct IL_full_info info[3]; + FLAG_TYPE flags [3] = { + CANNOT_BE_GRAY | CANNOT_BE_INDEXED | NOT_WRITABLE, + CANNOT_BE_GRAY | CANNOT_BE_INDEXED | NOT_WRITABLE | MUST_HAVE_ALPHA, + CANNOT_BE_GRAY | CANNOT_BE_INDEXED | NOT_READABLE | MUST_HAVE_ALPHA, + } + ILuint x0[3]; + ILuint y0[3]; + + struct option long_options[] = { + {"ong1", no_argument, NULL, 'o'}, + {"403", no_argument, NULL, '4'}, + {"remove-border", required_argument, NULL, 'r'}, + {"new-border", required_argument, NULL, 'b'}, + {"corners", no_argument, NULL, 'c'}, + {"help", no_argument, NULL, 'h'}, + {0, 0, 0, 0} + }; + char short_options[] = "o4r:b:ch"; + + int opt; + int r; + + optind = argi; + while ((opt = getopt_long(argc, argv, short_options, long_options, NULL)) != -1) + { + switch (opt) + { + case 'o': + ong1 = 1; + break; + case '4': + t403 = 1; + break; + case 'r': + sscanf(optarg, "%lu, &cut_border); + break; + case 'b': + sscanf(optarg, "%lu, &new_border); + fullsize = 1; + break; + case 'c': + corners = 1; + break; + case 'h': + /* help */ + break; + } + } + + if (argc < optind + 2) + { + *err = NPB_MISSING_ARGS; + return EINVAL; + } + + r = reserve_pictures(1); + if (r) + { + *err = CREATE_FAILED; + return r; + } + + r = load_picture(0, argv[optind], &(info[0]), &(flags[0]); + if (r) + { + *err = LOAD_FAILED; + return r; + } + + effective_width = (info[0].image_width > (2*cut_border)) ? (info[0].image_width - (2*cut_border)) : 0; + effective_height = (info[0].image_height > (2*cut_border)) ? (info[0].image_height - (2*cut_border)) : 0; + + if (t403) + { + npb_pix = npb_403; + npb_size = npb_403_size; + } + else if (ong1) + { + npb_pix = npb_ong1; + npb_size = npb_ong1_size; + } + else if ((effective_width <= NPB0_X_MAX) && (effective_height <= NPB0_Y_MAX) && (!fullsize)) + { + npb_pix = npb0; + npb_size = npb0_size; + fill_white = 1; + new_border = 0; + } + else if ((effective_width <= NPB1_X_MAX) && (effective_height <= NPB1_Y_MAX) && (!fullsize)) + { + npb_pix = npb1; + npb_size = npb1_size; + fill_white = 1; + new_border = 0; + } + else + { + npb_pix = npb2; + npb_size = npb2_size; + } + + +} #define INPIX_MUSTARD 1 #define OUTPIX_MUSTARD 2 @@ -322,4 +494,4 @@ void mustard(int mustard) ilDeleteImages(1, &npbPix); exit(mustard); } - + */ diff --git a/npb.h b/npb.h new file mode 100644 index 0000000..c2c95f3 --- /dev/null +++ b/npb.h @@ -0,0 +1,28 @@ +/* +npb.h +Take a picture and add a newpixbot to it! +29.11.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) +*/ + +int subtool_npb (int argc, char **argv, int argi, char **err); diff --git a/npb_403.png b/npb_403.png new file mode 100644 index 0000000000000000000000000000000000000000..326a1982fdee0a7753b2ef2507fa5fd4f0ce4eab GIT binary patch literal 15489 zcmd73byQVb|1Q48E<84hfF8jlM7m7`rIeDE?k+(>j~+P|A|fCuDqYgjDpDd6n}!W4 zxk)K$xX(QA`yKc1JI4Km`|iIlb@29{s=CxyAFjV{ z-AxI$ZOebuNX&HbnVNKV+#1c@Q*vs{Dhj3NRY1TljSX1Ihu!b%)>0_9l^7_LGsp0& zdpoeOa~rX&0Q}{T%lKc^n*V-)eBs{@{QJp&KR`bD?+5<BMq#Y_Fad9VM&W&i(W zi~jer|DQjO|9!9j!yx(pHi`}wr`4~WqfQSsXWg2ySz2BgyR4wl6d`ddAR;2=ybt4X z5fKeKoqqZ9W&fv7pK|LJC0z;PuC&M+oSz=b8!KAq>F+=4>gu|iM^{^4Uw_l)&B`}# zzCWR!k`xzrOq7XogYS_((>j`;D~qU;%);*xYK(knrggg@i-^O8g_$vR6O$O~Z;gVR z_J8~MBpQ@HOwcXNWA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sJP>>W=Ju#jF40MpR9S- zlJUI?X)K=XmhiOx$>vdfcfrjibfosxS+uzZ+>p!(^vP(!0ztAKlf}iUP<45PgoL1| z520t^rJ!#UlA!3B&{0P-$(ttHFVMP)wkQF(M%*!e=Rp;`IblLS_B!GVH4t|LUZyh-(~@2|xZ~BEY2*@_FQP*AcWD>6pnVpg4X-L? zYwvu8>dg>~w{1@A{08OE9i4@)1QC=}wIL{R#C8N;9y)_Zb)-Ku^d7xW56j)9j}gy}Ql{ zMd=z0P+fOAhipBxrX)<74nP}dM2tf{i6;mG@E3M>2t=>xayIXdxWfPmARuIHhtLP~ zkwnN6xf7M;ILEWu+N-LQ zi@2Q%==rUxLuLWqzuUoa8ABoexw?Y#t23*p#w)o>Or-7zH^3pa%;Pl0%bfVv6RvH& zhN}d~6%>>~2&l%n9;=bgAIz=XuKhyohvSOhecQfg&k-RZN1j%|IM_wxM?dIv^Z7ZU z;+5rm?6`C+$y+hP5V&_H6Uj&N|)>HmAZ!|d#zomwIL*8b<;C4mo8Iz0cg zUc9l@J2qyUVCCR&nuWX<_dx_O8f7v2&_V*mgE literal 0 HcmV?d00001 diff --git a/npb_ong1.png b/npb_ong1.png new file mode 100644 index 0000000000000000000000000000000000000000..2ef8a15b7ac0fc5f0c9ed0308610c69bfdc10908 GIT binary patch literal 6366 zcmV<47$N70P); z0F!-PpeR6EM+T&)$RqUPNPx9&2_rq_kaD@ocG)if0r$>X1nCCO*OWw3Bt^-W%fIpG zb}Fqn7gwH(gVS*3{ahU2)Tz^O72-;HJq>5Bm&%`p0}mH4r!6W=@P{}JSFq$k!+E$E zA>Gfi%|dv!2Uh{W?cFv@ZJ3MOaX>$RPT+v0c-x1AH!-RRkanmY4mPFNBo&XvtUOeD z2d)4d)f0z*YI)4xOJS~iY+b%^l};-mcEQk(Q>J-v9 z{T+vg%iF{2a8>GX5~aKBG>Wprec@QW&ogjE+%G$E`hgROlko7x`yF{FokpC3qgz;q zD+tFk?s66m_9*W(E)fn6<8%*aP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LR-{131^@x7#09R?_6b0lgDWBCfk}LU*X(e#E0ReOzt=JAwDg{9w>g#ao2#s($f4<_@ZAHfdccFu& z-u{!S6haDv4mqBL`wg5tDN$@aT!0gCtY(cq5BFuk=tEv)7#=tI_Ov+(SLOikG+ZI` zvm2-3sLNHKR=X=WKj?u+WpDbOmFm)sQ>@~07*qoM6N<$f>5(bxc~qF literal 0 HcmV?d00001 diff --git a/reveal.c b/reveal.c index f4769bb..8e7adde 100644 --- a/reveal.c +++ b/reveal.c @@ -1,7 +1,7 @@ /* reveal.c reveal hidden details -15.11.2022 +29.11.2022 Copyright (C) 2014 - 2019, 2022 Balthasar Szczepański @@ -91,7 +91,7 @@ int subtool_reveal (int argc, char **argv, int argi, char **err) int reveal (ILuint n, struct PixelInfo *p, void *data) { - if (p->flags & IS_GRAY) + if (p->flags & EFF_GRAY) p->value = reveal_swap2(p->value); else { -- 2.30.2