Compare commits

...

3 Commits

Author SHA1 Message Date
tonton th 785b521d4f be negative ans reverse the sort 2021-01-14 19:15:22 +01:00
tonton th 7da33bbd16 change debug target 2021-01-14 19:06:44 +01:00
tonton th 7f4ac3b39b cosmetic 2021-01-14 19:06:09 +01:00
4 changed files with 20 additions and 20 deletions

View File

@ -31,8 +31,8 @@ convert -delay 200 /tmp/fstack*.png foo.gif
essai_singlepass ()
{
MP4="/home/tth/Essais/FondageDePlomb/foo.mp4"
INPUT="/home/tth/Essais/FondageDePlomb/capture/??090.fimg"
FILTRE="water:liss3x3"
INPUT="/home/tth/Essais/FondageDePlomb/capture/00???.fimg"
FILTRE="trinitron"
OUTDIR="/tmp/x8/"
echo '********* essai single *********'

View File

@ -33,9 +33,14 @@ typedef struct {
float value; /* from metric analyse */
} IdxValue;
static int negative = 0;
static int cmp_idxvalues(const void *pa, const void *pb)
{
return ( ((IdxValue *)pa)->value > ((IdxValue *)pb)->value);
if (negative)
return ( ((IdxValue *)pa)->value < ((IdxValue *)pb)->value);
else
return ( ((IdxValue *)pa)->value > ((IdxValue *)pb)->value);
}
int tentative_triage(glob_t *ptr_glob, IdxValue **ptr_idxval,
@ -123,6 +128,8 @@ IdxValue *idx_values; /* gni? */
fprintf(stderr, " interpolate from '%s' to '%s' with %d steps.\n",
pattern, outdir, Nsteps);
if (negative) fprintf(stderr, "%s: negative on\n", __func__);
memset(&globbuf, 0, sizeof(glob_t));
foo = glob(pattern, 0, NULL, &globbuf);
fprintf(stderr, "globbing '%s' -> %d, %d files found\n",
@ -146,13 +153,6 @@ if (FIMG_TYPE_RGB != iarray[2]) {
exit(1); /* BLAM! */
}
#if 0
if (infx) fprintf(stderr, "\tin fx #%d\n", infx);
else fprintf(stderr, "\tno in fx\n");
if (outfx) fprintf(stderr, "\tout fx #%d\n", outfx);
else fprintf(stderr, "\tno out fx\n");
#endif
w = iarray[0], h = iarray[1];
fprintf(stderr, "first image size : %dx%d\n", w, h);
@ -232,12 +232,11 @@ puts("usage:\n\tinterpolator [options] <inglob> <outdir> <nbsteep>");
* the options of 'fonderie' software ?
*/
puts("options:");
puts("\t-S nn\t\tmysterious sort");
puts("\t-E i:bla:k\tinput filter chain");
puts("\t-F name:j\toutput filter chain");
puts("\t-n\t\tmake negative");
puts("\t-S nn\t\tmysterious sort");
puts("\t-L\t\tlist available filters");
// OBSOLETE puts("\t-w nn\t\tinput effect");
// OBSOLETE puts("\t-x nn\t\toutput effect");
puts("\t-v\t\tincrease verbosity");
if (verbosity) {
@ -268,7 +267,7 @@ for (foo=0; foo<argc; foo++)
fprintf(stderr, "%5d %s\n", foo, argv[foo]);
#endif
while ((opt = getopt(argc, argv, "E:F:hLS:vw:x:")) != -1) {
while ((opt = getopt(argc, argv, "E:F:hLnS:v")) != -1) {
switch(opt) {
case 'E': InFchain = optarg; break;
case 'F': OutFchain = optarg; break;
@ -278,8 +277,7 @@ while ((opt = getopt(argc, argv, "E:F:hLS:vw:x:")) != -1) {
exit(0);
case 'S': sort = atoi(optarg); break;
case 'v': verbosity++; break;
// OBSOLETE case 'w': inFx = atoi(optarg); break;
// OBSOLETE case 'x': outFx = atoi(optarg); break;
case 'n': negative = 1; break;
}
}

View File

@ -48,11 +48,12 @@ return -1;
/* nouveau du premier dimanche de 2020 'nextgen' */
static int pixel_trinitron(FloatImg *pimg, int pos[4], float *fvals)
{
int x, y, off;
int x, y, pline, off;
for (y=pos[1]; y<pos[1]+pos[3]; y++) {
for (x=pos[0]+1; x<pos[0]+pos[2]-1; x++) {
off = (y*pimg->width) + x;
pline = y*pimg->width;
for (x=pos[0]+2; x<pos[0]+pos[2]-2; x++) {
off = pline + x;
pimg->R[off] = fvals[0];
pimg->G[off] = fvals[1];
pimg->B[off] = fvals[2];

View File

@ -104,7 +104,8 @@ fimg_destroy(&image);
single_print_state("end of run :)", 0);
elapsed = fimg_timer_get(0);
fprintf(stderr, " %d frames, elapsed %.3f s, %.3f fps\n",
fprintf(stderr, "%s: %d frames, elapsed %.3f s, %.3f fps\n",
__func__,
globbuf.gl_pathc, elapsed,
(double)globbuf.gl_pathc/elapsed);