commit avant la Ganguise + push en vrac

This commit is contained in:
2019-08-24 13:24:01 +02:00
parent d1e9999e1c
commit a07883c0c2
7 changed files with 73 additions and 20 deletions

View File

@@ -191,6 +191,7 @@ foo = fimg_create(&cumul,
fmt.fmt.pix.width, fmt.fmt.pix.height,
FIMG_TYPE_RGB);
fimg_clear(&cumul);
cumul.fval = 255.0;
#endif
@@ -220,7 +221,8 @@ for (i = 0; i < nbre_capt; i++) {
}
if(verbosity > 1) {
printf("%6d / %6d %9.3f\n", i, nbre_capt, fimg_timer_get(0));
printf("%6d / %6d %9.3f\n", i, nbre_capt,
fimg_timer_get(0));
}
@@ -246,15 +248,13 @@ for (i = 0; i < nbre_capt; i++) {
#endif
#if SAVE_AS_CUMUL
/**
/** this is the slow version
x_rgb2fimg(buffers[buf.index].start,
fmt.fmt.pix.width, fmt.fmt.pix.height, &grab);
fimg_add(&grab, &cumul, &cumul);
**/
x_add_rgb2fimg(buffers[buf.index].start,
fmt.fmt.pix.width, fmt.fmt.pix.height, &cumul);
#endif
#if SAVE_AS_FIMG

View File

@@ -5,6 +5,11 @@
#include "funcs.h"
/*
* Be careful, these functions are not yet fireproof,
* and calling conventions are fluctuating.
*/
/* --------------------------------------------------------------------- */
int x_upscaler(unsigned char *src, int w, int h, FloatImg *d)
{
@@ -13,6 +18,14 @@ int x, y, xx, yy;
float r, g, b;
static unsigned short modz;
/*
* check in image sizes are correct
*/
if ( d->width != w*2 || d->height != h*2 ) {
fprintf(stderr, "%s : dimension error\n", __func__);
return -2;
}
// rp = d->R, gp = d->G, bp = d->B;
for (y=0; y<h; y++) {
@@ -49,7 +62,6 @@ for (iter=0; iter<size; iter++) {
return 0;
}
/* --------------------------------------------------------------------- */
/* --------------------------------------------------------------------- */
int x_add_rgb2fimg(unsigned char *src, int w, int h, FloatImg *d)
{
int iter, size;
@@ -64,8 +76,12 @@ for (iter=0; iter<size; iter++) {
*bp++ += (float)*src++;
}
d->count++; /* one more frame in the accumulator */
return 0;
}
/* --------------------------------------------------------------------- */
int x_rgb2file(unsigned char *src, int w, int h, char *fname)
{
FloatImg buff;

View File

@@ -95,7 +95,7 @@ return 0;
int enum_controls(int fd, char *txt, int k)
{
struct v4l2_queryctrl qctrl;
int foo, idx;
int idx;
printf("-- controls enumeration '%s'\n", txt);
@@ -208,7 +208,6 @@ fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
foo = ioctl(vfd, VIDIOC_G_FMT, &fmt);
if (0 != foo) {
perror("ioctl G_FMT");
// exit(1);
}
else {
pr_v4l2_format("Experimental", &fmt);
@@ -249,9 +248,13 @@ static void print_title(char *txt)
int foo, l;
l = strlen(txt);
for (foo=0; foo<l+18; foo++) putchar('*'); puts("");
for (foo=0; foo<l+18; foo++)
putchar('*');
puts("");
printf("****** %s ******\n", txt);
for (foo=0; foo<l+18; foo++) putchar('*'); puts("\n");
for (foo=0; foo<l+18; foo++)
putchar('*');
puts("\n");
}
/* --------------------------------------------------------------------- */
int main(int argc, char *argv[])