📄 rfc292.txt
字号:
Network Working Group 12 January 1972
Request for Comment: 292 Jim Michener, MAC
NIC 8302 Ira Cotton, MITRE
References: 282, 285 Karl Kelley, U. of Ill.
Updates: None Dave Liddle, Owens Ill.
Obsoletes: None Ed Meyer, MAC
GRAPHICS PROTOCOL - LEVEL 0 ONLY
INTRODUCTION
This document reflects opinions expressed and decisions reached at
the second meeting of the Network Graphics Group, held at the
Stanford Artificial Intelligence Laboratory in late November 1971.
It describes part of a proposed Network Standard Graphics Protocol
for transmitting graphics data within the ARPA network. The
particular aspects of the protocol covered in this document relate to
the form and content of graphics information sent from a source of
graphical information (an application program, say, in the "Serving
Host") to a display package for output to a graphics console (at the
"Using Host"). This will take the form of a sequence of 8-bit bytes,
and will be called the graphics output byte stream. In particular,
only the simplest forms of graphics data will be covered in this, the
first version of this document. The next version, already in
preparation, will be much more complete. In any case this is not
intended to describe a finished protocol; rather it should serve as a
basis for graphics experimentation on the network.
This document does not include form or content of graphics input
(data sent from the Using Host to the Serving Host) nor does it cover
how the connection is established between the hosts. A proposal for
the former will be generated eventually by this committee; the latter
is the job of the Connection Committee (of the Network Graphics
Group).
This RFC describes the commands which are available in the protocol
in terms of the effect they would have at the receiving (Using Host)
end. Clearly, some subroutine package is desirable at the Serving
Host for use by applications package in transmitting graphics data,
but on this topic this RFC does not intend to comment.
It may be observed by the reader that no facility is specified in
this protocol allowing the Using Host to report logical errors in the
graphics output byte stream to the Serving Host. Such a facility
would have to be intergrated with the graphics _input_ byte stream,
since it involves most of the problems related to synchrony of
independent hosts.
Michener [Page 1]
RFC 292 Graphics Protocol Level 0 January 1972
BACKGROUND
The reader should probably peruse RFC 282: "Graphics Meeting Report"
by Mike Padlipsky to obtain some of the framework surrounding this
discussion of network graphics. Also it might be valuable to make
note of the model described in RFC 285: "Network Graphics" by Donald
Huff.
LEVEL AND GROUND RULES PERTAINING THERETO
Functions within the graphics protocol will be classified into a
number of levels depending partly on how difficult it is to implement
those functions. It is intended that any host which claims to
implement the functions of level N must implement all lower levels as
well. Thus, it is envisioned that sites will implement levels
incremently. Implementations will be improved as a continuing
process to include more and more functions, and it is intended that
each implementation will be able to identify its own level to a
graphics protocol at a remote site which is requesting a graphics
interchange. A side result is that each site will be able to
determine its own priorities in committing programmers to the
graphics protocol as opposed to other efforts.
It is also our intention that implementation of level N will require
no knowledge of level N+1. Thus a site can implement a level in the
(reasonably) firm knowledge that no changes at higher levels will
alter the level implemented. At some time it may be decided by the
Network Graphics Group to redefine a level which has previously been
firmed up. It is not our intention that this shall happen but one
must recognize that the proposed Graphics Protocol is experimental
and may have to be changed.
One further ground rule: a stream of commands and data which is
valid at a given level, K, shall produce "identical" results on any
interpreter of level K or higher. By this we mean that as defined
operations, similar pictures should result. Aspects of the protocol
which are not strictly defined (at this time) include character size,
character position relative to the beam, how control characters in
text output affect the terminal and what happens when the beam is
moved or a line drawn outside of the logical screen boundary. This
rule forces upwards compatibility, so that an application written
using features of low numbered level will still work at sites which
have moved on to implement higher levels. Additionally, any aspects
of this protocol which are explicitly "left unspecified" in the
detailed operations descriptions below _shall_ be explicitly
specified in any public description of an actual implementation.
We now describe the framework which will be common to all levels.
Michener [Page 2]
RFC 292 Graphics Protocol Level 0 January 1972
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 an 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.
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 make his own decision, but it is recommended that the
largest possible _square_ area be utilized.) 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
Michener [Page 3]
RFC 292 Graphics Protocol Level 0 January 1972
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 had no "normal" size, 72 characters
per line would be desirable. Later, variable character size may be
introduced.
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.
COMMAND CODES
Each command in the graphics protocol will be assigned a non-negative
value which will represent this command in the byte stream. The
algorithm whereby values and commands are associated is, it turns
out, a very touchy subject. There are five or ten different criteria
for a "best" algorithm, each criterion different in emphasis. This
Gordian knot will be cut, in this proposal, by ordering the commands
approximately according to level, and then just numbering them. In
addition, if several closely related commands occur at the same
level, some attempt will be made to encode variations of meanings in
terms of bit configurations. Even if some later consideration causes
a change in ordering to be proposed, it is this committee's feeling
that the numbering should not be altered. However, until this matter
is firmly settled, it is strongly advised that any implementation
take into account the possibility of reassignment of command codes.
Michener [Page 4]
RFC 292 Graphics Protocol Level 0 January 1972
PARTICULAR PROPOSAL FOR LEVEL 0 PROTOCOL
It is proposed that level 0 be kept very simple. This is so that
implementation can be quickly accomplished and experimentation with
the protocol begun. Another reason is that the least powerful hosts
and even programmable terminals should be able to implement it. In
accordance with this, the "rule" was made that a command be
implemented only if the output is a function solely of the current
command and the "beam position" current at the start of the command.
In other words the interpreter for level 0 need have no internal
storage for "modes" or pushdown stacks. With this restriction it is
hoped that a very simple implementation will be possible for level 0.
In particular, perhaps one could eventually build a hardware
translator from level 0 code to one's own particular terminal's code.
Note that in the opcode assignment for level 0, bits 4, 2, and 1 have
special meaning for the move, line and dot commands. In particular,
the 1 bit encodes absolute versus relative data mode, the 4 bit
encodes whether any visible output occurs, and the 2 bit determines
whether the visible output is a line or a dot.
LEVEL 0: COMMAND SUMMARY
The following is a list of commands (and their syntax)in level zero.
Detailed descriptions of these commands follow in the next section.
Commands dealing with protocol may be added by the Connection
Committee. (They currently request opcodes in the range 128 to 255.)
(As described in Basic Data Forms, above, <x>, <y>, <x delta> and <y
delta> are two-byte coordinate values, <string> is a count followed
by (count) many bytes and <value> is an eight bit number.)
Decimal Octal Binary Format
0 0 00000000 Null
1 1 00000001 Erase screen and reset beam
2 2 00000010 Move Absolute <x> <y>
3 3 00000011 Move Relative <x> <y>
4 4 00000100 Draw Absolute <x> <y>
5 5 00000101 Draw Relative <x delta> <y delta>
6 8 00000110 Dot Absolute <x> <y>
7 7 00000111 Dot Relative <x delta> <y delta>
8 10 00001000 Text <string>
9 11 00001001 TextR <string>
10 12 00001010 End of Picture
11 13 00001011 Escape <value> <string>
Michener [Page 5]
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -