fixing random bugs

This commit is contained in:
Tonton Th 2019-09-17 13:14:33 +02:00
parent 9f5d5e2763
commit d294102ca4
4 changed files with 5 additions and 4 deletions

View File

@ -84,7 +84,7 @@ for (foo=0; foo<(head->width*head->height); foo++) {
add = head->R[foo];
add += head->G[foo];
add += head->B[foo];
head->R[foo] = head->G[foo] = head->B[foo] = add;
head->R[foo] = head->G[foo] = head->B[foo] = add / 3.0;
}
return -1;
}

View File

@ -168,11 +168,12 @@ if ( flags & 1 ) {
head->fval, head->count,
head->fval * head->count);
fk = (head->fval * head->count) / 65535.0;
fprintf(fp, "# fval/count %f %d\n", head->fval, head->count);
}
else {
maximum = fimg_get_maxvalue(head);
fk = maximum / 65535.0;
fprintf(fp, "# maxval %15f\n# divisor %15f\n", maximum, fk);
fprintf(fp, "# maxval %15f\n# divisor %15f\n", maximum, fk);
}
fprintf(fp, "65535\n");

View File

@ -17,7 +17,7 @@ rgb2fimg.o: rgb2fimg.c funcs.h Makefile
v4l2_pr_structs.o: v4l2_pr_structs.c v4l2_pr_structs.h Makefile
gcc ${COPT} -c $<
grabvidseq: grabvidseq.c Makefile rgb2fimg.o
grabvidseq: grabvidseq.c ${DEPS} rgb2fimg.o
gcc ${COPT} $< rgb2fimg.o ../libfloatimg.a -lm -lv4l2 -o $@
video-infos: video-infos.c Makefile funcs.o v4l2_pr_structs.o

View File

@ -316,7 +316,7 @@ if (to_gray) {
if (verbosity) fprintf(stderr, "saving to '%s'\n", outfile);
if (upscaling) { /* nasty workaround */
cumul.count /= 4;
cumul.count /= 4; /* WTF ? */
}
foo = fimg_save_as_pnm(&cumul, outfile, 1);