Skip to main content

Basic Data Forms

Information in the Network Standard Graphics Protocol will be expressed as a sequence of 8-bit bytes. A command will consist of a command byte followed by zero or more arguments. The same command byte will always take the same number of arguments in the same form. The length of each argument may be fixed or variable depending on the argument.

A simple type of argument is a "value", which is a 8-bit integer. Another type of argument is a "string" which is a count followed by (count) number of 8-bit bytes. If the count is between 0 and 127, it is sent in a single byte. If the count is between 128 and 2**15-1 (** means exponentiation), it is sent in two bytes with the high order bit of the first byte set to one. The first byte contains the seven high order bits of the number and the second byte contains the eight low order bits. A string is the only type of argument of a command which can vary in length. For example, whenever a command has optional arguments, they will be represented inside of a string.

Coordinate data engendered considerable discussion at the second Network Graphics Group meeting. It was decided that a two-dimensional Logical Coordinate System was required, and each interpreter for the graphic command byte stream would be responsible for mapping this coordinate system to physical device coordinates. It was decided that data in the logical coordinate system would be in twos-complement notation, that it would be fractional, that each edge of the screen would have unit length, and that the origin would correspond to the center of the screen on the output device. The vertical (horizontal) edges of the screen of the output device correspond to the lines X (Y) = -1/2 or X=+1/2-e where e is a small positive number determined by the precision of the fractional data. Particularly the points (-1/2, -1/2) (-1/2, 1/2-e), (1/2-e, -1/2) and (1/2-e, 1/2-e) shall be visible points at the corners of the logical screen. (In the case of a non-square display surface, the implementer may take his own decision. Thus we shall say that the Logical Coordinate System contains points whose coordinates range from -1/2 to a little less than +1/2.

Commands which take coordinate data will be available in various modes. In absolute mode, a position is specified by giving its coordinates in the Logical Coordinate System. In relative mode, the difference between the coordinates of the position and the coordinates of the current position must be specified. Thus a coordinate datum which is an argument for an absolute mode operation should be in the range -1/2 to +1/2-e, while one for a relative mode operation should be in the range -1+e to +1-e.

Interest was expressed at the second Graphics Group Meeting in eventually allowing a very large coordinate space (many bits of precision in each fractional coordinate). This is to be done by permitting the length, in 8-bit bytes, of each coordinate datum to be set (as a mode). It was decided at the meeting that two bytes per coordinate would suffice for now. Thus "e" in the above discussion is 2**(-15) (one in the least significant bit of a 15-bit plus sign fractional coordinate).

Text data will be transmitted as an argument of various commands for display on the output device. Network ASCII will be used to represent characters. At the lowest-levels of the protocol only one character size will be available -- whatever is "normal" on the display device. If the device has no "normal" size, 72 characters per line would be desirable. At higher levels the size of each individual character can be specified.

Also, at the lowest levels, control characters will be passed along to the device for it to do the best it can. However, the consensus of the graphics meeting was that at some reasonably low (but non-zero) level, carriage return, line feed, and backspace should be interpreted to do the right thing.