2019-03-04 02:22:55 +11:00
|
|
|
#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]);
|
2019-07-04 03:51:42 +11:00
|
|
|
fprintf(stderr, "making '%s' %d x %d\n", fname, width, height);
|
2019-03-04 02:22:55 +11:00
|
|
|
|
|
|
|
foo = fimg_create(&fimg, width, height, 3);
|
|
|
|
if (foo) {
|
|
|
|
fprintf(stderr, "create floatimg -> %d\n", foo);
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
fimg_clear(&fimg);
|
|
|
|
|
|
|
|
foo = fimg_dump_to_file(&fimg, fname, 0);
|
|
|
|
if (foo) {
|
|
|
|
fprintf(stderr, "dump floatimg -> %d\n", foo);
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
/* --------------------------------------------------------------------- */
|