forked from tTh/FloatImg
allons plutot boire un casanis...
This commit is contained in:
parent
9c845b5d04
commit
b8d86da9a0
1
.gitignore
vendored
1
.gitignore
vendored
@ -25,3 +25,4 @@ tools/mkfimg
|
||||
tools/png2fimg
|
||||
tools/addtga2fimg
|
||||
tools/addpnm2fimg
|
||||
tools/cumulfimgs
|
||||
|
@ -2,7 +2,7 @@
|
||||
* floatimg.h
|
||||
*/
|
||||
|
||||
#define FIMG_VERSION 60
|
||||
#define FIMG_VERSION 61
|
||||
|
||||
/*
|
||||
* in memory descriptor
|
||||
|
34
tools/cumulfimgs.c
Normal file
34
tools/cumulfimgs.c
Normal 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;
|
||||
}
|
||||
/* --------------------------------------------------------------------- */
|
@ -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;
|
||||
}
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user