Compare commits
No commits in common. "b8d86da9a0169d6542d8b6f02cb95b5d49277404" and "dc7734b49d5128a445aa0788fde8dff169f1d4cb" have entirely different histories.
b8d86da9a0
...
dc7734b49d
1
.gitignore
vendored
1
.gitignore
vendored
@ -25,4 +25,3 @@ tools/mkfimg
|
||||
tools/png2fimg
|
||||
tools/addtga2fimg
|
||||
tools/addpnm2fimg
|
||||
tools/cumulfimgs
|
||||
|
@ -2,7 +2,7 @@
|
||||
* floatimg.h
|
||||
*/
|
||||
|
||||
#define FIMG_VERSION 61
|
||||
#define FIMG_VERSION 60
|
||||
|
||||
/*
|
||||
* in memory descriptor
|
||||
|
@ -3,37 +3,34 @@
|
||||
# use with caution
|
||||
#
|
||||
|
||||
COPT = -Wall -fpic -g -DDEBUG_LEVEL=0
|
||||
COPT = -Wall -fpic -g -DDEBUG_LEVEL=1
|
||||
DEPS = ../floatimg.h ../libfloatimg.a Makefile
|
||||
|
||||
# ----------
|
||||
|
||||
all: fimg2pnm addtga2fimg mkfimg png2fimg fimgstats fimg2png \
|
||||
addpnm2fimg cumulfimgs
|
||||
addpnm2fimg
|
||||
|
||||
fimgstats: fimgstats.c $(DEPS)
|
||||
gcc $(COPT) $< ../libfloatimg.a -o $@
|
||||
|
||||
cumulfimgs: cumulfimgs.c $(DEPS)
|
||||
gcc $(COPT) $< ../libfloatimg.a -o $@
|
||||
gcc -g $< ../libfloatimg.a -o $@
|
||||
|
||||
mkfimg: mkfimg.c $(DEPS)
|
||||
gcc $(COPT) $< ../libfloatimg.a -o $@
|
||||
gcc -g $< ../libfloatimg.a -o $@
|
||||
|
||||
fimg2pnm: fimg2pnm.c $(DEPS)
|
||||
gcc $(COPT) $< ../libfloatimg.a -o $@
|
||||
gcc -g $< ../libfloatimg.a -o $@
|
||||
|
||||
fimg2png: fimg2png.c $(DEPS)
|
||||
gcc $(COPT) $< ../libfloatimg.a -o $@
|
||||
gcc -g $< ../libfloatimg.a -o $@
|
||||
|
||||
addtga2fimg: addtga2fimg.c $(DEPS)
|
||||
gcc $(COPT) $< ../libfloatimg.a -limageSO -lm -o $@
|
||||
gcc -g $< ../libfloatimg.a -limageSO -lm -o $@
|
||||
|
||||
addpnm2fimg: addpnm2fimg.c $(DEPS)
|
||||
gcc $(COPT) $< ../libfloatimg.a -lm -o $@
|
||||
gcc -g $< ../libfloatimg.a -lm -o $@
|
||||
|
||||
|
||||
# if "undefined reference to crc32" then "use -lz"
|
||||
png2fimg: png2fimg.c $(DEPS)
|
||||
gcc $(COPT) $< ../libfloatimg.a -lpnglite -o $@
|
||||
gcc -g $< ../libfloatimg.a -lpnglite -o $@
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
/* --------------------------------------------------------------------- */
|
@ -1,7 +1,3 @@
|
||||
/*
|
||||
* conversion vers le format PNM
|
||||
*
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
@ -64,4 +60,3 @@ if (foo) fprintf(stderr, "conversion -> %d\n", foo);
|
||||
|
||||
return 0;
|
||||
}
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
@ -20,13 +20,14 @@ if (4 != argc) {
|
||||
}
|
||||
fname = argv[1];
|
||||
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);
|
||||
if (foo) {
|
||||
fprintf(stderr, "create floatimg -> %d\n", foo);
|
||||
exit(1);
|
||||
}
|
||||
// fimg_describe(&fimg, "just a black flimg");
|
||||
fimg_clear(&fimg);
|
||||
|
||||
foo = fimg_dump_to_file(&fimg, fname, 0);
|
||||
|
24
v4l2/t.c
24
v4l2/t.c
@ -7,9 +7,8 @@
|
||||
#include <unistd.h>
|
||||
#include <math.h>
|
||||
#include <string.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
#include <linux/videodev2.h>
|
||||
#include <linux/videodev2.h>
|
||||
|
||||
#include "funcs.h"
|
||||
#include "../floatimg.h"
|
||||
@ -22,9 +21,8 @@ int verbosity;
|
||||
/* --------------------------------------------------------------------- */
|
||||
int essai(char *dev, int k)
|
||||
{
|
||||
int vfd, foo;
|
||||
struct v4l2_format fmt;
|
||||
struct v4l2_requestbuffers reqbuf;
|
||||
int vfd, foo;
|
||||
struct v4l2_format fmt;
|
||||
|
||||
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);
|
||||
|
||||
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;
|
||||
}
|
||||
@ -73,9 +58,6 @@ puts("\t-d\tselect the video device");
|
||||
puts("\t-K\tset the K parameter");
|
||||
puts("\t-l\tlist video devices");
|
||||
puts("\t-v\tincrease verbosity");
|
||||
|
||||
if (verbosity) { puts(""); fimg_print_version(1); }
|
||||
|
||||
exit(0);
|
||||
}
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
@ -52,7 +52,7 @@ return 0;
|
||||
/* --------------------------------------------------------------------- */
|
||||
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 */
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user