Browse Source

fixing random bugs

master
tth 3 years ago
parent
commit
d294102ca4
  1. 2
      lib/fimg-math.c
  2. 3
      lib/fimg-pnm.c
  3. 2
      v4l2/Makefile
  4. 2
      v4l2/grabvidseq.c

2
lib/fimg-math.c

@ -84,7 +84,7 @@ for (foo=0; foo<(head->width*head->height); foo++) { @@ -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;
}

3
lib/fimg-pnm.c

@ -168,11 +168,12 @@ if ( flags & 1 ) { @@ -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");

2
v4l2/Makefile

@ -17,7 +17,7 @@ rgb2fimg.o: rgb2fimg.c funcs.h Makefile @@ -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

2
v4l2/grabvidseq.c

@ -316,7 +316,7 @@ if (to_gray) { @@ -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);

Loading…
Cancel
Save