/* * INTERPOLATOR 2070 * * Don't use that software in real life ! * * imported in FloatImg Mon Nov 9 19:08:57 CET 2020 * */ #include #include #include #include #include #include "../floatimg.h" // XXX #include "fonctions.h" int verbosity; /* -------------------------------------------------------------- */ int interpolator(char *pattern, char *outdir, int Nsteps) { FloatImg A, B, Out, *pFirst, *pSecond, *pTmp; glob_t globbuf; int foo, idx, ipng, w, h, step; int iarray[3]; char *cptr, line[200]; float coef; fprintf(stderr, "\nfrom %s to %s with %d steps.\n", pattern, outdir, Nsteps); memset(&globbuf, 0, sizeof(glob_t)); foo = glob(pattern, 0, NULL, &globbuf); fprintf(stderr, "globbing '%s' -> %d, %ld files found\n", pattern, foo, globbuf.gl_pathc); if (0 == globbuf.gl_pathc) { fprintf(stderr, "%s : no file found, aborting\n", __func__); return -1; } foo = fimg_fileinfos(globbuf.gl_pathv[0], iarray); w = iarray[0], h = iarray[1]; fprintf(stderr, "\tfirst image size : %dx%d\n", w, h); fimg_create(&A, w, h, 3); pFirst = &A; fimg_create(&B, w, h, 3); pSecond = &B; fimg_create(&Out, w, h, 3); pTmp = NULL; ipng = 0; for (idx=0; idx %d\n", idx, foo); continue; } for (step=0; step \n"); exit(1); } nbrsteps = atoi(argv[3]); foo = interpolator(argv[1], argv[2], nbrsteps); fprintf(stderr, "interpolator -> %d\n", foo); return 0; } /* -------------------------------------------------------------- */