From 411aad94d75c420498d9c83497de0ab40f54fe51 Mon Sep 17 00:00:00 2001 From: tth Date: Mon, 12 Aug 2019 01:53:17 +0200 Subject: [PATCH] don't know how to make the upscaler --- doc/the_floatimg_hack.tex | 3 ++- tools/fimg2png.c | 4 +++- v4l2/Makefile | 4 ++-- v4l2/grabvidseq.c | 8 +++----- v4l2/rgb2fimg.c | 26 ++++++++++++++++++++++++++ 5 files changed, 36 insertions(+), 9 deletions(-) diff --git a/doc/the_floatimg_hack.tex b/doc/the_floatimg_hack.tex index 5a438d2..b286f76 100644 --- a/doc/the_floatimg_hack.tex +++ b/doc/the_floatimg_hack.tex @@ -242,7 +242,8 @@ sur la provenance de ces données prétendant être des images. En fait, notre désir secret est la découverte des choses cachées du monde qui nous entoure. Nous voulons des images du \textbf{réel} et pour cela, l'outil le plus commun, le plus répandu, -est la webcam\index{webcam}. L'universelle webcam. +est la webcam\index{webcam}. L'universelle webcam. Et l'incontournable +v4l2. % ------------------------------------------------------------------- \section{Et pour la suite ?} diff --git a/tools/fimg2png.c b/tools/fimg2png.c index 77cda77..6546142 100644 --- a/tools/fimg2png.c +++ b/tools/fimg2png.c @@ -7,7 +7,7 @@ /* --------------------------------------------------------------------- */ int main(int argc, char *argv[]) { -int foo; +// int foo; if (3 != argc) { fimg_print_version(1); @@ -15,6 +15,8 @@ if (3 != argc) { exit(1); } +fprintf(stderr, "ah ah ah, no working code here !\n"); + return 0; } /* --------------------------------------------------------------------- */ diff --git a/v4l2/Makefile b/v4l2/Makefile index 60395bf..8eb83e6 100644 --- a/v4l2/Makefile +++ b/v4l2/Makefile @@ -1,6 +1,6 @@ -COPT = -Wall -fpic -g -pg -DDEBUG_LEVEL=1 +COPT = -Wall -fpic -g -pg -no-pie -DDEBUG_LEVEL=1 DEPS = ../floatimg.h ../libfloatimg.a Makefile all: grabvidseq t @@ -18,7 +18,7 @@ v4l2_pr_structs.o: v4l2_pr_structs.c v4l2_pr_structs.h Makefile gcc ${COPT} -c $< grabvidseq: grabvidseq.c Makefile rgb2fimg.o - gcc ${COPT} $< rgb2fimg.o ../libfloatimg.a -lm -lv4l2 -o $@ + gcc ${COPT} $< rgb2fimg.o ../libfloatimg.a -lm -lv4l2 -o $@ video-infos: video-infos.c Makefile funcs.o v4l2_pr_structs.o gcc -Wall -g $< funcs.o v4l2_pr_structs.o -o $@ diff --git a/v4l2/grabvidseq.c b/v4l2/grabvidseq.c index 1c4516f..fb7a485 100644 --- a/v4l2/grabvidseq.c +++ b/v4l2/grabvidseq.c @@ -38,13 +38,8 @@ /* --------------------------------------------------------------------- */ - - #define CLEAR(x) memset(&(x), 0, sizeof(x)) - - - struct buffer { void *start; size_t length; @@ -194,6 +189,9 @@ foo = fimg_create(&cumul, fimg_clear(&cumul); #endif + + + type = V4L2_BUF_TYPE_VIDEO_CAPTURE; xioctl(fd, VIDIOC_STREAMON, &type); diff --git a/v4l2/rgb2fimg.c b/v4l2/rgb2fimg.c index 686a4fc..b50f4d8 100644 --- a/v4l2/rgb2fimg.c +++ b/v4l2/rgb2fimg.c @@ -5,6 +5,32 @@ #include "funcs.h" +/* --------------------------------------------------------------------- */ +int x_upscaler(unsigned char *src, int w, int h, FloatImg *d) +{ +int x, y, xx, yy; +float *rp, *gp, *bp; +float r, g, b; +static unsigned short modz; + +rp = d->R, gp = d->G, bp = d->B; + +for (y=0; y