Bibliothèque de traitements d'images en virgule flottante. http://la.buvette.org/photos/cumul/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
1.5 KiB

1 year ago
/*
*/
#include <stdio.h>
#include <unistd.h> /* pour getopt */
#include <stdlib.h>
#include "../floatimg.h"
int verbosity;
/* ------------------------------------------------------------- */
int faire_un_halfsize(char *iname, char *oname, int notused)
{
FloatImg src, dst;
int foo;
foo = fimg_create_from_dump(iname, &src);
if (foo) {
fprintf(stderr, "create fimg from '%s' -> %d\n", iname, foo);
return -1;
}
memset(&dst, 0, sizeof(FloatImg));
foo = fimg_halfsize_0(&src, &dst, 0);
if (foo) {
fprintf(stderr, "halfize fail -> %d\n", foo);
return -1;
}
foo = fimg_dump_to_file(&dst, oname, 0);
if (foo) {
fprintf(stderr, "save to '%s' -> %d\n", oname, foo);
return -1;
}
return -1;
}
/* ------------------------------------------------------------- */
void help(int u)
{
}
/* ------------------------------------------------------------- */
int main(int argc, char *argv[])
{
int foo, opt, action;
char *srcname = "";
char *dstname = "out.fimg";
while ((opt = getopt(argc, argv, "hv")) != -1) {
switch(opt) {
case 'h': help(0); break;
case 'v': verbosity++; break;
}
}
if (2 != argc-optind) {
fprintf(stderr, "error: %s need two filenames\n", argv[0]);
exit(1);
}
srcname = argv[optind];
dstname = argv[optind+1];
fprintf(stderr, "%s: optind: %d src: %s dst: %s\n", argv[0], optind,
srcname, dstname);
foo = faire_un_halfsize(srcname, dstname, 0);
return 0;
}
/* ------------------------------------------------------------- */