Browse Source

allons plutot boire un casanis...

master
phyto 3 years ago
parent
commit
b8d86da9a0
  1. 1
      .gitignore
  2. 2
      floatimg.h
  3. 34
      tools/cumulfimgs.c
  4. 5
      tools/fimg2pnm.c
  5. 3
      tools/mkfimg.c

1
.gitignore vendored

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

2
floatimg.h

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

34
tools/cumulfimgs.c

@ -0,0 +1,34 @@ @@ -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;
}
/* --------------------------------------------------------------------- */

5
tools/fimg2pnm.c

@ -1,3 +1,7 @@ @@ -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); @@ -60,3 +64,4 @@ if (foo) fprintf(stderr, "conversion -> %d\n", foo);
return 0;
}
/* --------------------------------------------------------------------- */

3
tools/mkfimg.c

@ -20,14 +20,13 @@ if (4 != argc) { @@ -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…
Cancel
Save