void make_filtered_image( unsigned short *source_array, //pointer to source array
unsigned short *dest_array, //pointer to dest array
unsigned short x_size, //x size in pixel
unsigned short y_size) //y size in pixel
{
unsigned short x,y,s0,s1,s2;
int r0,g0,b0,r1,g1,b1,r2,g2,b2;
for (y=0;y<y_size;y++) //y loop
{
s0=0;s1=*source_array++; //init s0 s1
for (x=0;x<x_size;x++) //x loop
{
if (x<x_size) //if no last x pixel
s2=*source_array++; // get s2
else //else s2=0
s2=0;
r0=s0&0xF800; //split RGB components
g0=s0&0x7e0;
b0=s0&0x1f;
r2=s2&0xF800;
g2=s2&0x7e0;
b2=s2&0x1f;
r1=r2-r0; //apply filter -1 0 +1
if (r1<0) r1=0; //clip
g1=g2-g0; //apply filter -1 0 +1
if (g1<0) g1=0; //clip
b1=b2-b0; //apply filter -1 0 +1
if (b1<0) b1=0; //clip
*dest_array++=(unsigned short)(r1|g1|b1);
s0=s1;
s1=s2;
}
}
}
[/FONT]