GR_PRIMI.DEF 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. DEFINITION MODULE GR_Primitives;
  2. (*
  3. ** Author : Peter Jardine
  4. **
  5. ** Version:
  6. ** 1.0 9 Mar 92 New file - based on the work of
  7. ** Michael McCarthy & John Pfitzner,
  8. ** CSP-960 Project, Semester 2, 1991
  9. **
  10. **
  11. ** A GPM Modula-2 graphics library module.
  12. **
  13. *)
  14. PROCEDURE ClearDisplay;
  15. (*
  16. ** Clear fill the screen with specified background colour. If clipping
  17. ** is on, clear fills only clipping rectangle.
  18. *)
  19. PROCEDURE Bezier(nCtrl : CARDINAL; VAR col, row : ARRAY OF INTEGER);
  20. PROCEDURE BezierNDC(nCtrl : CARDINAL; VAR x, y : ARRAY OF REAL);
  21. (*
  22. ** Draw a Bezier curve between the first and last points in the array
  23. ** of coordinates, using the intermediate points as the control points.
  24. ** nCtrl must be >= 1. VAR parameters are used for efficiency. These
  25. ** routines will not alter the contents of the arrays.
  26. *)
  27. PROCEDURE Circle(radius : CARDINAL; colCentre, rowCentre : INTEGER);
  28. PROCEDURE CircleNDC(radius, xCentre, yCentre : REAL);
  29. (*
  30. ** Draw a "circle" of given radius, and centre. This is faster than
  31. ** the routine below. Circles will appear elliptical unless drawn in a
  32. ** square aspect mode (MaxXAspect or MaxYAspect).
  33. *)
  34. PROCEDURE Ellipse(col1, row1, col2, row2 : INTEGER);
  35. PROCEDURE EllipseNDC(x1, y1, x2, y2 : REAL);
  36. (*
  37. ** Draw an ellipse bounded by the rectangle (col1, row1), (col2, row2).
  38. *)
  39. PROCEDURE FillArea(col, row : INTEGER);
  40. PROCEDURE FillNDCArea(x, y : REAL);
  41. (*
  42. ** Fill the area containing the seed coordinate.
  43. *)
  44. PROCEDURE Line(col1, row1, col2, row2 : INTEGER);
  45. PROCEDURE LineNDC(x1, y1, x2, y2 : REAL);
  46. (*
  47. ** Draw a line between (col1,row1) & (col2,row2)
  48. *)
  49. PROCEDURE PolyLine(nPoints : CARDINAL; VAR col, row : ARRAY OF INTEGER);
  50. PROCEDURE PolyNDCLine(nPoints : CARDINAL; VAR x, y : ARRAY OF REAL);
  51. (*
  52. ** Draw polyline whose coordinates are stored in the arrays col and
  53. ** row. This is equivalent to npoints calls to Line of the form
  54. ** Line(col[i],row[i], col[i+1],row[i+1]). VAR parameters are used for
  55. ** efficiency. These routines will not alter the contents of the arrays.
  56. *)
  57. PROCEDURE WritePixel(col, row : INTEGER);
  58. PROCEDURE WriteNDCPixel(x, y : REAL );
  59. (*
  60. ** Write a pixel at coordinates (col,row)
  61. *)
  62. PROCEDURE ReadPixel(col, row : INTEGER; VAR colour : CARDINAL);
  63. PROCEDURE ReadNDCRGBPixel(x, y : REAL; VAR red, green, blue : REAL);
  64. (*
  65. ** Returns the colour value of a specified pixel
  66. *)
  67. END GR_Primitives.