2021-03-28 18:52:03 +02:00
|
|
|
/*
|
|
|
|
* assemblage experimental
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
2021-05-25 12:01:56 +02:00
|
|
|
#include <stdint.h>
|
2021-03-28 18:52:03 +02:00
|
|
|
|
|
|
|
#include "../floatimg.h"
|
|
|
|
|
2021-05-10 00:44:29 +02:00
|
|
|
// #include "incrustator.h"
|
2021-03-28 18:52:03 +02:00
|
|
|
|
|
|
|
int verbosity;
|
|
|
|
|
|
|
|
/* ---------------------------------------------- ~~~~~~~~~~~~~~~~ */
|
2021-03-30 21:22:04 +02:00
|
|
|
/*
|
|
|
|
* le prototype de base avec trop peu de parametres, mais
|
|
|
|
* c'est assez dur de formaliser la structure des informations
|
|
|
|
* a transmettre de fonction en fonction, et commant on peut
|
|
|
|
* integrer cette mecanique dans singlepass.c ?!#@
|
|
|
|
*/
|
2021-03-28 18:52:03 +02:00
|
|
|
int premier_essai(int largeur, int hauteur, char *outname)
|
|
|
|
{
|
|
|
|
FloatImg grande, incrust;
|
|
|
|
int foo;
|
|
|
|
|
|
|
|
foo = fimg_create(&grande, largeur, hauteur, FIMG_TYPE_RGB);
|
|
|
|
if (foo) {
|
|
|
|
fprintf(stderr, "%s: Kkrkr %d pour create grande\n", __func__, foo);
|
|
|
|
return -1;
|
|
|
|
}
|
2021-03-29 10:36:59 +02:00
|
|
|
fimg_vdeg_a(&grande, 2345);
|
2021-03-28 18:52:03 +02:00
|
|
|
|
|
|
|
foo = fimg_create(&incrust, 640, 480, FIMG_TYPE_RGB);
|
|
|
|
if (foo) {
|
|
|
|
fprintf(stderr, "%s: Kkrkr %d pour create incrust\n", __func__, foo);
|
|
|
|
return -1;
|
|
|
|
}
|
2021-03-28 19:33:02 +02:00
|
|
|
// fimg_drand48(&incrust, 13.37);
|
|
|
|
foo = fimg_load_from_dump("foo.fimg", &incrust);
|
2021-03-29 10:36:59 +02:00
|
|
|
if (foo) {
|
|
|
|
fprintf(stderr, "%s: err %d loading image\n", __func__, foo);
|
|
|
|
return -1;
|
|
|
|
}
|
2021-03-28 18:52:03 +02:00
|
|
|
|
2021-03-30 21:22:04 +02:00
|
|
|
#define FLAGS 0
|
2021-05-10 00:44:29 +02:00
|
|
|
foo = fimg_incrustator_0(&incrust, &grande, 111, 111, FLAGS);
|
2021-03-30 21:22:04 +02:00
|
|
|
#undef FLAGS
|
2021-03-28 18:52:03 +02:00
|
|
|
if (foo) {
|
2021-03-30 21:22:04 +02:00
|
|
|
fprintf(stderr, "%s: err %d sur incrustator_0\n", __func__, foo);
|
2021-03-28 18:52:03 +02:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
foo = fimg_export_picture(&grande, outname, 0);
|
|
|
|
if (foo) {
|
|
|
|
fprintf(stderr, "%s: error %d export '%s'\n", __func__,
|
|
|
|
foo, outname);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2021-03-29 10:36:59 +02:00
|
|
|
fimg_destroy(&incrust); fimg_destroy(&grande);
|
|
|
|
|
2021-03-28 18:52:03 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
/* ---------------------------------------------- ~~~~~~~~~~~~~~~~ */
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
int foo;
|
|
|
|
|
2021-03-29 10:36:59 +02:00
|
|
|
verbosity = 2;
|
2021-03-28 18:52:03 +02:00
|
|
|
|
|
|
|
fimg_print_version(1);
|
|
|
|
|
2021-05-10 00:44:29 +02:00
|
|
|
foo = premier_essai(1280, 1024, "out.png");
|
2021-03-28 18:52:03 +02:00
|
|
|
if (foo) {
|
|
|
|
fprintf(stderr, "EPIC FAIL %s\n", argv[0]);
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
/* ---------------------------------------------- ~~~~~~~~~~~~~~~~ */
|
|
|
|
|
|
|
|
|
|
|
|
|