Compare commits

..

No commits in common. "3778e75399a10509c4b29900d5bb11b82a0ac7b1" and "785b521d4fd74c21389afc447007e96f40dda96e" have entirely different histories.

9 changed files with 31 additions and 67 deletions

View File

@ -97,6 +97,7 @@ FimgFilter3x3 hipass = {
1.0, 0.0
};
switch (typef) {
case 0: pfiltre = &lowpass; break;
case 1: pfiltre = &hipass; break;
@ -247,13 +248,11 @@ switch (idFx) {
break;
case CR_qsortrgb:
// fprintf(stderr, "!!! %d !!!\n", idFx);
// retval = fimg_qsort_rgb_b(image, image, 0);
retval = trier_les_pixels(image);
break;
case CR_multidots:
retval = plot_multidots(image, 42);
break;
case CR_message:
fprintf(stderr, "### msg from pid %d, fval=%f ###\n",
getpid(), fval);

View File

@ -25,7 +25,6 @@
26 rndblks 1 1.0
27 shiftln0 1 1.0
28 qsortrgb 2 1.0
30 multidots 100 1.333
42 nothing 42 3.1415926
42 nothing 42 3.14159
99 message 1 1.0
-1 end 1 1.0

View File

@ -31,8 +31,8 @@ convert -delay 200 /tmp/fstack*.png foo.gif
essai_singlepass ()
{
MP4="/home/tth/Essais/FondageDePlomb/foo.mp4"
INPUT="/home/tth/Essais/FondageDePlomb/capture/02[0123]??.fimg"
FILTRE="multidots:liss3x3:liss3x3"
INPUT="/home/tth/Essais/FondageDePlomb/capture/00???.fimg"
FILTRE="trinitron"
OUTDIR="/tmp/x8/"
echo '********* essai single *********'

View File

@ -120,24 +120,6 @@ for (y=0; y<8; y++) {
return 0;
}
/* -------------------------------------------------------------- */
int plot_multidots(FloatImg *picture, int notused)
{
int pass, szimg, osrc, odst;
szimg = picture->width * picture->height;
for (pass=0; pass<szimg/32; pass++) {
osrc = rand() % szimg;
odst = rand() % szimg;
picture->R[odst] = (picture->R[osrc] + picture->R[odst]) / 2.0;
picture->G[odst] = (picture->G[osrc] + picture->G[odst]) / 2.0;
picture->B[odst] = (picture->B[osrc] + picture->B[odst]) / 2.0;
}
return 0;
}
int random_blocks(FloatImg *picture, int percent)
{
int x, y;
@ -230,26 +212,16 @@ for (y=BB; y<h-BB; y++) {
return 0;
}
/* -------------------------------------------------------------- */
static void shifter(float *fs, float *fd, int stp, int largeur)
static void shifter(float *fs, float *fd, int w, int nbr)
{
int xpos;
int krkr;
/* move the pixels */
for (xpos=0; xpos<largeur; xpos++) {
fd[xpos] = fs[(xpos+stp)%largeur];
for (krkr=0; krkr<nbr; krkr++) {
fd[krkr] = fs[(krkr+w)%nbr];
}
/* take your sixpack, film at 11 */
}
static void smooth_line(float *fs, float *fd, int sz)
{
int xpos;
for (xpos=1; xpos<(sz-1); xpos++) {
fd[xpos] = (fs[xpos-1]+fs[xpos]+fs[xpos+1]) / 3.0;
}
fd[0] = fd[sz-1] = 0.0;
}
int multilines_shift_0(FloatImg *picz, int step, int nombre)
{
float *buffline, *sptr;
@ -270,18 +242,15 @@ for (idx=0; idx<nombre; idx++) {
sptr = picz->R + (ypos * picz->width);
shifter(sptr, buffline, step, picz->width);
smooth_line(buffline, sptr, picz->width);
// XXX memcpy (sptr, buffline, picz->width*sizeof(float));
memcpy(sptr, buffline, picz->width*sizeof(float));
sptr = picz->G + (ypos * picz->width);
shifter(sptr, buffline, step, picz->width);
smooth_line(buffline, sptr, picz->width);
// XXX memcpy (sptr, buffline, picz->width*sizeof(float));
memcpy(sptr, buffline, picz->width*sizeof(float));
sptr = picz->B + (ypos * picz->width);
shifter(sptr, buffline, step, picz->width);
smooth_line(buffline, sptr, picz->width);
// XXX memcpy (sptr, buffline, picz->width*sizeof(float));
memcpy(sptr, buffline, picz->width*sizeof(float));
}
return 0;

View File

@ -3,7 +3,6 @@
*/
int do_something(FloatImg *pimg, int notused);
int plot_multidots(FloatImg *picture, int notused);
int kill_a_random_line(FloatImg *pvictime, float level, int bits);
int kill_a_few_lines(FloatImg *who, float fval, int number);

View File

@ -89,7 +89,7 @@ for (idx=0; idx<nombre; idx++) {
if (method) {
/* and now, we can massage all our datas */
fprintf(stderr, "sorting method = %d ...\n", method);
// fprintf(stderr, "sorting %d ...\n", method);
qsort(idxvalues, nombre, sizeof(IdxValue), cmp_idxvalues);
}
@ -128,7 +128,7 @@ IdxValue *idx_values; /* gni? */
fprintf(stderr, " interpolate from '%s' to '%s' with %d steps.\n",
pattern, outdir, Nsteps);
if (negative) fprintf(stderr, "%s: negative ON\n", __func__);
if (negative) fprintf(stderr, "%s: negative on\n", __func__);
memset(&globbuf, 0, sizeof(glob_t));
foo = glob(pattern, 0, NULL, &globbuf);

View File

@ -153,7 +153,7 @@ puts("\t-F\tdefine:the:filter:chain");
puts("\t-g\tinput glob pattern");
puts("\t-i\tinfile.fimg");
puts("\t-L\tlist available filters");
puts("\t-o\toutfile.xxx");
puts("\t-o\tinfile.xxx");
puts("\t-O\t/output/directory");
puts("\t-s\tdo single test");

View File

@ -30,14 +30,10 @@ Bien entendu, avant tout, il faut installer quelques outils et
dépendances. Je vais tenter de les lister dans le plus grand
désordre (à la sauce Debian) :
```
apt install libtiff-dev
apt install libpnglite-dev
apt install liblo-dev
apt install libv4l2-dev
apt install libcfitsio-dev
apt install libnetpbm-dev
```
- libtiff-dev
- libpnglite-dev
- liblo-dev
- libv4l2-dev
Certains outils externes sont aussi utiles :

View File

@ -106,8 +106,7 @@ char *dev_name = "/dev/video0";
struct buffer *buffers;
int foo;
double period = 10.0; /* delai entre les captures
en secondes */
double period = 10.0; /* delai entre les captures */
int nbre_capt = 1; /* nombre de captures */
int opt;
int width = 640;
@ -145,6 +144,7 @@ while ((opt = getopt(argc, argv, "c:d:ghn:o:O:p:r:s:uv")) != -1) {
optarg);
exit(1);
}
period *= 1e6;
break;
case 'r': rotfactor = atoi(optarg); break;
case 's': parse_WxH(optarg, &width, &height);
@ -162,7 +162,7 @@ if (verbosity > 1) {
fprintf(stderr, "*** GrabVidSeq (%s, %s) libv %d, pid=%d\n",
__DATE__, __TIME__, FIMG_VERSION, getpid());
fprintf(stderr, "grabing %d picz, ", nbre_capt);
fprintf(stderr, "period is %.3f seconds\n", period);
fprintf(stderr, "period is %.3f milliseconds\n", period/1e3);
fprintf(stderr, "framesize is %dx%d\n", width, height);
// fprintf(stderr, "destdir is '%s'\n", dest_dir);
if (upscaling) fprintf(stderr, "upscaling is on\n");
@ -277,7 +277,7 @@ for (i = 0; i < nbre_capt; i++) {
}
if(verbosity > 1) {
fprintf(stderr, "%6d / %6d %9.3f\r", i, nbre_capt,
fprintf(stderr, "%6d / %6d %9.3f\n", i, nbre_capt,
fimg_timer_get(0));
fflush(stderr);
}
@ -309,15 +309,15 @@ for (i = 0; i < nbre_capt; i++) {
out_name);
#endif
if (nbre_capt > 1 && period > 0.001) {
/* suspend execution for
microsecond intervals */
usleep((int)(period*1E6));
if (nbre_capt > 1 && period > 1.0) {
usleep(period);
}
xioctl(fd, VIDIOC_QBUF, &buf);
}
fflush(stdout);
if (verbosity) {
t_final = fimg_timer_get(0);
fprintf(stderr, "pid %d : elapsed %.3g s -> %.2f fps\n", getpid(),
@ -398,6 +398,8 @@ switch (foo) {
}
// free buffers
fimg_destroy(&cumul);
#endif