home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume12 / postscript / part01 / source / path.h < prev    next >
Encoding:
C/C++ Source or Header  |  1987-10-27  |  1008 b   |  43 lines

  1. /*
  2.  * Copyright (C) Crispin Goswell 1987, All Rights Reserved.
  3.  */
  4.  
  5. #define CBUTT    0
  6. #define CROUND    1
  7. #define CSQUARE    2
  8.  
  9. #define JMITRE    0
  10. #define JROUND    1
  11. #define JBEVEL    2
  12.  
  13. #define STROKE_FILL 0
  14. #define STROKE_THIN 1
  15.  
  16. #define FILL_SINGLE        0
  17. #define FILL_CACHE_DOUBLE    1
  18. #define FILL_DOUBLE        2
  19. #define FILL_DOUBLE_STROKE    3
  20.  
  21. typedef struct hard_point { float hx, hy; } HardPoint;
  22.  
  23. enum pelem_type { EHeader, EMove, ELine, EArc, ECurve, EClose };
  24.  
  25. struct path_element
  26.  {
  27.      enum pelem_type ptype;
  28.      union {
  29.           HardPoint point;
  30.         struct arc { int dir; HardPoint centre; float radius, from, to; } arc;
  31.          struct bezier { HardPoint x0, x1, x2; } curve;
  32.      } pe;
  33.      struct path_element *next, *last;
  34.  };
  35.  
  36. typedef struct path_element *Path;
  37.  
  38. extern HardPoint NewHardPoint (), ExtToInt (), MoveHardPoint ();
  39. extern Path NewPath (), PathCopy (), NewMove ();
  40. extern int PNewPath (), PInitMatrix ();
  41. extern Path NewClipPath (), PathRemove (), ReversePath (), FlattenPath ();
  42. extern float Normalise (), PointX (), PointY ();
  43.