working on glitches

This commit is contained in:
le vieux
2020-11-15 21:31:02 +01:00
parent 1334d96822
commit fdc2544ad1
6 changed files with 90 additions and 4 deletions

View File

@@ -117,6 +117,7 @@ int vertical_singlitch(FloatImg *picz, int xpos, float fval,
float omega, float phi)
{
int y, x, w, h;
double dy;
#if DEBUG_LEVEL
fprintf(stderr, ">>> %s ( %p %d %f %f )\n", __func__, picz,
@@ -124,9 +125,13 @@ fprintf(stderr, ">>> %s ( %p %d %f %f )\n", __func__, picz,
#endif
h = picz->height; w = picz->width;
#define BB 12
#define BB 10
for (y=BB; y<h-BB; y++) {
x = xpos; /* add sinus deviation here */
dy = (double)y * omega;
x = xpos + (int)(10.9*sin(dy+phi)); /* add sinus deviation */
/* compute bounding box */
if ( (x>BB) && (x<w-BB) ) {
/* an make the glitch */