working on glitching methods

This commit is contained in:
le vieux
2020-11-15 11:47:37 +01:00
parent 70d811a7e5
commit dcacb07738
5 changed files with 63 additions and 23 deletions

View File

@@ -113,10 +113,31 @@ int poke_a_random_pixel(FloatImg *picz, float fval, int kaboo)
return -1;
}
/* -------------------------------------------------------------- */
int vertical_singlitch(FloatImg *picz, float omega, float phi)
int vertical_singlitch(FloatImg *picz, int xpos, float fval,
float omega, float phi)
{
int y, x, w, h;
return -1;
#if DEBUG_LEVEL
fprintf(stderr, ">>> %s ( %p %d %f %f )\n", __func__, picz,
xpos, omega, phi);
#endif
h = picz->height; w = picz->width;
#define BB 12
for (y=BB; y<h-BB; y++) {
x = xpos; /* add sinus deviation here */
/* compute bounding box */
if ( (x>BB) && (x<w-BB) ) {
/* an make the glitch */
fimg_plot_rgb(picz, x, y, fval, fval, fval);
if (rand() & 8)
fimg_plot_rgb(picz, x-1, y, 0.0, 0.0, 0.0);
if (rand() & 8)
fimg_plot_rgb(picz, x+1, y, 0.0, 0.0, 0.0);
}
}
return 0;
}
/* -------------------------------------------------------------- */