|
(11) | EP 0 437 064 A2 |
(12) | EUROPEAN PATENT APPLICATION |
|
|
|
|
|||||||||||||||||||||||||||
(54) | Computer graphics system |
(57) A method of displaying graphics on a computer terminal screen comprising:
1) digitising an image to be displayed into a digital information array of predetermined dimensions; 2) sub-dividing said information array into a plurality of identically sized pixel matrices, each corresponding in size to a standard character displayed on said screen; 3) assigning a different predefined standard character code to each pixel matrix in the array; 4) defining the screen display of the standard character code assigned to each pixel matrix according to the digitised information in the respective pixel; 5) displaying the defined characters on the screen in continuous arrangement corresponding to the arrangement of pixels in the array so as to display the image. |
Character Definition
a. Declare and Initialise Data Structures.
b. Read File. The data file that contains the X, Y data in ASCII form is opened for read access.
The first X coordinate is obtained by reading characters up to a colon (':') into
a string. This string will then be converted to an integer representing that value.
e.g. data from file 1234: (5 characters) is converted to an integer value of 1234
(One Thousand Two Hundred and Thirty Four).
The same operation is performed to obtain the Y and Z values for the first point.
This will result in all three values being stored as integer variables to represent
the current X, Y and Z values respectively.
The integer values are then compared with two values representing the maximum and
minimum X and Y values so far read from the file. Of course in the case of the first
set of coordinates read, these values will become the new limits.
The Z value is at this point written to a large integer array, containing all the
Z values read from the file. The procedure to fill in dots between values is then
called. If the current point is not the first point from the file and the previous
point's Z value was 0 (representing the pen being on the paper) the dots will be filled
in. A detailed explanation of this procedure will be given later.
The above action is then performed on the entire data file until the End-Of-File (EOF)
marker is reached. The file is then closed.
The values of maximum and minimum X and Y will now be set correctly as the entire
file has been compared.
c. Fill In Dots Between Points. A procedure within the program will (if necessary) fill in all possible dots between
two points. the first point will of course have no previous value to join to so no
action will be taken. Similarly no action will be taken if the pen was not on the
paper for the previous point. This will be known by examining the previous point's
Z value. If the value is 1 this will indicate that the pen was not on the paper and
that a line should not be drawn between the points. A value of 0 for the previous
Z value indicates that the point should be joined.
To find all the points on a line between two points the mathematical equation for
a straight line (y = mx + c) is used.
The method of this is as follows.
i. Calculate gradient (m) =
(prev. Y val. - cur. Y val.)/(prev X val. - cur. X val.)
ii. Calculate y axis intercept of line (c) =
(prev. Y val. - (gradient x prev. X val.))
d. Find-Scale. This procedure scales the signature so that it will best fit the size of the screen window. The maximum and minimum X and Y values obtained when the data file was read are used here.
e. Calculate Offset Into Screen Window. The offset into the screen window is calculated by taking the X, Y coordinate data
from the arrays and adjusting them by subtracting the scaling factor (previously calculated).
A value in the range 1 to 128 will be calculated for X, and a value in the range 1
to 30 for Y. The row number is then calculated. A Y value of 1 to 10 indicates top
row (row 3), 11 to 20 middle row (row 2) and 21 to 30 bottom row (row 1). The Y dot
position into its character cell is calculated by subtracting 0, 10 or 20 respectively.
The character number is calculated using the X offset (1 - 128) and the row number.
The character number will be in the range 1 - 48. Once this is known it is possible
to determine the X dot position into the particular character cell, using a modular
8 calculation.
f. Put Dot (Pixel) In Character Definition. This procedure sets a bit corresponding to the X and Y positions in the required
character definition. The Y dot position is used to determine the value that should
be logically ORed with the existing mask to set a bit. Y values of 1 to 4 are stored
in one array and values 5 to 10 in another. This is because of the way in which character
shapes are downloaded. This is shown in greater detail earlier in the document. Logically
ORing the values means that if a dot (pixel), has been set by a particular value it
does not matter if it is set again by subsequent ones. It is quite possible that a
number of points from the large scale are going to be represented by the same bit
as the 'scale-down' factor is quite large. The values are as follows.
g. Plot Signature On Screen. When all the X, Y data has been processed it is necessary to plot the signature on
the VT220 terminal screen. This procedure makes extensive use of the 'escape sequences'
associated with the VT220 terminal device, and it may be beneficial to study a copy
of the handbook.
Initially the new character set is given a 2 character i.d. and the character set
is designated by means of an escape sequence. The program uses the i.d. '@' (space
and at symbol). The designation is performed by sending the following:
ESC ( sp @ where sp = space character.
The font is then downloaded using the escape sequence described in the section on
'Character definitions'. The two arrays of dot (pixel) positions represent the a.
and b. values above. The characters 31 through to 79 are defined. All others have
no values. The newly defined characters have no meaning unless they are printed out
in the correct order. They need to be printed out as 3 rows of sixteen characters
directly above each other.
Further escape sequences are used to position the screen cursor to ensure that the
rows will be printed out above each other.
Finally it is necessary to reset the screen character set back to its original value
to reset the terminal for future operations.
1) digitising an image to be displayed into a digital information array of predetermined dimensions;
2) sub-dividing said information array into a plurality of identically sized pixel matrices, each corresponding in size to a standard character displayed on said screen;
3) assigning a different predefined standard character code to each pixel matrix in the array;
4) defining the screen display of the standard character code assigned to each pixel matrix according to the digitised information in the respective pixel matrix in the array;
5) displaying the defined characters on the screen in continuous arrangement corresponding to the arrangement of pixels in the array so as to display the image.