pike.git / src / modules / Image / orient.c

version» Context lines:

pike.git/src/modules/Image/orient.c:88:   **! The <tt>orient4</tt> function gives back   **! 4 image objects, corresponding to the   **! amount of different directions, see above.   **!   **! returns an image or an array of the four new image objects   **!   **! note   **! experimental status; may not be exact the same   **! output in later versions   */ - static INLINE int sq(int a) { return a*a; } +    static INLINE int my_abs(int a) { return (a<0)?-a:a; }      static void _image_orient(struct image *source,    struct object *o[5],    struct image *img[5])   {    int i;    struct { int x,y; } or[4]={ {1,0}, {1,1}, {0,1}, {-1,1} };    int x,y;   
pike.git/src/modules/Image/orient.c:128:       for(x=1; x<xz-1; x++)    for(y=1; y<yz-1; y++)    {   #define FOOBAR(CO) \    d[x+y*xz].CO \    = \    (COLORTYPE) \    my_abs( s[(x+xd)+(y+yd)*xz].CO - s[(x-xd)+(y-yd)*xz].CO )    -  /* -  sqrt( ( sq( s[(x-xd)+(y-yd)*xz].CO - s[x+y*xz].CO ) + \ -  sq( s[(x+xd)+(y+yd)*xz].CO - s[x+y*xz].CO ) ) / 2.0 ) -  */ -  +     FOOBAR(r);    FOOBAR(g);    FOOBAR(b);      #undef FOOBAR    }    }   CHRONO("end");   THREADS_DISALLOW();   }