home *** CD-ROM | disk | FTP | other *** search
/ Graphics Programming Black Book (Special Edition) / BlackBook.bin / disk1 / source / chapter39 / polygon.h < prev   
C/C++ Source or Header  |  1997-06-18  |  1KB  |  34 lines

  1. /* POLYGON.H: Header file for polygon-filling code */
  2.  
  3. /* Describes a single point (used for a single vertex) */
  4. struct Point {
  5.    int X;   /* X coordinate */
  6.    int Y;   /* Y coordinate */
  7. };
  8.  
  9. /* Describes a series of points (used to store a list of vertices that
  10.    describe a polygon; each vertex is assumed to connect to the two
  11.    adjacent vertices, and the last vertex is assumed to connect to the
  12.    first) */
  13. struct PointListHeader {
  14.    int Length;                /* # of points */
  15.    struct Point * PointPtr;   /* pointer to list of points */
  16. };
  17.  
  18. /* Describes the beginning and ending X coordinates of a single
  19.    horizontal line */
  20. struct HLine {
  21.    int XStart; /* X coordinate of leftmost pixel in line */
  22.    int XEnd;   /* X coordinate of rightmost pixel in line */
  23. };
  24.  
  25. /* Describes a Length-long series of horizontal lines, all assumed to
  26.    be on contiguous scan lines starting at YStart and proceeding
  27.    downward (used to describe a scan-converted polygon to the
  28.    low-level hardware-dependent drawing code) */
  29. struct HLineList {
  30.    int Length;                /* # of horizontal lines */
  31.    int YStart;                /* Y coordinate of topmost line */
  32.    struct HLine * HLinePtr;   /* pointer to list of horz lines */
  33. };
  34.