home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 2 / RISC_DISC_2.iso / pd_share / program / fortran77_210 / library / docs / graphics < prev    next >
Encoding:
Text File  |  1994-01-30  |  7.1 KB  |  193 lines

  1.  
  2.              A FORTRAN graphics subroutine library.   18 Nov 1991
  3.  
  4.   ************************************************************************
  5.  
  6.                     C O P Y R I G H T    N O T I C E
  7.  
  8.                      Copyright D.J & K.M. Crennell,          
  9.               P.O. Box 64, Didcot, Oxon, OX11 0TH.
  10.  
  11.  This software is in the Public Domain and may not be sold or included in any
  12.  program that will be sold, without written permission from the authors.
  13.  
  14.  The authors must be given credit in any publications using this software.
  15.  
  16.  The software may be copied and distributed as long as no changes are made
  17.  and this copyright notice is included. Please send any suggested
  18.  improvements to the authors. 
  19.  
  20.  In no circumstances shall the authors be liable for any damage, loss of
  21.  profits, or any indirect or consequential loss arising out of the use of
  22.  this software or inability to use this software, even if they have been
  23.  advised of the possibility of such loss.
  24.  
  25.  The authors do their best to ensure that this library is distributed virus
  26.  free.
  27.   ************************************************************************
  28.  
  29.      The source of this library is assembler, and is not included.
  30.      The library is %.lib.graphics
  31.  
  32. Notes:
  33.   1. The subroutine names try to follow the Basic graphics commands.
  34.  
  35.   2. Parameters are type INTEGER unless otherwise stated.
  36.  
  37.   3. Units are screen coordinates; no scaling is done.
  38.  
  39.   4. All routines are SUBROUTINES unless explicitely stated.
  40.  
  41. Bug fixes:
  42.    27 Dec 91: MVDUVAR, so as not to overwrite somebody else's memory.
  43.  
  44.  
  45.       CIRCLE(IX,IY,IR,FILL)
  46. Plots circle with centre at IX,IY radius IR; filled if FILL (LOGICAL) is
  47. .TRUE.
  48.  
  49.       CLG
  50. clears a graphics window
  51.  
  52.       CLS
  53. clears a text window
  54.  
  55.       COLORT(K,IT)
  56. emulates BASIC - COLOUR K TINT IT - for setting text colours in 256
  57. colour modes (see GCOLT for more help).
  58.  
  59.       COLOUR(K)
  60. sets colour for text for 2, 4, & 16 colour modes.   
  61.  
  62.       CURSOR(ISTAT)
  63. turns cursor ON if ISTAT is TRUE, OFF when ISTAT FALSE
  64.  
  65.       DRAW(IX,IY)
  66. draw line to point IX,IY
  67.  
  68.       FILL(IX,IY)
  69. fills an arbitrary area around IX,IY to a non-background colour boundary.
  70.  
  71.       FCOL16(IX,IY,NX,NY,IBUF,IDIM,COLOUR,MSHFT)
  72. sends colour bytes to a 16 colour graphics screen translated from the
  73. contents of an array IBUF.
  74.    IX,IY is the location of the top left PIXEL on the screen,
  75.    NX,NY are the number of columns and rows to plot,
  76.    IBUF(*,IDIM) is an array containing values to be plotted
  77.    COLOUR is a CHARACTER array of bytes (values<16) containing the colours
  78. to be plotted. If it is a single byte, then this is added to each element in
  79. IBUF and the result plotted modulo 16; if it is longer than a single byte,
  80. then the colour is selected from the Nth element where N is the value from
  81. IBUF. With either method, the value in IBUF is shifted right MSHFT places
  82. first. MSHFT must not be negative.
  83.  
  84.       FCOL256(IX,IY,NX,NY,IBUF,IDIM,COLOUR,MSHFT)
  85. sends colour bytes to a 256 colour graphics screen translated from the
  86. contents of an array IBUF.
  87.    IX,IY is the location of the top left PIXEL on the screen,
  88.    NX,NY are the number of columns and rows to plot,
  89.    IBUF(*,IDIM) is an array containing values to be plotted
  90.    COLOUR is a CHARACTER array of bytes containing the colours to be
  91. plotted. If it is a single byte, then this is added to each element in IBUF
  92. and the result plotted modulo 256; if it is longer than a single byte, then
  93. the colour is selected from the Nth element where N is the value from IBUF.
  94. With either method, the value in IBUF is shifted right MSHFT places first.
  95. MSHFT must not be negative.
  96.  
  97.       GCOL(M,K)
  98. similar to BASIC GCOL same arguments M=operation K=col no
  99.  
  100.       GCOLT(M,K,IT)
  101. for 256 colour modes emulates BASIC - GCOL M,K TINT IT
  102. K (0 to 63) defines the foreground colour, and IT the tint, (0, 64, 128, 192)
  103. adds four allowed amounts of white. To get background colour add 128 to K.
  104.  
  105.       GRFCOL(M,IRED,IGREEN,IBLUE,ITINT)
  106. does the same as GCOLT, but the colour is defined by the amounts of red,
  107. green, blue and tint which can only have values 0 to 3.
  108. Add 128 to IRED for a background colour.
  109.  
  110. Remember that the 256 colours can not all be selected independently, but 64
  111. are possible. Modifying the palette with VDU19 does change the colours, but
  112. is obscure.
  113.  
  114.       GWIND(IXL,IYL,IXH,IYH)
  115. make graphics window from lower left (IXL,IYL) to top right (IXH,IYH)
  116. measured in graphics coordinates. N.B. if the coordinates are illegal,
  117. (e.g. 0,0,1024,1024 for ordinary modes) no window will be made.
  118.  
  119.       LINE(IX1,IY1,IX2,IY2)
  120. draws a line from IX1,IY1 TO IX2,IY2 in current colour
  121.  
  122.       MODE(M)
  123. simulates the BASIC MODE command. For the TAXAN 795 monitor you may need to 
  124. change the monitor type for some modes.
  125.  
  126.       FUNCTION MODEVAR(MODE,NVAR)
  127. returns the ModeVariable number NVAR (see Programmer's reference manual I
  128. page 350). If MODE is -1, it uses the current mode. Use this to get useful
  129. things like the number of pixels in X,Y, the number of colours etc.
  130.  
  131.       FUNCTION MVDUVAR(NVAR) 
  132. returns the VduVariable number NVAR (see Programmer's reference manual I
  133. page 345).Use this to get useful for getting the address of start of screen, size of characters etc.
  134.  
  135.       MOVE(IX,IY)
  136. moves the graphics cursor to the absolute position IX,IY
  137.  
  138.       ORIGIN(IX,IY)
  139. moves graphics origin to the point IX,IY
  140.  
  141.       PLOT(IPL,IX,IY)
  142. emulates BASIC PLOT operation IPL
  143.  
  144.       PLOT85(IX,IY)
  145. draws filled triangle from two previous points to IX,IY.
  146.  
  147.       POLY(N,IX,IY,FILL)
  148.  
  149. If FILL (LOGICAL) is .FALSE., draws a polyline between the N points in the
  150. arrays IX(*),IY(*); the polygon is only closed if the end points are the
  151. same. If FILL is .TRUE. it fills the polygon defined by the N points. 
  152.  
  153.       RECTAN(IX1,IY1,IX2,IY2,FILL)
  154. DRAWS a rectangle with lower left IX1,IY1, upper right IX2,IY2
  155. outline if FILL (LOGICAL) is .FALSE. otherwise solid fill.
  156.  
  157.       SPOT(IX,IY)
  158. plots a single point at IX,IY in current colour
  159.  
  160.       TAB(IX,IY)
  161. move cursor to IX,IY (text positions in column and row; Y is down)
  162.  
  163.       TWIND(IX1,IY1,IX2,IY2)
  164. sets up a text window from lower left to upper right. Note IX1 < IX2 
  165. and IY1 > IY2 because these are text coordinates. N.B. if the coordinates
  166. are illegal, no window will be made.
  167.  
  168.       TXTCOL(IRED,IGREEN,IBLUE,IT)
  169. set text colour in 256 colour modes; arguments in the range 0 -> 3,
  170. but add 128 to IRED to get background colours. See GRFCOL for more help.
  171.  
  172.       VDU(I)
  173. send a single VDU command. 
  174.  
  175.       VDU19(I1,I2,IRED,IGREEN,IBLUE)
  176. defines the logical colour (I1) in terms of the physical colour (I2) for 2,
  177. 4 and 16 colour modes.
  178. When I2 <16, the red, green, blue values are ignored and the standard BBC
  179. colours are used.
  180. When I2 = 16 the IRED, IGREEN and IBLUE are combined to form the colour and
  181. each can have values between 0 and 15.
  182. When I2 > 16 see a manual, e.g. BASIC USER GUIDE page 376. 
  183.  
  184.       VDU23(I1,I2,I3,I4,I5,I6,I7,I8,I9)
  185. VDU 23 - define character shape etc. See BASIC USER GUIDE page 376 et seq.
  186.  
  187.       WOG(IX,IY,TEXT) prints TEXT at graphics location (IX,IY).
  188.  
  189.       WOGBIG(IX,IY,TEXT,ISIZE) prints TEXT at graphics location (IX,IY)
  190. magnified ISIZE times. ISIZE is forced to be between 1 and 20.
  191.  
  192.       WOT(IX,IY,TEXT) prints TEXT at TAB(IX,IY) (in text coordinates).
  193.