home *** CD-ROM | disk | FTP | other *** search
-
- A FORTRAN graphics subroutine library. 18 Nov 1991
-
- ************************************************************************
-
- C O P Y R I G H T N O T I C E
-
- Copyright D.J & K.M. Crennell,
- P.O. Box 64, Didcot, Oxon, OX11 0TH.
-
- This software is in the Public Domain and may not be sold or included in any
- program that will be sold, without written permission from the authors.
-
- The authors must be given credit in any publications using this software.
-
- The software may be copied and distributed as long as no changes are made
- and this copyright notice is included. Please send any suggested
- improvements to the authors.
-
- In no circumstances shall the authors be liable for any damage, loss of
- profits, or any indirect or consequential loss arising out of the use of
- this software or inability to use this software, even if they have been
- advised of the possibility of such loss.
-
- The authors do their best to ensure that this library is distributed virus
- free.
- ************************************************************************
-
- The source of this library is assembler, and is not included.
- The library is %.lib.graphics
-
- Notes:
- 1. The subroutine names try to follow the Basic graphics commands.
-
- 2. Parameters are type INTEGER unless otherwise stated.
-
- 3. Units are screen coordinates; no scaling is done.
-
- 4. All routines are SUBROUTINES unless explicitely stated.
-
- Bug fixes:
- 27 Dec 91: MVDUVAR, so as not to overwrite somebody else's memory.
-
-
- CIRCLE(IX,IY,IR,FILL)
- Plots circle with centre at IX,IY radius IR; filled if FILL (LOGICAL) is
- .TRUE.
-
- CLG
- clears a graphics window
-
- CLS
- clears a text window
-
- COLORT(K,IT)
- emulates BASIC - COLOUR K TINT IT - for setting text colours in 256
- colour modes (see GCOLT for more help).
-
- COLOUR(K)
- sets colour for text for 2, 4, & 16 colour modes.
-
- CURSOR(ISTAT)
- turns cursor ON if ISTAT is TRUE, OFF when ISTAT FALSE
-
- DRAW(IX,IY)
- draw line to point IX,IY
-
- FILL(IX,IY)
- fills an arbitrary area around IX,IY to a non-background colour boundary.
-
- FCOL16(IX,IY,NX,NY,IBUF,IDIM,COLOUR,MSHFT)
- sends colour bytes to a 16 colour graphics screen translated from the
- contents of an array IBUF.
- IX,IY is the location of the top left PIXEL on the screen,
- NX,NY are the number of columns and rows to plot,
- IBUF(*,IDIM) is an array containing values to be plotted
- COLOUR is a CHARACTER array of bytes (values<16) containing the colours
- to be plotted. If it is a single byte, then this is added to each element in
- IBUF and the result plotted modulo 16; if it is longer than a single byte,
- then the colour is selected from the Nth element where N is the value from
- IBUF. With either method, the value in IBUF is shifted right MSHFT places
- first. MSHFT must not be negative.
-
- FCOL256(IX,IY,NX,NY,IBUF,IDIM,COLOUR,MSHFT)
- sends colour bytes to a 256 colour graphics screen translated from the
- contents of an array IBUF.
- IX,IY is the location of the top left PIXEL on the screen,
- NX,NY are the number of columns and rows to plot,
- IBUF(*,IDIM) is an array containing values to be plotted
- COLOUR is a CHARACTER array of bytes containing the colours to be
- plotted. If it is a single byte, then this is added to each element in IBUF
- and the result plotted modulo 256; if it is longer than a single byte, then
- the colour is selected from the Nth element where N is the value from IBUF.
- With either method, the value in IBUF is shifted right MSHFT places first.
- MSHFT must not be negative.
-
- GCOL(M,K)
- similar to BASIC GCOL same arguments M=operation K=col no
-
- GCOLT(M,K,IT)
- for 256 colour modes emulates BASIC - GCOL M,K TINT IT
- K (0 to 63) defines the foreground colour, and IT the tint, (0, 64, 128, 192)
- adds four allowed amounts of white. To get background colour add 128 to K.
-
- GRFCOL(M,IRED,IGREEN,IBLUE,ITINT)
- does the same as GCOLT, but the colour is defined by the amounts of red,
- green, blue and tint which can only have values 0 to 3.
- Add 128 to IRED for a background colour.
-
- Remember that the 256 colours can not all be selected independently, but 64
- are possible. Modifying the palette with VDU19 does change the colours, but
- is obscure.
-
- GWIND(IXL,IYL,IXH,IYH)
- make graphics window from lower left (IXL,IYL) to top right (IXH,IYH)
- measured in graphics coordinates. N.B. if the coordinates are illegal,
- (e.g. 0,0,1024,1024 for ordinary modes) no window will be made.
-
- LINE(IX1,IY1,IX2,IY2)
- draws a line from IX1,IY1 TO IX2,IY2 in current colour
-
- MODE(M)
- simulates the BASIC MODE command. For the TAXAN 795 monitor you may need to
- change the monitor type for some modes.
-
- FUNCTION MODEVAR(MODE,NVAR)
- returns the ModeVariable number NVAR (see Programmer's reference manual I
- page 350). If MODE is -1, it uses the current mode. Use this to get useful
- things like the number of pixels in X,Y, the number of colours etc.
-
- FUNCTION MVDUVAR(NVAR)
- returns the VduVariable number NVAR (see Programmer's reference manual I
- page 345).Use this to get useful for getting the address of start of screen, size of characters etc.
-
- MOVE(IX,IY)
- moves the graphics cursor to the absolute position IX,IY
-
- ORIGIN(IX,IY)
- moves graphics origin to the point IX,IY
-
- PLOT(IPL,IX,IY)
- emulates BASIC PLOT operation IPL
-
- PLOT85(IX,IY)
- draws filled triangle from two previous points to IX,IY.
-
- POLY(N,IX,IY,FILL)
-
- If FILL (LOGICAL) is .FALSE., draws a polyline between the N points in the
- arrays IX(*),IY(*); the polygon is only closed if the end points are the
- same. If FILL is .TRUE. it fills the polygon defined by the N points.
-
- RECTAN(IX1,IY1,IX2,IY2,FILL)
- DRAWS a rectangle with lower left IX1,IY1, upper right IX2,IY2
- outline if FILL (LOGICAL) is .FALSE. otherwise solid fill.
-
- SPOT(IX,IY)
- plots a single point at IX,IY in current colour
-
- TAB(IX,IY)
- move cursor to IX,IY (text positions in column and row; Y is down)
-
- TWIND(IX1,IY1,IX2,IY2)
- sets up a text window from lower left to upper right. Note IX1 < IX2
- and IY1 > IY2 because these are text coordinates. N.B. if the coordinates
- are illegal, no window will be made.
-
- TXTCOL(IRED,IGREEN,IBLUE,IT)
- set text colour in 256 colour modes; arguments in the range 0 -> 3,
- but add 128 to IRED to get background colours. See GRFCOL for more help.
-
- VDU(I)
- send a single VDU command.
-
- VDU19(I1,I2,IRED,IGREEN,IBLUE)
- defines the logical colour (I1) in terms of the physical colour (I2) for 2,
- 4 and 16 colour modes.
- When I2 <16, the red, green, blue values are ignored and the standard BBC
- colours are used.
- When I2 = 16 the IRED, IGREEN and IBLUE are combined to form the colour and
- each can have values between 0 and 15.
- When I2 > 16 see a manual, e.g. BASIC USER GUIDE page 376.
-
- VDU23(I1,I2,I3,I4,I5,I6,I7,I8,I9)
- VDU 23 - define character shape etc. See BASIC USER GUIDE page 376 et seq.
-
- WOG(IX,IY,TEXT) prints TEXT at graphics location (IX,IY).
-
- WOGBIG(IX,IY,TEXT,ISIZE) prints TEXT at graphics location (IX,IY)
- magnified ISIZE times. ISIZE is forced to be between 1 and 20.
-
- WOT(IX,IY,TEXT) prints TEXT at TAB(IX,IY) (in text coordinates).
-