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

41
tools/mkfimg.c Normal file
View File

@@ -0,0 +1,41 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "../floatimg.h"
/* --------------------------------------------------------------------- */
int main(int argc, char *argv[])
{
int foo;
int width, height;
char *fname;
FloatImg fimg;
if (4 != argc) {
fimg_print_version(1);
fprintf(stderr, "Usage:\n\t%s quux.fimg width height\n", argv[0]);
exit(1);
}
fname = argv[1];
width = atoi(argv[2]); height = atoi(argv[3]);
fprintf(stderr, "making %s %d x %d\n", fname, width, height);
foo = fimg_create(&fimg, width, height, 3);
if (foo) {
fprintf(stderr, "create floatimg -> %d\n", foo);
exit(1);
}
fimg_describe(&fimg, "just a black flimg");
fimg_clear(&fimg);
foo = fimg_dump_to_file(&fimg, fname, 0);
if (foo) {
fprintf(stderr, "dump floatimg -> %d\n", foo);
exit(1);
}
return 0;
}
/* --------------------------------------------------------------------- */