Graphical Output Devices.

Copyright (c) Susan Laflin. August 1999.

There are two possible forms of two-dimensional graphical output

a) Computer screens of various sizes, colours and resolutions.

b) Hard-copy output such as printers and plotters.

The so-called "three-dimensional" output devices are still rare and expensive and so are outside the scope of this chapter - even the virtual reality headsets, which appear three-dimensional, in fact use a separate two-dimensional screen for each eye and rely on the human brain to process the images and produce a three-dimensional result.

Computer Screens.

Most computer screens available today are raster terminals. These may be visualised as having a rectangular grid across the screen with a number of equally-spaced lines in each direction. The number of lines determines the accuracy or resolution of the device (1024 x 1024 is quite common).

At each intersection, the screen may be illuminated with a dot of suitably-coloured light, i.e. a "pixel".

Varying the resolution (space between pixels) and the number of possible colours gives a wide variety of different terminals.

Each raster screen has at least one "frame buffer" associated with it and alterations to the screen are achieved by changing values in this frame buffer. The current state of the frame buffer is displayed, row by row, on the screen of the terminal and is automatically refreshed several times a second to give a clear steady image.

A monochrome terminal has one frame buffer and points on the screen can be recorded as either "black" or "white" (0 or 1), while colour terminals have several buffers. The number of buffers supplied in the hardware determines the maximum number of colours available at any given moment.

Earlier terminals were of a type known as "vector-refresh" terminals and had to be programmed rather differently. Much of the terminology used to discuss graphical algorithms still reflects this.

Vector-refresh terminals used the concept of moving a beam of light across the screen and leaving an illuminated line behind it. The disadvantage of the vector-refresh terminal was that refreshing the screen was under the control of the program. If the drawing was output once, it would appear on the screen and then fade away. The program had to loop and re-draw the diagram many times in order to keep it on the screen. Worse than this, if the diagram became too complex, the first lineswould start to fade before the last ones had been drawn and so the whole diagram would flicker most unpleasantly.

Raster terminals make life a great deal easier for the programmer, because they are automatically refreshed and this process takes the same time whatever the colour of the pixels and hence whatever the compexity of the drawing. The limit is now imposed by the number of pixel-positions on the screen.

Hard Copy Devices.

The hard-copy devices include plotters and printers.

The plotters usually contain pens of one or more colour and are designed for graphical output.

The printers were designed for text output, but some types may also be used for graphical output. The daisy-wheel or golf-ball printers, developed from the electric typewriter, cannot be used for graphical output, but these are already sufficiently out-of-date to be rarely met. Dot-matrix, ink-jet and laser printers can be used to copy what is on the screen, whether it be text or graphics. The higher the resolution of the printer, the better the quality of the output.

The pen-plotters use two main mechanisms, either drum plotters with pen movement in one direction and paper movement in the other, or flat bed plotters with pen movement in two directions.

Drum plotters varied from the large Calcomp plotters (with paper up to a metre wide and a resolution of 0.01 mm) at the one extreme, to the small Tandy colour plotter (with a roll of paper about 10 cm wide and 80 plotter steps across) at the other. In each case, movement in one direction was obtained by rotation of the drum resulting in movement of the paper. The pen was moved by a wire in the other direction, and as the loop of wire was rotated so the plotting head was dragged to and fro across the paper. If there was only one pen available, then it was permanently mounted in the plotting head, but if there are several pens of different colours and/or different thicknesses were provided, then the one currently in use was mounted in position in the plotting head and some means of changing pens, either under program control or through operator intervention, was needed.

In the flat bed plotters, the paper lay on a flat surface and there were two wires, one parallel to the x-axis and the other parallel to the y-axis, to control the movement of the pen. The paper supplied to these plotters may be in separate sheets or on a roll, but the paper was not moved during the plotting of a graph.

In either type of plotter, there were two pen positions within the plotting head.

"Pen-up" meant that the pen was raised clear of the paper and left no mark when the plotting head was moved.

"Pen-down" meant that it was in contact with the paper and left a trail as it was dragged across the surface of the paper.

On the screen (or copied to the printer), each pixel may be illuminated or not and this "off" or "on" corresponded to the pen-up or pen-down of the plotter.

The smallest distance the pen can move is -1, 0, or +1 units in the x and y directions. This gives the possibility of eight directions in which the pen can move from any given position (the diagonal directions being obtained by simultaneous movement in both x and y) as shown in the figure. All graphs, however complicated, must be broken down into these "elementary plotter steps" and all graphics packages contain software to calculate these and issue commands to the plotter in the correct form. This mapping from theoretical curve to elementary plotter steps to commands for the appropriate hardware is an essential part of any graphics system.

The second part of the mapping - from elementary plotter steps to hardware commands is usually supplied in the device-driver software along with the plotter. In addition, the CGI (Computer Graphics Interface) standard has been designed to map from GKS commands such as polyline to a format which the actual plotters can interpret.

Exercise

If 0 indicates a step of +1 in the x-direction, 1 a step of +1 in both x and y directions and so on, what diagram is produced by the following sequence of plotter-steps ?
0 6 6 0 0 6 4 4 6 6 4 2 2 4 4 2 0 0 2 2

The use of these chain-codes to represent line drawings has been used in many applications. In some cases it may be the most efficient way to store diagrams (note that the numbers 0 to 7 can be represented by 3 bits and packed several values per computer word when it is necessary to store them).