Compare commits
6 Commits
67cb70fa3b
...
3949d147ef
Author | SHA1 | Date | |
---|---|---|---|
![]() |
3949d147ef | ||
![]() |
72cb5aa0f6 | ||
![]() |
2ff17fc54b | ||
![]() |
ed227d6563 | ||
![]() |
90b9d4e37a | ||
![]() |
253647c008 |
@ -161,20 +161,22 @@ 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, "%s: %d%d bad dims\n", __func__,
|
fprintf(stderr, "WARNING %s: %dx%d bad dims\n", __func__,
|
||||||
picture->width, picture->height);
|
picture->width, picture->height);
|
||||||
return -1;
|
// return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (y=0; y<picture->height; y+=16) {
|
for (y=16; y<picture->height-16; y+=16) {
|
||||||
for (x=0; x<picture->width; x+=16) {
|
for (x=16; x<picture->width-16; 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);
|
||||||
|
@ -39,7 +39,7 @@ fprintf(stderr, ">>> %s ( '%s' '%s' %d %d )\n", __func__,
|
|||||||
globber, destdir, fchain, outfmt);
|
globber, destdir, fchain, outfmt);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// filterstack_list(fchain, "Run the single pass");
|
if (verbosity) filterstack_list(fchain, "Run the single pass");
|
||||||
|
|
||||||
(void)fimg_timer_set(0);
|
(void)fimg_timer_set(0);
|
||||||
|
|
||||||
|
2
experiment/.gitignore
vendored
2
experiment/.gitignore
vendored
@ -3,6 +3,8 @@
|
|||||||
*.fimg
|
*.fimg
|
||||||
*.o
|
*.o
|
||||||
*.pnm
|
*.pnm
|
||||||
|
*.data
|
||||||
|
|
||||||
assemblage
|
assemblage
|
||||||
extracteur
|
extracteur
|
||||||
fimg2obj
|
fimg2obj
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
* https://git.tetalab.org/tTh/FloatImg
|
* https://git.tetalab.org/tTh/FloatImg
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define FIMG_VERSION (221)
|
#define FIMG_VERSION (223)
|
||||||
#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 */
|
||||||
|
@ -10,6 +10,11 @@
|
|||||||
#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)
|
||||||
{
|
{
|
||||||
@ -26,6 +31,8 @@ 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);
|
||||||
}
|
}
|
||||||
@ -60,6 +67,7 @@ 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;
|
||||||
@ -78,6 +86,8 @@ for (x=0; x<fimg->width; x++) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fprintf(stderr, "ALIVE %s\n", __func__);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/* --------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------- */
|
||||||
|
@ -178,11 +178,17 @@ 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");
|
||||||
if (NULL==fp) {
|
// fprintf(stderr, " fp at %p\n", 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);
|
||||||
@ -195,6 +201,9 @@ 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);
|
||||||
|
@ -62,11 +62,11 @@ if (foo) {
|
|||||||
return 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]);
|
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]);
|
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]);
|
vals[4], vals[5], vals[5]-vals[4]);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -153,8 +153,12 @@ switch (nbargs) {
|
|||||||
|
|
||||||
fname = argv[optind];
|
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());
|
__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);
|
||||||
|
|
||||||
@ -166,6 +170,8 @@ 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;
|
||||||
@ -181,8 +187,12 @@ 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);
|
||||||
|
Loading…
Reference in New Issue
Block a user