|
|
|
@ -120,6 +120,24 @@ for (y=0; y<8; y++) {
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
/* -------------------------------------------------------------- */
|
|
|
|
|
int plot_multidots(FloatImg *picture, int notused)
|
|
|
|
|
{
|
|
|
|
|
int pass, szimg, osrc, odst;
|
|
|
|
|
|
|
|
|
|
szimg = picture->width * picture->height;
|
|
|
|
|
|
|
|
|
|
for (pass=0; pass<szimg/32; pass++) {
|
|
|
|
|
|
|
|
|
|
osrc = rand() % szimg;
|
|
|
|
|
odst = rand() % szimg;
|
|
|
|
|
picture->R[odst] = (picture->R[osrc] + picture->R[odst]) / 2.0;
|
|
|
|
|
picture->G[odst] = (picture->G[osrc] + picture->G[odst]) / 2.0;
|
|
|
|
|
picture->B[odst] = (picture->B[osrc] + picture->B[odst]) / 2.0;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
int random_blocks(FloatImg *picture, int percent)
|
|
|
|
|
{
|
|
|
|
|
int x, y;
|
|
|
|
@ -212,16 +230,26 @@ for (y=BB; y<h-BB; y++) {
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
/* -------------------------------------------------------------- */
|
|
|
|
|
static void shifter(float *fs, float *fd, int w, int nbr)
|
|
|
|
|
static void shifter(float *fs, float *fd, int stp, int largeur)
|
|
|
|
|
{
|
|
|
|
|
int krkr;
|
|
|
|
|
int xpos;
|
|
|
|
|
|
|
|
|
|
for (krkr=0; krkr<nbr; krkr++) {
|
|
|
|
|
fd[krkr] = fs[(krkr+w)%nbr];
|
|
|
|
|
/* move the pixels */
|
|
|
|
|
for (xpos=0; xpos<largeur; xpos++) {
|
|
|
|
|
fd[xpos] = fs[(xpos+stp)%largeur];
|
|
|
|
|
}
|
|
|
|
|
/* take your sixpack, film at 11 */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void smooth_line(float *fs, float *fd, int sz)
|
|
|
|
|
{
|
|
|
|
|
int xpos;
|
|
|
|
|
for (xpos=1; xpos<(sz-1); xpos++) {
|
|
|
|
|
fd[xpos] = (fs[xpos-1]+fs[xpos]+fs[xpos+1]) / 3.0;
|
|
|
|
|
}
|
|
|
|
|
fd[0] = fd[sz-1] = 0.0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int multilines_shift_0(FloatImg *picz, int step, int nombre)
|
|
|
|
|
{
|
|
|
|
|
float *buffline, *sptr;
|
|
|
|
@ -242,15 +270,18 @@ for (idx=0; idx<nombre; idx++) {
|
|
|
|
|
|
|
|
|
|
sptr = picz->R + (ypos * picz->width);
|
|
|
|
|
shifter(sptr, buffline, step, picz->width);
|
|
|
|
|
memcpy(sptr, buffline, picz->width*sizeof(float));
|
|
|
|
|
smooth_line(buffline, sptr, picz->width);
|
|
|
|
|
// XXX memcpy (sptr, buffline, picz->width*sizeof(float));
|
|
|
|
|
|
|
|
|
|
sptr = picz->G + (ypos * picz->width);
|
|
|
|
|
shifter(sptr, buffline, step, picz->width);
|
|
|
|
|
memcpy(sptr, buffline, picz->width*sizeof(float));
|
|
|
|
|
smooth_line(buffline, sptr, picz->width);
|
|
|
|
|
// XXX memcpy (sptr, buffline, picz->width*sizeof(float));
|
|
|
|
|
|
|
|
|
|
sptr = picz->B + (ypos * picz->width);
|
|
|
|
|
shifter(sptr, buffline, step, picz->width);
|
|
|
|
|
memcpy(sptr, buffline, picz->width*sizeof(float));
|
|
|
|
|
smooth_line(buffline, sptr, picz->width);
|
|
|
|
|
// XXX memcpy (sptr, buffline, picz->width*sizeof(float));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|