Browse Source

not ready for primetime

master
tth 1 year ago
parent
commit
7cf56ea70a
  1. 12
      experiment/assemblage.c
  2. 9
      experiment/essai.sh
  3. 4
      experiment/incrustator.c

12
experiment/assemblage.c

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

9
experiment/essai.sh

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

4
experiment/incrustator.c

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

Loading…
Cancel
Save