FloatImg4PythonBinding/lib/metadata.c

44 lines
1.2 KiB
C
Raw Normal View History

/*
* 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);
2022-03-20 15:53:49 +01:00
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;
2022-04-03 21:38:29 +02:00
strcpy(pmd->idcam, "<unknow>");
2022-03-20 15:53:49 +01:00
pmd->origin = 999;
return -1;
}
/* ---------------------------------------------------------------- */