Compare commits
No commits in common. "ddfadf9a674212d8fb1d02a76347aece402b8172" and "a5fac7effd54613fb8edb38db63663e0716a20a3" have entirely different histories.
ddfadf9a67
...
a5fac7effd
4
Makefile
4
Makefile
@ -3,8 +3,8 @@
|
||||
# a look to the 'build.sh' script ! #
|
||||
####################################################
|
||||
|
||||
COPT = -Wall -Wextra -fpic -g -no-pie -DDEBUG_LEVEL=0
|
||||
LDOPT = libfloatimg.a -g -lm
|
||||
COPT = -Wall -Wextra -fpic -g -pg -no-pie -DDEBUG_LEVEL=0
|
||||
LDOPT = libfloatimg.a -pg -lm
|
||||
|
||||
all: essai
|
||||
|
||||
|
6
essai.c
6
essai.c
@ -22,7 +22,7 @@ fimg_draw_something(dessin);
|
||||
|
||||
}
|
||||
/* --------------------------------------------------------------------- */
|
||||
void help(void)
|
||||
void help(int k)
|
||||
{
|
||||
puts("Options :");
|
||||
puts("\t-d WxH\timage size");
|
||||
@ -34,14 +34,14 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
FloatImg fimgA, fimgB;
|
||||
int foo, opt;
|
||||
int W = 640, H = 480;
|
||||
int W = 800, H = 600;
|
||||
double tb;
|
||||
|
||||
while ((opt = getopt(argc, argv, "d:hv")) != -1) {
|
||||
switch(opt) {
|
||||
case 'd': parse_WxH(optarg, &W, &H);
|
||||
break;
|
||||
case 'h': help(); break;
|
||||
case 'h': help(0); break;
|
||||
case 'v': verbosity++; break;
|
||||
}
|
||||
}
|
||||
|
13
floatimg.h
13
floatimg.h
@ -4,8 +4,8 @@
|
||||
* http://la.buvette.org/photos/cumul
|
||||
*/
|
||||
|
||||
#define FIMG_VERSION (181)
|
||||
#define RELEASE_NAME ("noname")
|
||||
#define FIMG_VERSION 179
|
||||
|
||||
/*
|
||||
* in memory descriptor
|
||||
*/
|
||||
@ -25,17 +25,16 @@ typedef struct {
|
||||
* fimg file header (short version)
|
||||
*/
|
||||
typedef struct {
|
||||
char magic[8]; // this is not an asciiz !
|
||||
char magic[8];
|
||||
int32_t w, h, t;
|
||||
} FimgFileHead;
|
||||
/*
|
||||
* new 11 mars 2022, and a lot of iterations
|
||||
* around the concept of metadata for my work.
|
||||
* new 11 mars 2022
|
||||
*/
|
||||
typedef struct {
|
||||
char magic[8]; // this is not an asciiz !
|
||||
char magic[8];
|
||||
struct timeval timestamp;
|
||||
uint64_t pid; // process id of the creator
|
||||
uint64_t pid; // WTF ?
|
||||
int32_t count;
|
||||
float fval;
|
||||
char idcam[32];
|
||||
|
@ -8,7 +8,6 @@ cp tools/mkfimg tools/fimg2pnm tools/fimgops \
|
||||
tools/png2fimg tools/fimgstats tools/fimgfx \
|
||||
tools/cumulfimgs tools/fimg2text \
|
||||
tools/fimghalfsize \
|
||||
tools/fimgmetadata \
|
||||
/usr/local/bin
|
||||
|
||||
cp v4l2/grabvidseq v4l2/video-infos \
|
||||
|
@ -39,8 +39,8 @@ return "???";
|
||||
/* --------------------------------------------------------------------- */
|
||||
int fimg_print_version(int k)
|
||||
{
|
||||
fprintf(stderr, "*** FloatImg library, v%d '%s' (%s, %s)\n",
|
||||
FIMG_VERSION, RELEASE_NAME, __DATE__, __TIME__);
|
||||
fprintf(stderr, "*** FloatImg library, alpha %d (%s, %s)\n",
|
||||
FIMG_VERSION, __DATE__, __TIME__);
|
||||
|
||||
if (51 == k) {
|
||||
puts("+------------------------+");
|
||||
|
@ -6,8 +6,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/time.h>
|
||||
#include <string.h>
|
||||
#include "string.h"
|
||||
|
||||
#include "../floatimg.h"
|
||||
|
||||
@ -30,7 +29,6 @@ fflush(fp);
|
||||
int fimg_show_metadata(FimgMetaData *pmd, char *title, int notused)
|
||||
{
|
||||
int foo;
|
||||
double doubletime;
|
||||
|
||||
fprintf(stderr, ">>> %s ( %p '%s' 0x%08x )\n", __func__,
|
||||
pmd, title, notused);
|
||||
@ -42,10 +40,6 @@ if (verbosity) {
|
||||
}
|
||||
|
||||
/* SHOW TIMESTAMP HERE */
|
||||
fprintf(stderr, "seconds sc. epoch = %ld\n", pmd->timestamp.tv_sec);
|
||||
doubletime = (double)pmd->timestamp.tv_sec + \
|
||||
(double)pmd->timestamp.tv_usec / 1e6;
|
||||
fprintf(stderr, "dtime of day = %e\n", doubletime);
|
||||
fprintf(stderr, "creator pid = %ld\n", pmd->pid);
|
||||
fprintf(stderr, "counter = %d\n", pmd->count);
|
||||
fprintf(stderr, "float value = %.3f\n", pmd->fval);
|
||||
@ -54,7 +48,7 @@ fprintf(stderr, "origin = 0x%x\n", pmd->origin);
|
||||
|
||||
fputs("reserved words are:\n ", stderr);
|
||||
for (foo=0; foo<8; foo++) {
|
||||
fprintf(stderr, " 0x%08x", pmd->reserved[foo]);
|
||||
fprintf(stderr, " 0x%08x", pmd->reserved[foo]);
|
||||
if (3 == foo) fputs("\n ", stderr);
|
||||
}
|
||||
fputc('\n', stderr);
|
||||
@ -63,25 +57,10 @@ return 0;
|
||||
/* ---------------------------------------------------------------- */
|
||||
int fimg_default_metadata(FimgMetaData *pmd)
|
||||
{
|
||||
int foo;
|
||||
struct timeval tvl;
|
||||
|
||||
memset(pmd, 0, sizeof(FimgMetaData));
|
||||
memcpy(pmd->magic, "metadata", 8);
|
||||
|
||||
/* set timestamp here ? */
|
||||
/* CHALLENGE ACCEPTED */
|
||||
memset(&tvl, 0, sizeof(struct timeval));
|
||||
foo = gettimeofday(&tvl, NULL);
|
||||
if (foo) {
|
||||
/* error on get time of day ? */
|
||||
perror("omg");
|
||||
}
|
||||
else {
|
||||
fprintf(stderr, "Time of day %12ld %12ld\n", tvl.tv_sec, tvl.tv_usec);
|
||||
memcpy(&(pmd->timestamp), &tvl, sizeof(struct timeval));
|
||||
}
|
||||
|
||||
pmd->pid = getpid();
|
||||
pmd->count = 0;
|
||||
pmd->fval = 255.0;
|
||||
|
@ -23,7 +23,6 @@ int verbosity;
|
||||
#define T_TPAT0 6
|
||||
#define T_MIRCOL1 7
|
||||
#define T_BLOUP 8
|
||||
#define T_STRIPES 9
|
||||
typedef struct {
|
||||
int code;
|
||||
char *name;
|
||||
@ -39,7 +38,6 @@ Type types[] = {
|
||||
{ T_TPAT0, "tpat0" },
|
||||
{ T_MIRCOL1, "mircol1" },
|
||||
{ T_BLOUP, "bloup" },
|
||||
{ T_STRIPES, "stripes" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
@ -56,6 +54,7 @@ for (type = types; type->code; type++) {
|
||||
return type->code;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
/* --------------------------------------------------------------------- */
|
||||
@ -88,7 +87,7 @@ puts("\n\t-v\tincrease verbosity");
|
||||
|
||||
if (verbosity) {
|
||||
fimg_print_version(1);
|
||||
printf("*** compiled on the %s, at %s\n", __DATE__, __TIME__);
|
||||
printf("*** compiled %s, %s\n", __DATE__, __TIME__);
|
||||
}
|
||||
|
||||
exit(0);
|
||||
@ -191,7 +190,7 @@ else {
|
||||
foo = fimg_dump_to_file(&fimg, fname, 0);
|
||||
}
|
||||
if (foo) {
|
||||
fprintf(stderr, "dump fimg to %s error -> %d\n", fname, foo);
|
||||
fprintf(stderr, "dump fimg to %s -> %d\n", fname, foo);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user