not ready for primetime

This commit is contained in:
tth 2021-03-29 10:36:59 +02:00
parent f3c9d85c73
commit 7cf56ea70a
3 changed files with 21 additions and 4 deletions

View File

@ -22,7 +22,7 @@ if (foo) {
fprintf(stderr, "%s: Kkrkr %d pour create grande\n", __func__, foo); fprintf(stderr, "%s: Kkrkr %d pour create grande\n", __func__, foo);
return -1; return -1;
} }
fimg_vdeg_a(&grande, 13.37); fimg_vdeg_a(&grande, 2345);
foo = fimg_create(&incrust, 640, 480, FIMG_TYPE_RGB); foo = fimg_create(&incrust, 640, 480, FIMG_TYPE_RGB);
if (foo) { if (foo) {
@ -31,8 +31,12 @@ if (foo) {
} }
// fimg_drand48(&incrust, 13.37); // fimg_drand48(&incrust, 13.37);
foo = fimg_load_from_dump("foo.fimg", &incrust); foo = fimg_load_from_dump("foo.fimg", &incrust);
if (foo) {
fprintf(stderr, "%s: err %d loading image\n", __func__, foo);
return -1;
}
foo = incrustator_0(&incrust, &grande, 100, 100, 0); foo = incrustator_0(&incrust, &grande, 333, 333, 0);
if (foo) { if (foo) {
fprintf(stderr, "%s: Kkrkr %d sur incrustator_0\n", __func__, foo); fprintf(stderr, "%s: Kkrkr %d sur incrustator_0\n", __func__, foo);
return -1; return -1;
@ -45,6 +49,8 @@ if (foo) {
return -1; return -1;
} }
fimg_destroy(&incrust); fimg_destroy(&grande);
return 0; return 0;
} }
/* ---------------------------------------------- ~~~~~~~~~~~~~~~~ */ /* ---------------------------------------------- ~~~~~~~~~~~~~~~~ */
@ -52,7 +58,7 @@ int main(int argc, char *argv[])
{ {
int foo; int foo;
verbosity = 1; verbosity = 2;
fimg_print_version(1); fimg_print_version(1);

9
experiment/essai.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/bash
make assemblage
grabvidseq -vv -n 4 -p 3.3333 -o foo.fimg
./assemblage -v
display out.pnm

View File

@ -36,15 +36,17 @@ if ( (xpos < 0) || (xpos > pdst->width - psrc->width) ||
/* move all the data by looping over lines */ /* move all the data by looping over lines */
srcpos = 0; srcpos = 0;
dstpos = (ypos * pdst->width) + xpos;
szl = psrc->width * sizeof(float); szl = psrc->width * sizeof(float);
for (y=0; y<psrc->height; y++) { for (y=0; y<psrc->height; y++) {
dstpos = ((y + ypos) * pdst->width) + xpos;
// fprintf(stderr, " %7d %7d %7d\n", y, srcpos, dstpos); // fprintf(stderr, " %7d %7d %7d\n", y, srcpos, dstpos);
memcpy(pdst->R + dstpos, psrc->R + srcpos, szl); memcpy(pdst->R + dstpos, psrc->R + srcpos, szl);
memcpy(pdst->G + dstpos, psrc->G + srcpos, szl); memcpy(pdst->G + dstpos, psrc->G + srcpos, szl);
memcpy(pdst->B + dstpos, psrc->B + srcpos, szl); memcpy(pdst->B + dstpos, psrc->B + srcpos, szl);
srcpos += psrc->width; srcpos += psrc->width;
dstpos += pdst->width;
} }
return 0; return 0;