Demo entry 6745519

a

   

Submitted by anonymous on May 27, 2018 at 09:56
Language: C. Code size: 1.2 kB.

       for (j=1;j<=max_rl;j+=2)
       {
        index=RIDX(i,j,dim);
        pix.red=src[index-dim].red+src[index-(dim-1)].red+src[index].red+src[index+1].red+src[index+dim].red+src[index+(dim+1)].red;
        pix.green=src[index-dim].green+src[index-(dim-1)].green+src[index].green+src[index+1].green+src[index+dim].green+src[index+(dim+1)].green;
        pix.blue=src[index-dim].blue+src[index-(dim-1)].blue+src[index].blue+src[index+1].blue+src[index+dim].blue+src[index+(dim+1)].blue;
        pix_r=pix_l=pix;
        pix_l.red=pix.red+(src[index-(dim+1)].red+src[index-1].red+src[index+(dim-1)].red);
        pix_l.green=pix.green+(src[index-(dim+1)].green+src[index-1].green+src[index+(dim-1)].green);
        pix_l.blue=pix.blue+(src[index-(dim+1)].blue+src[index-1].blue+src[index+(dim-1)].blue);
        pix_r.red=pix.red+(src[index-(dim-2)].red+src[index+2].red+src[index+(dim+2)].red);
        pix_r.green=pix.green+(src[index-(dim-2)].green+src[index+2].green+src[index+(dim+2)].green);
        pix_r.blue=pix.blue+(src[index-(dim-2)].blue+src[index+2].blue+src[index+(dim+2)].blue);
        assign_pixel(&pix_l,9,p++);
        assign_pixel(&pix_r,9,p++);
       }

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).