Compare commits

..

No commits in common. "b8d86da9a0169d6542d8b6f02cb95b5d49277404" and "dc7734b49d5128a445aa0788fde8dff169f1d4cb" have entirely different histories.

8 changed files with 16 additions and 76 deletions

1
.gitignore vendored
View File

@ -25,4 +25,3 @@ tools/mkfimg
tools/png2fimg tools/png2fimg
tools/addtga2fimg tools/addtga2fimg
tools/addpnm2fimg tools/addpnm2fimg
tools/cumulfimgs

View File

@ -2,7 +2,7 @@
* floatimg.h * floatimg.h
*/ */
#define FIMG_VERSION 61 #define FIMG_VERSION 60
/* /*
* in memory descriptor * in memory descriptor

View File

@ -3,37 +3,34 @@
# use with caution # use with caution
# #
COPT = -Wall -fpic -g -DDEBUG_LEVEL=0 COPT = -Wall -fpic -g -DDEBUG_LEVEL=1
DEPS = ../floatimg.h ../libfloatimg.a Makefile DEPS = ../floatimg.h ../libfloatimg.a Makefile
# ---------- # ----------
all: fimg2pnm addtga2fimg mkfimg png2fimg fimgstats fimg2png \ all: fimg2pnm addtga2fimg mkfimg png2fimg fimgstats fimg2png \
addpnm2fimg cumulfimgs addpnm2fimg
fimgstats: fimgstats.c $(DEPS) fimgstats: fimgstats.c $(DEPS)
gcc $(COPT) $< ../libfloatimg.a -o $@ gcc -g $< ../libfloatimg.a -o $@
cumulfimgs: cumulfimgs.c $(DEPS)
gcc $(COPT) $< ../libfloatimg.a -o $@
mkfimg: mkfimg.c $(DEPS) mkfimg: mkfimg.c $(DEPS)
gcc $(COPT) $< ../libfloatimg.a -o $@ gcc -g $< ../libfloatimg.a -o $@
fimg2pnm: fimg2pnm.c $(DEPS) fimg2pnm: fimg2pnm.c $(DEPS)
gcc $(COPT) $< ../libfloatimg.a -o $@ gcc -g $< ../libfloatimg.a -o $@
fimg2png: fimg2png.c $(DEPS) fimg2png: fimg2png.c $(DEPS)
gcc $(COPT) $< ../libfloatimg.a -o $@ gcc -g $< ../libfloatimg.a -o $@
addtga2fimg: addtga2fimg.c $(DEPS) addtga2fimg: addtga2fimg.c $(DEPS)
gcc $(COPT) $< ../libfloatimg.a -limageSO -lm -o $@ gcc -g $< ../libfloatimg.a -limageSO -lm -o $@
addpnm2fimg: addpnm2fimg.c $(DEPS) addpnm2fimg: addpnm2fimg.c $(DEPS)
gcc $(COPT) $< ../libfloatimg.a -lm -o $@ gcc -g $< ../libfloatimg.a -lm -o $@
# if "undefined reference to crc32" then "use -lz" # if "undefined reference to crc32" then "use -lz"
png2fimg: png2fimg.c $(DEPS) png2fimg: png2fimg.c $(DEPS)
gcc $(COPT) $< ../libfloatimg.a -lpnglite -o $@ gcc -g $< ../libfloatimg.a -lpnglite -o $@

View File

@ -1,34 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "../floatimg.h"
int verbosity;
/* --------------------------------------------------------------------- */
void help(int v)
{
puts("options :");
puts("\t-v\tincrease verbosity");
puts("\t-o\tname of output file");
if (verbosity) { puts(""); fimg_print_version(1); }
}
/* --------------------------------------------------------------------- */
int main(int argc, char *argv[])
{
int foo;
int opt;
char *output_file = "noname.fimg";
while ((opt = getopt(argc, argv, "ho:v")) != -1) {
switch(opt) {
case 'h': help(0); break;
case 'o': output_file = optarg; break;
case 'v': verbosity++; break;
}
}
return 0;
}
/* --------------------------------------------------------------------- */

View File

@ -1,7 +1,3 @@
/*
* conversion vers le format PNM
*
*/
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
@ -64,4 +60,3 @@ if (foo) fprintf(stderr, "conversion -> %d\n", foo);
return 0; return 0;
} }
/* --------------------------------------------------------------------- */

View File

@ -20,13 +20,14 @@ if (4 != argc) {
} }
fname = argv[1]; fname = argv[1];
width = atoi(argv[2]); height = atoi(argv[3]); width = atoi(argv[2]); height = atoi(argv[3]);
fprintf(stderr, "making '%s' %d x %d\n", fname, width, height); fprintf(stderr, "making %s %d x %d\n", fname, width, height);
foo = fimg_create(&fimg, width, height, 3); foo = fimg_create(&fimg, width, height, 3);
if (foo) { if (foo) {
fprintf(stderr, "create floatimg -> %d\n", foo); fprintf(stderr, "create floatimg -> %d\n", foo);
exit(1); exit(1);
} }
// fimg_describe(&fimg, "just a black flimg");
fimg_clear(&fimg); fimg_clear(&fimg);
foo = fimg_dump_to_file(&fimg, fname, 0); foo = fimg_dump_to_file(&fimg, fname, 0);

View File

@ -7,9 +7,8 @@
#include <unistd.h> #include <unistd.h>
#include <math.h> #include <math.h>
#include <string.h> #include <string.h>
#include <sys/ioctl.h>
#include <linux/videodev2.h> #include <linux/videodev2.h>
#include "funcs.h" #include "funcs.h"
#include "../floatimg.h" #include "../floatimg.h"
@ -22,9 +21,8 @@ int verbosity;
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
int essai(char *dev, int k) int essai(char *dev, int k)
{ {
int vfd, foo; int vfd, foo;
struct v4l2_format fmt; struct v4l2_format fmt;
struct v4l2_requestbuffers reqbuf;
fprintf(stderr, ">>> %s ( '%s' %d )\n", __func__, dev, k); fprintf(stderr, ">>> %s ( '%s' %d )\n", __func__, dev, k);
@ -42,19 +40,6 @@ fmt.fmt.pix.field = V4L2_FIELD_INTERLACED;
pr_v4l2_format("before ioctl", &fmt); pr_v4l2_format("before ioctl", &fmt);
foo = ioctl(vfd, VIDIOC_S_FMT, &fmt);
fprintf(stderr, "ioctl -> %d\n", foo);
if (foo < 0) {
perror("ioctl S_FMT");
exit(1);
}
pr_v4l2_format("after ioctl", &fmt);
/* todo V4L2_BUF_TYPE_VIDEO_CAPTURE */
memset(&reqbuf, 0, sizeof(reqbuf));
pr_v4l2_requestbuffers("after 0", &reqbuf);
return k; return k;
} }
@ -73,9 +58,6 @@ puts("\t-d\tselect the video device");
puts("\t-K\tset the K parameter"); puts("\t-K\tset the K parameter");
puts("\t-l\tlist video devices"); puts("\t-l\tlist video devices");
puts("\t-v\tincrease verbosity"); puts("\t-v\tincrease verbosity");
if (verbosity) { puts(""); fimg_print_version(1); }
exit(0); exit(0);
} }
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */

View File

@ -52,7 +52,7 @@ return 0;
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
int pr_v4l2_requestbuffers(char *txt, struct v4l2_requestbuffers *ptr) int pr_v4l2_requestbuffers(char *txt, struct v4l2_requestbuffers *ptr)
{ {
fprintf(FP, "-- v4l2_requestbuffers, %s %p\n", txt, ptr); fprintf(FP, "-- v4l2_requestbuffers, at %p\n", ptr);
fprintf(FP, " type %d\n", ptr->type); /* enum v4l2_buf_type */ fprintf(FP, " type %d\n", ptr->type); /* enum v4l2_buf_type */