Compare commits

..

No commits in common. "3949d147ef0dbaccebf1c2ed931f1181c0283dcc" and "67cb70fa3bba5155b6492a0c4781c72efc6304b6" have entirely different histories.

8 changed files with 13 additions and 46 deletions

View File

@ -161,22 +161,20 @@ for (pass=0; pass<szimg/32; pass++) {
return 0; return 0;
} }
/* -------------------------------------------------------------- */ /* -------------------------------------------------------------- */
/*
* FIXME XXX
*/
int random_blocks(FloatImg *picture, int percent) int random_blocks(FloatImg *picture, int percent)
{ {
int x, y; int x, y;
if ( (picture->width%16) || (picture->height%16) ) if ( (picture->width%16) || (picture->height%16) )
{ {
fprintf(stderr, "WARNING %s: %dx%d bad dims\n", __func__, fprintf(stderr, "%s: %d%d bad dims\n", __func__,
picture->width, picture->height); picture->width, picture->height);
// return -1; return -1;
} }
for (y=16; y<picture->height-16; y+=16) { for (y=0; y<picture->height; y+=16) {
for (x=16; x<picture->width-16; x+=16) { for (x=0; x<picture->width; x+=16) {
if (percent < (rand()%100) ) { if (percent < (rand()%100) ) {
un_petit_flou_8x8(picture, x, y); un_petit_flou_8x8(picture, x, y);
un_petit_flou_8x8(picture, x+8, y); un_petit_flou_8x8(picture, x+8, y);

View File

@ -39,7 +39,7 @@ fprintf(stderr, ">>> %s ( '%s' '%s' %d %d )\n", __func__,
globber, destdir, fchain, outfmt); globber, destdir, fchain, outfmt);
#endif #endif
if (verbosity) filterstack_list(fchain, "Run the single pass"); // filterstack_list(fchain, "Run the single pass");
(void)fimg_timer_set(0); (void)fimg_timer_set(0);

View File

@ -3,8 +3,6 @@
*.fimg *.fimg
*.o *.o
*.pnm *.pnm
*.data
assemblage assemblage
extracteur extracteur
fimg2obj fimg2obj

View File

@ -20,7 +20,7 @@
* https://git.tetalab.org/tTh/FloatImg * https://git.tetalab.org/tTh/FloatImg
*/ */
#define FIMG_VERSION (223) #define FIMG_VERSION (221)
#define RELEASE_NAME ("noname") #define RELEASE_NAME ("noname")
/* XXX add a test for stdint.h / uint32_t XXX */ /* XXX add a test for stdint.h / uint32_t XXX */

View File

@ -10,11 +10,6 @@
#include "../floatimg.h" #include "../floatimg.h"
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
/*
*********************************************
* SEGFAULT SI IMAGE TROP PETITE *
*********************************************
*/
int fimg_test_pattern(FloatImg *fimg, int type, double dval) int fimg_test_pattern(FloatImg *fimg, int type, double dval)
{ {
@ -31,8 +26,6 @@ if (fimg->type != FIMG_TYPE_RGB) {
return -6; return -6;
} }
fprintf(stderr, "ENTERING %s\n", __func__);
if (type) { if (type) {
fprintf(stderr, "%s : %d %f\n", __func__, type, dval); fprintf(stderr, "%s : %d %f\n", __func__, type, dval);
} }
@ -67,7 +60,6 @@ for (x=0; x<fimg->width; x++) {
// fprintf(stderr, " %6d %f\n", x, val); // fprintf(stderr, " %6d %f\n", x, val);
} }
k = (fimg->height / 4) + 90; k = (fimg->height / 4) + 90;
for (x=0; x<fimg->width; x++) { for (x=0; x<fimg->width; x++) {
val = ((x%8)<4) ? dval : 0.0; val = ((x%8)<4) ? dval : 0.0;
@ -86,8 +78,6 @@ for (x=0; x<fimg->width; x++) {
} }
} }
fprintf(stderr, "ALIVE %s\n", __func__);
return 0; return 0;
} }
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */

View File

@ -178,17 +178,11 @@ if (FIMG_TYPE_RGB != fimg->type) {
return -8; return -8;
} }
// fprintf(stderr, "'%s' try to open '%s'\n", __func__, fname);
fp = fopen(fname, "w"); fp = fopen(fname, "w");
// fprintf(stderr, " fp at %p\n", fp); if (NULL==fp) {
if (NULL == fp) {
perror(fname); perror(fname);
return -1; return -1;
} }
else {
// fprintf(stderr, "file '%s' opened\n", fname);
}
memset(&filehead, 0, sizeof(filehead)); memset(&filehead, 0, sizeof(filehead));
memcpy(filehead.magic, "FIMG", 4); memcpy(filehead.magic, "FIMG", 4);
@ -201,9 +195,6 @@ if (1 != foo) {
fclose(fp); fclose(fp);
return -2; return -2;
} }
// fprintf(stderr, "'%s' write header --> %d\n", __func__, foo);
nbre = fimg->width * fimg->height; /* pixels per frame */ nbre = fimg->width * fimg->height; /* pixels per frame */
foo = fwrite(fimg->R, sizeof(float), nbre, fp); foo = fwrite(fimg->R, sizeof(float), nbre, fp);

View File

@ -62,11 +62,11 @@ if (foo) {
return foo; return foo;
} }
printf("Rmin %12.6g Rmax %12.6g delta %12.6g\n", printf("Rmin %12.4g Rmax %12.4g delta %12g\n",
vals[0], vals[1], vals[1]-vals[0]); vals[0], vals[1], vals[1]-vals[0]);
printf("Gmin %12.6g Gmax %12.6g %12.6g\n", printf("Gmin %12.4g Gmax %12.4g %12g\n",
vals[2], vals[3], vals[3]-vals[2]); vals[2], vals[3], vals[3]-vals[2]);
printf("Bmin %12.6g Bmax %12.6g %12.6g\n", printf("Bmin %12.4g Bmax %12.4g %12g\n",
vals[4], vals[5], vals[5]-vals[4]); vals[4], vals[5], vals[5]-vals[4]);
return 0; return 0;

View File

@ -153,12 +153,8 @@ switch (nbargs) {
fname = argv[optind]; fname = argv[optind];
if (verbosity>1) { if (verbosity>1) fprintf(stderr, "*** mkfimg *** %s %s *** pid %ld\n",
fprintf(stderr, "*** mkfimg *** %s %s *** pid %ld\n",
__DATE__, __TIME__, (long)getpid()); __DATE__, __TIME__, (long)getpid());
fimg_print_version(0);
}
if (verbosity) fprintf(stderr, "::: %s is making '%s' %dx%d, type %d\n", if (verbosity) fprintf(stderr, "::: %s is making '%s' %dx%d, type %d\n",
argv[0], fname, width, height, type); argv[0], fname, width, height, type);
@ -170,8 +166,6 @@ if (foo) {
exit(3); exit(3);
} }
/* NO ERROR CONTROL ? WTF ? */
switch(type) { switch(type) {
default: default:
case T_BLACK: fimg_clear(&fimg); break; case T_BLACK: fimg_clear(&fimg); break;
@ -187,12 +181,8 @@ switch(type) {
case -1: exit(1); case -1: exit(1);
} }
if (verbosity > 1) fprintf(stderr, "%s: end of switch\n", __func__);
/* NO ERROR CONTROL ? WTF ? */
if (wrmdata) { if (wrmdata) {
fprintf(stderr, "%s: warning, metadata is bogus\n", argv[0]); // fprintf(stderr, "%s: warning, metadata is bogus\n", argv[0]);
(void)fimg_default_metadata(&metadata, 9); (void)fimg_default_metadata(&metadata, 9);
sprintf(metadata.idcam, "mkfimg (libv %d)", FIMG_VERSION); sprintf(metadata.idcam, "mkfimg (libv %d)", FIMG_VERSION);
foo = fimg_dumpmd_to_file(&fimg, fname, &metadata, 0); foo = fimg_dumpmd_to_file(&fimg, fname, &metadata, 0);