first shoot

This commit is contained in:
Tonton Th
2019-03-03 16:22:55 +01:00
commit 5a72327882
25 changed files with 1480 additions and 0 deletions

39
tools/png2fimg.c Normal file
View File

@@ -0,0 +1,39 @@
/*
* PNG ---> FIMG
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include "../floatimg.h"
/* --------------------------------------------------------------------- */
int main(int argc, char *argv[])
{
FloatImg fimg;
int foo;
if (3 != argc) {
fimg_print_version(1);
fprintf(stderr, "usage:\n\t%s foo.fimg bar.png\n", argv[0]);
exit(1);
}
memset(&fimg, 0, sizeof(FloatImg));
foo = fimg_create_from_png(argv[1], &fimg);
if (foo) {
fprintf(stderr, "%s : err %d, abort.\n", argv[0], foo);
exit(1);
}
fimg_describe(&fimg, "oups");
foo = fimg_save_as_pnm(&fimg, "t.pnm", 0);
fprintf(stderr, "save as pnm -> %d\n", foo);
return 0;
}
/* --------------------------------------------------------------------- */