work on the real PGM export
This commit is contained in:
@@ -83,12 +83,13 @@ return 0;
|
||||
}
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
int essai_2gray(FloatImg *picz, char *outname)
|
||||
int essai_2gray(FloatImg *picz, char *basename)
|
||||
{
|
||||
int foo;
|
||||
FloatImg gray;
|
||||
char outname[200];
|
||||
|
||||
fprintf(stderr, ">>> %s ( %p '%s' )\n", __func__, picz, outname);
|
||||
fprintf(stderr, ">>> %s ( %p '%s' )\n", __func__, picz, basename);
|
||||
|
||||
foo = fimg_create(&gray, picz->width, picz->height, FIMG_TYPE_GRAY);
|
||||
if (foo) {
|
||||
@@ -101,9 +102,16 @@ if (foo) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
strcpy(outname,basename); strcat(outname, ".pnm");
|
||||
foo = fimg_save_as_pnm(&gray, outname, 0);
|
||||
if (foo) {
|
||||
fprintf(stderr, "%s : err %d on save_as_pnm\n", __func__, foo);
|
||||
fprintf(stderr, "%s : err %d on save_as_PNM\n", __func__, foo);
|
||||
exit(1);
|
||||
}
|
||||
strcpy(outname,basename); strcat(outname, ".pgm");
|
||||
foo = fimg_save_as_pgm(&gray, outname, 0);
|
||||
if (foo) {
|
||||
fprintf(stderr, "%s : err %d on save_as_PGM\n", __func__, foo);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@@ -261,8 +269,8 @@ if (verbosity) {
|
||||
fimg_print_sizeof();
|
||||
}
|
||||
|
||||
foo = essai_contraste("quux.fimg");
|
||||
fprintf(stderr, "retour essai contraste -> %d\n", foo);
|
||||
foo = essai_2gray(NULL, "quux");
|
||||
fprintf(stderr, "retour essai -> %d\n", foo);
|
||||
|
||||
// foo = essai_clone_et_copy(0);
|
||||
// fprintf(stderr, "retour essai clone'n'copy -> %d\n", foo);
|
||||
|
||||
Reference in New Issue
Block a user