Compare commits

...

6 Commits

Author SHA1 Message Date
tTh 3949d147ef bump version 2023-06-29 14:30:41 +02:00
tTh 72cb5aa0f6 need more work 2023-06-29 14:29:59 +02:00
tTh 2ff17fc54b chasse au bug 2023-06-29 14:29:14 +02:00
tTh ed227d6563 cosmetic 2023-06-29 14:14:47 +02:00
tTh 90b9d4e37a add *.data 2023-06-29 13:39:26 +02:00
tTh 253647c008 krkrkr 2023-06-26 17:34:53 +02:00
8 changed files with 46 additions and 13 deletions

View File

@ -161,20 +161,22 @@ for (pass=0; pass<szimg/32; pass++) {
return 0;
}
/* -------------------------------------------------------------- */
/*
* FIXME XXX
*/
int random_blocks(FloatImg *picture, int percent)
{
int x, y;
if ( (picture->width%16) || (picture->height%16) )
{
fprintf(stderr, "%s: %d%d bad dims\n", __func__,
fprintf(stderr, "WARNING %s: %dx%d bad dims\n", __func__,
picture->width, picture->height);
return -1;
// return -1;
}
for (y=0; y<picture->height; y+=16) {
for (x=0; x<picture->width; x+=16) {
for (y=16; y<picture->height-16; y+=16) {
for (x=16; x<picture->width-16; x+=16) {
if (percent < (rand()%100) ) {
un_petit_flou_8x8(picture, x, 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);
#endif
// filterstack_list(fchain, "Run the single pass");
if (verbosity) filterstack_list(fchain, "Run the single pass");
(void)fimg_timer_set(0);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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