don't know how to make the upscaler

This commit is contained in:
2019-08-12 01:53:17 +02:00
vanhempi 5d91e0b73b
commit 411aad94d7
5 muutettua tiedostoa jossa 36 lisäystä ja 9 poistoa

Näytä tiedosto

@@ -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 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 monde qui nous entoure. Nous voulons des images du \textbf{réel} et
pour cela, l'outil le plus commun, le plus répandu, 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 ?} \section{Et pour la suite ?}

Näytä tiedosto

@@ -7,7 +7,7 @@
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
int foo; // int foo;
if (3 != argc) { if (3 != argc) {
fimg_print_version(1); fimg_print_version(1);
@@ -15,6 +15,8 @@ if (3 != argc) {
exit(1); exit(1);
} }
fprintf(stderr, "ah ah ah, no working code here !\n");
return 0; return 0;
} }
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */

Näytä tiedosto

@@ -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 DEPS = ../floatimg.h ../libfloatimg.a Makefile
all: grabvidseq t all: grabvidseq t

Näytä tiedosto

@@ -38,13 +38,8 @@
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
#define CLEAR(x) memset(&(x), 0, sizeof(x)) #define CLEAR(x) memset(&(x), 0, sizeof(x))
struct buffer { struct buffer {
void *start; void *start;
size_t length; size_t length;
@@ -194,6 +189,9 @@ foo = fimg_create(&cumul,
fimg_clear(&cumul); fimg_clear(&cumul);
#endif #endif
type = V4L2_BUF_TYPE_VIDEO_CAPTURE; type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
xioctl(fd, VIDIOC_STREAMON, &type); xioctl(fd, VIDIOC_STREAMON, &type);

Näytä tiedosto

@@ -5,6 +5,32 @@
#include "funcs.h" #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<h; y++) {
yy = (y*2) + ! (modz & 1);
for (x=0; x<w; x++) {
xx = (x*2) + ! (modz & 2);
r = (float)*src++;
g = (float)*src++;
b = (float)*src++;
fimg_plot_rgb(d, xx, yy, r, g, b);
}
}
modz++;
return -1;
}
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
int x_rgb2fimg(unsigned char *src, int w, int h, FloatImg *d) int x_rgb2fimg(unsigned char *src, int w, int h, FloatImg *d)
{ {