Compare commits
No commits in common. "1d6f0e8b4eef255b96ec1a64031ceb884f87928f" and "864c8d2d05a1abfab7aadad7749879078d140a8c" have entirely different histories.
1d6f0e8b4e
...
864c8d2d05
@ -203,9 +203,6 @@ switch (idFx) {
|
||||
retval = octotree_classif(image, 0.500, 0);
|
||||
break;
|
||||
|
||||
case CR_trinitron:
|
||||
retval = trinitron(image, 0);
|
||||
break;
|
||||
|
||||
/* here are the glitches */
|
||||
case CR_bsombra: /* experiment ! */
|
||||
@ -231,10 +228,6 @@ switch (idFx) {
|
||||
retval = 0;
|
||||
break;
|
||||
|
||||
case CR_nothing:
|
||||
retval = do_something(image, 3);
|
||||
break;
|
||||
|
||||
default :
|
||||
fprintf(stderr, "%s : effect #%d invalid\n",
|
||||
__func__, idFx);
|
||||
|
@ -19,11 +19,9 @@
|
||||
18 updown 1 1.0
|
||||
19 hipass 1 1.0
|
||||
20 octotree 1 1.0
|
||||
21 trinitron 3, 0.0
|
||||
24 bsombra 1 1.0
|
||||
25 vsglitch 1 1.0
|
||||
26 rndblks 1 1.0
|
||||
27 shiftln0 1 1.0
|
||||
42 nothing 42 3.14159
|
||||
99 message 1 1.0
|
||||
-1 end 1 1.0
|
||||
|
@ -125,9 +125,8 @@ for (idx=0; idx<f_stacks[numid].count; idx++) {
|
||||
|
||||
if (foo) {
|
||||
fprintf(stderr,
|
||||
"crapulator give me error %d on effect %d (%s)\n",
|
||||
foo, eff,
|
||||
crap_name_from_number(eff));
|
||||
"crapulator give me error %d on effect %d\n",
|
||||
foo, eff);
|
||||
return foo;
|
||||
}
|
||||
}
|
||||
|
@ -82,12 +82,10 @@ if (1 != step) fprintf(stderr, "\tstep is %d\n", step);
|
||||
|
||||
(void)fimg_timer_set(0);
|
||||
|
||||
#if 0
|
||||
if (infx) fprintf(stderr, "\tin fx #%d\n", infx);
|
||||
else fprintf(stderr, "\tno in fx\n");
|
||||
if (outfx) fprintf(stderr, "\tout fx #%d\n", outfx);
|
||||
else fprintf(stderr, "\tno out fx\n");
|
||||
#endif
|
||||
|
||||
memset(&globbuf, 0, sizeof(glob_t));
|
||||
foo = glob(pattern, 0, NULL, &globbuf);
|
||||
@ -198,7 +196,7 @@ int blanks = 20;
|
||||
char *InFchain = "0";
|
||||
char *OutFchain = "0";
|
||||
|
||||
fprintf(stderr, "%s\n\tcompiled %s, %s, pid %d\n",
|
||||
fprintf(stderr, "%s, compiled %s, %s, pid %d\n",
|
||||
argv[0], __DATE__, __TIME__, getpid());
|
||||
fimg_print_version(2);
|
||||
|
||||
|
@ -16,28 +16,6 @@
|
||||
|
||||
extern int verbosity;
|
||||
|
||||
/* -------------------------------------------------------------- */
|
||||
/* nouveau du 32 decembre 2020, endless september */
|
||||
int do_something(FloatImg *pimg, int notused)
|
||||
{
|
||||
int ypos, idx, pos, sline;
|
||||
|
||||
#if DEBUG_LEVEL
|
||||
fprintf(stderr, ">>> %s ( %p %d )\n", __func__, pimg, notused);
|
||||
#endif
|
||||
|
||||
ypos = rand() % pimg->width;
|
||||
|
||||
for (idx=0; idx < pimg->height; idx++) {
|
||||
sline = idx * pimg->width;
|
||||
pos = sline + ypos;
|
||||
// fprintf(stderr, "%6d %6d\n", idx, sline);
|
||||
pimg->R[pos] = pimg->G[pos];
|
||||
pimg->B[pos] = pimg->G[pos];
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
/* -------------------------------------------------------------- */
|
||||
int kill_a_random_line(FloatImg *pvictime, float fval, int bits)
|
||||
{
|
||||
|
@ -2,8 +2,6 @@
|
||||
* glitches.h
|
||||
*/
|
||||
|
||||
int do_something(FloatImg *pimg, int notused);
|
||||
|
||||
int kill_a_random_line(FloatImg *pvictime, float level, int bits);
|
||||
int kill_a_few_lines(FloatImg *who, float fval, int number);
|
||||
int random_blocks(FloatImg *picture, int percent);
|
||||
|
@ -9,38 +9,6 @@
|
||||
|
||||
extern int verbosity;
|
||||
|
||||
/* -------------------------------------------------------------- */
|
||||
int stat_zone(FloatImg *pimg, int geom[4], float v3[3])
|
||||
{
|
||||
int x, y, xe, ye;
|
||||
int off;
|
||||
double accus[3], divisor;
|
||||
|
||||
xe = geom[0] + geom[2];
|
||||
ye = geom[1] + geom[3];
|
||||
|
||||
#if DEBUG_LEVEL
|
||||
fprintf(stdout, "geom: %5d %5d %5d %5d\n",
|
||||
geom[0], geom[1], geom[2], geom[3]);
|
||||
#endif
|
||||
|
||||
accus[0] = accus[1] = accus[2] = 0.0;
|
||||
for (y=geom[1]; y<ye; y++) {
|
||||
for (x=geom[0]; x<xe; x++) {
|
||||
off = (y*pimg->width) + x;
|
||||
accus[0] += (double) pimg->R[off];
|
||||
accus[1] += (double) pimg->G[off];
|
||||
accus[2] += (double) pimg->B[off];
|
||||
}
|
||||
}
|
||||
|
||||
divisor = (double)(geom[2] * geom[3]); /* array of zone */
|
||||
v3[0] = (float)(accus[0] / divisor);
|
||||
v3[1] = (float)(accus[1] / divisor);
|
||||
v3[2] = (float)(accus[2] / divisor);
|
||||
|
||||
return 0;
|
||||
}
|
||||
/* -------------------------------------------------------------- */
|
||||
/*
|
||||
* premier essai...
|
||||
|
@ -4,9 +4,6 @@
|
||||
|
||||
/* -------------------------------------------------------------- */
|
||||
|
||||
int stat_zone(FloatImg *pimg, int geom[4], float v3[3]);
|
||||
|
||||
|
||||
/* first experiments */
|
||||
|
||||
int get_float_metric_a(FloatImg *pimg, float *where);
|
||||
|
@ -12,7 +12,6 @@
|
||||
#include "../floatimg.h"
|
||||
|
||||
#include "fonctions.h"
|
||||
#include "metriques.h"
|
||||
#include "sfx.h"
|
||||
|
||||
/* -------------------------------------------------------------- */
|
||||
@ -20,51 +19,13 @@
|
||||
*/
|
||||
extern int verbosity;
|
||||
|
||||
/* -------------------------------------------------------------- */
|
||||
/* nouveau du premier dimanche de 2020 'nextgen' */
|
||||
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]; x<pos[0]+pos[2]; x++) {
|
||||
off = (y*pimg->width) + x;
|
||||
pimg->R[off] = fvals[0];
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
int trinitron(FloatImg *pimg, int notused)
|
||||
{
|
||||
int x, y, coo[4], foo;
|
||||
float vals[3];
|
||||
|
||||
#if DEBUG_LEVEL
|
||||
fprintf(stderr, ">>> %s ( %p %d )\n", __func__, pimg, notused);
|
||||
#endif
|
||||
|
||||
#define STP 16 /* stepd for x & y axex */
|
||||
coo[2] = coo[3] = STP;
|
||||
|
||||
for (y=0; y<pimg->height; y+=STP) {
|
||||
coo[1] = y;
|
||||
for (x=0; x<pimg->width; x+=STP) {
|
||||
coo[0] = x;
|
||||
foo = stat_zone(pimg, coo, vals);
|
||||
if (foo) abort();
|
||||
/* next step : plot the datas */
|
||||
pixel_trinitron(pimg, coo, vals);
|
||||
}
|
||||
}
|
||||
#undef STP
|
||||
return 0;
|
||||
}
|
||||
/* -------------------------------------------------------------- */
|
||||
/* nouveau du 27 decembre 2020, un soir de grand froid... */
|
||||
|
||||
int octotree_classif(FloatImg *pimg, float kdist, int notused)
|
||||
{
|
||||
int foo;
|
||||
float mm[6], delta[3];
|
||||
float mm[6], means[4], delta[3];
|
||||
float r, g, b, kr, kg, kb, dp, trig;
|
||||
int idx, sz, n8, count;
|
||||
typedef struct {
|
||||
@ -77,6 +38,16 @@ fprintf(stderr, ">>> %s ( %p %f %d )\n", __func__,
|
||||
pimg, kdist, notused);
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
foo = fimg_meanvalues(pimg, means);
|
||||
if (foo) {
|
||||
fprintf(stderr, "oups %d in meanvalues\n", foo);
|
||||
return foo;
|
||||
}
|
||||
fprintf(stderr, "means: %11f %11f %11f\n",
|
||||
means[0], means[1], means[2]);
|
||||
#endif
|
||||
|
||||
foo = fimg_get_minmax_rgb(pimg, mm);
|
||||
if (foo) {
|
||||
fprintf(stderr, "oups %d in get minmax\n", foo);
|
||||
|
@ -3,8 +3,6 @@
|
||||
* ---------------------------------------------------
|
||||
*/
|
||||
|
||||
int trinitron(FloatImg *pimg, int notused);
|
||||
|
||||
int bouger_les_pixels(FloatImg *pimg, int kaboo);
|
||||
int octotree_classif(FloatImg *pimg, float fk, int notused);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user