Contact us Heritage collections Image license terms
HOME ACL Associates Technology Literature Applications Society Software revisited
Further reading □ OverviewNo.1No.2No.3No.4No.5No.8No.9No.11No.12No.13No.14No.15No.17No.19No.21No.22No.23No.24No.25No.26No.27No.28No.29No.30No.31No.32No.33No.37No.38No.39No.40No.41No.43No.44No.45No.46No.47No.48No.49No.50No.51No.52
ACD C&A INF CCD CISD Archives Contact us Heritage archives Image license terms

Search

   
ACLLiteratureProgress ReportsSPROGS Papers
ACLLiteratureProgress ReportsSPROGS Papers
ACL ACD C&A INF CCD CISD Archives
Further reading

Overview
No.1
No.2
No.3
No.4
No.5
No.8
No.9
No.11
No.12
No.13
No.14
No.15
No.17
No.19
No.21
No.22
No.23
No.24
No.25
No.26
No.27
No.28
No.29
No.30
No.31
No.32
No.33
No.37
No.38
No.39
No.40
No.41
No.43
No.44
No.45
No.46
No.47
No.48
No.49
No.50
No.51
No.52

SPROGS Paper No 52: New Routines

A H Francis

June 30 1977

This paper describes some new routines which have been added to the SPROGS system over the past eighteen months. These routines are mainly of use to people requiring animation and/or high quality solid pictures, ie not simply outline drawings. These extra facilities have, of course, made the package some what larger, but routines have also been provided to 'dummy out' these features if they are not being used. References are either to the SPROGS Manual (eg 4.1) to the SPROGS Supplement (eg S4) or to FR8O User Note 6 which explains how to access the FR8O from SPROGS (eg F4.3).

Whenever picture filenames are referred to as FNAM, FNAM is assumed to be a FORTRAN REAL variable which has been set to ANAME('FNAM') (4.1) earlier in the program. The same assumption is made, where possible, when referring to index variables, ie the FORTRAN REAL variable V1 is assumed to have been set to ANAME ('V1'). This slight inconvenience, having to ANAME names, is caused by the poor character handling facilities available in standard FORTRAN on the 1906A. The ANAME statements and the CALLs to subroutines are omitted from all of the examples except the final one which is a complete program. Similarly, unless stated otherwise, all examples assume that an output device has been selected and that drawing is occurring in region 1 which has limits (0,0) to (1023,1023).

1. SCANNED IN PICTURES

There is often a need to produce high quality slides or film with coloured shaded in areas. The routines described in this section are an extension of those described in Graphics User Note 5 which showed how fairly simple images could be shaded in. This set of routines allows several complex images to be scanned in simultaneously with the hidden lines removed. An outline can be left around each picture where it hides another one and several pictures can be elided together. Each picture to be scanned in must consist only of line drawing and positioning commands which should describe a closed curve or a set of several closed curves and should be stored in a SPROGS picture file (4). If any of the curves are not closed a warning message will be output, and an attempt will be made to artificially close the curve. However this usually results in incorrect output being generated. For these routines, a call to VEC(X1,Y1,X2,Y2) will be treated as a call to TOXY(X2,Y2), the first point is ignored. For this reason VEC should not be the first command in a picture file to be scanned. When several pictures are to be scanned in together the picture files names and some attributes of the pictures are held in a scanning list.

1.1 The display routine

      SCOLEV (POS, FNAM, COL, XINT, XLEV, ELEV) 

(set colour and level) sets into the POSth position of the scanning list the name of the picture file FNAM/current file number and its associated attributes. The first position is number 1.0 and there are currently a maximum of 20 positions available in the scanning list. When scanned in the picture will be drawn with colour COL at intensity XINT and hits as last selected for the colour COL by the routine (J) COLOR (see SMOG 6.1). (A new method of selecting colours is being developed.) It will be scanned at level XLEV and may be elided with other pictures at or up to and including level ELEV.

The levels are used to define which pictures may hide each other, like cel levels in conventional hand animation. Level 1 is the highest level and so hides pictures at all other levels, pictures at level 2 are hidden by pictures at level 1 but hide pictures at all lower levels, etc. There may be more than one picture at each level and if these overlap the one nearer the top of the scanning list, ie the numerically lower POS, will hide the other. There may also be levels which have no pictures associated with them.

Where hiding occurs a black (white on hardcopy) outline may be 'drawn' (ie left undrawn) around each hiding picture. Sometimes, however, some parts of an image will require an outline whilst others will need to be elided or joined together. For example, a particular object may have been split into several parts which may be on different levels and may overlap each other. In this case the parts of the object could be elided together, to make the object seem whole, while leaving an outline around it to separate it from the background.

For the purposes of specifying eliding levels eliding is defined to operate from 'below', ie the 'hidden' picture is elided with the 'hiding' picture. Thus ELEV must always be above LEV ie numerically less than or equal to LEV. If ELEV is positive then this picture will be elided with any pictures scanned from the level LEV up to and including the level ELEV which are the same colour as this picture. If ELEV is negative then this picture will be elided with any pictures scanned at the level -ELEV which are the same colour as this picture. If ELEV is zero then this picture is not elided with any others, although pictures below may be elided with it.

1.2 The display routine

      SCANUD(XN) 

(scan with hiding) scans in the pictures in the first XN positions in the scanning list. This routine uses the information about colour, intensity, level and elide level for each of the XN pictures in the scanning list. This routine may be used repeatedly without having to reset pictures into the scanning list. The scanning in is effected by drawing closely spaced vertical lines inside the closed curves.

A single picture may be scanned in by the display routine

      DRSCPC(FNAM) 

(draw scanned picture). This simply scans in the picture file FNAM/ current file number at the currently selected colour and intensity. Since only one picture is specified there is no hiding or eliding. If there are no overlapping areas it is more efficient to use several calls to DRSCPC than to use several calls to SCOLEV and one call to SCANHD.

1.3 Scanning a picture is, in fact, a two stage process in SPROGS. Firstly the outline is examined and a set of flags is created which contains information about each point at which the outline changes direction with respect to the x axis, ie points of the form < and >. The picture is then scanned using the outline definition and the flags just created.

If a picture is to be repeatedly scanned, say on a sequence of frames of a film, for all but the first frame the first stage, the creation of the flags, is omitted, the set already available being used. This is obviously more efficient and works well unless the picture has been altered in any way, ie it has been redefined or an index variable (7) referenced from it has had its value changed. In this case the old set of flags for the picture need to be erased and a new set for the new version of the picture need to be created. The display routine

      CRFLPC (FNAM) 

(create flags for picture) creates the flags for picture file FNAM/current file number, erasing any existing flags for a picture of that name.

1.4 The routine

      CSZOL (XISIZE, XINC, XIOUTL) 

(set scanning size and outline) sets the range of the scanning, the scanning increment and the width of the outline required when using hiding. All of the arguments should be integer-valued reals. The scan size is normally the same as the range of the x-coordinate limits of the region (the lower limit of the region usually being 0) in which the picture(s) are to be drawn. The x coordinates of the scan lines will be integer values in the range 1 < x < XISIZE. Thus any part of any of the picture whose x coordinate is outside this range will not be scanned. The scanning increment XINC, controls the number of scan lines to be drawn. Only every XINCth scan line of the XISIZE potential scan lines will be drawn, starting with the first. The total number of scan lines across the scanning area, XISIZE/XINC, is the line density. The following table suggests suitable line densities for each output device to obtain solid shading over the full screen area.

Output Device                       Line Density 
FR80 35mm                              1000
FR80 16mm                               500
FR80 Hardcopy (single)                 1000
FR80 Hardcopy (2x2)                     500
FR80 Microfiche                         500
Tektronix                               250
Hewlett Packard                        1000 (not recommended)
Lineprinter graphical                   120

The width of the outline XIOUTL, is only significant when the routine SCANHD is being used. When one picture hides another a black (white on hardcopy) outline of width about twice XIOUTL is left, ie not drawn, around the edge of the hiding picture. This can help to distinguish different parts of a picture, and can be used to simulate the black line drawn around objects in conventional animation. XIOUTL is specified in terms of they coordinates of the region in which scanning is to take place and for best effect the range of these y coordinates should be about the same as the scanning range. If XIOUTL is zero no outline is left. For normal use a value of about twice that of the scanning increment XINC, for the outline width, XIOUTL, will give satisfactory results.

The routine SCSZIN (XINC XISIZE) is similar to SCSZOL but the outline width is not altered. The default outline width is zero.

The routine SCSZRG(XINC,XIST,XISIZE,XIOUTL) is also similar to SCSZOL but has an extra argument XIST which sets the lower x-limit for the scan lines. Thus the x coordinates of the scan lines will be integer values in the range XIST≤x≤XISIZE. Again only every XINCth of the potential XISIZE-XIST+1 potential scan lines will be drawn.

1.5 Before producing the final scanned in version of a film sequence it is common practise to produce a line test to check that the animation and timing are correct. This is a sequence in which all of the animation is performed but instead of scanning in the pictures their outlines are drawn.

The display routine

      DRLINT(XN) 

(draw line test) draws the pictures in the first XN positions in the scanning list. This routine uses the information about colour and intensity for each of the XN pictures in the scanning list. It does not do any hidden line removal and so does not use the information about levels and elide levels. Also since the pictures are not scanned in no use is made of the scan size, scan increment, etc.

Thus, if a film sequence uses SCANHD to generate scanned pictures, the same sequence with SCANHD replaced by DRLINT will produce a 'line test' version. If DRSCPC is being used to generate a scanned picture, replacing DRSCPC by the normal DRAW command will produce a 'line test' version. A 'line test' takes considerably less time to compute and plot than a scanned version so this method of working is recommended.

1.6 Example 1

      STDF(ELL)                           [Define picture file of ellipse 
      ELLPSB(200.0,200.0,200.0,100.0,24.0,0.0) 
      FIDF(1.0) 
      SCSZOL(1024.0,2.0,5.0)              [Set scan size, increment and outline
      DRSCPC (ELL)                        [Draw scanned in picture 
      ADVFLM 
      STDF (BACK)                         [Define picture file for rectangular background 
      BOXA(0.0, 0.0, 1023.0, 1023.0) 
      FIDF (1.0) 
      SCOLEV(1.0,ELL,2.0,255.0,1.0,0.0)   [Put ellipse on top level, colour yellow 
      SCOLEV(2.0,BACK,5.0, 128.0,3.0,0.0) [Put background on 3rd level, colour blue 
      SCANHD(2.0)                         [Scan first 2 pictures 
      ADVFLM 
      STDF(ELL)                           [Redefine ellipse 
      ELLPSB(200.0, 200.0, 100.0, 200.0, 24.0,0.0) 
      FIDF(1.0) 
      STDF(BAR)                           [Define picture file of horiz bar 
      BOXA (50.0, 150.0,800.0,250.0) 
      FIDF(1.0)                           [elide with ellipse
      SCOLEV(3.0,BAR,2.0, 255.0,2.0,1.0)  [Put bar on 2nd level, colour yellow
      CRFLPC(ELL)                         [Create new flags for ellipse 
      SCANHD (3.0)                        [Scan first three pictures
Example 1.1 
       SCOLEV(1.0,BODY,YELLOW,255.0,1.0,0.0) 
       SCOLEV(2.0,ALEG,YELLOW,255.0,3.0,1.0) 
       SCOLEV3.0,TROUSER,GREEN,255.0,2.0,0.0) 
       SCOLEV(4.0,ARM,BLUE,255.0,3.0,1.0) 
       SCOLEV (5.0,HAND,BLUE,255.0,4.0,-3.0) 
       SCANHD (5.0) 

In this example ALEG would be elided with BODY and HAND would be elided with ARM, but ARM would not be elided with BODY, TROUSER or ALEG because they are not BLUE.

2. ANIMATION ROUTINES

Some high level animation routines eg PAN, TILT, ZOOM are already available in SPROGS (S4). Some more are now available, some of which use new display routines which are also described here. Animation routines are defined to be those routines which call display routines which can be stored in film files (4.4) and which affect more than one frame ie are a sequence or are part of a sequence. All of these routines therefore have a parameter TF, which is the total number of frames for which the specified action occurs and some have a parameter, FRAC, which specifies the type of 'movement' required eg linear, faired, etc (see FRACOP).

Any of the arguments to these routines can be parameterised ie can refer to index variables (7). A set of index variables with names L:x, where x can be any character but is usually the sequence number, are used by these routines and so should be avoided by the user. This allows any number of sequences containing the same animation command, eg HOLD, to be executed in parallel. The animation routines in S4, eg ZOOM, did not allow multiple-copy parallel execution. These animation commands use the WHILE display routine (9.6) and so should never be executed directly; they should always be stored in a film file which is then executed by adding it to the sequence list or DRAWing it (9).

2.1 HOLD (FNAM,FNO,TF)

This animation routine holds ie draws the picture file FNAM/FNO on each of TF frames. (This does not necessarily produce the same picture on each frame, since the picture may be being changed or zoomed, etc in parallel with the hold.)

2.2 FADE (FNMAM,FNO,PI,P2,FRAC,TF)

This animation routine draws the picture file FNAM/FNO at a different intensity on each of TF frames ie it fades from one intensity to another. On the first frame it will be drawn at intensity P1 and on the TFth frame it will be drawn at intensity P2. The intensities on the intermediate frames are controlled by FRAC.

This routine uses a new display routine

      FADINT (PI,P2,FRAC,TF,CF) 

which sets the appropriate intensity, between P1 and P2, for the CFth frame from a total sequence of TF frames.

2.3 PATH2(FNAM,FNO,V1,FRAC,TF)

PATH2(FNAM,FNO,V1,V2,FRAC,TF)

These animation routines are used to follow a one/two dimensional path which is contained in picture file FNAM/FNO. A ID path can be any picture file consisting of ID line drawing routines, eg, SETX, TOX or NULLs. A 2D path can be any picture file containing 2D line drawing routines eg, SETXY, TOXY or pairs of NULLs, but not VEC. Whether line drawing commands or NULLs are used it is the value which is significant, thus a SETXY is equivalent to a TOXY, and UPDX is equivalent to an UPDY, a TODX or a TODY, etc. For each of the TF frames of the sequence a new value from the path is loaded into the index variable(s) V1 (and V2). These index variables-can then be used to control some effect in a parallel sequence. For example, this effect could be the movement of a picture on the screen or it could be a change in the expansion factor, etc. If a call to draw a relative picture file in one sequence is preceded by CALL SETXY (FRI(XP),PR2(YP)) or the picture file contains this as its first command, where XP and YP refer to index variables called XP and YP, and a call of

      PATH2 (ALOCUS,1.0,XP,YP,FRAC,TOTFR) 

is contained in another sequence which is executed in parallel, then the picture will move about the screen following the path described in the picture file ALOCUS/1.0. The form of the movement will be controlled by the spacing of the points in the path file and the value of FRAC.

These routines use the new display routines

      PATH1D(FNAM,V1,FRAC,TF,CF) 
      PATH2D(FNAM,Vl,V2,FRAC,TF,CF) 

which set the value(s) into the index variable(s) V1 (and V2) appropriate to the CFth out of TF frames along the path on the picture file FNAM/current file number. It should be noted that the PR function is not used when referring to the index variables V1 and V2 in this case.

2.4 PICST(FNAM,FNO,P1,P2,FRAC,TF)

PICFN(FNAM,FNO,P2,P2,FRAC,TF)

These animation routines change, the start and finish visible points, respectively, of the picture file FNA/FNO from point P1 to point P2 over a period of TF frames. The actual picture file is not changed by these routines but the first or last, respectively, set of points are not visible when the picture file is DRAWn. These routines can be used to make a picture appear to progressively 'draw up' itself or erase itself, from the beginning or the end ie, more or less of the picture is seen on each frame. For example a call of PICFN(FRED,1.0,1.0,10.0,2.0,20.0) will change the last visible point, ie the end of the picture from 1 to 10 over a period of 20 frames. If FRED has 10 lines defining it and the picture is DRAWn, by HOLD for example, in a parallel sequence, then the picture will 'draw up' from nothing to the complete picture in 20 frames. The notional points P1 and P2 really refer to the P1tb and P2th commands in the picture file. The picture file should, therefore, consist only of line drawing commands. If it does not the PICST or PTCFN command will be ignored.

These routines uses, respectively, the new display routines

      PICLST(FNAM,P1,P2,FRAC,TF,CF) 
      PICLFN(FNAM,P1,P2,FRAC,TF,CF) 

which set the start/finish visible point between P1 and P2 of the picture file FNAM/current file number for the CFth frame of a sequence of TF frames.

2.5 BTWEEN(FNAM1,FN01,FNAM2,FN02,FRAC,TT)

This animation routine inbetweens from picture file FNAM1/FN01 to FNAM2/FN02 in TF frames. Both picture files should contain only line drawing routines eg TODXY, SETXY,TOX etc. Each set of contiguous line segments from the first file is inbetweened to its equivalent set in the second file. If there are more lines in a set in the second file than in the first, new lines appear at the end of the set. If there are less lines in the set in the second picture than in the first, the excess lines of the set disappear. If there are more sets of contiguous line segments in one picture than the other, the extra set(s) will appear from nowhere or disappear to nowhere as appropriate. Often, of course, inbetweens will be from one version of a picture to another version of the same picture, so these circumstances will not arise.

This routine uses a new display routine

      DRFRTO(FNAM1,FNAM2,FN02,FRAC,TF,CF) 

which draws the CFth frame of the inbetween sequence from picture file FNAM1/current file number to picture file FNAM2/FN02 which lasts TF frames. When CF, the current frame is zero the first picture is drawn and when CF equals TF the second picture is drawn.

2.6 REPSEQ(TF)

This animation routine repeats the existing sequence for TF frames. It is effectively an idle or timing loop since nothing is drawn from the film file which contains it but the sequence list is allowed to execute for TF frames. Typically it is used to keep a number of sequences in step where one or more of the sequences has nothing happening for a number of frames or to start one sequence sometime after another.

2.7 A11 of the above animation routines, from HOLD to REPSEQ, have consisted of a film loop. This is basically a WHILE command followed by a BEGINS/ENDS block containing calls to one or more display routines, an advance film order and an increment counter order. For example the subroutine HOLD (FNAM,FNO,TF) 100ks somewhat like the following:

      LOAD (ANAME('L:1'),0.0)           [ load counter
      WHILE (PR1(ANAME'L:1')),'LT',TF)  [ see if loop finished
      BEGINS                            [ begin block for loop
      NUMBR (FNO)                       [ set file number 
      DRAW (FNAM)                       [ draw picture file
      ADVFLM                            [ advance film
      ADD (ANAME('L:1'),1.0)            [ increment counter
      ENDS                              [ end block 

During execution this loop will be executed TF times ie for TF frames, with the counter taking the values 0 to TF-1.

To aid the user in creating his own film loops the two routines start film loop and finish film loop have been defined-

      STFLOP (TF) 
      FIFLOP 

STFLOP(TF) is equivalent to the first 3 lines of the code shown for HOLD and FIFLOP is equivalent to the last 3 lines of the code shown for HOLD. For example the following:

      STFLOP (10.0) 
      VEC(1.0,2.0,3.0,4.0) 
      FIFLOP 

would draw line (1.0,2.0) to (3.0,4.0) on each of 10 successive frames. If the value of the loop counter is needed as the nth argument to one of the display routines in the film loop it can be referenced by using

      PRn (ANAME ('L:1')) 

as the argument. For example the animation routine PICST(FNAM,FNO,P1,P2,FRAC,TF) is equivalent to the following:

      STFLOP(TF) 
      NUMBR (FNO) 
      PICLST(FNAN,P1,P2,FRAC,IF,PR6(ANAME('L: 1'))) 
      FIF1OP 

2.8 Example 2

      Draws up circle 10, hold 5 
      Starts to move circle round square path, hold circle 10 
      Betweens to ellipse 20, still moving along path 
      Ellipse fades out 10, still moving along path 
      STDF (BOX) 
      BOXA(200.0,200.0,800.0,800.0)     [Define box for path 
      FIDF(1.0)
      STDF (CIRC)                       [Define circle, centre (XVAR, YVAR) 
      SETXY(PR1(XVAR),PR2(YVAR)) 
      CIRCLS(100.,30.,0.) 
      FIDF (1.0) 
      STDF(ELL)                         [Define ellipse, centre(XVAR,YVAR) 
      SETXY(PR1(XVAR),PR2(YVAR)) 
      ELLPSS(100.,200.,30.,0.) 
      FIDF(1.0) 
      LOAD(XVAR,200.)                   [Set start position for circle 
      LOAD(YVAR,200.) 
      STDF (SEQA)                       [Define first sequence 
      PICFN(CIRC,1.0,1.0,30.0,2.0,10.0) [Linearly draw up circle in 10 frames 
      REPSEQ(5.)                        [Idle loop for 5 frames 
      PATH2(BOX,1.0,XVAR,YVAR,4.0,40.)  [Move centre along 2D path 
      FIDF(1.0)                         [faired for 40 frames 
      STDF(SEQB)                        [Define second sequence 
      HOLD(CIRC,10.,25.0)               [Hold circle for 25 frames 
      BTWEEN(CIRC,1.0,ELL,1.0,3.0,20.)  [Between from circle to ell 20 frames 
      FADE(ELL,1.0,255.,0.,9.0,10.0)    [Fade out ellipse in 10 frames 
      FIDF(1.0) 
      ADSQLG(SFQA,1.0,0.0)              [Add sequences to list 
      ADSQLG(SEQB,1.0,0.0) 
      STSQLS                            [Start sequence list. 

3. FAIRING OF MOVEMENTS

Many of the animation and display routines described here have an argument FRAC which controls the movement or change from frame to frame in some way. The options, shown graphically below, include linear, faired, faired first or last part and various degrees of fairing. Fairing means that the movement 'accelerates' initially, then moves at a constant 'speed' and then 'decelerates' to rest. This avoids the apparent jerk at the beginning and end of the movement which is often apparent and annoying when the movement is linear.

3.1 The fairing is calculated by the subroutine

      FRACOP(FRAC,TF,CF) 

The arguments are FRAC, the option number, TF the total number of frames for the sequence and CF the current frame number. The value, between 0.0 and 1.0 for the current frame is returned in FRAC. If FRAC is already in the range 0.0 to 1.0 it is not changed, ie FRACOP does nothing. To produce TF frames the current frame number usually ranges from 0 to TF-1, so the movement, or change goes from the first position to almost the final position, the final position being achieved on frame TF. The actual movement thus lasts TF frames.

However it is sometimes required that the movement should start at the first position, on frame 0 and achieve the final position on the last frame, frame TF-1. In this case the movement takes only TF-1 frames, but this sequence still takes TF frames. This can be achieved by adding 20 to the option number, FRAC. This is indicated by the number in brackets in the table of options.

Options numbered 5 to 8 are included so that a movement can be accelerated up to 'speed' ie faired first part, moved linearly at a fixed 'speed' for any length of time and then decelerated back to rest, ie faired last part.

Each of the graphs shows the movement paths generated by that option and by the linear option.

Option Number  Description of movement type
 0             Always draws first position
 1             Always draws final position
 2 (22)        Linear
 3 (23)        Faired or sine
 4 (24)        Sine of sine (more faired)
 5 (25)        Faired or sine for first part
 6 (26)        Sine of sine for first part
 7 (27)        Faired of sine for last point
 8 (28)        Sine of sine for last part
 9 (29)        Logarithmic
10 (30)        Log of log
11 (31)        Exponential
12 (32)        Exponential of exponential
FRACOP OPTIONS 3 SINE OR FAIR 4 SINE OF SINE 5 SINE 1ST HALF 6 SINE OR SINE 1ST HALF 7 SINE 2ND HALF 8 SINE OF SINE 2ND HALF 9 LOG 10 LOG OF LOG 11 EXP 12 EXP OF EXP ALL OF THE FIRST ORDER CURVES ALL OF THE CURVES

4. LINKING ANIMATION AND SCANNING

4.1 In order to be able to transform basic pictures in some way before scanning them a pseudo output device has been defined. This is device number 32 and is called pseudo because it is only used to send line drawing commands back into the SPROGS filestore. This is done by saving basic device orders, using STSAV(FNAM,DEV) and FISAV, in a named picture file. For this new device, pseudo, basic device orders are, in fact, normal line drawing orders, so a basic file for the pseudo device is an ordinary picture file and can thus be scanned. The pseudo device never outputs any commands to a real output device and only saves line drawing commands when using basic file saving. All other commands, except those to draw picture files, are ignored. Using this pseudo device a picture file can be passed through the region chain, where rotation, scaling, translation, etc can be applied. It also enables the result of an inbetween operation to be saved ready for scanning. Each output device, real or pseudo, which is to be used, has to be associated with a region. If the files are being saved prior to being scanned it is recommended that the output region for the pseudo device should be the same as that in which the scanning is to be performed. Since this pseudo device is normally only going to be used when scanned pictures are being produced two routines have been defined to take much of the complication out of using it.

4.2 These routines

      STSVSC (FNAM, REG) (start saving for scanning) and 
      FISVSC (finish saving for scanning) 

open and close, respectively, the picture file FNAM/current file number for saving line drawing commands.

STSVSC also selects the region REG as the output region for the pseudo device, selects the pseudo device for output and temporarily disconnects any other currently selected output devices. FISVSC also disconnects the pseudo device and reselects the devices in use prior to the call of STSVSC. However the region REG is left not connected to any output devices. If this region is to be used again as a basic output region it should be reconnected to a device by a call to BASER, BASE or RGPRM (2.3, 2.8). It is also recommended that scissoring is turned off in all the regions through which the line drawing commands will be passed before reaching the pseudo device. This is to prevent parts of a closed. curve being scissored, which would leave an open curve which would be unsuitable for scanning. Scissoring is controlled by VISO, VISOR, DSALL or RGPRM 2.5, 2.8).

4.3 Example 3

Shade in the inbetween from an ellipse to a circle in blue in front of a red background, whilst zooming in by a factor of 2 in 10 frames. Zoom is in region 2, which maps to region 1. Region 1 is for scanning and maps to region 0 which is basic output region for, say, FR80 colour 16mm camera. The picture file BETRES is used to store the result of the inbetween which is then scanned.

      FRCL16                                [Select output device and region 1 
      GETHI                                 [Get high level routines from library 
      CINE                                  [Select visible area 
      LIMITS(0.0,0.0,1023.0,1023.0,1.0,1.0) [Make region 1 square 
      VISO(1.0,1.0)                         [Turn off scissoring 
      REGION(2.0)                           [Select region 2 
      PLIMIT(1.0,0.0,0.0,1023.0,1023.0)     [Set P limits for region 2 
      LIMITV(0.0,0.0,1023.0,1023.0)         [Set limits for region 2 
      VISO(1.0,1.0)                         [Turn off scissoring 
      STDF(ELL)                             [Define ellipse, centre at middle of screen 
      ELLPSB(512.0,512.0,200.0,100.0,30.0,0.0) 
      FIDF(1.0) 
      STDF(CIRC)                            [Define circle, centre at middle of screen 
      CIRCLB(512.0,512.0,200.0,30.0,0.0) 
      FIDF (1.0) 
      STDF (BOX)                            [Define background 
      BOXA(0.0,0.0,1023.0,1023.0) 
      FIDF(1.0) 
      SCSZOL(1024.0,4.0,6.0)                [Set scanning size, inc, outline 
      SCOLEV(1.0,BOX,6.0,255.0,2.0,0.0)     [Put background in 
      SCOLEV(2.0,BETRES,5.0,255.0,1.0,0.0)  [Put result of inbetween in scanning list as foreground
      STDF(ZOOMA)                           [Define zoom sequence 
      ZOOM(2.0,512.0,512.0,2.0,10.0,1.0) 
      FIDF(1.0) 
      STDF(BETA)                            [Define inbetween sequence 
      REGION(2.0)                           [Select region 2 
      STFLOP(10.0)                          [Start film loop 
      STSVSC BETRES,1.0)                    [Start saving in file BETRES in region 1
      DRFRTO(ELL,CIRC,1.0,2.0,10.0,PR6(ANAME'L:1')))    [Inbetween 
      FISVSC                                [Finish saving 
      CRFLPC(BETRES)                        [Create new flags for picture 
      FIFLOP                                [Finish film loop 
      FIDF(1.0) 
      STDF(SCANA)                           [Define scanning sequence
      REGION(1.0)                           [Select region 1
      STFLOP(10.0)                          [Start film loop 
      SCANHD (2.0)                          [Scan first two pictures in list
      FIFLOP                                [Finish film loop
      FIDF(1.0) 
      ADSQLG(ZOOMA,1.0,0.0)                 [Add 3 sequences to sequence list and start it 
      ADSQLG(BETA,1.0,0.0) 
      DRAW(SCANA) 

5. MISCELLANEOUS

5.1 Two routines have been provided to count the number of lines drawn per frame for monitoring purposes. The routine

      STLINC 

starts or reinitialises the line counter and the routine

      LINCNT(LPF,LF) 

returns, as integers, LPF, the average number of lines per frame and LF the number of frames. Blank frames, ie those with no lines drawn on them are not included in the frame count.

5.2 If it is not intended to use the new pseudo device, 32, the device handler can be dummied out by the routine

      NOFST

If it is not intended to use the scanning facilities these can, and should since they occupy a lot of space, be dummied out by the routine

      NOSCAN 

5.3 The routines STSAV, FISAV and DVOUT, previously ordinary subroutines, have now become display routines ie calls to them can be stored in picture files and executed later or executed when encountered.

5.4 New Display Routines

No      Name       Operation 
 91 DRFTO(FNAM1,FNAM2,FN02,FRAC,TF,CF)
                                 Draws the CFth frame inbetween picture FNAM1/ 
                                 current file number and picture FNAM2/FN02 of 
                                 a sequence of TF frames. Used by BTWEEN.
 92 VECFMC(XN)
                                 Sets the number of lines for the vector family 
                                 command on the FR80 to XN. 
 93 FADINT(XI1,XI2,FRAC,TF,CF) 
                                 Set the intensity for the CFth frame when fading 
                                 from intensity XI1 to intensity XI2 in TF frames. 
                                 Used by FADE. 
 94 PICLST(FNAM,P1,P2,FRAC,TF,CF)
                                 Sets the start visible point between Pl and P2 of the 
                                 picture FNAM/current file number for the CFth frame of 
                                 a sequence of TF frames. Used by PICST. 
 95 PICLFN(FNAM,P1,P2,FRAC,TF,CF)
                                 As for PICLST but sets finish visible point. Used by PICFN. 
 96 DVOUT(XN)                   
                                 Selects device(s) according to XN (2.4). 
 97 STSAV(FNAM,DEV)
                                 Starts saving orders for device DEV (4.7) in picture 
                                 file FNAM/current file number.
 98 FISAV
                                 Finishes saving orders in picture file (4.7).
 99 CRFLPC(FNAM)
                                 Creates the flags for scanning picture file FNAM/current 
                                 file number.
100 DRSCPC(FNAM) 
                                 Draws scanned in picture described by picture file 
                                 FNAM/current file number. 
101 SCOLEV(POS,FNAM,COL,XINT,XLEV,ELEV) 
                                 Puts picture file FNAM/current file number into POSth position 
                                 in list of pictures to be scanned by SCANHD. Sets this picture 
                                 to be colour COL, intensity XINT, its scanning level to XLEV 
                                 and its elide level to ELEV. 
102 SCANHD (XN) 
                                 Scans the pictures in the first XN positions in the scanning list, 
                                 the higher numbered levels being hidden by the lower numbered ones. 
103 PATHID (FNAM,PI,FRAC,TF,CF) 
                                 Sets the path value for the CFth out of TF frames from picture file 
                                 FNAM/current file number into index variable PI. FNAM must consist 
                                 of ID line drawing or NULL commands. 
104 PATI2D (FNAM,PI,P2,FRAC,TF,CF) 
                                 As for PATHID but the values from the 2D file which consists of 2D 
                                 1ine drawing or NULL commands, are put into index variables Pl and P2. 
105 DRLINT(XN) 
                                 Draws the pictures in the first XN positions in the scanning list. 
⇑ Top of page
© Chilton Computing and UKRI Science and Technology Facilities Council webmaster@chilton-computing.org.uk
Our thanks to UKRI Science and Technology Facilities Council for hosting this site