Compare commits

..

No commits in common. "6c92cca12c90704de83246cdba1dc871899d51da" and "19c8f6aad53991fda02f954b7b0b1926ff173604" have entirely different histories.

20 changed files with 13 additions and 655 deletions

View File

@ -10,7 +10,6 @@ OBJS = fifo.o sfx.o crapulator.o glitches.o metriques.o \
filterstack.o single.o
DEPS = ../floatimg.h \
../libfloatimg.a \
fifo.h crapulator.h metriques.h glitches.h sfx.h \
filterstack.h crapdef.h crapstr.h single.h

View File

@ -102,9 +102,9 @@ FimgFilter3x3 hipass = {
FimgFilter3x3 diagonal = {
{
4.0, 1.0, 0.0,
2.0, 1.0, 0.0,
1.0, 0.0, -1.0,
0.0, -1.0, -4.0,
0.0, -1.0, -2.0,
},
1.0, 0.0
};
@ -152,81 +152,6 @@ fimg_destroy(&img);
return retval;
}
/* -------------------------------------------------------------- */
int run_killrgb_0(FloatImg *img, int k)
{
FloatImg tmp;
int ret;
// fprintf(stderr, "----> %s\n", __func__);
memset(&tmp, 0, sizeof(FloatImg));
fimg_clone(img, &tmp, 0);
ret = fimg_killrgb_v(img, &tmp, k);
fimg_copy_data(&tmp, img);
fimg_destroy(&tmp);
// fprintf(stderr, "%s ---->\n", __func__);
return ret;
}
/* -------------------------------------------------------------- */
static int run_pixelize_0(FloatImg *img, int k)
{
FloatImg tmp;
int ret;
memset(&tmp, 0, sizeof(FloatImg));
fimg_clone(img, &tmp, 0);
ret = fimg_pixelize_h_0(img, &tmp, k);
fimg_copy_data(&tmp, img);
fimg_destroy(&tmp);
return ret;
}
/* -------------------------------------------------------------- */
static int run_pixelize_random(FloatImg *img, int k)
{
FloatImg tmp;
int ret;
memset(&tmp, 0, sizeof(FloatImg));
fimg_clone(img, &tmp, 0);
ret = fimg_pixelize_h_rnd(img, &tmp, k);
fimg_copy_data(&tmp, img);
fimg_destroy(&tmp);
return ret;
}
/* -------------------------------------------------------------- */
static int run_decomprgbz_color(FloatImg *img, int k)
{
FloatImg tmp;
int ret;
memset(&tmp, 0, sizeof(FloatImg));
fimg_clone(img, &tmp, 0);
ret = fimg_decomp_rgbz_color(img, &tmp, k);
fimg_copy_data(&tmp, img);
fimg_destroy(&tmp);
return ret;
}
/* -------------------------------------------------------------- */
static int run_decomprgbz_gray(FloatImg *img, int k)
{
FloatImg tmp;
int ret;
memset(&tmp, 0, sizeof(FloatImg));
fimg_clone(img, &tmp, 0);
ret = fimg_decomp_rgbz_gray(img, &tmp, k);
fimg_copy_data(&tmp, img);
fimg_destroy(&tmp);
return ret;
}
/* -------------------------------------------------------------- */
/*
* This is the main filter engine used both for input and
* output processing. It can be called by the filterstack
@ -394,29 +319,6 @@ switch (idFx) {
retval = do_something(image, 3);
break;
case CR_killrgb0:
retval = run_killrgb_0(image, 0);
break;
case CR_pixelizh:
retval = run_pixelize_0(image, 8);
break;
case CR_pixelrand:
retval = run_pixelize_random(image, -1);
break;
case CR_splitlevel:
retval = fimg_split_level(image, image, 0);
break;
case CR_decrgbzc:
retval = run_decomprgbz_color(image, -1);
break;
case CR_decrgbzg:
retval = run_decomprgbz_gray(image, -1);
break;
case CR_hilightr:
retval = fimg_highlight_color(image, image, 'R', 1.717);
break;
@ -456,7 +358,7 @@ void list_crapulors(char *texte)
int idx;
#define OUT stdout
if (NULL!=texte) fprintf(OUT, "______________. %s\n", texte);
fprintf(OUT, "______________. %s\n", texte);
for (idx=0; CrapL[idx].id!=-1; idx++) {
fprintf(OUT, " %-12s | %4d | %5d | %8.3f\n",
CrapL[idx].name,

View File

@ -33,13 +33,6 @@
32 vsglitch 1 1.0
33 crumphard 1 1.0
42 nothing 42 3.1415926
43 killrgb0 1 9
45 hilightr 1 1.717
46 pixelizh 1 1.111
47 pixelizv 1 1.111
48 pixelrand 1 1
49 splitlevel 1 1
50 decrgbzc 1 99
51 decrgbzg 1 99
99 message 1 1.0
-1 end 1 1.0

View File

@ -47,9 +47,6 @@ return -1;
}
/* -------------------------------------------------------------- */
/* nouveau du premier dimanche de 2020 'nextgen' */
/* CE TRUC NE MARCHE PAS COMME PRÉVU */
static int pixel_trinitron(FloatImg *pimg, int pos[4], float *fvals)
{
int x, y, pline, off;
@ -58,7 +55,6 @@ for (y=pos[1]; y<pos[1]+pos[3]; y++) {
pline = y*pimg->width;
for (x=pos[0]+2; x<pos[0]+pos[2]-2; x++) {
off = pline + x;
/* wtf i'm doing here ? */
pimg->R[off] = fvals[0];
pimg->G[off] = fvals[1];
pimg->B[off] = fvals[2];
@ -66,10 +62,6 @@ for (y=pos[1]; y<pos[1]+pos[3]; y++) {
}
return 0;
}
/*
* need more explanation, need more work
*/
int trinitron(FloatImg *pimg, int notused)
{
int x, y, coo[4], foo;
@ -332,8 +324,6 @@ if (offset<0 || offset>=pimg->width) {
return -66;
}
fprintf(stderr, "ERROR: %s not implemented\n", __func__);
return -1;
}
/* -------------------------------------------------------------- */

View File

@ -170,8 +170,7 @@ fprintf(stderr, "EXPERIMENT\n");
foo = fimg_create_from_dump("01137.fimg", &image);
if (foo) {
fprintf(stderr, "%s: err %d on create_from_dump\n",
__func__, foo);
fprintf(stderr, "%s: err %d on create\n", __func__, foo);
return -1;
}

View File

@ -66,8 +66,6 @@ for (foo=0; foo<argc; foo++) {
}
#endif
fprintf(stderr, "*** Extracteur %s %s\n", __DATE__, __TIME__);
while ((opt = getopt(argc, argv, "hv")) != -1) {
switch(opt) {
case 'h': help(0), exit(0); break;

View File

@ -46,7 +46,7 @@ int try_this_muxplane(char *fr, char *fg, char *fb, char *dst, int flags)
int foo;
FloatImg imr, img, imb, dest;
fprintf(stderr, "muxing: %s %s %s -> %s\n", fr, fg, fb, dst);
fprintf(stderr, "muxing: %s %s %s --> %s\n", fr, fg, fb, dst);
foo = fimg_create_from_dump(fr, &imr);
if (foo) {
@ -82,8 +82,7 @@ int main(int argc, char *argv[])
int foo;
if (5 != argc) {
fprintf(stderr, "ERROR: %s need four fimg files arguments\n",
argv[0]);
fprintf(stderr, "ERROR: %s need four fimg files arguments\n", argv[0]);
return 1;
}

View File

@ -4,7 +4,7 @@
* http://la.buvette.org/photos/cumul
*/
#define FIMG_VERSION 157
#define FIMG_VERSION 153
/*
* in memory descriptor
@ -28,9 +28,6 @@ typedef struct {
char magic[8];
int32_t w, h, t;
} FimgFileHead;
/*
* we MUST look at packing and endianess problems NOW */
#define MAGIC_AREA51 0xA5EA0051
typedef struct {
@ -131,15 +128,11 @@ int fimg_crump_hard(FloatImg *src, FloatImg *dst, float kval, int notused);
/* module sfx4.c */
int fimg_sfx_triplemul(FloatImg *s, FloatImg *d, int notused);
int fimg_split_level(FloatImg *src, FloatImg *dst, int notused);
/* funcs/rotate.c module */
/* #coronamaison */
int fimg_rotate_90(FloatImg *src, FloatImg *dst, int notused);
int fimg_killrgb_v(FloatImg *src, FloatImg *dst, int k);
int fimg_decomp_rgbz_color(FloatImg *psrc, FloatImg *pdst, int k);
int fimg_decomp_rgbz_gray(FloatImg *psrc, FloatImg *pdst, int k);
/* universal exporter XXX */
int fimg_export_picture(FloatImg *pic, char *fname, int flags);
@ -166,11 +159,6 @@ int fimg_auto_shift_to_zero(FloatImg *s, FloatImg *d);
/* --> funcs/plasmas.c */
int fimg_prototype_plasma(FloatImg *img, double time, int type);
/* --> funcs/pixelize.c
voir fimg_pixelize_h_rnd() */
int fimg_pixelize_h_0(FloatImg *psrc, FloatImg *pdst, int k);
int fimg_pixelize_h_rnd(FloatImg *psrc, FloatImg *pdst, int largeur);
/* * * * experimental ! */
int fimg_classif_trial(FloatImg *src, FloatImg*dst, float fval, int notused);
int fimg_qsort_rgb_a(FloatImg *psrc, FloatImg *pdst, int notused);
@ -242,7 +230,6 @@ int fimg_multirandom(FloatImg *fimg, long nbpass);
void fimg_print_minmax(float minmax[6], char *titre);
int parse_WxH(char *str, int *pw, int *ph);
int parse_double(char *str, double *dptr);
int irand2(int offset, int modulo);
int print_rectangle(char *str, FimgArea51 *rect);
int parse_rectangle(char *str, FimgArea51 *r, int notused);
int format_from_extension(char *fname);

View File

@ -13,7 +13,7 @@ OBJS = fimg-png.o fimg-tiff.o misc-plots.o filtrage.o utils.o \
equalize.o fimg-fits.o saturation.o histogram.o \
hsv.o classif.o contour2x2.o qsortrgb.o exporter.o \
displacement.o dithering.o plasmas.o incrustator.o \
killrgb.o recurse.o pixelize.o decomprgb.o
recurse.o
#---------------------------------------------------------------
@ -37,15 +37,6 @@ tests.o: tests.c tests.h $(DEPS)
# ###
decomprgb.o: decomprgb.c $(DEPS)
gcc $(COPT) -c $<
pixelize.o: pixelize.c $(DEPS)
gcc $(COPT) -c $<
killrgb.o: killrgb.c $(DEPS)
gcc $(COPT) -c $<
recurse.o: recurse.c $(DEPS)
gcc $(COPT) -c $<

View File

@ -4,8 +4,8 @@ Plein de fonctions qu'il serait bon de documenter :)
## PNG
__Attention__ : la bibliothèque `pnglite`actuellement utilisée pour lire
les fichiers PNG n'accepte que **certains** types de fichiers.
__Attention__ : la bibliothèque `pnglite`actuellement utiilsée pour lire les
fichiers PNG n'accepte que **certains** types de fichiers.
Et en particulier, elle brotche sur ceux produits par ImageMagick !
## Contours
@ -21,10 +21,6 @@ une image en fonction de l'extension du nom de fichier.
Effets spéciaux divers.
La fonction `fimg_pixelize_h_rnd` est issue d'une idée qui m'est venue
dans la roulotte de TerreBlanque. Elle a besoin de recherches sur la
dynamique temporelle, et d'une FSM à trois états.
## Dithering
Work in progress...

View File

@ -1,149 +0,0 @@
/*
* DECOMPOSITION RGB
*/
#include <stdio.h>
#include <stdint.h>
#include "../floatimg.h"
extern int verbosity;
/* == ---------------------------------------------------- == */
/* some dirty macros */
#define pixidx(fi,x,y) (((y)*fi->width)+(x))
#define getRpix(fi,x,y) (fi->R[ pixidx(fi,(x),(y)) ])
#define getGpix(fi,x,y) (fi->G[ pixidx(fi,(x),(y)) ])
#define getBpix(fi,x,y) (fi->B[ pixidx(fi,(x),(y)) ])
/* A lot of strange and usefull parenthesis */
/* == ---------------------------------------------------- == */
static float compute_z_value(float r, float g, float b)
{
double dval;
return 42.0;
}
/* == ---------------------------------------------------- == */
int fimg_decomp_rgbz_color(FloatImg *psrc, FloatImg *pdst, int k)
{
int x, y, x2, y2;
int w2, h2, idx;
float cumul, vgray;
#if DEBUG_LEVEL
fprintf(stderr, ">>> %s ( %p %p %d )\n", __func__,
psrc, pdst, k);
#endif
fimg_clear(pdst);
w2 = psrc->width/2; h2 = psrc->height/2;
for (y=0; y<h2; y++)
{
y2 = y * 2;
for (x=0; x<w2; x++) {
x2 = x * 2;
cumul = getRpix(psrc, x2, y2) +
getRpix(psrc, x2, y2+1) +
getRpix(psrc, x2+1, y2) +
getRpix(psrc, x2+1, y2+1);
cumul /= 4, vgray = cumul;
pdst->R[pixidx(pdst,x,y)] = cumul;
cumul = getGpix(psrc, x2, y2) +
getGpix(psrc, x2, y2+1) +
getGpix(psrc, x2+1, y2) +
getGpix(psrc, x2+1, y2+1);
cumul /= 4, vgray += cumul;
pdst->G[pixidx(pdst,x+w2,y)] = cumul;
cumul = getBpix(psrc, x2, y2) +
getBpix(psrc, x2, y2+1) +
getBpix(psrc, x2+1, y2) +
getBpix(psrc, x2+1, y2+1);
cumul /= 4, vgray += cumul;
pdst->B[pixidx(pdst,x,y+h2)] = cumul;
idx = pixidx(pdst,x+w2,y+h2);
pdst->R[idx] = pdst->G[idx] = \
pdst->B[idx] = vgray / 3.0;
}
}
return 0;
}
/* == ---------------------------------------------------- == */
/* PUTAIN LE COPIER/COLLÉ DE BATARD !!! */
int fimg_decomp_rgbz_gray(FloatImg *psrc, FloatImg *pdst, int k)
{
int x, y, x2, y2;
int w2, h2, idx;
float cumul, vgray;
#if DEBUG_LEVEL
fprintf(stderr, ">>> %s ( %p %p %d )\n", __func__,
psrc, pdst, k);
#endif
fimg_clear(pdst);
w2 = psrc->width/2; h2 = psrc->height/2;
for (y=0; y<h2; y++)
{
y2 = y * 2;
for (x=0; x<w2; x++) {
x2 = x * 2;
cumul = getRpix(psrc, x2, y2) +
getRpix(psrc, x2, y2+1) +
getRpix(psrc, x2+1, y2) +
getRpix(psrc, x2+1, y2+1);
cumul /= 4, vgray = cumul;
idx = pixidx(pdst,x,y);
pdst->R[idx] = pdst->G[idx] = pdst->B[idx] = cumul;
cumul = getGpix(psrc, x2, y2) +
getGpix(psrc, x2, y2+1) +
getGpix(psrc, x2+1, y2) +
getGpix(psrc, x2+1, y2+1);
cumul /= 4, vgray += cumul;
idx = pixidx(pdst,x+w2,y);
pdst->R[idx] = pdst->G[idx] = pdst->B[idx] = cumul;
cumul = getBpix(psrc, x2, y2) +
getBpix(psrc, x2, y2+1) +
getBpix(psrc, x2+1, y2) +
getBpix(psrc, x2+1, y2+1);
cumul /= 4, vgray += cumul;
idx = pixidx(pdst,x,y+h2);
pdst->R[idx] = pdst->G[idx] = pdst->B[idx] = cumul;
idx = pixidx(pdst,x+w2,y+h2);
pdst->R[idx] = pdst->G[idx] = \
pdst->B[idx] = vgray / 3.0;
}
}
return 0;
}
/* == ---------------------------------------------------- == */

View File

@ -44,7 +44,6 @@ if (verbosity) {
tiff = TIFFOpen(fname, "w");
if (NULL==tiff) {
fprintf(stderr, "erreur TIFFOpen\n");
return -6;
}

View File

@ -1,45 +0,0 @@
/*
* KILL RGB !
*
* nouveau TerreBlanque 4 octobre 2021
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <math.h>
#include "../floatimg.h"
#include "tests.h"
/* --------------------------------------------------------------------- */
int fimg_killrgb_v(FloatImg *src, FloatImg *dst, int k)
{
int foo, line, col;
int ir;
#if DEBUG_LEVEL
fprintf(stderr, ">>> %s ( %p %p %d )\n", __func__,
src, dst, k);
#endif
fimg_clear(dst);
ir = 0;
for (line=0; line<src->height; line++) {
// fprintf(stderr, "%s line %d\n", __func__, line);
for (col=0; col<(src->width-3); col+=3) {
dst->R[ir ] = src->R[ir]; ir++;
dst->G[ir+1] = src->G[ir]; ir++;
dst->B[ir+2] = src->B[ir]; ir++;
}
}
return 0;
}
/* --------------------------------------------------------------------- */

View File

@ -1,102 +0,0 @@
/*
* P I X E L I Z E
*/
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include "../floatimg.h"
extern int verbosity;
/* -------------------------------------------------------------- */
/* nouveau 10 octobre 2021 dans la roulotte de Terreblanque */
#define LARGEUR 16
int fimg_pixelize_h_0(FloatImg *psrc, FloatImg *pdst, int largeur)
{
int line, col, loop, idx;
float cr, cg, cb; /* cumuls */
#if DEBUG_LEVEL
fprintf(stderr, ">>> %s ( %p %p %d )\n", __func__, psrc, pdst, largeur);
#endif
if (fimg_images_not_compatible(psrc, pdst)) {
fprintf(stderr, "%s: err compatibility\n", __func__);
return -8;
}
switch(largeur) {
case 8: case 16: case 32:
break;
default:
fprintf(stderr, "pixeliz bad width %d\n", largeur);
return -77;
}
for (line=0; line<psrc->height; line++) {
for (col=0; col<psrc->width; col+=largeur) {
cr = cg = cb = 0.0;
idx = line * psrc->width + col;
for (loop=0; loop<largeur; loop++) {
cr += psrc->R[idx+loop];
cg += psrc->G[idx+loop];
cb += psrc->B[idx+loop];
}
for (loop=0; loop<largeur; loop++) {
pdst->R[idx+loop] = cr / (float)largeur;
pdst->G[idx+loop] = cg / (float)largeur;
pdst->B[idx+loop] = cb / (float)largeur;
}
}
}
return 0;
}
/* -------------------------------------------------------------- */
/*
* un essai dans la roulotte :)
* 11 oct 2021 : premier jet, essai concluant, mais nécessite
* du travail sur les rand() pour être plus 'noisy'
*
*/
int fimg_pixelize_h_rnd(FloatImg *psrc, FloatImg *pdst, int largeur)
{
static int count = 0;
static int flag = 0;
int foo;
if (0==count) {
if (flag) {
count = irand2(5, 10);
flag = ! flag;
}
else {
count = irand2(20, 40);
flag = ! flag;
}
if (verbosity) {
fprintf(stderr, "%s c=%d f=%c\n", __func__,
count, flag?'T':'F');
}
}
if (verbosity) {
fprintf(stderr, "%s: count=%d flag=%d\n", __func__, count, flag);
}
foo = fimg_pixelize_h_0(psrc, pdst, flag ? 8 : 32);
if (foo) {
fprintf(stderr, "PANIC in %s\n", __func__);
abort();
}
count--; /* nice trick bro */
return 0;
}
/* -------------------------------------------------------------- */

View File

@ -23,11 +23,6 @@ fprintf(stderr, ">>> %s ( %p %p %d )\n", __func__, src, dst, notused);
fprintf(stderr, "!!!!!! %s is a wip !!!!!\n", __func__);
/*
* bon, maintenant, il faut plonger dans du code du
* siecle dernier et l'adapter a ce nouveau contexte
*/
return -1;
}
/* -------------------------------------------------------------------- */

View File

@ -40,36 +40,5 @@ for (y=0; y<src->height; y++) {
return 0;
}
/* -------------------------------------------------------------- */
/*
* see also:
sfx3.c:fimg_crump_hard()
*/
int fimg_split_level(FloatImg *src, FloatImg *dst, int notused)
{
float means[4];
float in[3], out[3];
int foo, idx, surface;
#if DEBUG_LEVEL
fprintf(stderr, ">>> %s ( %p %p 0x%04x )\n", __func__, src, dst, notused);
#endif
foo = fimg_meanvalues(src, means);
if (foo) {
return -66;
}
surface = src->width*src->height;
for(idx=0; idx<surface; idx++) {
if (src->R[idx]<means[0]) dst->R[idx]=src->R[idx]*2.0;
else dst->R[idx]=(src->R[idx]-means[0])*2.0;
if (src->G[idx]<means[1]) dst->G[idx]=src->G[idx]*2.0;
else dst->G[idx]=(src->G[idx]-means[1])*2.0;
if (src->B[idx]<means[2]) dst->B[idx]=src->B[idx]*2.0;
else dst->B[idx]=(src->B[idx]-means[2])*2.0;
}
return 0;
}
/* -------------------------------------------------------------- */
/* -------------------------------------------------------------- */

View File

@ -23,8 +23,7 @@ float global_fvalue;
enum nCmd { Equalize=1, Rotate, Sfx0, F3x3, MIRE, Wfits, Wpng, Wtiff,
Histo, Hsv, Classif, Ctr2x2, Qsortrgb,
Displace, ReadPNG, Plasmas, Hilight, OpenEXR,
Geometrie, FileType, Mirror, KillRGB,
Pixelize,SplitLevel,DecompRgbz };
Geometrie, FileType, Mirror };
typedef struct {
char *name;
int Cmd;
@ -52,10 +51,6 @@ Command commands[] = {
{ "geometrie", Geometrie, },
{ "filetype", FileType },
{ "mirror", Mirror },
{ "killrgb", KillRGB },
{ "pixelize", Pixelize },
{ "spltlvl", SplitLevel },
{ "decomprgbz", DecompRgbz },
{ NULL, 0 }
} ;
@ -221,18 +216,6 @@ switch(opt) {
case Mirror:
foo = essai_miroir(filename, outfile, 0);
break;
case KillRGB:
foo = essai_killrgb(filename, outfile);
break;
case Pixelize:
foo = essai_pixelize(filename, outfile);
break;
case SplitLevel:
foo = essai_split_level(filename, outfile, 0);
break;
case DecompRgbz:
foo = essai_decomprgb(filename, outfile);
break;
default:
fprintf(stderr, "'%s' is a bad command\n", command);
exit(1);

View File

@ -17,71 +17,6 @@
extern int verbosity;
/* --------------------------------------------------------------------- */
int essai_killrgb(char *inf, char *outf)
{
int foo;
FloatImg src, dst;
fprintf(stderr, ">>> %s ( %s %s )\n", __func__, inf, outf);
foo = fimg_create_from_dump(inf, &src);
if (0 != foo) {
fprintf(stderr, "%s: err %d loading image '%s'\n", __func__,
foo, inf);
return foo;
}
fimg_clone(&src, &dst, 1);
foo = fimg_killrgb_v(&src, &dst, 0);
if (foo) {
fprintf(stderr, "%s:%s(): fail %d line %d\n",
__FILE__, __func__, foo, __LINE__);
return foo;
}
foo = fimg_export_picture(&dst, outf, 0);
if (foo) {
fprintf(stderr, "%s : err %d saving result\n", __func__, foo);
return foo;
}
return 0;
}
/* --------------------------------------------------------------------- */
/* --------------------------------------------------------------------- */
int essai_decomprgb(char *inf, char *outf)
{
int foo;
FloatImg src, dst;
fprintf(stderr, ">>> %s ( %s %s )\n", __func__, inf, outf);
foo = fimg_create_from_dump(inf, &src);
if (0 != foo) {
fprintf(stderr, "%s: err %d loading image '%s'\n", __func__,
foo, inf);
return foo;
}
fimg_clone(&src, &dst, 1);
foo = fimg_decomp_rgbz_gray(&src, &dst, 0);
if (foo) {
fprintf(stderr, "%s:%s(): fail %d line %d\n",
__FILE__, __func__, foo, __LINE__);
return foo;
}
foo = fimg_export_picture(&dst, outf, 0);
if (foo) {
fprintf(stderr, "%s : err %d saving result\n", __func__, foo);
return foo;
}
fimg_destroy(&src); fimg_destroy(&dst);
return 0;
}
/* --------------------------------------------------------------------- */
int fimg_recursion_proto(FloatImg *src, FloatImg *dst, int notused);
@ -138,7 +73,7 @@ fimg_clone(&src, &dst, 0);
/* run the crappy code */
foo = fimg_mirror(&src, &dst, 0);
if (foo) {
fprintf(stderr, "err %d in fimg_mirror\n", foo);
fprintf(stderr, "err %d in fimg_mirrot\n", foo);
return -6;
}
@ -148,36 +83,6 @@ if (foo) {
return foo;
}
return 0;
}
/* --------------------------------------------------------------------- */
/* --------------------------------------------------------------------- */
int essai_split_level(char *inf, char *outf, int flags)
{
int foo;
FloatImg src, dst;
fprintf(stderr, ">>> %s ( '%s' '%s' 0x%X )\n", __func__,
inf, outf, flags);
foo = fimg_create_from_dump(inf, &src);
if (0 != foo) {
fprintf(stderr, "%s: err %d loading image '%s'\n", __func__,
foo, inf);
return foo;
}
fimg_clone(&src, &dst, 0);
foo = fimg_split_level(&src, &dst, 0);
if (foo) {
fprintf(stderr, "err %d in split_level\n", foo);
return -6;
}
foo = fimg_export_picture(&dst, outf, 0);
if (foo) {
fprintf(stderr, "%s : err %d saving result\n", __func__, foo);
return foo;
}
return 0;
}
/* --------------------------------------------------------------------- */
@ -894,7 +799,7 @@ return 0;
}
/* --------------------------------------------------------------------- */
int fimg_essai_hsv(char *fname); /* hsv.c */
int fimg_essai_hsv(char *fname); /* hsv.c */
int essai_histogramme(char *fname, int k)
@ -923,43 +828,4 @@ fprintf(stderr, "\\o/ end of %s\n", __func__);
return 0;
}
/* --------------------------------------------------------------------- */
/*
* dans la roulotte de terreblanque
*/
int essai_pixelize(char *infile, char *outfile)
{
FloatImg src, dst;
int foo;
fprintf(stderr, ">>> %s ( '%s' '%s' )\n", __func__, infile, outfile);
memset(&src, 0, sizeof(FloatImg));
foo = fimg_create_from_dump(infile, &src);
if (foo) {
fprintf(stderr, "%s: err load '%s'\n", __func__, infile);
return foo;
}
memset(&dst, 0, sizeof(FloatImg));
foo = fimg_clone(&src, &dst, 0);
if (foo) return -888;
foo = fimg_pixelize_h_0(&src, &dst, 8);
if (foo) {
fprintf(stderr, "in %s, pixelize give us a %d\n", __func__, foo);
return foo;
}
foo = fimg_export_picture(&dst, outfile, 0);
if (foo) {
fprintf(stderr, "%s : err %d saving result to %s\n", __func__,
foo, outfile);
return foo;
}
fimg_destroy(&src);
fimg_destroy(&dst);
return 0;
}
/* --------------------------------------------------------------------- */

View File

@ -5,9 +5,6 @@
int essai_plasma(char *infile, char *outfile, int ikoef, float fkoef);
int essai_miroir(char *inf, char *outf, int flags);
int essai_killrgb(char *inf, char *outf);
int essai_decomprgb(char *inf, char *outf);
int essai_split_level(char *inf, char *outf, int flags);
int essai_displacement(char *infile, char *outfile);
int essai_qsort_rgb(char *infile, char *outfile);
@ -33,5 +30,3 @@ int essai_lecture_png(char *fname, char *outfile, int notused);
int essai_highlights(char *inf, char *outf, int ikoef, float fkoef);
int essai_openexr(char *inf, char *outf, int flags);
int essai_pixelize(char *infile, char *outfile);

View File

@ -3,7 +3,6 @@
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
@ -54,12 +53,6 @@ if (1 == foo) {
return -1;
}
/* --------------------------------------------------------------------- */
/* new Mon 11 Oct 2021 08:28:27 PM CEST */
int irand2(int offset, int modulo)
{
return offset + (rand() % modulo);
}
/* --------------------------------------------------------------------- */
int file_type_from_name(char *name)
{