+ random blocks 8x8

master
tonton th 2 years ago
parent 6bd95089f9
commit cdeeb9d92d
  1. 5
      Fonderie/crapulator.c
  2. 19
      Fonderie/glitches.c
  3. 1
      Fonderie/glitches.h

@ -221,6 +221,11 @@ switch (idFx) {
retval = vertical_singlitch(image, 290+rand()%45,
fval, 0.19, 0);
break;
case 26:
retval = random_blocks(image, 80);
break;
default :
fprintf(stderr, "%s : effect #%d invalid\n",
__func__, idFx);

@ -96,6 +96,25 @@ for (y=0; y<8; y++) {
return 0;
}
/* -------------------------------------------------------------- */
int random_blocks(FloatImg *picture, int percent)
{
int x, y;
for (y=0; y<picture->height; y+=8) {
for (x=0; x<picture->width; x+=8) {
if (percent < (rand()%100) ) {
un_petit_flou_8x8(picture,x, y);
}
}
}
return 0;
}
/* -------------------------------------------------------------- */
int un_moyen_flou_8x8(FloatImg *picture, int xpos, int ypos)
{
int i, j, x, y;

@ -4,6 +4,7 @@
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);
int un_petit_flou_8x8(FloatImg *picture, int x, int y);
int un_moyen_flou_8x8(FloatImg *picture, int x, int y);

Loading…
Cancel
Save