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

version» Context lines:

pike.git/src/modules/Image/orient.c:1: - /* $Id: orient.c,v 1.2 1998/02/15 15:50:10 hedda Exp $ */ + /* $Id: orient.c,v 1.3 1998/02/15 15:53:00 mirar Exp $ */      /*   **! module Image   **! note - **! $Id: orient.c,v 1.2 1998/02/15 15:50:10 hedda Exp $ + **! $Id: orient.c,v 1.3 1998/02/15 15:53:00 mirar Exp $   **! class image   */      #include "global.h"      #include <math.h>   #include <ctype.h>      #include "stralloc.h"   #include "global.h"
pike.git/src/modules/Image/orient.c:29: Inside #if defined(THIS)
  extern struct program *image_program;   #ifdef THIS   #undef THIS /* Needed for NT */   #endif   #define THIS ((struct image *)(fp->current_storage))   #define THISOBJ (fp->current_object)      #define testrange(x) MAXIMUM(MINIMUM((x),255),0)      static const double c0=0.70710678118654752440; - static const double PI=3.14159265358979323846; + static const double my_PI=3.14159265358979323846;      /*   **! method object orient( foo bar args?)   **! Draws four images describing the orientation.   **!   **!   **!   **!   **!   **!
pike.git/src/modules/Image/orient.c:54:   **!   **!   **!   **!   **!   **!   **!   **! returns an array of four new image objects   **! arg int newx   **! arg int newy - **! new image size in pixels + **! new image size in my_PIxels   **!   */   static INLINE int sq(int a) { return a*a; }      void image_orient(INT32 args)   {    int x,y;    int h,j;    struct object *o1;    struct object *o2;
pike.git/src/modules/Image/orient.c:184:       h=o2img->img[x+y*B->xsize].r+    o2img->img[x+y*B->xsize].g+    o2img->img[x+y*B->xsize].b-    o4img->img[x+y*B->xsize].r-    o4img->img[x+y*B->xsize].g-    o4img->img[x+y*B->xsize].b;       if (h>0)    if (j>0) -  A->img[x+y*B->xsize].r=(int)(0.5+(255/(2*PI))* +  A->img[x+y*B->xsize].r=(int)(0.5+(255/(2*my_PI))*    atan((float)h/(float)j));    else    if (j<0) -  A->img[x+y*B->xsize].r=(int)(0.5+(255/(2*PI))* -  (PI+atan((float)h/(float)j))); +  A->img[x+y*B->xsize].r=(int)(0.5+(255/(2*my_PI))* +  (my_PI+atan((float)h/(float)j)));    else    A->img[x+y*B->xsize].r=255/4;    else    if (h<0)    if (j>0) -  A->img[x+y*B->xsize].r=(int)(0.5+(255/(2*PI))* -  (2*PI+atan((float)h/(float)j))); +  A->img[x+y*B->xsize].r=(int)(0.5+(255/(2*my_PI))* +  (2*my_PI+atan((float)h/(float)j)));    else    if (j<0) -  A->img[x+y*B->xsize].r=(int)(0.5+(255/(2*PI))* -  (PI+atan((float)h/(float)j))); +  A->img[x+y*B->xsize].r=(int)(0.5+(255/(2*my_PI))* +  (my_PI+atan((float)h/(float)j)));    else    A->img[x+y*B->xsize].r=(3*255)/4;    else    if (j<0)    A->img[x+y*B->xsize].r=255/2;    else    A->img[x+y*B->xsize].r=0;          A->img[x+y*B->xsize].g=255;