Compare commits
No commits in common. "ceefa63d1def7d4ef4d7ea8802a5c0ef8710bfd4" and "47dbf6ea1abdc0289709de80cde3b69a3b1afce6" have entirely different histories.
ceefa63d1d
...
47dbf6ea1a
@ -225,13 +225,8 @@ switch (idFx) {
|
||||
retval = multilines_shift_0(image, 11, 120);
|
||||
break;
|
||||
|
||||
case CR_qsortrgb:
|
||||
// fprintf(stderr, "!!! %d !!!\n", idFx);
|
||||
retval = fimg_qsort_rgb_b(image, image, 0);
|
||||
break;
|
||||
|
||||
case CR_message:
|
||||
fprintf(stderr, "### msg from pid %d, fval=%f ###\n",
|
||||
fprintf(stderr, "### message from pid %d, fv=%f ###\n",
|
||||
getpid(), fval);
|
||||
retval = 0;
|
||||
break;
|
||||
|
@ -24,7 +24,6 @@
|
||||
25 vsglitch 1 1.0
|
||||
26 rndblks 1 1.0
|
||||
27 shiftln0 1 1.0
|
||||
28 qsortrgb 2 1.0
|
||||
42 nothing 42 3.14159
|
||||
99 message 1 1.0
|
||||
-1 end 1 1.0
|
||||
|
@ -3,29 +3,27 @@
|
||||
|
||||
|
||||
# ------------------------------------------------------------
|
||||
essai_filtres ()
|
||||
liste_filtres ()
|
||||
{
|
||||
FILTRES=$(./t -L | awk 'NR>1 { print $1 }' | sort)
|
||||
FILTRES="5:6:13 15 2:2 5:9:8 4:25 8:13:13:7 10:1 25:25:25:25 13:14:13"
|
||||
|
||||
rm /tmp/fstack*.png
|
||||
|
||||
SRC=$(ls -rt1 $HOME/Essais/FondageDePlomb/capture/* | tail -1)
|
||||
|
||||
for F in $FILTRES
|
||||
do
|
||||
|
||||
I="/tmp/fstack-"$F".png"
|
||||
echo ; echo ======== $I
|
||||
./t -v -i $SRC -F $F -o foo.png
|
||||
txt=$(printf "( %-10s )" $F)
|
||||
convert foo.png -pointsize 48 -kerning 0 \
|
||||
echo ; echo ==== $I
|
||||
./t -F $F
|
||||
txt=$(printf "[%-10s]" $F)
|
||||
convert foo.png -pointsize 24 -kerning 0 \
|
||||
-fill Gray80 -undercolor Gray20 \
|
||||
-font Courier-Bold \
|
||||
-annotate +10+50 "$txt" \
|
||||
-annotate +0+23 "$txt" \
|
||||
$I
|
||||
done
|
||||
|
||||
echo ; echo "making gif89a..."
|
||||
convert -delay 200 /tmp/fstack*.png foo.gif
|
||||
done
|
||||
convert -delay 100 /tmp/fstack*.png foo.gif
|
||||
}
|
||||
# ------------------------------------------------------------
|
||||
essai_single ()
|
||||
@ -48,6 +46,6 @@ ffmpeg -nostdin \
|
||||
# ------------------------------------------------------------
|
||||
# MAIN
|
||||
|
||||
essai_filtres
|
||||
essai_single
|
||||
|
||||
# ------------------------------------------------------------
|
||||
|
@ -20,28 +20,6 @@
|
||||
*/
|
||||
extern int verbosity;
|
||||
|
||||
/* -------------------------------------------------------------- */
|
||||
|
||||
int incrustation_0(FloatImg *src, FloatImg *dst, int k)
|
||||
{
|
||||
int x, y, x4, y4;
|
||||
float rgb[3];
|
||||
|
||||
#if DEBUG_LEVEL
|
||||
fprintf(stderr, ">>> %s ( %p %p %d )\n", __func__, src, dst, k);
|
||||
#endif
|
||||
|
||||
x4 = dst->width / 4, y4 = dst->height / 4;
|
||||
|
||||
for (y=0; y<y4; y++) {
|
||||
for (x=0; x<x4; x++) {
|
||||
fimg_get_rgb(src, x*4, y*4, rgb);
|
||||
fimg_put_rgb(dst, x+9, y+9, rgb);
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
/* -------------------------------------------------------------- */
|
||||
/* nouveau du premier dimanche de 2020 'nextgen' */
|
||||
static int pixel_trinitron(FloatImg *pimg, int pos[4], float *fvals)
|
||||
@ -49,7 +27,7 @@ static int pixel_trinitron(FloatImg *pimg, int pos[4], float *fvals)
|
||||
int x, y, off;
|
||||
|
||||
for (y=pos[1]; y<pos[1]+pos[3]; y++) {
|
||||
for (x=pos[0]+1; x<pos[0]+pos[2]-1; x++) {
|
||||
for (x=pos[0]; x<pos[0]+pos[2]; x++) {
|
||||
off = (y*pimg->width) + x;
|
||||
pimg->R[off] = fvals[0];
|
||||
pimg->G[off] = fvals[1];
|
||||
|
@ -3,9 +3,6 @@
|
||||
* ---------------------------------------------------
|
||||
*/
|
||||
|
||||
int incrustation_0(FloatImg *src, FloatImg *dst, int k);
|
||||
|
||||
|
||||
int trinitron(FloatImg *pimg, int notused);
|
||||
|
||||
int bouger_les_pixels(FloatImg *pimg, int kaboo);
|
||||
|
@ -81,14 +81,48 @@ nextpng++;
|
||||
return 0;
|
||||
}
|
||||
/* -------------------------------------------------------------- */
|
||||
int single_print_state(char *title, int k)
|
||||
/*
|
||||
* test-only function !
|
||||
*/
|
||||
int essayer_single(char *globpattern, char *destdir, int chain)
|
||||
{
|
||||
#if DEBUG_LEVEL
|
||||
fprintf(stderr, ">>> %s ( '%s' %d )\n", __func__, title, k);
|
||||
#endif
|
||||
FloatImg image;
|
||||
int idx, foo;
|
||||
|
||||
fprintf(stderr, "nextpng %d\n", nextpng);
|
||||
fprintf(stderr, "counter %d\n", counter);
|
||||
fprintf(stderr, ">>> %s ( '%s' '%s' %d )\n", __func__,
|
||||
globpattern, destdir, chain);
|
||||
|
||||
foo = fimg_create(&image, 640, 480, 3);
|
||||
if (foo) {
|
||||
fprintf(stderr, "erreur %d creation image\n", foo);
|
||||
return foo;
|
||||
}
|
||||
fimg_vdeg_a(&image, (double)3.141592654);
|
||||
|
||||
foo = single_init(0, destdir, "none");
|
||||
if (foo) {
|
||||
fprintf(stderr, "erreur %d single_init\n", foo);
|
||||
return foo;
|
||||
}
|
||||
|
||||
filterstack_list(chain, "essai du single");
|
||||
|
||||
for (idx=0; idx<666; idx++) {
|
||||
|
||||
foo = filterstack_run(chain, &image, 0);
|
||||
if (foo) {
|
||||
fprintf(stderr, "%s: filterstack run --> %d\n",
|
||||
__func__, foo);
|
||||
return foo;
|
||||
}
|
||||
|
||||
foo = single_push_picture(&image);
|
||||
if (foo) {
|
||||
fprintf(stderr, "erreur %d push picture\n", foo);
|
||||
return foo;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
@ -2,6 +2,7 @@
|
||||
SINGLE
|
||||
experimental and/or testing code, do not use in
|
||||
production.
|
||||
|
||||
*/
|
||||
|
||||
/* -------------------------------------------------------------- */
|
||||
@ -9,8 +10,12 @@
|
||||
int single_init(int next, char *dest, char *sfxchain);
|
||||
int single_push_picture(FloatImg *pimg);
|
||||
|
||||
int single_print_state(char *title, int k);
|
||||
|
||||
/* -------------------------------------------------------------- */
|
||||
/*
|
||||
* test function
|
||||
*/
|
||||
int essayer_single(char *globpattern, char *destdir, int K);
|
||||
|
||||
/* -------------------------------------------------------------- */
|
||||
|
||||
|
75
Fonderie/t.c
75
Fonderie/t.c
@ -67,90 +67,24 @@ fimg_destroy(&image);
|
||||
return 0;
|
||||
}
|
||||
/* ----------------------------------------------------------- */
|
||||
/*
|
||||
* test-only function !
|
||||
|
||||
foo = essayer_single("capture/???42.fimg", "/tmp/x8/", STK);
|
||||
fprintf(stderr, "essayer single -> %d\n", foo);
|
||||
|
||||
|
||||
*/
|
||||
int essayer_single(char *globpattern, char *destdir, int chain)
|
||||
{
|
||||
FloatImg image;
|
||||
int idx, foo;
|
||||
|
||||
fprintf(stderr, ">>> %s ( '%s' '%s' %d )\n", __func__,
|
||||
globpattern, destdir, chain);
|
||||
|
||||
foo = fimg_create(&image, 640, 480, 3);
|
||||
if (foo) {
|
||||
fprintf(stderr, "erreur %d creation image\n", foo);
|
||||
return foo;
|
||||
}
|
||||
fimg_vdeg_a(&image, (double)3.141592654);
|
||||
|
||||
foo = single_init(0, destdir, "none");
|
||||
if (foo) {
|
||||
fprintf(stderr, "erreur %d single_init\n", foo);
|
||||
return foo;
|
||||
}
|
||||
|
||||
filterstack_list(chain, "essai du single");
|
||||
|
||||
for (idx=0; idx<666; idx++) {
|
||||
|
||||
foo = filterstack_run(chain, &image, 0);
|
||||
if (foo) {
|
||||
fprintf(stderr, "%s: filterstack run --> %d\n",
|
||||
__func__, foo);
|
||||
return foo;
|
||||
}
|
||||
|
||||
foo = single_push_picture(&image);
|
||||
if (foo) {
|
||||
fprintf(stderr, "erreur %d push picture\n", foo);
|
||||
return foo;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
/* ----------------------------------------------------------- */
|
||||
|
||||
int help(void)
|
||||
{
|
||||
puts("yolo!");
|
||||
|
||||
puts("\t-F\tdefine:the:filter:chain");
|
||||
puts("\t-L\tlist available filters");
|
||||
puts("\t-i\tinfile.fimg");
|
||||
puts("\t-o\tinfile.xxx");
|
||||
|
||||
|
||||
exit(0);
|
||||
}
|
||||
/* ----------------------------------------------------------- */
|
||||
int experiment(void)
|
||||
void experiment(void)
|
||||
{
|
||||
int foo;
|
||||
FloatImg image, dest;
|
||||
|
||||
fprintf(stderr, "EXPERIMENT\n");
|
||||
|
||||
foo = fimg_create_from_dump("01137.fimg", &image);
|
||||
if (foo) {
|
||||
fprintf(stderr, "%s: err %d on create\n", __func__, foo);
|
||||
return -1;
|
||||
}
|
||||
foo = essayer_single("capture/???42.fimg", "/tmp/x8/", STK);
|
||||
|
||||
foo = fimg_clone(&image, &dest, 1);
|
||||
foo = fimg_copy_data(&image, &dest);
|
||||
|
||||
incrustation_0(&image, &dest, 0);
|
||||
|
||||
fimg_export_picture(&dest, "foo.png", 0);
|
||||
fprintf(stderr, "essayer single -> %d\n", foo);
|
||||
|
||||
exit(0); /* back to real world */
|
||||
}
|
||||
@ -162,7 +96,7 @@ int foo;
|
||||
int opt, do_xper = 0;
|
||||
char *filterchain = "0";
|
||||
char *infile = "mire.fimg";
|
||||
char *outfile = PNG;
|
||||
char *outfile = "out.png";
|
||||
char *outdir = "/tmp/x8/";
|
||||
|
||||
fprintf(stderr, "*** %s : compiled by tTh, %s %s\n", __FILE__,
|
||||
@ -196,7 +130,6 @@ if (foo) {
|
||||
|
||||
if (do_xper) {
|
||||
experiment();
|
||||
return 0;
|
||||
}
|
||||
|
||||
foo = essai_filterstack(infile, outfile);
|
||||
|
@ -36,9 +36,7 @@ if (fimg_images_not_compatible(psrc, pdst)) {
|
||||
return -8;
|
||||
}
|
||||
|
||||
if (psrc != pdst) { /* optimize or futurbug ? */
|
||||
foo = fimg_copy_data(psrc, pdst);
|
||||
}
|
||||
foo = fimg_copy_data(psrc, pdst);
|
||||
|
||||
szimg = pdst->width * pdst->height;
|
||||
fprintf(stderr, "%s : %d pixels\n", __func__, szimg);
|
||||
|
Loading…
Reference in New Issue
Block a user