
void kaleido(unsigned char *s,int xs,int ys)
{
    int     x,y;
    unsigned char   *p,*d;

    for(y=0;y<ys/2;y++)
    {
        p=&s[xs*y];
        d=&s[xs*y+xs-1];
        for(x=0;x<xs/2;x++)
            *d--=*p++;

        memcpy(&s[xs*(ys-y-1)],&s[xs*y],xs);
    }
}