+ upside-down
This commit is contained in:
parent
0def451bf4
commit
d369babbb3
@ -183,6 +183,9 @@ switch (idFx) {
|
||||
case 17:
|
||||
retval = mirror_split(image, 0);
|
||||
break;
|
||||
case 18:
|
||||
retval = upside_down(image);
|
||||
break;
|
||||
|
||||
/* here are the glitches */
|
||||
case 24: /* experiment ! */
|
||||
@ -217,6 +220,7 @@ switch (num) {
|
||||
case 0: return "none";
|
||||
case 8: return "ctr2x2";
|
||||
case 13: return "fltr3x3";
|
||||
case 18: return "updown";
|
||||
}
|
||||
|
||||
return "???";
|
||||
|
@ -76,7 +76,7 @@ if (numid < 0 || numid > NUMBER_OF_STACK) {
|
||||
fprintf(stderr, "--- %2d -- %-20s --------\n", numid, txt);
|
||||
// fprintf(stderr, "stack at %p, size %d, current %d\n",
|
||||
// f_slots, nbre_filters, idx_slot);
|
||||
fprintf(stderr, "idx fx# name ival fval\n");
|
||||
fprintf(stderr, "idx ___ fx# _ name ________ ival _ fval ___\n");
|
||||
|
||||
for (idx=0; idx<f_stacks[numid].count; idx++) {
|
||||
|
||||
@ -122,7 +122,9 @@ for (idx=0; idx<f_stacks[numid].count; idx++) {
|
||||
foo = crapulator(target, eff, fv);
|
||||
|
||||
if (foo) {
|
||||
fprintf(stderr, "crapulator error %d\n", foo);
|
||||
fprintf(stderr,
|
||||
"crapulator give me error %d on effect %d\n",
|
||||
foo, eff);
|
||||
return foo;
|
||||
}
|
||||
}
|
||||
|
@ -76,7 +76,8 @@ for (idx=0; idx<nombre; idx++) {
|
||||
return -1;
|
||||
}
|
||||
if (verbosity)
|
||||
fprintf(stderr, "%5d %s %f\r", idx, filename, metrique);
|
||||
fprintf(stderr, "%5d %s %10.3f\r",
|
||||
idx, filename, metrique);
|
||||
idxvalues[idx].idx = idx;
|
||||
idxvalues[idx].value = metrique;
|
||||
average += (double)metrique;
|
||||
|
@ -18,6 +18,58 @@
|
||||
*/
|
||||
extern int verbosity;
|
||||
|
||||
/* -------------------------------------------------------------- */
|
||||
/* nouveau du 19 decembre 2020, pour le grand ecran de da Scritch */
|
||||
|
||||
int upside_down(FloatImg *pimg)
|
||||
{
|
||||
float *rowpix;
|
||||
float *Ps, *Pd;
|
||||
int Os, Od; /* offset of lines */
|
||||
int wsz;
|
||||
int ya, y2;
|
||||
|
||||
fprintf(stderr, "%s: image width is %d\n", __func__, pimg->width);
|
||||
|
||||
rowpix = calloc(pimg->width, sizeof(float));
|
||||
if (NULL==rowpix) {
|
||||
fprintf(stderr, "%s : memory full\n", __func__);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
wsz = pimg->width * sizeof(float);
|
||||
fprintf(stderr, "%s: wsx = %d\n", __func__, wsz);
|
||||
|
||||
for (ya=0; ya<pimg->height/2; ya++) {
|
||||
|
||||
y2 = pimg->height - (ya+1);
|
||||
Os = (pimg->width * ya);
|
||||
Od = (pimg->width * y2);
|
||||
|
||||
/* let's go, crash coredumping... */
|
||||
Ps = pimg->R + Os;
|
||||
Pd = pimg->R + Od;
|
||||
memcpy(rowpix, Ps, wsz);
|
||||
memcpy(Ps, Pd, wsz);
|
||||
memcpy(Pd, rowpix, wsz);
|
||||
|
||||
Ps = pimg->G + Os;
|
||||
Pd = pimg->G + Od;
|
||||
memcpy(rowpix, Ps, wsz);
|
||||
memcpy(Ps, Pd, wsz);
|
||||
memcpy(Pd, rowpix, wsz);
|
||||
|
||||
Ps = pimg->B + Os;
|
||||
Pd = pimg->B + Od;
|
||||
memcpy(rowpix, Ps, wsz);
|
||||
memcpy(Ps, Pd, wsz);
|
||||
memcpy(Pd, rowpix, wsz);
|
||||
}
|
||||
|
||||
free(rowpix);
|
||||
|
||||
return 0;
|
||||
}
|
||||
/* -------------------------------------------------------------- */
|
||||
/* nouveau du 9 decembre 2020, en ecoutant le Fermion raconter du
|
||||
superbe portnawak */
|
||||
@ -113,7 +165,7 @@ return 0;
|
||||
int trinarize(FloatImg *pimg, int notused)
|
||||
{
|
||||
float mm[6], mRa, mGa, mBa, mRb, mGb, mBb;
|
||||
float val, *fptr;
|
||||
float *fptr;
|
||||
int foo, size;
|
||||
|
||||
#if DEBUG_LEVEL
|
||||
|
@ -6,6 +6,7 @@
|
||||
int bouger_les_pixels(FloatImg *pimg, int kaboo);
|
||||
|
||||
int mirror_split(FloatImg *pimg, int kaboo);
|
||||
int upside_down(FloatImg *pimg);
|
||||
|
||||
int des_bords_sombres_a(FloatImg *pimg, int offset);
|
||||
|
||||
|
@ -76,7 +76,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
int foo;
|
||||
int opt;
|
||||
char *filterchain = "0";
|
||||
char *filterchain = "18";
|
||||
|
||||
fprintf(stderr, "*** %s : compiled by tTh, %s %s\n", __FILE__,
|
||||
__DATE__, __TIME__);
|
||||
@ -100,7 +100,7 @@ if (foo) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
foo = essai_filterstack("mire.fimg");
|
||||
foo = essai_filterstack("01137.fimg");
|
||||
if (foo) {
|
||||
fprintf(stderr, "err %d in essai_filterstack\n", foo);
|
||||
exit(1);
|
||||
|
Loading…
Reference in New Issue
Block a user