Compare commits

..

9 Commits

Author SHA1 Message Date
tth
73b8048dea problem solved ? 2021-05-10 00:14:45 +02:00
tth
198bd874f1 need more work 2021-05-10 00:05:52 +02:00
tth
a27a165404 debug code added 2021-05-10 00:05:01 +02:00
tth
c30e073abd mollyguard + debug code 2021-05-10 00:04:10 +02:00
tth
f67cd9be3e aie... 2021-05-10 00:03:28 +02:00
tth
69cb36b84c better message 2021-05-09 23:30:58 +02:00
tth
a60d2afa4d + fimghalsize 2021-05-09 20:52:11 +02:00
tth
936ea6ceab added sqrt & pow2 processing 2021-05-08 21:57:10 +02:00
tth
c0f3b86d0c oups... 2021-05-08 21:48:29 +02:00
9 changed files with 66 additions and 12 deletions

View File

@ -157,7 +157,7 @@ return retval;
* processor.
*/
#define DEBUG_THIS_CRAP 0
#define DEBUG_THIS_CRAP 100
int crapulator(FloatImg *image, int idFx, float fval)
{
@ -262,6 +262,13 @@ switch (idFx) {
retval = trinitron(image, 0);
break;
case CR_sqrt:
retval = fimg_square_root(image, image, 1000.0);
break;
case CR_pow2:
retval = fimg_power_2(image, image, 1000.0);
break;
/* here are the glitches */
case CR_bsombra: /* experiment ! */
retval = des_bords_sombres_a(image, 160);
@ -291,6 +298,8 @@ switch (idFx) {
case CR_message:
fprintf(stderr, "### msg from pid %d, fval=%f ###\n",
getpid(), fval);
/* here, we can display stats ! */
fimg_describe(image, "in crapulator");
retval = 0;
break;

View File

@ -19,7 +19,9 @@
18 updown 1 1.0
19 hipass 1 1.0
20 octotree 1 1.0
21 trinitron 3, 0.0
21 trinitron 3 0.0
22 sqrt 1 0.0
23 pow2 1 0.0
24 bsombra 1 1.0
25 vsglitch 1 1.0
26 rndblks 1 1.0

View File

@ -51,6 +51,11 @@ fprintf(stderr, ">>> %s ( %p %p %d )\n", __func__,
pfifo, destination, step);
#endif
if (step<1){
fprintf(stderr, "***** %s invalid step %d\n", __func__, step);
exit(1);
}
if (NULL==destination) {
pdest = &(pfifo->total); }
else {
@ -68,11 +73,11 @@ for (idx=0; idx<pfifo->nbslots; idx += step) {
}
}
/* XXX
#if 0
fprintf(stderr, "*** %s:%s writing debugB file ***\n",
__FILE__, __func__);
fimg_dump_to_file(&g_fifo.total, "debugB.fimg", 0);
XXX */
#endif
return 0;
}
@ -96,6 +101,10 @@ if (foo) {
return foo;
}
#if 0
fimg_dump_to_file(&g_fifo.total, "outputXXX.fimg", 0);
#endif
foo = fimg_export_picture(&g_fifo.total, fname, 0);
if (foo) {
fprintf(stderr, "ERR EXPORT '%s' is %d\n", fname, foo);

View File

@ -118,7 +118,7 @@ for (idx=0; idx<f_stacks[numid].count; idx++) {
fv = f_stacks[numid].slots[idx].fval;
if (verbosity > 1)
fprintf(stderr, "stack %d pass %d : effect %2d on %p\n",
fprintf(stderr, "stack %d idx %d : effect %2d on %p\n",
numid, idx, eff, target);
foo = crapulator(target, eff, fv);

View File

@ -145,6 +145,9 @@ for (idx=0; idx<globbuf.gl_pathc; idx++) {
fprintf(stderr, "%s: input filter -> %d\n", __func__, foo);
exit(1);
}
#if 0
if (idx==42) fimg_dump_to_file(&input, "inputXXX.fimg", 0);
#endif
foo = traite_une_image(&input, outdir);
if (foo) {

View File

@ -10,6 +10,7 @@
extern int verbosity;
/* -------------------------------------------------------------- */
/* usage --> sfx.c:trinitron */
int stat_zone(FloatImg *pimg, int geom[4], float v3[3])
{
int x, y, xe, ye;
@ -43,9 +44,12 @@ return 0;
}
/* -------------------------------------------------------------- */
/*
* premier essai...
* premier essai : moyenne de toutes les composantes
* de tous les pixels.
*
* Question: pourquoi pas le retour en double precision ?
*/
int get_float_metric_a(FloatImg *pimg, float *where)
int get_float_metric_avg(FloatImg *pimg, float *where)
{
float means[4]; /* four values : R G B A */
int foo;
@ -63,7 +67,8 @@ if (foo) {
return 0;
}
/* -------------------------------------------------------------- */
int get_float_metric_b(FloatImg *pimg, float *where)
/* echantillonage des pixels rouges */
int get_float_metric_iRed(FloatImg *pimg, float *where)
{
int idx, size, nbre;
double adder;
@ -79,6 +84,28 @@ for (idx=20; idx < size; idx+=42) {
return 0;
}
/* -------------------------------------------------------------- */
int get_float_metric_LR(FloatImg *pimg, float *where)
{
int coords[4], foo;
float valL[3], valR[3];
coords[0] = 0; // X
coords[1] = 0; // Y
coords[2] = pimg->width / 2; // W
coords[3] = pimg->height; // H
foo = stat_zone(pimg, coords, valL);
coords[1] = pimg->width / 2;
foo = stat_zone(pimg, coords, valR);
*where = valL[1] - valR[1];
return 0;
}
/* -------------------------------------------------------------- */
/*
* et voici le grand dispactheur
*/
int get_float_metric_from_file(char *fname, float *where, int mode)
{
FloatImg image;
@ -97,10 +124,13 @@ if (foo) {
fval = -1.0; /* sensible default value */
switch (mode) {
case 0: case 1:
foo = get_float_metric_a(&image, &fval);
foo = get_float_metric_avg(&image, &fval);
break;
case 2:
foo = get_float_metric_b(&image, &fval);
foo = get_float_metric_iRed(&image, &fval);
break;
case 3:
foo = get_float_metric_LR(&image, &fval);
break;
default:
fprintf(stderr, "%s: method %d invalid\n",

View File

@ -61,7 +61,7 @@ int single_push_picture(FloatImg *pimg)
{
int foo;
char line[1000], buff[100];
char *extension = ".png";
char *extension = "png";
#if DEBUG_LEVEL
fprintf(stderr, ">>> %s ( %p )\n", __func__, pimg);

View File

@ -7,6 +7,7 @@ cp tools/mkfimg tools/fimg2pnm tools/fimgops \
tools/fimg2png tools/fimg2tiff tools/fimg2fits \
tools/png2fimg tools/fimgstats tools/fimgfx \
tools/cumulfimgs tools/fimg2text \
tools/fimghalfsize \
/usr/local/bin
cp v4l2/grabvidseq v4l2/video-infos \

View File

@ -60,7 +60,7 @@ for (idx=0; idx<nbre; idx++) {
d->B[idx] = maxval * sqrt(dval);
}
return -1;
return 0;
}
/* ---------------------------------------------------------------- */
int fimg_power_2(FloatImg *s, FloatImg *d, double maxval)