Compare commits

..

2 Commits

Author SHA1 Message Date
tth
ed864ea45a bla 2020-07-02 16:55:45 +02:00
tth
a81d218fc8 more useles messages 2020-06-24 12:37:02 +02:00
5 changed files with 37 additions and 7 deletions

View File

@ -14,7 +14,7 @@
int fimg_test_pattern(FloatImg *fimg, int type, double dval) int fimg_test_pattern(FloatImg *fimg, int type, double dval)
{ {
int nio; int nio;
int x, y; int x, y, k;
float fr, fg, fb, val; float fr, fg, fb, val;
#if DEBUG_LEVEL #if DEBUG_LEVEL
@ -46,6 +46,14 @@ for (x=0; x<fimg->width; x++) {
fimg_plot_rgb(fimg, x, y, fr, fg, fb); fimg_plot_rgb(fimg, x, y, fr, fg, fb);
} }
k = fimg->height/4;
for (x=0; x<fimg->width; x++) {
val = ((double)x / (double)fimg->width) * dval;
for (y=0; y<20; y++) {
fimg_plot_rgb(fimg, x, k+y, val, val, val);
fimg_plot_rgb(fimg, x, k+y+20, 1-val, 1-val, 1-val);
}
}
return 0; return 0;

View File

@ -307,6 +307,20 @@ printf("%-10s %d\n\n", fname, foo);
return 0; return 0;
} }
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
int essai_mire(char *outname, int notused)
{
FloatImg fimg;
int re;
fimg_create(&fimg, 1280, 960, FIMG_TYPE_RGB);
re = fimg_test_pattern(&fimg, 9, 1.0);
fimg_save_as_pnm(&fimg, "mire.pnm", 0);
return -1;
}
/* --------------------------------------------------------------------- */
int essai_rampes(void) int essai_rampes(void)
{ {
FloatImg fimg; FloatImg fimg;
@ -351,7 +365,7 @@ fprintf(stderr, "save as png -> %d\n", foo);
return 0; return 0;
} }
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
enum nCmd { Equalize=1, Rotate, Sfx0, F3x3 }; enum nCmd { Equalize=1, Rotate, Sfx0, F3x3, MIRE };
typedef struct { typedef struct {
char *name; char *name;
int Cmd; int Cmd;
@ -362,6 +376,7 @@ Command commands[] = {
{ "rotate", Rotate }, { "rotate", Rotate },
{ "sfx0", Sfx0 }, { "sfx0", Sfx0 },
{ "f3x3", F3x3 }, { "f3x3", F3x3 },
{ "mire", MIRE },
{ NULL, 0 } { NULL, 0 }
} ; } ;
@ -383,7 +398,7 @@ void help(int k)
{ {
Command *pcmd; Command *pcmd;
fprintf(stderr, "usage:\n\t./t command in-filename\n"); fprintf(stderr, "usage:\n\t./t command filename\n");
fprintf(stderr, "commands:\n"); fprintf(stderr, "commands:\n");
pcmd = commands; pcmd = commands;
@ -440,6 +455,9 @@ switch(opt) {
case F3x3: case F3x3:
foo = essai_filtrage_3x3(filename); break; foo = essai_filtrage_3x3(filename); break;
case MIRE:
foo = essai_mire(filename, 0);
break;
default: default:
fprintf(stderr, "%s : bad command\n", command); fprintf(stderr, "%s : bad command\n", command);

View File

@ -19,14 +19,15 @@ echo "=== " $0 " ==="
# ----------------------------------------------------- # -----------------------------------------------------
function essai_drand48 function essai_drand48
{ {
./mkfimg -v -t drand48 $TMPF 800 600 ./mkfimg -vv -t drand48 $TMPF 800 600
./fimgstats -vv $TMPF ./fimgstats -vv $TMPF
} }
# ----------------------------------------------------- # -----------------------------------------------------
function essai_cmixa function essai_cmixa
{ {
./mkfimg -v -t tpat0 $TMPF 800 600 ./mkfimg -vv -t tpat0 $TMPF 800 600
./fimgfx -v cmixa $TMPF bar.fimg ./fimgfx -vv cmixa $TMPF bar.fimg
} }
# ----------------------------------------------------- # -----------------------------------------------------

View File

@ -210,6 +210,8 @@ if (3 > argc-optind) {
exit(1); exit(1);
} }
if (verbosity>1) fprintf(stderr, "*** fimgfx *** %s %s\n", __DATE__, __TIME__);
operator = argv[optind]; operator = argv[optind];
action = lookup_fxidx(operator); action = lookup_fxidx(operator);
if (action < 0) { if (action < 0) {

View File

@ -111,6 +111,7 @@ if (type < 0) {
fname = argv[optind]; fname = argv[optind];
width = atoi(argv[optind+1]); height = atoi(argv[optind+2]); width = atoi(argv[optind+1]); height = atoi(argv[optind+2]);
if (verbosity>1) fprintf(stderr, "*** mkfimg *** %s %s\n", __DATE__, __TIME__);
if (verbosity) fprintf(stderr, "making '%s' %d x %d, type %d\n", if (verbosity) fprintf(stderr, "making '%s' %d x %d, type %d\n",
fname, width, height, type); fname, width, height, type);