allons plutot boire un casanis...

This commit is contained in:
phyto 2019-07-03 18:51:42 +02:00
parent 9c845b5d04
commit b8d86da9a0
5 changed files with 42 additions and 3 deletions

1
.gitignore vendored
View File

@ -25,3 +25,4 @@ tools/mkfimg
tools/png2fimg
tools/addtga2fimg
tools/addpnm2fimg
tools/cumulfimgs

View File

@ -2,7 +2,7 @@
* floatimg.h
*/
#define FIMG_VERSION 60
#define FIMG_VERSION 61
/*
* in memory descriptor

34
tools/cumulfimgs.c Normal file
View File

@ -0,0 +1,34 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "../floatimg.h"
int verbosity;
/* --------------------------------------------------------------------- */
void help(int v)
{
puts("options :");
puts("\t-v\tincrease verbosity");
puts("\t-o\tname of output file");
if (verbosity) { puts(""); fimg_print_version(1); }
}
/* --------------------------------------------------------------------- */
int main(int argc, char *argv[])
{
int foo;
int opt;
char *output_file = "noname.fimg";
while ((opt = getopt(argc, argv, "ho:v")) != -1) {
switch(opt) {
case 'h': help(0); break;
case 'o': output_file = optarg; break;
case 'v': verbosity++; break;
}
}
return 0;
}
/* --------------------------------------------------------------------- */

View File

@ -1,3 +1,7 @@
/*
* conversion vers le format PNM
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@ -60,3 +64,4 @@ if (foo) fprintf(stderr, "conversion -> %d\n", foo);
return 0;
}
/* --------------------------------------------------------------------- */

View File

@ -20,14 +20,13 @@ if (4 != argc) {
}
fname = argv[1];
width = atoi(argv[2]); height = atoi(argv[3]);
fprintf(stderr, "making %s %d x %d\n", fname, width, height);
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);