working on glitching methods
This commit is contained in:
@@ -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;
|
||||
}
|
||||
/* -------------------------------------------------------------- */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user