forked from tTh/FloatImg
44 lines
1.2 KiB
C
44 lines
1.2 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);
|
|
fprintf(stderr, "origin = %d\n", pmd->origin);
|
|
|
|
return -1;
|
|
}
|
|
/* ---------------------------------------------------------------- */
|
|
int fimg_default_metadata(FimgMetaData *pmd)
|
|
{
|
|
|
|
memcpy(pmd->magic, "metadata", 8);
|
|
pmd->count = 0;
|
|
pmd->fval = 255.0;
|
|
strcpy(pmd->idcam, "unknow");
|
|
pmd->origin = 999;
|
|
return -1;
|
|
}
|
|
/* ---------------------------------------------------------------- */
|