home *** CD-ROM | disk | FTP | other *** search
/ Encyclopedia of Graphics File Formats Companion / GFF_CD.ISO / software / unix / saoimage / sao1_07.tar / hfiles / coord.h < prev    next >
C/C++ Source or Header  |  1991-06-21  |  3KB  |  83 lines

  1. #ifndef lint
  2. static char SccsCoordId[] = "%W%  %G%";
  3. #endif
  4.  
  5. /* Module:    Coord.h
  6.  * Purpose:    Define the structs for coordinate handling and some related
  7.  *        constants
  8.  * Modified:    {0} Michael VanHilst    initial version         31 December 1988
  9.  *        {1} MVH replaced rep variables in cornerRec     21 June 1991
  10.  *        {n} <who> -- <does what> -- <when>
  11.  */
  12.  
  13. #define LX     1        /* flags to show which edges clipped */
  14. #define TY     2
  15. #define RX     4
  16. #define BY     8
  17. #define LXTY     3        /* flags to test clipped corners */
  18. #define RXBY    12
  19.  
  20. typedef struct fieldRec {
  21.   float X1, X2, Y1, Y2;        /* edges of subsection area in its system */
  22.   int X1i, X2i, Y1i, Y2i;    /* first and last coords of subsection */
  23.   int Xwdth, Yhght;        /* dimensions of subsection */
  24.   float cenX, cenY;        /* native coordinates of official center */
  25.   int width, height;        /* dimensions of system */
  26.   double ioff;            /* ir offset (realX = (float)intX + ioff) */
  27. } Coordsys;
  28.  
  29. typedef struct transfRec {
  30.   float inx_outx, iny_outx, add_outx;
  31.   float inx_outy, iny_outy, add_outy;
  32.   float iadd_outx, iadd_outy;
  33.   int no_rot;
  34.   int int_math, zoom, multiply, flip;
  35.   int ixzoom, iyzoom;
  36. } Transform;
  37.  
  38. /* parameters to map data from one window (src) to another (dst)
  39. /* clipping occurs when the (dst) window extends beyond the (src) window */
  40. /* clipping codes (unique bit) follow this struct declaration */
  41. typedef struct cornerRec {
  42.   float cenX, cenY;            /* dst's center in src's coords */
  43.   double zoom;                /* src to dst zoom */
  44.   int srcX1, srcX2, srcY1, srcY2;    /* src left, top, right, bottom pixs */
  45.   int srcXwdth, srcYhght;        /* dst's dim's in src's coords */
  46.   int clip;                /* code where src clips dst */
  47.   int block;                /* integer blocking code */
  48.   int dstX1, dstX2, dstY1, dstY2;    /* four edges of map in dst */
  49.   int dstXwdth, dstYhght;        /* dimensions as delivered to dst */
  50.   int dst_x, dst_y;            /*  src(0,0) in dst coords  */
  51.   int src_x, src_y;            /*  dst(0,0) in src coords  */
  52. } Edges;
  53.  
  54. struct coordRec {
  55.   Coordsys file;            /* the image file */
  56.   Coordsys fbuf;            /* buffer for data larger than i*2 */
  57.   Coordsys img;                /* TV oriented reference system */
  58.   Coordsys buf;                /* i*2 buffer for data */
  59.   Coordsys disp;            /* char buffer for main display */
  60.   Coordsys pan;                /* all buffers for pan/zoom window */
  61.   Transform imgtofile, filetoimg;
  62.   Transform pantoimg, imgtopan;
  63.   Transform disptoimg, imgtodisp;
  64.   Transform buftoimg, imgtobuf;
  65.   Transform fbuftoimg, imgtofbuf;
  66.   Transform buftofile, filetobuf;
  67.   Transform disptofile, filetodisp;
  68.   Transform buftofbuf;            /* i*2 buffer to file data buffer */
  69.   Transform pantofile;
  70.   Transform disptobuf;
  71.   Transform filetoaux;            /* 2nd system in coord track string */
  72.   Edges id;                /* outline of disp in img coords */
  73.   Edges tid;                /* proposed edges of disp in img */
  74.   Edges ib;                /* edges of buffer contents in img */
  75.   Edges bd;                /* edges of disp in the buffer */
  76.   Edges fb;                /* edges of buffer in file */
  77.   Edges fp;                /* edges of pan window in file */
  78.   int bufcheck;                /* flag to buf change to suit disp */
  79.   int buferror;                /* flag proposed disp needs new buf */
  80.   int imtool_aux;            /* transform to true coords exists */
  81.   int pad;
  82. };
  83.