GR_BLOCK.DEF 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. DEFINITION MODULE GR_Block;
  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. ** jrh 16-Jun-92 File save/restore from Malcolm Corney.
  10. **
  11. **
  12. ** A GPM Modula-2 graphics library module.
  13. **
  14. *)
  15. FROM UxFiles IMPORT File;
  16. TYPE
  17. BitMap; (* Opaque type used in Block Save and Restore routines *)
  18. PROCEDURE FreeBlock(VAR b : BitMap);
  19. (*
  20. ** Deallocates the memory used to store an image via BlockSave.
  21. *)
  22. PROCEDURE BlockRestore(bitmap : BitMap ; col, row : INTEGER);
  23. PROCEDURE BlockNDCRestore(bitmap : BitMap ; x, y : REAL);
  24. (*
  25. ** Restores a previously saved region to the screen. Does not destroy
  26. ** or alter bitmap in any way, which means that we need some way of
  27. ** releasing memory when the image is no longer needed (FreeBlock).
  28. ** Note that of course the current video mode must be the same as that
  29. ** when the image was saved.
  30. *)
  31. PROCEDURE BlockSave(col1, row1, col2, row2 : INTEGER; VAR bits : BitMap);
  32. PROCEDURE BlockNDCSave(x1, y1, x2, y2 : REAL; VAR bits : BitMap);
  33. (*
  34. ** Save a rectangular region of the screen, returning a pointer to a
  35. ** structure that store the image data and some header details.
  36. *)
  37. PROCEDURE BlockSaveToFile(file : File; col1, row1, col2, row2 : INTEGER;
  38. VAR done : BOOLEAN);
  39. PROCEDURE BlockNDCSaveToFile(file : File; x1, y1, x2, y2 : REAL;
  40. VAR done : BOOLEAN);
  41. (*
  42. ** Save a rectangular region of the screen to the file.
  43. *)
  44. PROCEDURE BlockRestoreFromFile(file : File; col1, row1 : INTEGER;
  45. VAR ok : BOOLEAN);
  46. PROCEDURE BlockNDCRestoreFromFile(file : File; x1, y1 : REAL;
  47. VAR done : BOOLEAN);
  48. (*
  49. ** Restore a previously saved region from file to the screen.
  50. ** The current video mode must be the same as that when the image was
  51. ** saved.
  52. *)
  53. END GR_Block.