big cleanup, word on metadata

This commit is contained in:
tTh
2022-07-06 10:27:55 +02:00
parent aa2ced081a
commit c7a51ec7a0
49 changed files with 348 additions and 105 deletions

View File

@@ -325,12 +325,11 @@ for (i = 0; i < nbre_capt; i++) {
out_name);
#endif
if (nbre_capt > 1 && period > 0.001) {
if (nbre_capt > 1 && period > 0.0001) {
/* suspend execution for
microsecond intervals */
usleep((int)(period*1E6));
}
xioctl(fd, VIDIOC_QBUF, &buf);
}
@@ -378,6 +377,10 @@ switch (contrast) {
break;
}
/* XXX for the debug of metadata thing */
// fprintf(stderr, "after grab & contrast: fval %f count %d\n",
// cumul.fval, cumul.count);
/* XXX warning, new from coronahome 26 mars 2020 */
to_save = &cumul;
if (90 == rotfactor) {
@@ -388,17 +391,23 @@ if (90 == rotfactor) {
foo = fimg_save_as_png(&tmpfimg, "rot90.png", 0);
}
to_save = &tmpfimg;
/*
* CRITICAL : we have to restore those values !
*/
to_save->fval = cumul.fval;
to_save->count = cumul.count;
}
foo = format_from_extension(outfile);
switch (foo) {
case FILE_TYPE_FIMG:
fimg_default_metadata(&metadata, 51);
/* copy some values to mdstruct */
metadata.fval = to_save->fval;
metadata.count = to_save->count;
if (add_metadata) {
fprintf(stderr, ">>> save %s with md\n", outfile);
fimg_default_metadata(&metadata, 51);
/* copy some values to mdstruct */
metadata.fval = to_save->fval;
metadata.count = to_save->count;
// fprintf(stderr, "-> save '%s' with metadata\n",
// outfile);
foo = fimg_dumpmd_to_file(to_save, outfile, \
&metadata, 0);
}