FloatImg/lib/metadata.c

43 lines
1.1 KiB
C

/*
* metadata.c
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <unistd.h>
#include "string.h"
#include "../floatimg.h"
extern int verbosity; /* must be declared around main() */
/* ---------------------------------------------------------------- */
int fimg_show_metadata(FimgMetaData *pmd, char *title, int notused)
{
fprintf(stderr, ">>> %s ( %p '%s' 0x%08x )\n", __func__,
pmd, title, notused);
fprintf(stderr, "sizeof metadata = %ld\n", sizeof(FimgMetaData));
fprintf(stderr, "magic = '%8s'\n", pmd->magic);
/* TIMESTAMP HERE */
fprintf(stderr, "counter = %d\n", pmd->count);
fprintf(stderr, "float value = %.3f\n", pmd->fval);
fprintf(stderr, "id camera = '%s'\n", pmd->idcam);
return -1;
}
/* ---------------------------------------------------------------- */
int fimg_default_metadata(FimgMetaData *pmd)
{
memcpy(pmd->magic, "metadata", 8);
pmd->count = 0;
pmd->fval = 255.0;
strcpy(pmd->idcam, "unknow");
return -1;
}
/* ---------------------------------------------------------------- */