1 Introduction
1.1 Purpose
This standard specifies a data representation for the device independent description of a certain class of imagery called synthetic graphics. "Synthetic graphics" is a term used to describe a mode of drawing in which images are defined in terms of component parts. These parts may be synthesized from geometric entities such as lines, circles, points, and uniform areas. Synthetic graphics differ from "natural imagery" in that "natural images" are usually derived photographically and stored in dot matrix or some other pixel oriented form, and contain only limited explicit information regarding their component content. The REmote Graphic Instruction Set (ReGIS), a generic graphic descriptor, is the system described for executing the graphics commands.
1.2 Scope
This standard achieves the above purpose by:
Postulating a system model based on current technology in which graphics can be supported;
Identifying commonly required access points into this model, and;
Specifying an execution model and instruction set (ReGIS) consistent with this model.
1.3 Implementation Of ReGIS
It is not the intent of this standard to specify what products, hardware or software, must implement ReGIS. The decision to support ReGIS or not will be made by the appropriate marketing and engineering organizations during the initial stages of the Phase Review Process for the product(s) in question. This standard defines the function and form which must be implemented in a product for it to be certified as conforming to ReGIS.
ReGIS can be implemented as either a hardware or a software product; any products which generate or interpret ReGIS are within the scope of this standard.
1.4 Reference Standards And Related Publications
DIGITAL STANDARDS
- EL-00138-00
- DEC STD 138-0 Registry of Control Functions for Character-Imaging Devices
- EL-00169-00
- DEC STD 169-0 Digital Standard Coded Graphic Character Sets for Hardware and Software
Copies of Digital Standards Can be obtained from Standards and Methods Control, CTS1-2/D4, DTN 287-3724, JOKUR::SMC
Please provide your name, badge number, cost center, mailstop, and ENET node when ordering.
ANSI and ISO STANDARDS
- ANSI X3.4 - 1986
- American National Standard Code for Information Interchange (ASCII character set)
- ANSI X3.41 - 1974
- American National Standard Code Extension Techniques for use with the 7-Bit Coded Character Set of the American National Standard Code for Information Interchange
- IS2022-1986
- Information Processing - ISO 7-bit and 8-bit Coded Character Sets - Code Extension Techniques
- (unnumbered)
- ISO Register of Coded Character Sets for Use with Escape Sequences
- ANSI X3.64 - 1979
- Additional Controls for use with American National Standard Code for Information Interchange
- ANSI X3.122-1986 (IS8632-1986)
- Computer Graphics Metafile
- ANSI X3.124-1985 (IS7942-1985)
- Graphical Kernel System (GKS)
Copies of ANSI and ISO Standards and other related publications can be obtained from local Digital Libraries.
"Computer Graphics" vol 13, number 3 (August 1979) - GSPC CORE proposed graphics standard
1.5 Terminology
- Absolute Location
- An unsigned coordinate pair that specifies a location based on the screen origin.
- Active Position
- The character position on the visual display at which the next graphic character would (will) be displayed.
- Application Free Primitives
- A ReGIS-implemented set of drawing primitives based upon common geometric rule and compass constructions. It contains basic, general constructions only, not specific capabilities for particular applications.
- Base Logical Device
- See Logical Graphics Device.
- Bracketed Pair ([])
- A pair of quantitative values enclosed in brackets; used in ReGIS command strings to encode position values and other position or extent related information.
- Closed Curve Sequence
- A series of locations ReGIS uses to interpolate a curve whose end points meet. One example is a circle.
- Command Keyletter
- The ReGIS syntactic element which indicates that a command or command option is to be interpreted.
- Complement Writing
- Writing mode in which ReGIS complements the image existing on the display with new images being written to the screen.
- Current Location
- The location in the display space last moved or drawn to.
- Display Surface
- The active area of the screen; it may be the entire screen.
- Echo
- Retransmit encoded messages back to the sending device as they are sent.
- Erase Writing
- Writing operation which overwrites previously drawn objects from the display by using the background (secondary) writing value for both primary and secondary writing values.
- Filling
- Coloring in a bounded area as it is defined; contrast with "flooding" and "shading".
- Flooding
- Coloring in, with variable pattern or texture, a bounded area already defined in the display. Supported only by extension to ReGIS.
- Graphic Character
- A character, other than a control character, that has a visual, displayable representation.
- Graphics Cursor
- A visible indicator of the current drawing position.
- Graphics Pipeline
- Graphics environment models are often layered, with higher level layers requesting services of lower levels to effect actions. The route(s) through these layers is called the "graphics pipeline."
- Graphic Text
- Strings of characters drawn by executing graphics commands; these are distinguished from other types of text by the use of state stored by previous graphics commands.
- Gray Scale
- The range of varying levels of light displayable by black and white raster graphics devices. High resolution color raster devices can display the gray scale in addition to a full range of color hues.
- HLS
- Hue, Lightness, Saturation. A three-parameter system for describing a color based on human perceptual description of color.
- Landscape Mode
- The rectangular viewing area with the X (horizontal) axis as the longer one.
- Logical Graphic Device
- An abstract graphic device for which ReGIS defines an image. This abstract device is a composite of a wide range of physical devices, and is used as a hypothetical basis for the ReGIS device interface. Allowable exceptions to the Base Logical Graphic Device are provided for in the Extended Logical Graphic Device.
- Line Pattern
- Line styles or drawing patterns (solid, dashed, dotted, etc.) defined and supported by ReGIS.
- Macrograph
- A series of ReGIS commands or command elements that are stored as part of the ReGIS implementation state and invoked on request by a named string. Macrographs reduce communication line traffic between the terminal and computer in the case of frequently used commands. Concept derived from the assembly programming construct of macro instructions.
- Offset
- A distance from a given reference location.
- Open Curve Sequence
- A series of points interpolated by ReGIS to draw a curve whose end points do not meet.
- Overlay Writing
- Writing mode in which only the foreground (primary) writing value is executed into the display, and the background (secondary) writing value is not used. Contrast with "replace writing."
- Pixel
- Picture element; the smallest displayable unit on the screen.
- Pixel Vector
- A scalable unit vector whose direction is parallel to an axis or to a diagonal between the axes.
- Portrait Mode
- A rectangular viewing area with the Y (vertical) axis as the longer one.
- Position Address
- A specific point in the viewing area of a graphic device that is representable by an X-Y (horizontal-vertical) pair of numbers.
- Protocol
- The conventions or rules for the format and timing of messages sent and received. Devices must be using the same protocol to understand each other.
- Raster Device
- A display device that generates images using a raster scan.
- Raster Scan
- In computer graphics, a technique of generating or recording the elements of a display image by a line-by-line sweep across the entire display surface; for example, the generation of a picture on a television screen.
- ReGIS
- Mnemonic for REmote Graphics Instruction Set; a set of graphics object description commands.
- Relative Location
- A point on the screen measured from the current location rather than the screen origin.
- Replace Writing
- A ReGIS writing mode in which both foreground and background values are written to the display medium; contrast with "Overlay Writing."
- Reset
- Return to a known default condition.
- Shading
- An area fill operation that fills the area between a vector or curve and a specified horizontal or vertical line or a point. Shading differs from FLOOD and FILL in that it colors in a solid or textured area which is not explicitly bounded.
- Sixel
- A coined term derived from "six pixels." Sixels are an image transfer mechanism in which six pixels of information are encoded into a single character code. Sixels may be used as an image re-transmission scheme from ReGIS.
- Transportability
- The capability of carrying ReGIS-defined images across device technologies without loss of critical information.
- Viewing Point
- See Pixel.
- Writing
- The operation of executing graphics to the display medium.
1.6 Modeling The Graphics System
The Remote Graphics Instruction Set (ReGIS) is intended to be used for device level portable graphic image definition. ReGIS is meant for the communication of graphic images between a host computer and a remote graphics device. It has applicability to tightly coupled graphics systems in any context in which a graphic image can be stored in geometric component form encoded as a sequence of characters. ReGIS is not intended for use in high performance graphics applications where picture complexity is great or where texture and graded shading are required.
1.6.1 The Graphics Pipeline
The state of the art in computer graphics layers the graphics environment in a manner very much like the way networks and communications models are layered. In layered models, higher level layers request services of lower levels to effect actions. Traversing these layers is known as proceeding through the graphics pipeline.
Existing proposals postulate levels for modeling of graphics information and performing viewing operations on the data represented in these models. The level of graphics execution is added to these levels. It is this level that most closely approaches the capabilities of existing graphics devices (as opposed to systems), and it is to this level that ReGIS is directed.
1.6.2 The System Model
Figure 8-1 illustrates the assumed general block diagram of the graphics system for which ReGIS was designed. As illustrated, the system consists of two major parts: (1) the host computer system, which from the user's point of view consists of various software modules and (2) the remote graphics device. The term "remote" here refers to the assumption that the graphics device is attached to the host computer by a possibly low-speed communications link.
The host computer system is assumed to consist of four major parts (not all of which may be present in any particular system):
Graphics application package - Such packages allow the user to access the graphics capabilities of the remote device in terms of syntax and semantics appropriate to the user's intended application. For example, a data plotting package may accept tables of data and allow the user to construct plots of varying types based on that data, using an interaction dialog appropriate to the application.
High level language - Users often need to generate graphic images of significant complexity requiring algorithmic definition, or images requiring dynamic changes. Such programs are generally written in higher level languages which may or may not have direct access to graphics functionality.
Text files - Sometimes called the graphics "metafiles"; static storage of the definition of a graphic image allows later use of that graphic image in the same manner as printing out a report file of standard text.
Operating system - The operating system may provide support to the graphics user in the general case by converting the graphic image definition provided by the other software to the required protocols necessary to drive one or more remote graphics devices, or may use graphics directly to implement a pictorial (iconic) dialog with the user.
1.6.3 Graphics Language Access Points
Based on the above assumed structure, the system has at least six language access points of interest to the users and developers of such a system:
Graphics application languages - such as plot commands in a data plotting package or the constructors of physical images as represented by the Graphical Kernel System (GKS) graphics standard.
High level languages - allow access to graphics semantics in three possible ways:
By direct drive of character based communication protocols by using string constants output through "PRINT" statements
Through graphics subroutines accessed by programmed calls
Through embedded graphics statements accessed in the same manner as other language capabilities
Graphics text files - the syntax of how the graphics image is stored as text for later communication to the graphics device (metafiles).
Communications Interface - the syntax of the graphics commands sent sequentially to the graphics device.
Graphics hardware instructions - the (presumably digital) signals generated by the local device processor to control the hardware image generator.
User graphics entries - the specialized entry sequences for local control in addition to the syntax of the user commands required to use the application software programs.
1.6.4 ReGIS Scope of Application
Considering the breadth of graphics applications and the differences in "personality" between the different language points, it is not feasible to identify or specify one instruction set which satisfies the requirements of all access points in the system. On the other hand, the relatively large number of different graphics language syntaxes of which a user may have to be aware predicates a few standardized language approaches, with special languages applied when dictated by the application. These latter special applications must be based, where possible, upon other existing standards. It is the purpose of ReGIS to standardize the syntax and semantics of the communications interface graphics commands. By extrapolation, it is also intended that ReGIS be used at other graphics language access points at which a character based descriptive representation of the graphic image is appropriate. In summary then, it is intended that ReGIS be used for the following graphic language access points for both remote and closely coupled graphics systems:
Graphics instruction string constants from high level languages, whether generated by print statements or the compilation of high level language programs having embedded graphics statements
The "semantic protocol" for graphics access across a serial communications line to a remote graphics device
The syntax of graphics commands when stored in a character oriented file
1.7 Range Of Intended Devices
ReGIS attempts to cover a broad range of both soft-copy (temporary record) and hard-copy (permanent record) remote graphics devices. ReGIS executes well-defined, two dimensional, descriptively encoded graphics images. The technology of a device is generally not a factor in the determination of whether that device would be suitable for an implementation of ReGIS.
The principal requirement for transporting ReGIS-defined images is that the essential information content of an image MAY be encoded in the basic set of ReGIS instructions so that little, if any, essential information content is lost. This must hold true if attributes of one device are transformed, or even ignored, by another device which does not have that particular attribute capability.
1.8 ReGIS Overview
Good design practice specifies the function set of a proposed interface before selecting an encoding to implement it. However, the primary operational environments of ReGIS are required to be:
Serial communication channels operating under existing text-oriented protocols, and
Text-oriented data storage for deferred execution of pictures.
These design constraints make it feasible to define the function set of ReGIS and its encoding concurrently. As a consequence, the function set of ReGIS is defined in this standard in terms of its encoding, both syntax and semantics.
ReGIS instructions are sequences of characters based upon the alphabet common to most computing systems. This alphabet consists of letter, digit, and punctuation characters. A graphic image is drawn by sending the graphics device a sequence of instructions encoded into this alphabet. The general format of each instruction is a keyletter denoting the type of operation to be performed, plus instruction arguments which have a prescribed meaning when associated with a keyletter. The nine basic (keyletter) instructions in ReGIS are briefly defined as follows:
Screen Instruction - keyletter "S" - Screen operations affect the entire visible viewing area. Actions include setup of the display space, clearing the display in preparation for a new image, and controls which may affect the re-direction or retransmission of an image.
Writing Attributes Instruction - keyletter "W" - Write Attribute instructions are modifiers which affect the actions of drawing instructions following them. Attributes include line style, color and intensity, patterns and textures, and other image modifiers.
Position Instruction - keyletter "P" - The Position instruction causes the drawing process to commence or resume from a specific position in the drawing area.
Vector Instruction - keyletter "V" - The Vector instruction invokes the line primitive causing straight lines to be drawn between positions specified by the instruction arguments.
Curve Instruction - keyletter "C" - The Curve instruction causes circles, arcs, or general curve images to be drawn based upon the arguments of the instruction.
Text Instruction - keyletter "T" - The Text instruction causes a sequence of text characters to be drawn in a manner based upon the arguments of the instruction.
Report Instruction - keyletter "R" - The Report instruction allows state information to be returned to the host from the ReGIS implementation.
Fill Instruction - keyletter "F" - The Fill instruction allows linear elements (lines and curves) to be used as boundaries for simple or complex closed areas, which can then be "colored in."
Load character cell Instruction - keyletter "L" - The Load character cell instruction allows ReGIS programs to define character patterns for use in the Text instruction and general character patterns that are used in area operations.
There are four general types of arguments used in ReGIS:
Position arguments are strings of characters written within the bracket characters "[" and "]". Bracketed position specifiers are used as effective addresses or address increments.
Text strings are character sequences contained within paired quote characters, either ' or ", and are used when a character is itself an argument of an instruction, as in the case of the Text instruction.
Digits are interpreted as numeric values, decimally encoded binary values (as logic masks, and so on), or addresses of adjacent neighbors of a given point in a display.
Option arguments are strings of characters written within the parenthesis characters "(" and ")" which in some manner modify the way in which the instruction carries out its intended purpose. The syntax of the option strings is the same as for instructions and for this reason, option arguments are also called sub-instructions.
These basic instructions and their arguments are sufficient to define most of the information of most graphic images required by users of graphics systems.
2 ReGIS Philosophy
This section describes and discusses the rationale of ReGIS in terms of:
The approach of allowing an image originally defined for one graphics device to be drawn on a dissimilar graphic device, called the instruction set "transportability";
Concepts of the instruction syntax and the orientation to the ASCII character code conventions; and
Concepts of handling dissimilar device attributes and capabilities, referred to as the "semantics" of ReGIS.
2.1 Transportability Concepts
The goal of image definition transportability is to enable a given sequence of graphic instructions to draw similar looking images on dissimilar graphic devices. There are three major aspects of the design of ReGIS which enhance transportability. These are:
Application free primitives
A mandatory base implementation
Imposition of critical device parameters
Note that complete transportability depends on the user selecting features of a device that are possible to transport across technologies without loss of critical information. For instance, ReGIS cannot preserve the information content encoded as blinking when the commands are transported to a hard-copy device.
2.1.1 Application Free Primitives
ReGIS implements a set of drawing primitives based upon common geometric rule and compass constructions, and does not contain any specific capabilities which can be interpreted in terms of the semantics of the application. For example, ReGIS does not include viewing transformation, hidden line removal, and other capabilities generally useful in presenting images of real physical things. Neither does it have built-in axis and bar graph primitives which would be used to support only data plotting. Instead, this model assumes that these capabilities are adequately supported at higher levels in the graphics pipeline, and that these functions are encoded into a sequence of ReGIS instructions. In this way, ReGIS does not burden one application with features required specifically for another.
2.1.2 Mandatory Base Implementation
ReGIS instructions are based on a general instruction syntax which all devices are required to parse.
Every device using the ReGIS instruction set must completely interpret all possible character sequences defined by this general instruction grammar, whether or not those character sequences have semantic meaning in the device in question. The syntax of ReGIS is complete and well formed. Only the semantics can vary among devices of differing capabilities, and, at that, only among extensions to the most fundamental required instruction set.
Semantically, ReGIS instructions and parameters are separated into a Base ReGIS category, a Raster Extensions category, and Open Extensions. Other extensions may be defined to apply to other technologies or categorizations. It is assumed that most of the essential information content of any desired graphic image may be defined by the Base ReGIS instructions and parameters. All ReGIS based graphic devices must accurately interpret these Base capabilities.
In addition, users expecting to output the defined images to a variety of devices should use only the Base ReGIS capabilities to ensure maximum transportability. For example, color is not a common attribute of every graphic device, and for this reason the ReGIS Base is "color-blind". Users desiring maximum transportability should avoid using color to relate essential information where that same information is not also implied by monochrome boundaries or patterns.
There are several possible categories of Standard Extensions to ReGIS. These extensions are based on differences in technology, and are used to standardize device features across the class of devices represented by that technology. The most important extension class is for raster scan display devices, including color CRT displays. Standard extensions for a given class of device allow all devices within that class to be controlled in a class dependent, yet device-within-class independent manner. Hence, all raster devices must implement the full range of the standard Raster Extensions.
This concept works, and even allows commands from an extension set to work on simpler devices, because all devices must fully parse the general instruction syntax. Therefore, a capability in one of the extension sets is simply ignored or transformed to an alternate attribute in a device for which that capability does not exist.
This approach is feasible because of the small number of syntactic elements in ReGIS, and their ease of identification.
2.1.3 Critical Device Parameters
The third major concept in allowing maximum image transportability is the use of critical setup parameters defined once for each image and placed at the beginning of the instruction sequence for that image definition. Thus, in the worst case, the user might have to adjust these parameters to achieve maximum fidelity in the reproduction of a graphic image. As an example of such a critical device parameter, ReGIS allows the user to set the range of (X,Y) coordinates to be used for an image definition. These should be set to the actual physical range values of the device which the user most often accesses. These range parameters could be adjusted to maximally utilize a dissimilar low resolution device but would not have to be adjusted for displaying the same image on a high resolution device.
Imposing expectations on the device departs from what has been common practice in graphics and other areas of computer peripheral access. Commonly, devices are interrogated for their function sets and features, and the applications take on the burden of manipulating data to fit the device. By placing the burden of accommodation on the device, the application or picture file becomes more portable and less likely to require modification as new devices or classes of devices come into use.
2.1.4 Fidelity of Information Presentation
Devices must be allowed varying levels of fidelity in the presentation of information implied by ReGIS instructions. This is a reflection of differences in technology and engineering constraints in product implementations. Fidelity may be measured in a qualitative and quantitative sense. Qualitatively speaking, a line is a line because it appears to connect two points in the display in a continuous fashion. A circle is a circle because it is "round." These aspects of fidelity are, in part, subjective. Pixel oriented devices actually draw lines as a sequence of intensified dots, and the ragged nature of some lines is entirely unpleasant in some instances. However, even these less than perfect lines are, qualitatively speaking, lines.
When fidelity is measured quantitatively, some features of some systems cannot be satisfactorily transported. Display resolution varies from device to device, and the capacity of a display in terms of discernible line pairs or character cells will vary, as will capacities of character cell stores or attribute memories. Where such limits can be quantitatively described, they will be specified with the appropriate instructions as guides to transportability.
Lower resolution and/or monochrome devices by their nature have limited information presentation capacity. Drawing a very detailed image whose information content exceeds the information capacity of the target device may result in essential information being lost. These devices may conform to the ReGIS standard if the qualitative judgement is that they will serve to display images which preserve "enough" information content for normal use. While this definition may appear quite open and perhaps circular, it is a pragmatic and workable one when the decision as to whether ReGIS is the appropriate graphics support mechanism is well-founded. Higher resolution devices may be expected to implement the highest degree of fidelity of information presentation.
Transportability is achievable if images are prepared on lower resolution devices for later output on higher resolution devices, or that a high information content image is prepared directly for the high resolution device. It is not expected that an image prepared on a high resolution device will be drawn on a substantially lower resolution device, except perhaps for "quick checking." Should this situation exist, however, the user must be willing to accept the possible misinterpretation of information as a result of the lower fidelity of reproduction.
2.1.4.1 Guidelines for Image Creators
Given the above, the user must bear some of the burden for balancing the devices available and the applications in mind. If transportability is a goal, then appropriate consideration must be given to the range of devices that may be encountered; the complexity of the presentation should be tailored to that environmental range. For this reason, device or technology specific features should be used only where they are absolutely necessary, or when transportability is not a goal. Even though they are supported through ReGIS, special features cannot be guaranteed across all devices.
There are certain specific methodologies image creators can adopt to enhance the transportability of images. This list is not exhaustive, but should serve to lead the reader's thoughts in the direction that will allow for accommodation of device differences.
Do not use expected device resolution to encode maximum information content into an image. While the most aesthetically pleasing results can often be obtained by planning patterning, character cell placement, and the like based on the pixel resolution of known devices, such attention to detail builds into an image a dependency on resolution that precludes image transportability.
Specify text character sizing in terms of the imposed address space using the expanded Text commands for Unit {T(U[])} and Display {T(S[])} cell sizes rather than as multiples of standard size {T(S<n>), T(H<n>)}. The definition of standard sizes has been a concession to device dependency, and the inability of devices to smoothly scale or otherwise provide for variable text sizing. While such hardware considerations are not entirely moot, it can be expected that as device resolutions increase and windowed displays come into wider use, the ability of devices to better couple graphics drawing elements and descriptive text will be enhanced.
Select colors descriptively using RGB or HLS parameterization rather than by index value. Index values wrap and collide in a manner dependent upon the number of index values supported, and probably without any attention to the perceptual flavor of what is being specified. Collisions between descriptive colors are defined in this standard to merge similar colors (red and orange or red and pink, for example) to some common color ("closest match"). Dissimilar colors (blue and yellow or orange and green, for example) are less likely to collide in a single common color, thereby maintaining perceptual separation.
Perhaps most importantly, use the imposition of coordinate address space to define the expected device. The use of device inquiry and accommodation of device differences in software is not the best way to ensure transportability. Such an approach cannot easily be applied to stored files, as it places a burden of re-interpretation of the file on the image transfer system.
In windowed systems, the actual physical granularity of a display may not be known to driving software, or it may change dynamically in a way that cannot be communicated to driving software. Also, accommodation by inquiry requires that software try to guess what future implementations will do to enhance or subset present devices.
Device developers have the advantage of hindsight with regard to what features of devices software has used, and in what combinations,and can thus make future devices compatible with existing software, rather than having software try to anticipate, perhaps inconsistently, the direction future hardware will take.
2.1.4.2 Guidelines for Image Interpreters
Device developers can minimize the problems that software will encounter in pursuing the goal of transportability.
First and foremost, device developers should be guided by the past. Various ReGIS implementations must be syntactically and semantically compatible and minimize non-functional changes from one product to the next. "Non-functional" changes mean capricious changes in device parameters that this standard allows developers the freedom to define, but which have minimal impact in the details of device design. For example, one might argue that all devices with less than 1000 addressable points in the horizontal dimension should have exactly 800. While the "Guidelines for Image Creators" above recommend that software not depend on pixel level registration for images, small changes in resolution, as from 800 to 768 pixels across, can result in significantly different screen presentations.
Hardware address spaces should be isotropic, meaning that equal increments of physical addressing quanta horizontally and vertically should translate to the same measured distance. ReGIS requires that the imposed coordinate space be treated as isotropic, and the device must mask any variation from the 1-to-1 pixel aspect ratio. It may not be possible to hide the aesthetic effects of such mismatches, however. Consider that 45 degree rotation of text is generally deemed an "easy" case. Deviations from 1-to-1 (or at least integrally related) pixel aspect ratios make this case either difficult to execute or unaesthetic.
The most visible departure from fidelity in image transportability does revolve around character handling. Variables relating to character storage size, standard sizes, and scalability should be scrutinized carefully for effects on software and existing imaging practice before they are changed. As with other aspects of "non-functional" change, any resulting variations should be based on significant improvement in capability, not just for incremental improvement.
2.2 Syntax Considerations
2.2.1 Character Codes
All ReGIS commands may be formed from characters in columns 2 through 5 of the ASCII code chart. It may be considered, in light of strict interpretation of ANSI character set and coding rules, that ReGIS is a violation of the use of printing character codes for commands. This compromise achieves two goals:
To allow an encoding more terse than that required by existing control code standards (ANSI X3.41 and ANSI X3.64)
To develop an instruction set which could be easily generated, stored, and interpreted
As a matter of convention, ReGIS is defined in terms of upper-case letters with the understanding that lower-case letters are equivalent to upper-case for command interpretation. Lower-case letters remain lower case within quoted string arguments, however.
2.2.2 7-bit Versus 8-bit Encoding
The ReGIS command syntax and semantics are specified for use in a 7-bit coding environment, though provision has been made for the support of 8-bit encoding of character arguments. See subheadings 8.4.3 Argument Types, 8.4.3.2 Quoted Strings. Support of ReGIS command codes in an eight bit environment is an environmental issue, and is not addressed in this standard.
2.2.3 ASCII Control Codes
ReGIS does not specify the use of any ASCII control codes, except for certain occurrences within quoted text strings. Any controls or control or escape sequences passed to a ReGIS interpreter are not required to be recognized or parsed by the interpreter 1. Such controls may be included in a ReGIS data stream for purposes of control of the system or device in which the interpreter is running (such as XON/XOFF for communications synchronization or escape or control sequences to activate or deactivate the ReGIS interpreter) but the recognition and interpretation of such sequences is not required by this standard for conformance.
- Some devices find it appropriate to scan for and parse escape and control sequences while interpreting ReGIS. Some of these devices execute escape sequences as if they (the devices) were not in ReGIS mode, and return to ReGIS mode after such execution. Other devices use the occurrence of any escape code (code position 1/11 or 8/* or 9/*) as reason to exit the ReGIS mode. Such use may be necessary to support non-conforming software, but such use is deprecated by this standard.
2.2.4 Linguistic Relationship to Higher Level Languages
The ReGIS general syntax is based on a simple, easily parsed grammar. This grammar can be easily generated by common high level languages and user application packages. Also, the ReGIS instructions encompass most, if not all, of the graphics primitives required to support the execution of graphics constructs required by higher level graphics applications packages.
The encoding of ReGIS instructions and arguments is such that the use of ReGIS directly in the PRINT or WRITE commands of such languages as BASIC, FORTRAN, and Pascal is practical and straightforward. The representation allows reasonably clear, although admittedly terse, coding. In particular, numeric arguments are encoded as the usual decimal integer, fixed point, floating point, and scientific notation strings generated by these languages.
2.2.5 Algorithmic Relation to Higher Level Languages
ReGIS is not meant to be a language in its own right. ReGIS has no algorithmic structures, such as conditional or loop constructs, no general arithmetic capability, and no named variable storage. All these features are presumably present in the higher level languages from which ReGIS may be used for the encoding of pictorial information.
2.2.6 Communications Line Efficiency
The level of ReGIS instructions is set high enough so that reasonable performance can be obtained even at low transmission rates. A relatively few command characters can invoke fairly complex graphics activity. The "macrograph" construct is included in the ReGIS Base to allow string sequences to be transmitted once, stored locally, and then referred to by name for subsequent, repeatable invocation.
ReGIS is generally free format and requires no instruction separators, thereby allowing multiple instructions per "line." In fact, ReGIS has no awareness of line boundaries, since ASCII control characters are ignored (except for a few instances, and only within quoted string arguments).
2.2.7 High-level Language "Personality"
Although it is not possible to define a completely compatible personality among all higher level languages, ReGIS has attempted to capture the essence of the personality of many higher level languages to allow the most rapid learning by users with minimal corruption of well-known syntactic constructs. Common numeric and string constant constructs, the ignoring of blanks and auto-conversion of lower case to upper case are examples of the implementation of this concept.
2.3 Semantic Considerations
2.3.1 Range of Devices
The ReGIS Base defines a logical graphics device modeled after a composite of existing and envisioned graphics execution devices. The common capabilities of flat bed and rotary plotters, storage tube devices, raster video and hard-copy devices, and other devices were evaluated in the definition of the command complement of ReGIS. The ReGIS Base defines a common denominator of these devices, and the Extensions categories are defined to access the unique capabilities of these and other graphics devices.
2.3.2 Position Addressing
A specific point in the viewing area of a graphic device is assumed to be representable by an (X,Y) (horizontal-vertical) pair of numbers. It is also assumed that the viewing area is rectangular in shape for the purpose of code transportability. The size of an address increment is defined by the coordinate space as imposed by the device setup, or by device default if this setup is not used.
2.3.3 Semantic Defaults
In the ReGIS Base, all parameter ranges required by a device are derivable from user supplied screen coordinates. These are transformed to physical coordinates by the device. An exception to this is the size of "standard characters" in the device. These are typically constrained by the physical design of the device. To accommodate such variances, ReGIS allows the user to "adjust" some of these parameters so that the actual visual result is as close as possible to what is desired. Such adaptations may require user intervention (that is, trial and error) to reproduce picture content accurately.
Devices that implement ReGIS extensions are required to implement default values for all such semantic features that affect the visible display. These defaults must approximate, to the degree possible, the visual impression of the image on a device without these visual enhancements. These defaults must be assumed each time the screen addressing operation, S(A[][]), is performed.
3 Base Logical Graphic Device
ReGIS defines an image for an abstract graphic device called the ReGIS Logical Graphic Device. In principle, this abstract device is a composite of a wide range of physical devices. Features unique to specific types of physical devices are part of the extended ReGIS logical device and are discussed in later sections. An image defined for one physical device is transportable to a different type of physical device. However, feature extensions may be ignored or approximated on some devices. Therefore, exact duplication of an image may not always be expected when image definitions are so transported. It is not expected that any one specific device have the parameters of the logical device, but rather each ReGIS based physical device maps (transforms) the parameters given in terms of the logical device to its specific physical parameters.
The ReGIS logical device is defined in terms of:
Parameters of the viewing area.
Attributes of viewing points in the viewing area.
The general process of defining an image in the viewing area by modifying the attributes of the viewing points; interpretation of ReGIS is a serial process, and the visible portions of the image are drawn in the order in which the instructions are received.
The allowed range of parameters and attributes.
The phrase "implementation dependent" refers to a parameter or attribute value that has a semantic meaning which may vary with the type of physical device or because of other implementation constraints. The allowed range of variance for an implementation dependent feature is included with the discussion of that feature in this standard.
The physical embodiment of the Logical Device is not presumed by this standard. The Logical Device may be represented by a single physical device, or it could, in fact, be a subset of a single physical device comprising a number of independent Logical Devices. In the latter case, the viewing area (and other physical device resources) available to a particular Logical Device are but a fraction of the whole of the physical device. In either case, the view of the Logical Device as seen through ReGIS is that of a single, independent presentation entity having no effect on and not being affected by any other device.
3.1 Viewing Area Definition
The ReGIS Logical Device viewing area consists of a rectangular grid of a finite, possibly large, number of viewing points. Each viewing point is of finite area and is located at the intersection of the invisible lines of the two dimensional Cartesian coordinate grid. Usually, a viewing point is the smallest physical area with homogeneous structure that can be seen by the viewer. This viewing point corresponds to the smallest area which can be modified by the physical device.
This area has historically been referred to as the "screen." Because of the connotation of "video" in the use of the term "screen," modern practice uses the term "display surface." Both terms are used in this document. Mathematically, the display surface may be thought of as a set of viewing points such that the union of all viewing points completely covers the viewing area. A viewing point may also be referred to as a picture element or "pixel."
When the screen is rotated so that the image has its "normal" orientation, then the four edges of the rectangular screen are called the left, right, top and bottom edges. The terms horizontal and vertical are used to refer to pixel positions relative to these four sides. The position of each pixel on the screen is uniquely identified by the combination of two numbers which refer to the horizontal (or X) position and the vertical (or Y) position of the pixel. Using this, the pixel VP(X,Y) refers to the Viewing Point at the horizontal value denoted by the number X and at vertical value denoted by the number Y.
This model of addressing the view surface centers pixels on their enumerated coordinates. A different device model places pixels between coordinate values. Device implementors are allowed to exercise certain freedoms in mapping the coordinate enumeration scheme used by their devices to that of the ReGIS Logical Device. There are two important reasons for this:
The ReGIS Logical Device Addressing scheme will not always map one-for-one to the physical device space when device transporting S(A) transformations are invoked.
The ReGIS Logical Device addressing scheme does not map to all device technologies.
For example, stroke oriented devices have positioning increments, but no real pixels. Also, the underlying hardware of some devices may support the pixel-interval model as opposed to the pixel-centered model, and do so in a way that precludes the pixel-centered model from being accurately supported.
Conforming software must not depend on pixel level access to a ReGIS device.
Using ReGIS instructions, the user defines the possible range of values of X and Y by identifying the numeric values which are taken on by X and Y at the four edges. Without loss of generality, these parameters may be assumed to be non-negative and directly define the following screen area parameters:
- SYT - Value of the Y-position at the top of the screen area
- SYB - Value of the Y-position at the bottom of the screen area
- SXL - Value of X at the left edge
- SXR - Value of X at the right edge
If they are all of integer value, these parameters define the total number of usable horizontal and vertical positions. These totals are represented as follows:
SXN = abs(SXR-SXL)+1
= the number of horizontal screen positions
SYN = abs(SYT-SYB)+1
= the number of vertical screen positions
STN = SXN * SYN
= the total number of unique screen positions (number of
pixels)
The ReGIS Base Logical Device is ignorant of the real physical size of a pixel. This accommodates most low resolution graphic devices which have no controllable pixel size, as in the case of raster CRT, stroke CRT, and storage CRT devices. Other devices must define default values of physical pixel sizes from the given data while determining the resolution of the original device. This may be determined by the parameters described above. The concept of physical measure is covered in Extensions to Base ReGIS under subheadings 8.6 The Extended Logical Graphics Device, 8.7 Required Extensions for Raster Devices, and 8.8 Open Extensions to ReGIS.
The parameter SXR is not necessarily greater than SXL and similarly, SYT is not necessarily larger than SYB. To define the ReGIS instructions in terms of the logical device, is necessary to be able to identify the pixels which are above, below, to the left and to the right of a given pixel, in terms of the user supplied screen coordinate definition. This is accomplished by the X,Y screen increments SXINC and SYINC which are defined as follows:
SXINC = SGN(SXR,SXL)
SYINC = SGN(SYB,SYT)
where SGN( ) is the function returning the sign of the difference of the two arguments. By this convention:
- VP(X+SXINC,Y) is to the right of VP(X,Y),
- VP(X-SXINC,Y) is to the left of VP(X,Y),
- VP(X,Y+SYINC) is below VP(X,Y), and
- VP(X,Y-SYINC) is above VP(X,Y).
3.2 Viewing Point Attributes
Each viewing point generally has background intensity and foreground intensity attributes as well as a foreground/background selector attribute. They are defined in the following paragraphs. Each pixel has a background "intensity" value called the BI(X,Y). The semantic meaning of the word intensity is implementation dependent in the sense of psychophysical and photometric measurement units. For purposes of the Base Logical Device, intensity is defined simply as some visually discernible property of a viewing point; pixels with different intensity values are, by definition, distinguishable from each other. The Base ReGIS Logical Device is both color-blind and binary in terms of intensity attributes, so the possible values BI(X,Y) are either "off" or "on".
The foreground intensity attribute associated with the pixel at position X,Y is denoted by FI(X,Y) and in the Base Logical Device also has values of either "off" or "on". Because of the binary nature of the base device, the FI and BI quantities are redundant, but are included here for completeness since they will be needed in the definition of the Extended Logical Device.
This model does not elegantly accomodate devices with other than binary display states. In devices that do not have immediately differentiable foregrounds and backgrounds, such as multiplane raster bit map displays, an arbitrary distinction between foreground and background may be required. The accommodation chosen for ReGIS is to consider the background specifier as a secondary foreground. These issues are discussed further in the Raster Extensions.
Each viewing point has a foreground-background selector function denoted by FBS(X,Y,t), which has a binary value that may be a function of time. The FBS function for each VP(X,Y) selects whether the currently defined foreground or the currently defined background attribute is to be seen. Without loss of generality, the values of FBS are "F" (for foreground selection, also denoted by the binary value "1") and "B" (for background selection, also denoted by the binary value "0"). In the base logical device, the value of BI(X,Y) is "off" for all (X,Y) and the value of FI(X,Y) is "on" for all (X,Y). Then the set of all VP(X,Y) for which FBS(X,Y) has value "F" ("1") is visually discernible since it is imposed on a background of different, and uniform, intensity.
3.3 General Drawing Process
Generating an image on the logical device (as distinguished from defining the image) involves executing a sequence of instructions to modify the FBS values for a selected subset of (X,Y) values. The sequence of instruction execution is important in ReGIS. The general procedure for generating a ReGIS logical image is as follows:
Set up the viewing area parameters using the Screen control command, S(A[][]).
Erase the viewing area using the S(E) command.
Identify a sequence of (X,Y) positions and change the FBS for each of these pixels using the Position and Write control commands and the action commands for Vector, Curve, and Text.
An image may be modified by repeating step 3. A new image may be drawn by repeating from step 2. A new drawing session may be repeated from step 1. Note that step 1 should result in a screen erasure, since step 2 follows it. This serves to preclude pictures with conflicting definition attributes, such as expected display size or orientation, from being shown together. Also, it is consistent with the description of the screen setup command, which cautions that the state of an existing image is not guaranteed across a screen setup operation.
4 ReGIS General Syntax
This section discusses the general syntax and some aspects of the semantics of ReGIS. This discussion applies not only to the Base ReGIS instructions discussed under heading 8.5, but also provides the general framework for extending ReGIS in a backward and forward compatible way.
4.1 Alphabet
ReGIS is based on the ASCII character set (and includes assignment of some national use positions from that code table). Columns 2 through 5 of the ASCII Code Table contain all the characters needed to express all the constructs of ReGIS.
The description of ReGIS is in terms of characters, not their encoding. It is presumed that all Digital systems support ASCII as their standard character encoding. However, there is nothing which precludes ReGIS from being transported in foreign codes, such as EBCDIC, as long as all the desired descriptive characters can be expressed in the chosen code. The user alphabet may differ from the required ReGIS alphabet since any characters are allowable within quoted strings. Transporting such use is in the hands of the users.
The ReGIS command alphabet consists of the following characters:
Letters: A,B,...,Z
Digits: 0,1,...,9
Punctuation: [ ] , ; . ( ) ' " : @ + - =
Any and all extensions to ReGIS must conform to these alphabet selection criteria. In addition, the following alphabet conventions apply.
Lower case letters a, b, ... z may be used but are treated as upper case letters when used outside of quoted strings.
The parenthesis characters "(" and ")" are reserved for option sequences (outside of quoted strings).
The bracket characters "[" and "]" are reserved for position and extent arguments (outside of quoted strings).
Single and double quote characters ("'" and '"') are reserved for delimiting literal string arguments.
The semicolon character ";" is reserved for use as an instruction separator. The occurrence of the ";" character always terminates an instruction, even if the instruction arguments are incomplete or nesting levels remain pending. The only exception is that the ";" character does not terminate a quoted string construction, and may be included within the quoted string as a literal character. Synchronization should be considered a "recovery" mechanism which, while returning the parser to a known state, does not guarantee how much of the command currently being parsed has been or will be executed. Refer to subheading 8.4.2 General Grammar for elaboration of this point.
A ";" does not terminate macrograph storage operations, because such storage definitions are not "instructions," but are extra-syntactic operations.
The "at" character "@" is reserved for use by macrograph strings and is not used in any other context, outside of quoted strings. Within quoted strings, the "@" character is treated as a literal character. There is no ability to expand macrographs within quoted strings.
The comma character "," serves as an argument separator. The comma always terminates the parsing of a multicharacter token, except within a quoted string, where it is treated as a literal character. The comma is needed to separate the X and Y parts of a position argument, consecutive numeric arguments to the alphabet character Load command, and the option letter "E" from any preceding numeric reference in which exponential notation might be used. The comma is legal between any other paired tokens without affecting the syntactic state, unless otherwise noted in this standard.
The blank (space) character " " is ignored outside of quoted strings and does NOT serve as an argument separator. Spaces are treated as control characters and may be included anywhere within the data stream without effect, except within quoted strings.
ASCII control characters and similar communications line control and device control characters are ignored in ReGIS and are allowable anywhere without affecting the interpretation process, except within quoted strings, where a specified subset of the control characters apply.
4.2 General Grammar
A ReGIS image definition consists of an arbitrary length sequence of instructions that may or may not be separated by commas or semicolons. Any character other than a defined command keyletter is ignored. By this rule, an unattached ReGIS argument (one not logically coupled to a command key letter) is ignored without effect. Therefore, unattached quoted strings can be used to "comment" ReGIS instruction streams or files. The proper way to "unattach" an argument is to precede it with a semicolon. The semicolon terminates any outstanding keyletter, and the following argument is ignored as having no context.
A ReGIS instruction consists of a keyletter followed by an argument list. ReGIS can encode up to 26 different instructions. Only eight keyletters are used in the ReGIS Base allowing considerable room for extension. See subhead 8.1.8 ReGIS Overview.
An instruction argument list consists of an arbitrary number of four argument types arranged in an arbitrary syntactic order. Semantically, all instructions and instruction arguments are assumed to be executed in the "left-to-right" order they are received. ReGIS syntax does not require that instruction arguments be received in any particular order by type. It is the semantics of a given command which will determine the sense of intermixed argument types.
Actions take effect when enough characters have been received to sufficiently specify an action. A drawing action, for example, will usually commence, or continue, upon receipt of a closing bracket (]) of a position argument, indicating that the given position specification is complete. Unless there is a specific need for further information (as would be the case in a curve interpolation sequence), drawing can occur regardless of whether more point specifiers are being sent as arguments to the current command. Similarly, characters received as part of a quoted string argument to a Text command can usually be displayed as received, without waiting for the string to be terminated.
Actions involving potentially interacting argument types, may have to be buffered before "enough" information can be identified. This will often be the case where arguments to option commands are involved. Most option commands set state, as opposed to generating visible output. Where an action (such as output) does occur, it is often modified by state elements that are other arguments to the same option. For example, the Raster ReGIS command to dump the screen bitmap to a printer is, most simply, S(H). The option specifier (H) may, however, include suboption specifiers to indicate the offset of the image when printed, such as
S(H(P[10,50]))
or arguments to indicate the exact portion of the display to be dumped, such as
S(H[100,250][600,400]).
The complete command might be
S(H(P[10,50])[100,250][600,440])
or the equally valid combination
S(H[100,250][600,440](P[10,50])).
No action should be taken on the occurrence of an option keyletter alone until it is seen to have no subarguments that would modify such action.
In the case of most command options, the entire option must be parsed to identify the complete intent of the command. Syntactically, arguments of the four types could follow the H option indefinitely. The terminating condition must therefore be some indication that no further option arguments can apply to the option letter in question. This indication may be any one of the following:
The matching right parenthesis that closes the left parenthesis that initiated the current option level is encountered.
This is the means by which the example above was closed. Subsequent arguments apply to the S command, and a new keyletter is interpreted at command level.
A new option keyletter is seen at the same level at which the current option keyletter is in force.
Thus the X in
S(H[100,250][600,440](P[10,50])X)indicates that the (H) option is complete, and any buffered state may be applied to its execution. The new option indicated by X need not be semantically significant in the context in question; it is its syntactic presence which serves to delimit.
The ReGIS implementation resumes parsing at that character, so the character is doubly parsed: once as a syntactic delimiter, secondly for its semantic meaning. Parsing resumes at the option level to the S command.
The synchronizing semicolon is encountered.
In the command stream
S(H[100,250][600,440](P[10,50];the semicolon indicates that the entire parser nesting is to be popped. As shown, this represents popping two levels of options, since the suboption P was not closed. There is no command keyletter in force after this action, and any following arguments will be parsed as unattached.
The visible actions which derive from this synchronizing action are not always clear, however. In general, any state-saving actions are performed as necessary, but the actions conditioned by this state cannot be guaranteed to occur. In the example above, the offset definition implied by the suboption P[10,50] would likely be saved since it is a state definition action, and does not initiate a drawing or communication action. The synchronizing action would prevent the actual image dump from occurring. Also, the image extents would not be saved, since they are specified to be volatile settings, and the next S(H...) operation would cause them to be reset to defaults.
Use of the semicolon should be viewed as a syntactic recovery operation, not a semantic terminating operation, except as may be noted in specific exceptions in this standard. Refer to the terminating condition to the Load alphabet command.
It is NOT necessary or expected that exiting the ReGIS environment and reentering it via the resynchronizing entry will have the same effect as as encountering a resynchronizing semicolon. The semicolon and environmental resynchronizations are two separate schemes; they are not meant to be interchangeable.
Environmental resynchronization will force resynchronization even from within a quoted string argument or a macrograph definition. Semicolon resynchronization can do neither of these.
The actions described above show an entity is not complete until it is delimited. Such delimiting may be explicit, as with the closing quote of a quoted extent, or it may be implicit, being terminated by a character of a type not valid for the token in question. This is illustrated by the parsing numeric of values. In the command
T(S1D90A2)
the parsing of the values 1, 90, and 2 is terminated upon the characters "D", "A", and ")", respectively.
In some cases, command parsing may have to be "batched" for good visual effect. Commands which change an output map, for example, may be deferred until all such updates are received, or their option string is terminated. This may be required to prevent undesirable flashing of the image were updates to be received and made piecemeal. Some batched parsings are defined in this standard. Implementations that extend such batchings must clearly state this in their product documentation.
Any decision to implement batching of output may not restrict function otherwise defined in this standard. For example, curve interpolation in ReGIS places no bounds on the number of intermediate points which may be specified as part of the curve definition. An implementation which batches the interpretation of such curve rendering must still support an unbounded number of points.
4.3 Argument Types
The following describes the syntax for each of the argument types.
4.3.1 Bracketed Coordinate Specifier
A sequence of characters enclosed in the bracket characters ([]) refers to an (X,Y) position argument or increment. The contents of a bracketed extent are always numeric and there is no nesting of brackets. Any non-numeric character other than a comma encountered within a bracketed position argument causes the part (x value or y value) being decoded to be terminated and interpreted as not present. If more than two parts are encountered within one pair of brackets (that is, more than one comma is present), only the first two parts are accepted; the third and any subsequent parts are ignored. See subheading 8.4.3.3 Numerics.
4.3.2 Quoted Strings
A sequence of characters beginning with the single quote character (') or the double quote character (") and ending with a quote character of the same type is a text string and treated as a single argument. The contents of a quoted string are entirely arbitrary. Once the opening delimiter is seen, all following characters are interpreted literally until the string is terminated by the matching quote character.
ReGIS allows 8-bit encoding of character arguments within quoted strings. Legal character codes are 2/0 through 7/15, and 10/0 through 15/15 (two 96 character sets, 192 characters total). The accessibility of codes 7/15 and 15/15 is not guaranteed because of their interpretation as control characters in some environments. Provision for them must be made in alphabet storage, however.
The quote characters themselves are not part of the text string; a string which is introduced by a quote of one type is not terminated by a quote of the opposite type. Therefore, a quote of one type can be included in a string by using the quote character of the other type as the string delimiter.
Should it be required to include a quote character of a given type within a string delimited by quotes of the same type, the target quote character must be doubled, that is, repeated in place without any intervening characters. For example,
- "A" encodes the string A
- '"' encodes the string "
- "'" encodes the string '
- 'a''C' encodes the string a'C
- '''' encodes the string '
- "A'""B" encodes the string A'"B
- "" encodes the empty string
ReGIS instructions may have multiple string arguments. Consider, however, that if 'ABC' and 'DEF' are two consecutive string arguments, then the resulting structure is 'ABC''DEF', which will be treated by ReGIS as the single string ABC'DEF. This undesired result is avoided by separating possible consecutive string arguments with the comma character.
A potential ambiguity arises in the case of doubled quotes separated by control characters. Outside of quoted strings, all control characters and SPACE are treated as "no character" by ReGIS. Within quoted strings used as arguments to the Text command, the controls BACKSPACE, CARRIAGE RETURN, LINE FEED, HORIZONTAL TAB, and SPACE have meaning.
Should paired quotes within a set of paired quotes be separated by BS, CR, LF, HT, or SP, then they are NOT considered doubled, and two quoted arguments are recognized as if they had been separated by a comma. When separated by other controls, these controls are interpreted as "no character" and the quotes are considered doubled, forcing the inclusion of one of the quotes in the string argument. Hence, if in the command stream
T"text"<>"moretext"
the token <> were replaced by one of SP, BS, HT, LF, or CR, then an equivalent command stream would be
T"textmoretext"
because of the resulting doubled quote. Were <> to be replaced by any other control, an equivalent command stream would be
T"text""moretext"
resulting in the effective text argument
text"moretext.
Were <> to be replaced by a macrograph definition (which is specified not to disturb the state of the parser, but which is not allowed within quoted strings), the quotes are NOT doubled. The result is, again, as if the two quoted extents were separated by a comma. The macrograph definition would succeed, but would have the side effect of acting like a supported control character.
4.3.3 Numerics
Digit characters represent either numbers or sequences of arguments where each argument is a single digit character. The distinction between such uses is semantic, not syntactic and is distinguished by context. The ReGIS grammar allows numeric information to be skipped when the context is not known to an implementation. Digit strings may have semantic meaning as numbers, and integer, fixed point, floating point, and scientific notation formats are accepted.
The allowable alphabet for numeric representation is composed as follows:
Digits zero through nine
Plus and minus signs
Decimal point
The letter "E" or "e", for scientific notation
The composition of these elements into numbers is by common rules. A simple BNF-like expression of the allowed format for these numbers is
<number> ::= [+|-] <unsgnreal> [<exponent>]
<unsgnreal> ::= <digits>* [.] <digits>+
| <digits>+ [.] <digits>*
<exponent> ::= E[+|-]<digits>+
In this expression format, "|" means OR, "::=" means production, "<token>*" means zero or more instances of <token>, "<token>+" means one or more instances of <token>, and [] enclose optional constructs. In words, this means that a number consists of:
A string of one or more digits, with an optional decimal point placed either before, after, or within the string, this string being
optionally preceded by a single sign character, AND
optionally followed by an exponent comprising
the letter "e" (upper or lower case),
followed by a string of one or more digits, optionally signed.
Any character other than those noted as legal numerics terminates the scan, and the accumulated numeric extent is taken as complete.
The character causing the termination is rescanned as part of the next token following the number. Consecutive numeric arguments must be separated by commas to ensure proper decoding.
The results of encountering an apparent numeric which violates the above grammar (such as having more than one sign character, more than one decimal point, a sign character or decimal point with no digits, or more than one exponentiation operator (E) within a single numeric token) are not specified in this standard, and such occurrences must be considered an error with device-dependent recovery.
The inclusion of the letter "E" in the numeric alphabet may create ambiguity in certain instances of consecutive arguments. The construct X(Y1E2) could be a legal specification of the (hypothetical) X command with quantified options Y and E, having values 1 and 2, respectively. Because of the use of the letter "E", the above construct could also be interpreted as the X command with a quantified option of Y with a value of 1e2, or 100. A ReGIS interpreter must always interpret the letter "E" numerically where such use is conceivable in context.
Hence, as shown, the interpretation of (Y1E2) would be as (Y100). Note that (Y1E2E3) would have to be interpreted as (Y100,E3), since the numeric grammar precludes the interpretation of a second exponentiation operator in a single numeric.
ReGIS generators must always precede the "E" character with the option-separating comma when there is any chance of a semantic error.
Where digit strings are used as pixel vectors described under subheading 8.4.5.3 Pixel Vectors, the sign characters and the decimal point are ignored without effect, and the interpretation of the digits takes place normally. Any other character terminates the digit string scan, and the scan state changes to that indicated by the non-digit character. This is also true of the letter "E", which, although normally valid in numerics as an exponentiation operator, must be interpreted as a keyletter at the current option level.
4.3.3.1 Dynamic Range and Precision
Implementations are not required to USE any fractional part of a completely decoded numeric. However, all implementations must RECOGNIZE when fractions occur, and not truncate to integers until the number is COMPLETELY parsed and decoded. In particular, exponential format numbers may have a fractional part and yet resolve to an integer. The format 1.02e2 must resolve to 102, not 100.
The need for proper decoding of values expressed using negative exponents is less clear. For example, the form 100000e-3 resolves to 100, but the 100,000 part would overflow the integer precision of many implementations. Thus, the goal of interpreting exponential formats is targeted toward the use of exponentials that resolve into the supported integer range of most devices, and the use of large negative exponents in such forms is deprecated.
All implementations must support signed integer arithmetic in a range no less than -32767 to +32767, that is, sixteen bits of 1's or 2's complement expression.
4.3.3.2 Numeric Format Violation
The numeric arguments for the Load character cell command (not a part of Base ReGIS) operate somewhat in violation of the above rules. The Load command uses a potentially variable radix for specifying character masks, and typically uses hexadecimal. In this case the characters a through f (and A through F) are not keyletters, but numerics. Hence, implementations should recognize the L command as a special case, and, if it is not supported, enter a special skip state to wait for the next synchronizing semicolon, which is required to terminate the Load command.
4.3.4 Options
Sequences of characters enclosed within the parenthesis characters "(" and ")" represent instruction options. The syntax of each option is the same as the syntax of a ReGIS instruction, including the four argument types. The option syntax is thus fully recursive, allowing theoretically infinite extensibility of ReGIS semantics. The components of all the arguments types are the same within options as they are at the command level.
For readability, options, also called sub-instructions, may be separated by comma characters but not by the semicolon character. The semicolon character terminates the instruction to the highest level.
ReGIS interpreters must be prepared to accept recursion of options to at least six levels. A conforming ReGIS generator must not exceed this level of recursion. Recovery from an attempt to exceed allowable recursion depth is to the highest command level, just as if a semicolon character had been encountered.
The hypothetical command
X(A(B(C(D(E(F))))))
represents the deepest legal nesting of option levels. Any argument type applied to suboption letter "F" other than another option level would be properly interpreted. Suboption "E" could legally accept other suboptions, as well.
Unless otherwise specified in the body of the option description, option settings are modal, that is, they represent a change of state which is maintained across commands until explicitly changed by resetting the option or by the side effect of another action. Coloquially, such options are referred to as "sticky".
Some options, particularly in the Curve instruction and all of the temporary Write options, are "volatile." They remain in effect only for the duration of the command in process. These options revert to their default state (or to their previous modal state, if applicable) when a new command keyletter or a synchronization operation is processed.
All commands whose actions reference state set by the Write options command, W, may include W as an option, and may set any W-settable state for the duration of that command. The W-state previously in force (set by a W at the top command level) is saved when the option W is encountered, and is restored when the current command is terminated by synchronization or the occurrence of a command keyletter. Such option level state is always volatile.
4.4 Macrograph Strings
The concept of the macrograph is derived from the assembly language programming construct of macro instructions (macros). The macrograph facility is "extra-syntactic."
Macrograph strings provide the ability for commonly used character sequences to be stored in the graphics device and then referred to, repeatedly if necessary, in the sequence of instruction execution. This facility reduces the number of characters that must be transmitted over the communications interface. For example, if the image being drawn is a sheet of music, each of the different types of notes could be defined in a macrograph; they could then be referred to by name rather than by content. The result can be a significant reduction of communications overhead without substantially reducing image definition readability. In some cases, readability may even be improved by such compaction.
Macrograph strings are "extra-syntactic" in that they conform to a grammar built on top of the ReGIS general grammar. Therefore, macrograph definitions may take place anywhere in a ReGIS command stream without affecting the state of the ReGIS parser. A macrograph definition may even occur within the extent of a numeric argument without adversely affecting the interpretation of that numeric value.
Because of the co-precedence of quoted string extents and macrograph transactions, however, neither macrograph definition nor expansion may take place within a quoted string. Similarly, a quoted string within a macrograph definition is not treated as a quoted string until the macrograph is invoked.
A macrograph invocation affects the state of the parser only insofar as it provides a different character input path. In the process of parsing ReGIS instructions, the detection of a macrograph string reference causes the characters previously defined for that macrograph to be substituted for the string reference characters. In the general case, a macrograph string may be just an argument of an instruction (such as a position argument) or may even be a piece of an argument (such as an argument to a sub-instruction or one element or part of an element in a coordinate pair).
All operations relating to macrographs are initiated by the "at" character "@". Altogether 26 macrograph strings can be defined, each identified by a single letter of the alphabet. Lower-case letters are converted to upper-case for the purpose of macrograph string identification.
The entire set of macrograph strings is cleared by the character sequence "@." ("at" followed by period). The operation of clearing a macrograph causes the string to consist of no characters (the empty string). The default content of all macrographs is the empty string.
An attempt to execute the global clear (@.) from within a macrograph is an error. Determination of and recovery from this error is not specified in this standard.
A macrograph string is defined by the sequence
@:<letter><string>@;
where <letter> refers to any alphabetic character, and <string> is any sequence of characters not containing "@;" or "@:". The sequence "@:" (colon) is called the macrograph definition initiator. The sequence "@;" (semicolon) is called the macrograph definition terminator.
Neither a macrograph clear nor a macrograph definition affects the state of the ReGIS interpreter. A macrograph definition may occur at any point in the ReGIS instruction stream, between keyletters and arguments, between arguments, or within an argument, without affecting the interpretation of of the ReGIS stream. Macrograph invocation, on the other hand, causes previously stored pieces of the ReGIS stream to be inserted into the interpreted stream, in a manner indistinguishable from non-macrograph ReGIS.
A macrograph string is invoked by the sequence
@<letter>
where <letter> is one of the names given a previously defined macrograph. Such a sequence may appear anywhere in a sequence of ReGIS instructions, except within a quoted string. Macrographs cannot be expanded from within quoted strings.
A macrograph string cannot contain the definition of another macrograph string. Determination of and recovery from this error is not specified in this standard.
A macrograph string may include invocations of other macrograph strings, but a macrograph string must not invoke itself either directly or indirectly. There are no conditional execution controls in ReGIS, therefore there is no termination mechanism for recursive invocation. Determination of and recovery from this error is not specified in this standard.
Once defined, a macrograph may not be extended. The first action taken upon the occurrence of a macrograph definition initiator must be to clear the contents of the specified macrograph.
A single macrograph string may be of any length from no characters up to the defined storage limit of the ReGIS device, thereby excluding all other macrographs from use. Conforming implementations must provide for no less than 4000 characters of macrograph storage. User attempts to exceed the macrograph storage capacity will "fail soft" with the following results:
No other macrographs already stored will be affected.
Any part of the macrograph string being stored which is already stored will remain stored.
The remainder of the attempted definition will be discarded, but the definition will terminate "normally" upon the next occurrence of the macrograph definition terminator, and there will be no effect on the command state of the ReGIS interpreter.
4.5 Position Arguments
ReGIS maintains a current drawing position. This means that each graphics primitive starts at the "position" left by the previous operation. Vector commands, for example, have an implicit start point, and only a single argument (the other end point) is required to specify a line. The effect of any command upon the current position is described with the definition of that command.
ReGIS implementations may, at their option, provide a visible cursor which tracks the current drawing position. This standard neither specifies nor precludes such a feature.
ReGIS provides two syntactic structures for the definition of drawing positions: (X,Y) coordinates and pixel vectors. The (X,Y) coordinate structure is the traditional system of defining positions. It specifies two numbers separated by a comma, with a semantic extension which allows absolute and relative coordinates to be distinguishable in context, thus eliminating the need to have separate relative and absolute instructions or options. Pixel vectors correspond to the "chain encoding" technique used to drive many incremental plotting devices.
4.5.1 Position Argument
A position argument is delimited by a pair of left/right square brackets, both of which must be present. A position argument consists of an x-position part and a y-position part, either or both of which may be missing. The x part precedes the y part. Each component is made up of numbers, following the rules for numbers as standalone arguments. The y part, if present, is separated from the x part by a comma. See subheading 8.4.3.4 Numerics.
Each coordinate part consists of a number possibly preceded by a plus or minus sign ("+" or "-"). If a coordinate part is not preceded by a sign character, that argument represents an absolute coordinate; the value of the coordinate part is the new number, irrespective of the value of the current drawing position. If a coordinate part is preceded by a sign character, then that part is evaluated relative to the current drawing position value. A position argument may have one coordinate part as a relative specifier and the other coordinate part as an absolute specifier.
If a coordinate part is missing, that part is interpreted to mean +0, which is a relative specifier indicating a displacement of 0. Note that +0 is a different specifier from 0, which is an absolute specifier.
For each example below, assume the initial values of X and Y are 100 and 50 respectively.
| Position Spec | Effective Addr | ||
|---|---|---|---|
| [0,0] | 0 | 0 | |
| [30,23] | 30 | 23 | |
| [200] | 200 | 50 | (only X changed) |
| [,42] | 100 | 42 | (only Y changed) |
| [+10,-25] | 110 | 25 | (relative change) |
| [0,+10] | 0 | 60 | (combination relative and absolute change) |
| [15,20] | 15 | 20 | |
| [10,20][+5] | 15 | 20 | (multiple specifiers have cumulative action) |
4.5.2 Use of Bracketed Extents for Non-Positional Information
Some ReGIS commands are defined to use the square brackets to enclose non-positional information, as for specification of positional information not coupled to the current drawing position or to the imposed coordinate space in effect. Some uses are for expression of rectangular extent, others are for situations where "position-like" information is required.
The following uses of bracketed extent are non-positional.
In Base ReGIS:
S(A[][]) - The contents of the bracketed subarguments define the imposed address space. They have no dependence on current position, and signed values are interpreted as absolutes. Negative values for imposed coordinate space are not allowed. Missing values (fewer than two bracketed extents or unspecified values within the brackets) result in illegal specification.
T[] - Character escapement for the text command is measured in the imposed coordinate space, but these values are always interpreted as relative to the current position, even if the provided values are unsigned. Omitted values are interpreted as spacing of +0.
In Raster extentions to ReGIS:
T(M[]) - The storage cell multiplier is not positional, but the two elements are an ordered pair of multipliers.
T(U[]) and T(S[]) - The Unit and Display sizes of character cells are measured in the imposed coordinate space, but do not relate to current position. Missing values default to values associated with standard size characters.
L[] - The storage size of a character is measured in technology-dependent units, usually bits of storage. There is no association with current position; missing values are interpreted as 0.
In Open extentions to ReGIS:
S(H(P[])) - The hard-copy offset is not coupled to current position. Its relationship to the imposed coordinate space is implementation- and retransmission protocol- dependent. Missing values are interpreted as 0. The bracketed arguments to the H option itself ARE positional, do relate to the imposed coordinate space, and may be expressed in terms of the current position.
4.5.3 Pixel Vectors
A pixel vector is represented by a single digit character in the range of 0 to 7. Each of these numbers refers to one of the eight pixel neighbors relative to the current position. As illustrated in Figure 8-2, pixel vector number 0 refers to the right, pixel vector number 1 refers to the pixel up and to the right, and so forth around a circle in a counter-clockwise direction. These directions are constant, and are not affected by the display surface orientation set by the Screen address setup command S(A[][]). That is, pixel vector 0 is always to the right, even if the +X direction has been defined to be to the left.
The character sequence 2057 refers to a sequence of four pixel vectors and not to the number two thousand fifty seven.
Pixel vectors allow only relative positioning and not absolute positioning.
The default size of a pixel vector is the unit integer size defined by the screen coordinate setup operation, S(A[][]). This length is modifiable by a multiplicative factor specified in the writing attributes instruction. Scaling of horizontal and vertical components of the pixel vector is isotropic, that is, an increment of distance in X is taken to be the same distance as that increment in Y.
Depending on the granularity of the unit pixel size defined by the screen coordinate setup operation, the exact position after executing a sequence of pixel vectors is subject to roundoff error and thus pixel vector positioning sequences should be broken occasionally by absolute positioning, or by position reports.
For the examples which follow, assume that the ReGIS coordinate space has been set with an upper left origin, and that initial values of X and Y are 100 and 50, respectively.
| Multiplier | Pixel string | New (X,Y) Value | |
|---|---|---|---|
| 1 | 0 | 101 | 50 |
| 1 | 1 | 101 | 49 |
| 1 | 0002 | 103 | 49 |
| (any) | 01234567 | 100 | 50 |
| 5 | 667 | 105 | 65 |
| 23 | 5 | 77 | 73 |
| 1 | 0000000000 | 110 | 50 |
4.5.4 Position Stack
ReGIS provides for the current drawing position to be saved for use by commands which may follow in the command stream. The mechanism for such saving is a stack. A current drawing position can be saved by a "begin block" operation and later, after possibly several intervening position changes, the position can be restored to its old position by an "end block" operation.
The begin and end points are identified by option characters "B" and "E" in the option arguments of the drawing and positioning instructions which use the block structure.
There is only one stack on which positions are saved, and only the Vector and Position instructions have access to this stack. The Curve instruction does NOT use this stack, since the state required for curve maintenance is more complex than that of vectors and positions. Thus, an "end" reference in a vector instruction can cause a position saved by a "begin" operation in a position instruction to be returned.
ReGIS devices must provide a stack at least eight positions deep. While more depth may be provided by devices, conforming software should never assume more than eight entries.
Should stack capacity be exceeded during a save, the current element (the value for which the save failed) is not saved, but discarded.
Stack underflow will cause NO ELEMENT to be returned. NO ELEMENT is distinguished from an empty bracketed pair ([]) in that the former implies no argument present (as would be fetched from an empty macrograph), and the latter implies the use of current position for a position argument. In the case of a null argument to a Vector command, no drawing is done; in the case of an empty argument ([]), a single dot is drawn to indicate a line drawn from the current position to the current position.
4.6 Extensibility Requirements
The following notes give general requirements for extending ReGIS to take advantage of device specific characteristics:
The ReGIS syntax of keyletter and four defined argument types is fixed and will not be extended. New features must be added to ReGIS by assigning meaning to previously unassigned keyletters, or by assigning semantic meaning to previously unspecified keyletter/argument combinations, such as by adding options to existing instructions.
A new instruction type shall be added to ReGIS only if:
The new operation cannot be conveniently or efficiently performed by a sequence of existing ReGIS instructions, and
The designer can ensure a minimal loss of information content when the new instruction is ignored by a ReGIS device which does not implement the instruction.
By this reasoning, new instruction types must minimize side effects of state to the greatest degree possible. For example, no command not already defined shall affect the drawing position, as this element of state is critical to the basic drawing process, and commands unknown to older implementations could not possibly be accommodated if such changes were to occur.
Extensions must be unique. The same command semantics must not be used to specify different effects on different types of devices, except where the differing effects are closely related and controlled by a mode setting. (Refer to the two modes of on-screen data movement and the S(D) switch as an example.)
ReGIS shall not be extended beyond its intended range of applicability as outlined under heading 8.2 ReGIS Philosophy.
Extensions will be registered via Engineering Change Orders (ECOs) to this document, either as additions to existing chapters, new chapters, or in appendices, as appropriate to the meaning and classification of the extension.
5 Base ReGIS Instructions
This section details the semantics of the eight Base ReGIS instructions.
5.1 Screen Instruction
The screen instruction, keyletter "S", controls screen coordinate parameters and attributes which affect the entire viewing area. In the ReGIS Base, this instruction includes clearing the screen area, setting the coordinate system to be used, and making adjustments to device specific parameters.
5.1.1 Position Arguments
There is no significance to bracketed position arguments to the S command in Base ReGIS.
5.1.2 Numeric Arguments
There is no significance to numeric arguments to the S command in Base ReGIS.
5.1.3 Quoted String Arguments
There is no significance to quoted string arguments to the S command in Base ReGIS.
5.1.4 Options
5.1.4.1 S(A[][]) - Screen Address definition
The screen coordinate definition option allows the user to define the coordinate range to be used in position arguments. In the absence of this command, the default device coordinate range will be in effect. The implementation default is not standardized, and may or may not, at the implementor's option, reflect the actual physical resolution of the device. Throughout this document, the coordinate space defined by the last effective S(A[][]) command is referred to as the "imposed" coordinate space.
The screen definition option has two position arguments. These specify the user-defined coordinates of the upper left and the lower right corner of the viewing area rectangle, respectively.
If fewer than two address specifiers are given in the S(A[][]) command, or if the specified address space would require absolute negative coordinate values to be properly referenced, the command is ignored and the address space previously in effect shall be maintained.
If more than two address specifiers are given in the S(A[][]) command, just the first two are used, the remainder are ignored. Missing elements inside the brackets cause the command to be ignored. As described under heading 8.3 Base Logical Graphic Device, this will be sufficient information for the device to set up appropriate scaling functions for most other address-related device features. In particular, the default length of the pixel vector is taken to be equal to 1.0 unit as defined by the values of the addresses of the corners specified in the S(A[][]). Other side effects of this operation are listed at the end of this discussion.
The screen coordinate option is not meant to be used as a viewing or image transformation. That is, it shall not be used to define a coordinate system which "makes sense" for the user's specific problem. Such transformations are more appropriately accomplished with higher level software. The option is to provide a mechanism for transporting image definitions from one device to another, while ensuring that the maximum capability of a device is usable in the simplest cases.
The state of any image existing in the display need not be guaranteed when an S(A[][]) is executed. In particular, devices may perform a new frame or screen clear action if that is required to support a new imposed coordinate range. Applications should still send the S(E) command before beginning to draw. Not doing so could produce undesirable side effects.
5.1.4.1.1 Mandatory Arithmetic Range
The screen address setup applies to the orientation and magnitude of the Cartesian (bracketed) coordinate specifications of addressing the display surface. Left and right, up and down, clockwise and counterclockwise describe the user's view of the display in its normal orientation. As described earlier, pixel vector orientation is always 0 to the right, 2 up, 4 left, and 6 down, with the odd numbers diagonally in between. The default direction for text is left to right along the baseline; down is the direction below the baseline. Thus, an attempt to reflect an image in its totality merely by inverting the X address space (as to implement rear projection video, for example) will likely fail.
Though the screen addressing limits specified in the S(A[][]) command will normally cover the desired range of device addresses, use of values outside this range may be desirable. ReGIS devices must properly interpret addresses beyond the "edges" so defined to at least twice the defined extent of the display. Such legal use is positioning the center of an arc outside the display, even though the entire arc drawn is within the viewing area.
Since ReGIS implementations may provide for as little as sixteen bits of integer arithmetic precision, the effect of the two bit "guard band" on off-screen addressing is that the largest guaranteed value for on-screen addressing is 16383, or (2**14)-1.
The command
S(A[0,0][1000,750])
defines a display extent 1000 by 750 units, with an upper-left corner origin. The legal addressing range must then be at least -1000 to +2000 in X, and -750 to +1500 in Y. This allows relative specifiers to access negative addresses, and off screen accesses to be recovered without special precautions. Figure 8-3 shows this positioning of address space.
Left and right margins shall not "wrap" immediately to one another, nor shall top and bottom. ReGIS generators should never expect to take advantage of such abnormal effects for defined purposes.
5.1.4.1.2 Accommodation of Shape
The region defined by the S(A[][]) is the "region of interest" of graphics output. It is device dependent as to whether all graphics output is limited to this area. For example, the area specified by S(A[][]) might not use the entire visible extent of the device, either because the device cannot adequately scale the range specified to the entire width and height of the display, or because the shape of the area specified does not exactly match the shape of the display. In such cases, it is the device's option as to whether graphics actions taken outside the range specified by S(A) are visible in this unmapped area.
Furthermore, it is left to the device to position the area represented by the S(A[][]) as it can within the visible display, with three constraints:
The shape (aspect ratio) implied by S(A[][]) must be maintained.
The command S(A[0,0][1000,750]) implies an area one and a third times as wide as it is tall. The area on the display to which the source address space is mapped must maintain this shape; if the target width is to be 768 units wide, for example, then the height must be 576 units tall.
All the area implied by the S(A[][]) must be visible in the target mapping.
In the case immediately above, if the available height of the display were only 480 units, so that the required 576 units would not fit, then the width used could not exceed 640 units, maintaining both shape and visible extent.
An implementation may elect to use an integral scaling to fit the requested coordinate space into the device space, but any such mapping must use at least half the visible extent of at least one of the horizontal and vertical extents of the available hardware.
Consider the cases as above, in which the requested space is 1000 by 750 units. If the target device has native addressing of 768 by 480, then incoming address values can be divided by two, and only 500 by 375 device addressing will be used. Note that if the requested address space were 1000 by 300, then dividing by two would use only 500 by 150 device units. While 150 is less than 1/3 the available vertical range, more than half of the horizontal range is used, meeting this requirement while maintaining the requested aspect ratio.
The placement of any subset range within the device space is left to the device implementor. Conforming software shall not depend upon a given alignment of requested space within device space, nor shall it depend upon the exact scale factor used to map the requested space to the device space. Figure 8-4 shows how a 1000 by 750 unit space could map into video- and page printer-like display spaces.
Within the constraints described above, a device is allowed to re-orient its display surface with respect to horizontal and vertical to better match an imposed address space, as long as all reorientation takes place as if the device were exactly a device of the assumed aspect ratio. In other words, "turning" the display surface horizontally or vertically to fit a particular graphic may be desirable.
The above action is not likely in an interactive video device, but may be useful in a hard-copy device, where the output is viewed out of the context of its generating hardware. For example, an 8 1/2 by 11 inch plotter best mimics the 4 to 3 aspect ratio of video when the long axis is the horizontal (landscape mode). However, if used to execute graphics for publication, the vertical may be the more natural long axis (portrait mode). The magnitude of the horizontal to vertical aspect ratio implied by the S(A[][]) relative to unity may be used to infer the utility of reorientation.
Each physical device has its own pixel and picture aspect ratios. The pixel aspect ratio is the ratio of the width to the height of the physical picture elements of the display. ReGIS expects the display medium to be isotropic (equal measure in the X and Y dimensions, that is, a perceived pixel aspect ratio of unity). The implementation must shield variations in pixel aspect ratio from the application; ReGIS provides no assistance.
5.1.4.1.3 Numeric Accuracy
Note that ReGIS allows numeric parameters to be given in integer, floating point, and scientific notation. The following two rules are guidelines to be used in determining the degree of fidelity necessary for different devices in implementing the numeric formats:
Low resolution devices are assumed to use integer numeric quantities only. However, low resolution devices must extract the integer portions of floating point and scientific notation number constants. Refer to subheading 8.4.3 Argument Types and subheading 8.4.3.3 Numerics for rules on numeric interpretation.
Allowing the truncation of numbers with fractional parts to the next lower integer numbers on low resolution devices precludes the use of the unit screen concept of fractional addressing.
High resolution devices are expected to use the entire resolution provided by floating point numbers. The fractional portion of numbers should not be ignored. These devices are expected to use a nearly exact coordinate transformation algorithm which loses little, if any, of the usable viewing area, subject to mismatches of imposed and available aspect ratios.
5.1.4.1.4 States Set to Default as a Side Effect of S(A[][])
The following states are set to the following default values whenever a valid S(A) is executed: A "valid" S(A) is one with two extent arguments, both of which are expressed in terms of non-negative imposed position values. The equivalent ReGIS command which would institute this setting is shown after the defined action.
Current position is set to [0,0] in the imposed coordinate space.
Equivalent explicit command: P[0,0]
The pixel vector multiplier is set to 1.
Equivalent explicit command: W(M1)
The line pattern is set to solid, and the line pattern element multiplier is set to 2.
Equivalent explicit command: W(P1), W(P(M2))
Text character escapement is set to rightward movement the width of one standard size 1 character cell, with device-optional extra intercharacter spacing, and no vertical movement. Vertical movement executed upon Line Feed is one standard size 1 character height downward, with device-optional extra downward interline spacing. Pixel vector character motion is always one-half a character extent.
Equivalent explicit command: T[<+w>,0] assuming X increases rightward (else use <-w>); w is not less than the width of a standard size 1 character
Equivalent explicit command: T[0,<+h>] assuming Y increases downward (else use <-h>); h is not less than the height of a standard size 1 character
Character set selection is returned to the default state for the device. This is normally ASCII in GL and the appropriate supplemental set in GR.
Equivalent explicit command: T(A(L"0B",R"1A"))
The macrograph store is not affected by executing an S(A).
5.1.4.2 S(E) - Screen Erase
The screen erase option initializes the display surface in preparation for a new image. The precise meaning of "erase" is device dependent, but generally has the connotation of creating a homogeneous visual image. In some systems, this operation is called "new frame."
S(E) clears the position stack (loaded by P(B/S) or V(B/S)). Shading state, a ReGIS extension set by W(S), is disabled on S(E).
5.1.4.3 S(F<integer>) - Feed medium
In hard-copy devices with movable media, this command causes a "sheet feed" or equivalent action to occur. The numeric argument to the F option indicates how many frames of the medium are to be advanced. The default value, 0, indicates that the medium is to be moved one frame only if some drawing action has occurred since the last S(F) or S(E) command. Devices which can recover media already advanced are allowed to implement negative values for this option. Negative values are interpreted as 0 in devices which cannot support negative values.
S(F) can be used as an "image complete" indicator for ReGIS interpreters, including both hard-copy devices and image conversion utilities. Systems which do not run interactively often need such an indicator to identify the end of the ReGIS stream, so that they may take further image processing action. S(F) does NOT imply image retransmission, as does S(H), and should be used at the end of any stored ReGIS file to indicate "image complete," even on files sent to interactive devices. ReGIS-based images intended for file storage should be terminated with S(F) to facilitate their handling in such environments.
5.2 Position Instruction
ReGIS assumes and uses the "current position" or "current drawing position" convention for determining where a drawing instruction starts its operation in the viewing area. A ReGIS device is required to maintain the value of an X and Y set of numbers, and these saved values are assumed always to be the starting point for a drawing operation. These values are updated to new values after each drawing operation. An example of the current value concept is the position of a drawing pen on a flat-bed plotter device.
The Position instruction, keyletter "P", changes the value of the current drawing position without drawing any visible image. One physical analog is the movement of the plotter pen with the pen up. ReGIS allows the drawing position to be moved on both absolute and relative bases.
5.2.1 Position Arguments
Position arguments to the position command cause the current drawing position to take on the value specified by the argument.
Multiple position arguments may be associated with a single Position command, or pixel vectors may be intermixed with position arguments. Each argument is executed in turn, providing cumulative results.
5.2.2 Numeric Arguments
Numeric arguments to the Position command are interpreted as single digit pixel vector specifiers. This supports programs which use "chain encoding" techniques and allows small relative changes in the drawing position. A sequence of pixel vector digits may be used, with accumulative results. The number of unit pixels actually moved for each digit is determined by the granularity (the unit distance) of the imposed coordinate space and the current pixel vector multiplier value as set by the writing options instruction.
5.2.3 Quoted String Arguments
There is no defined meaning for quoted text as an argument to the Position command in Base ReGIS.
5.2.4 Options
5.2.4.1 P(B), P(E), and P(S) - Position stack operations
The position begin and end options allow a simple means for recording a current position value and then recovering that value at some later point in the instruction stream. The P(B) option saves the current value of X and Y on the position stack. Should subsequent drawing or positioning instructions change the drawing position, execution of the P(E) option causes the drawing position to be restored to the saved value. This helps define images which are to have maximum transportability, since it allows accumulative roundoff errors to be occasionally eliminated, particularly in the case of text drawing which may be very roughly approximated on low resolution devices.
The construct P(S) is provided for symmetry with the V(S) and C(S) position constructs. P(S) saves a dummy entry on the position stack. This entry, when recovered by a P(E), performs no action beyond incrementing the stack pointer to pop the dummy entry. In this way, the same drawing positions will be visited by Position, Vector, and open Curve instructions executing the same parameter sequence.
The position stack is cleared to no entries on the execution of S(E) or when a valid S(A) is executed.
5.2.4.2 P(W) - temporary Write options
The W option to any of the drawing action commands temporarily changes the write attributes to the specified values for the extent of the instruction in which it occurs. Temporary write options revert to their previous state upon the occurrence of a new command keyletter (not necessarily different from the one in effect) or when the interpreter is brought to command level by synchronization, such as by encountering a semicolon.
Suboptions to the P(W()) form are the same as for the W() command itself. The only meaningful suboption in the context of the Position command is the pixel vector multiplier, that is, P(W(M<m>)).
5.3 Writing Attributes Instruction
The writing attributes instruction, keyletter "W", provides controls under which the image is to be drawn. In the ReGIS Base this includes the selection of line drawing patterns and the adjustment of pixel vector sizes. Extensions to ReGIS add controls for color, intensity, and drawing modes, among other features.
5.3.1 Position Arguments
There is no assigned meaning for bracketed position arguments to the Write attributes command in Base ReGIS.
5.3.2 Numeric Arguments
There is no assigned meaning for numeric arguments to the Write attributes command in Base ReGIS.
5.3.3 Quoted Text Arguments
There is no assigned meaning for quoted text arguments to the Write attributes command in Base ReGIS.
5.3.4 Options
5.3.4.1 W(M) - Pixel Vector Multiplier
The M option to the attributes command defines the pixel vector multiplier that apply to pixel vector arguments. These pixel vector arguments apply to the commands which interpret numeric arguments as addressing constructs. A numeric argument is a multiplicative scale factor to be applied to the default pixel size set by the S(A) command. It may be a floating point value in systems which support floating point arithmetic, but may be truncated to an integer in systems which do not. A value of 0 is taken to be 1. There is no upper bound on legal values for the numeric argument other than that imposed by the base arithmetic limits of the ReGIS interpreter (16 bit integer arithmetic).
The pixel vector multiplier is set to 1 when a valid S(A) is executed.
5.3.4.2 W(P<n>(<suboption>)) - line Pattern definition
The ReGIS Base does not require that devices draw in color or gray scale, as these attributes do not transport easily across devices. The Base ReGIS definition assumes that lines can be presented which differ by line style, that is, dashed, dotted, solid,and so on. There are ten predefined line drawing patterns, and ReGIS supports bit by bit definition of custom drawing patterns. A single digit argument to the P option selects a line style from the following list.
- P0 - no visible foreground image specified
- P1 - Solid line
- P2 - Dash pattern
- P3 - Dash dot pattern
- P4 - Dot pattern
- P5 - Dash dot dot pattern
- P6 - Sparse dot pattern
- P7 - Asymmetrical sparse dot pattern
- P8 - Sparse dash dot pattern
- P9 - Sparse dash dot pattern
P1 is the default line drawing style.
When the numeric argument is a string of binary digits (decimal ones and zeros), the argument represents a bit by bit definition of a custom pattern. Base ReGIS interprets the user defined pattern as a sequence of line segments based upon an alternating pattern of P0 and P1 line types. For example, the sequence
P111010
constructs a Dash Dot pattern similar to the P3 line type.
Digit arguments to the (P) option are treated individually. If a digit string consists entirely of ones and zeros, then it is interpreted as a binary pattern specification. Any other single digit specifies one of the line patterns 2 through 9 noted above. The last such digit in a sequence of digits selects the appropriate pattern.
These standard patterns 2 through 9 are represented in an eight bit pattern length as:
- 2 - 11110000 - Dash pattern
- 3 - 11100100 - Dash dot pattern
- 4 - 10101010 - Dot pattern
- 5 - 11101010 - Dash dot dot pattern
- 6 - 10001000 - Sparse dot pattern
- 7 - 10000100 - Asymmetric sparse dot pattern
- 8 - 11001000 - Sparse dash dot pattern
- 9 - 10000110 - Sparse dash dot pattern
The length of the units of the pattern elements is not specified, nor is the relationship of the lengths of the "dashes" and "dots." In raster devices, the unit dot may typically be the size of the physical pixel, but there is no requirement that this length be coupled to any absolutes of screen addressing. Therefore, only the "duty cycle" of the patterns, not their component lengths, is guaranteed by this standard.
Each device must have a certain repetition length for the line drawing patterns. This length is not standardized since a basic dot pattern will carry essentially the same information content independent of this repetition period. If the number of binary digits specified exceeds the implemented width <k>, then the implementor may choose to keep either the first <k> bits specified or the last <k> bits specified, at his option.
Conforming software should use only the standardized patterns (with multipliers to expand the distinguishable range of patterns) unless the details of the pattern register in the device being driven are known.
Patterns specified should repeat within the repetition length of the device. In this way predefined pattern P1 is identical to the custom pattern P1. The action taken by the device in repeating patterns not a submultiple of its internal pattern length is not specified.
The only defined suboption to the W(P()) command is M<m>, where the value <m> represents a multiplier to be applied to each element of the requested pattern, either predefined or custom. As noted above, the unit size of the pattern elements is not specified, but should be large enough to be easily distinguished, yet small enough to multiply well for scaled patterns. The multiplier value may be used to expand the pattern spacing, and thus achieve additional discernible line pattern types. Implementations must provide for multipliers as large as 16.
There is to be no interaction between the pixel vector multiplier specified by W(M<n>) and the pattern element multiplier W(P(M<m>)).
The line pattern is reset to solid and the pattern element multiplier is set to 2 when a valid S(A) is executed.
5.3.5 Writing Modes
As was noted at the start of this section, the only Writing Attributes required in Base ReGIS are those for the control of line pattern and pixel vector length. Extensions to ReGIS provide for other controls, among them the writing mode, that is, how new drawing actions affect the execution medium. Base ReGIS does not specify what writing mode must be present when these controls are not or cannot be implemented. The two most natural choices are either:
Overlay mode, the model that most closely resembles writing with pen on paper, or
Replace mode, a model which may be convenient for certain bitmap devices.
Refer to subheadings 8.7.2 Raster Extension and 8.7.2.4.1 Writing Attributes Extensions - Writing Mode Options. for a complete definition of writing modes. The guiding criterion to the device implementor is that visible output is generated.
5.4 Vector Instruction
The Vector instruction, keyletter "V", draws straight line segments connecting the current drawing position and one or more specified positions. It uses bracketed position arguments or pixel vectors.
5.4.1 Arguments
Semantically, the vector instruction is exactly the same as the Position instruction, with the exception that the V instruction can cause a visible image to be generated. The lines drawn by this instruction are subject to the current line drawing pattern selected by the W instruction and the pixel vectors drawn are subject to the current pixel vector multipliers selected by the W instruction.
The B and E options allow the user to define a closed polygon, though this is not the mechanism used in ReGIS to specify a filled polygon. Refer to the section on Position instruction options, and the section on the position stack, for detailed descriptions of the use of the B and E options.
The S option to the Vector instruction is included to provide symmetry with the open Curve instruction. An S option to a vector or position instruction saves a dummy entry on the position stack, consuming one entry of stack space. The matching E option to this S pops the dummy element from the stack without other effect. This dummy element will cause the same action as would be achieved by trying to pop from the empty stack, except that any data below the dummy entry is still valid and available. The dummy entry implies NO ELEMENT, as contrasted with the empty bracket ([]), which implies action at the current position. This allows vector and open curve sequences to use exactly the same argument list to achieve parallel results. Note that the position stack available to the Vector instruction is not available to the Curve instruction. These parallels are parallels of semantics, not of shared or shareable state. Refer to the C(B), C(E) and C(S) sections later in this standard for descriptions of closed and open curve actions.
The W option allows the writing attributes to be temporarily set. After completion of the Vector instruction, the value of the writing attributes returns to those they had before the execution of the V instruction.
5.5 Curve Instruction
The Curve instruction, keyletter "C," draws circles, arcs of circles, and interpolated curve sequences. "Interpolated Curve Sequence" means a curved line image of varying radius of curvature such as a draftsman using French curves or similar aids would draw.
A Curve construct in Base ReGIS has been included for the following reasons:
Each graphic device knows its abilities better than the software driving the device, and thus is better able to select an optimal quality versus performance tradeoff. This avoids the problem which arises when software approximates a circle by specifying an 18 sided polygon for use on a low resolution device, and produces an 18 sided polygon precisely when the application is run on a high resolution device.
With the assumption that all devices will have local processors, there is no longer any significant complexity to having a local curve capability.
The availability of a local curve capability can substantially reduce the number of characters transmitted to the device.
The inclusion of a curve capability gives ReGIS a degree of completeness in terms of incorporating the "rule and compass" drawing primitives.
5.5.1 Position Arguments
The meaning of a position argument depends upon whether or not a curve position block has been selected.
5.5.1.1 Circles
Outside of a position block, position arguments mean "draw a circle" or, if the arc-angle option has been selected, "draw an arc of a circle." The instruction form C[<position>] draws a circle with the current drawing position as the center and [<position>] a point on the circumference of that circle. The drawing position is left at the center after the circle is drawn; that is, the drawing position is unchanged.
Thus, consecutive [<position>] arguments to a C command causes concentric circles to be drawn. The (C) option inverts the relationship of the initial drawing position and the position arguments.
If the arc-angle option (A<ang>) is used, an arc of a circle is drawn starting at the point on the circumference and ending <ang> degrees from that point.
5.5.1.2 Curves
Within a position block, position arguments refer to points on a curve through which an interpolated curve is to be drawn. S and B represent the two types of curve interpolation sequences. The S option specifies an open end point curve. The B option specifies a bounded curve, in which the end point of the interpolated curve is drawn back to the beginning point to form a smooth closed curve.
5.5.2 Numeric Arguments
Numeric arguments to both forms of the Curve command are interpreted as pixel vectors. The pixel vector specifier shall be interpreted as if it were a relative bracketed extent, and executed in the circle or curve context, as appropriate. For instance, C0 = C[+m] where m is the current pixel vector multiplier. If m = 10, then C0 draws the circle just as if it were C[+10]. The pixel vector multiplier should be set to a reasonably large value for these vectors to have worthwhile effect.
5.5.3 Quoted String Arguments
There is no meaning defined for any quoted string arguments to the Circle or Curve command in Base ReGIS.
5.5.4 Options
5.5.4.1 Circles
5.5.4.1.1 C(A<ang>) - Circular Arc
The circular arc option causes only a portion of the specified circle to be drawn. The current drawing position specifies the center of the arc, and a position argument or pixel vector argument specifies the start point of the arc. The arc is drawn <ang> degrees, counterclockwise for positive <ang>, clockwise for a negative <ang>. Arc directions, clockwise and counterclockwise, are referenced against the viewing reference, that is, as seen by the viewer. Inverting the address space by changing the sense defined in S(A) does not change angle orientation.
The accuracy to which <ang> may be specified is device dependent, It is based on the methods and computational resources available in the device. ReGIS devices are allowed to round angular specifiers to the nearest 10 degree increment, rounding up to the next 10 degree increment at the five degree point. Where consecutive arcs are a requirement, as for drawing pie charts and the like, careful applications should specify arcs rounded down to the next lower increment of 10 degrees, and complete the arc by one or more vector segments to more closely reach the idealized end point.
Should the absolute value of the specified angle exceed 360 degrees, the value executed will be plus or minus 360 degrees, as appropriate.
The drawing position is left at the end point of the arc if the (C) option was used. Otherwise, the drawing position is left at the center of the arc.
5.5.4.1.2 C(C) - Circumferential Circle
The (C) option to the circle command causes the relationship between the current drawing position and specified position arguments to be inverted. When the (C) option is in effect, the current position defines a point on the circumference, and a position argument or pixel vector specifier indicates the center of the circle or arc.
A circle command with the (C) option draws the circle with the current drawing position as a point on the circumference and [<position>] as the center. In this case, the drawing position is left on the circumference of the circle at the the end point of the circle drawing.
The (C) and (A) options to the Circle command may be used together, as illustrated by Figure 8-5. In this case, the drawing position defines the start point of the arc, and is left at the end of the arc when it is completed.
5.5.4.2 Curves
5.5.4.2.1 C(B), C(E), and C(S) - Curve interpolation
Either the option "S" (for an open curve sequence) or "B" (for a bounded curve) starts a general curve interpolation sequence. The sequence ends with the "E" (end) option. There must be no intervening circle or block structured P or V instructions within the range of a curve begin-end sequence, nor shall C(S)...(E) or C(B)...(E) sequences be nested. (Curve and circle operations may be present within a vector or position (B)(E) block, however.) Within these option specifiers, the position arguments (starting with the current drawing position) represent points through which a smooth curve image is drawn.
An open or closed curve interpolation must be completed within one invocation of the C command, or the state of the interpolation may be lost. Note that in the command stream
C(B)[]C[]C[]C[]...
the intent seems to be that a closed curve sequence be invoked. The occurrence of the second C in this stream returns the ReGIS parser to command level, however, voiding the actions of the (B) option and resulting in some number of concentric circles.
The only three elements allowed within a curve interpolation sequence, either open or closed, are:
Position elements (bracketed or pixel vector)
Options (some of which may have no meaning within a curve construct)
Text arguments (which cause a skip state and are ignored)
Any new command keyletter, even a reiteration of the C command keyletter, results in the abnormal termination of the curve context, and the curve state is lost. Termination of curve context by a synchronizing semicolon has the same effect. In either case the number of curve elements drawn is device dependent. Thus, conforming software should always properly terminate a curve construct to ensure consistent visible results.
The use of (W()) suboptions in curve interpolation commands is similarly device dependent. Given the allowed variability of curve interpolation algorithms, prediction of what writing mode or rendition will be coupled with what curve segment is beyond the scope of this standard.
The algorithms used and the drawing methods employed to execute open and closed curves are not prescribed by this standard. The intent of this standard is not to prescribe a class of curves by definition (as, say, "cubic spline" or "conic approximation"). The following constraints do apply, however, and may limit the practical choice of algorithms:
The curve must pass through every point specified in the argument list with the same accuracy that a vector would pass through them (zero-order continuity).
The slope of the curve must be continuous across every specified point (first order continuity). Furthermore, the slope of the curve at any given point in the argument list must be parallel to the line connecting the previous and subsequent adjacent points in the argument list.
Four or more collinear points must result in a straight line from the second to the next to last of these four points. This is a necessary result of constraints 1 and 2.
Intermediate computed points found for the curve must be the same regardless of the direction in which the points are specified, that is, whether the points defining it are given from 1..n or from n..1. This does not mean that the visible results must coincide, since this constraint does not impose a method of rasterization on the line segments which connect these intermediate points.
The slope constraint above leads to an indeterminacy of slope at the first and last points on an open curve. For a closed curve (option B), the point information at the beginning of the sequence must be retained by the ReGIS interpreter so that the closed curve will have a continuous first derivative at the end point. Determining the slope of open curves at the end points is handled in the following manner:
The curve segments from the start to the second point and from the penultimate to the last point are not drawn. These point pairs (first and third, and second next to last and last) are used to define the slope of the curve at the second and penultimate points.
The begin and end points may be visually included in the curve by using the "null" point syntax [] to indicate that the point is to be repeated in the sequence. In this case, the visual appearance of the curve at the end points may not be realistic, since the effects of doubling the end points bypasses the natural constraint of first order continuity and the intended shape of the curve.
As a result of these constraints and conditions, at least three position arguments in addition to the current cursor position must be given to result in a visible curve segment between the second and third positions (the first position being the initial drawing position). One additional curve segment is then drawn for each additional position argument.
For open curves, the current cursor position is always maintained at the last position argument given and thus leads the drawing process by one curve segment. For closed curves, the drawing position at the end of a closed curve command is not changed as a result of curve drawing. The value of the drawing position resulting from abnormal termination of a curve interpolation sequence, as by sending a parser synchronizing sequence, is not standardized and is thus device dependent.
Despite the definition of curve constraints outlined earlier in this section, ReGIS does not specify the exact algorithm by which devices will implement curve interpolation. The exact curve sequence drawn varies depending upon the algorithm used, but this is not considered a problem, since the essential information content is shown in spite of minor variations in the curve path. Devices may implement more than one curve interpolation algorithm; these algorithms may be user selectable by option extensions.
5.5.4.3 Common
5.5.4.3.1 C(W) - temporary Write options
The drawing style of the lines which make up the curve or circle are controlled by the settings of the Write attribute controls. These settings may be temporarily modified by the use of the W suboption, just as in the Vector instruction.
5.5.4.4 Volatility of C Instruction Options
All options to the Curve and Circle commands are temporary, and apply only within the scope of the instance of the C command keyletter in which they appear. Specifically, arc and circumferential circle specifiers apply to all position or pixel specifiers that follow it until:
These options are respecified.
A new keyletter is encountered.
The interpreter is synchronized to command level.
5.6 Text Instruction
The graphic text instruction, keyletter "T", draws strings of characters starting at the current drawing position.
Each ReGIS device must have a built in character definition and writing capability. The default alphabet for writing is a full 8-bit encoded printing set, typically ASCII or some other base set in GL, and some supplemental set in GR. The recommended default and initial contents of the in-use table is ASCII in GL and ISO Latin-1 Supplemental in GR. For products targeted for use in areas where these sets are not reasonable defaults, product-dependent initial and default values are allowed.
Each character of the text string is written by placing the visual image of the referenced character at the current drawing position such that the upper left corner of the character cell coincides with the current drawing position. After writing the character, the drawing position changes to a point which would be the logical position for writing another character, normally horizontally a distance a little more than the visual width of a character. In an extended system, the color or intensity of text is determined by the setting of the Write attributes, W(I), just as are lines and curves.
ReGIS does not specify the size of the text, its spacing, or the number of rows or columns of text which must be supported on a given display surface. ReGIS text is meant to be used annotatively, that is, to supplement the drawing process, not as a high density verbal display medium.
Only the capabilities expected of low resolution devices are specified in Base ReGIS. Variable character size, orientation, aspect ratio, and other factors are standardized in ReGIS extensions. Standard (default) character sizes are not defined by the ReGIS standard. Thus the drawing position resulting from the execution of a text string cannot be determined without knowledge of the target device or the detailed specification of text size and escapement. The quality of character representation at this level is also assumed to be poor and typically drawn as a sequence of short vectors or as a pixel pattern.
ReGIS does not have the facility to choose among alternate typestyles (fonts) that may be stored in a device. ReGIS extensions do support the idea of down-line loadable character sets, which may be used to implement such a capability.
5.6.1 Position Arguments
A position argument to the Text command specifies character escapement, that is, how much the drawing position moves after a character has been drawn. This measure is expressed in units of the imposed coordinate space. It defaults to rightward movement equal to the current width of the character display cell, and no vertical movement. This character to character movement defines what is known as "character path," and describes the orientation of the entire character string. It should not be confused with, nor does it affect, the orientation of the character cell baseline, which is not controllable in Base ReGIS, but is covered in ReGIS extentions. The presence of a bracketed argument to the T command is non-positional. Refer to the subheading 8.4.5.2 Use of Bracketed Extents for Non-Positional Information. This value is always considered relative, regardless of the presence or absence of sign characters on the X and Y parts. Any missing elements are interpreted as +0, that is, no escapement in that dimension. If character size options are supported, they also set character escapement as a side effect.
Character escapement is returned to its default value when a valid S(A) operation is executed.
5.6.2 Numeric Arguments
Numeric arguments to the Text command are interpreted as a form of pixel vector, and cause special motion of the drawing point. This motion is equal to half the current character size. When character height and width are not equal, this movement will take on the proportions of the character cell.
Movement is executed only when the pixel vector digit is encountered, and does not affect, nor is it affected by, the character escapement value. The direction of the 0 pixel vector is parallel to, and in the direction of, the character baseline. (This reference is significant in ReGIS extensions, where the character baseline is not constrained to be parallel to the horizontal axis.) Numbers 1 through 7 step in equal increments, counterclockwise, as for normal pixel vectors. This argument can be used for superscripting and subscripting in text strings.
5.6.3 Quoted String Arguments
Quoted string arguments to the Text command provide the character data to be displayed. Character patterns are retrieved from the stored alphabet (the last alphabet selected by T(A) if multiple alphabets are supported). A0 is the default alphabet, and is the only alphabet required in Base ReGIS. The contents of the A0 may be affected by state set external to ReGIS.
Only within quoted strings used as arguments to the Text command are any control characters interpreted. Only four codes are used: carriage return, line feed, backspace, and horizontal tab:
The carriage return code resets the drawing position, both horizontally and vertically, to the value it had at the start of the current quoted text extent.
The line feed code moves the drawing position down one character height unit vertically, and saves this new position as that which will be restored should a carriage return code be subsequently encountered in the current quoted extent.
The backspace code moves the drawing position back one character escapement step, both horizontally and vertically.
The horizontal tab code moves the drawing position forward one character position, just as a space character would, but without drawing anything. The distinction between drawing a space and just moving the drawing position is significant when different drawing modes are considered. A replace mode space executes the background color into the drawing medium, while an overlay mode space or a horizontal tab in any mode do not.
5.6.4 Options
5.6.4.1 T(A) - Alphabet selection
Arguments to the Text instruction select among possible alphabets of characters. Extensions to ReGIS specify loadable alphabets. The only selection mechanisms in the ReGIS Base are among pre-loaded alternate character sets.
The T(A) command has suboptions R and L, each of which takes a quoted string argument, the tail of the reformatted ANSI designating escape sequence. The resulting format is
T(A<n>(L"<designating tail>"))
to select a character set into the left half, and
T(A<n>(R"<designating tail>"))
to select a character set into the right half.
Under the formats established by ISO 2022, a sequence of the form
ESC I ... I F
is a character set designating sequence if the first intermediate (I) is from certain code positions in column 2 of the code table. This first intermediate identifies the type of character set and its G-set (G0, G1, G2, or G3) assignment. By replacing this particular intermediate with a character from column 3 of the table, the G-set assignment is ignored but identification of the character set type is retained. This technique is used in the DEC Common Font File Format (CFFF) for identifying character sets where G-set assignment is not a factor. The "tail" of the resulting sequence is everything except the introducing ESCAPE code. Without the ESCAPE code, the tail is clear text, and can be used as a string-type argument.
The designating tail in the quoted argument to L and R must start with a legal first intermediate as noted in either of the two tables below. An incomplete or illegal tail will be ignored. There may be multiple tails in a single quoted argument, as multiple tails may be required to couple a character set selection with a version number tail, or to list alternative designations in a single command.
The following table lists the legal first intermediates (the "column two" intermediates) used in the normal character set selection scheme.
| Code | Graphic | Use |
|---|---|---|
| 2/4 | $ | multi-byte set |
| 2/6 | & | version number |
| 2/8 | ( | 94 character set, G0 |
| 2/9 | ) | 94 character set, G1 |
| 2/10 | * | 94 character set, G2 |
| 2/11 | + | 94 character set, G3 |
| 2/13 | - | 96 character set, G1 |
| 2/14 | . | 96 character set, G2 |
| 2/15 | / | 96 character set, G3 |
This table lists the replacement intermediates (the "column three" intermediates) and their resulting character set assignments.
| Code | Graphic | Use |
|---|---|---|
| 3/0 | 0 | 94 character set |
| 3/1 | 1 | 96 character set |
| 3/2 | 2 | multi-byte 94 character set |
| 3/3 | 3 | multi-byte 96 character set |
| 3/4 | 4 | complete code character set |
| 3/5 | 5 | character set revision |
ReGIS has a single 8-bit in-use table with left and right halves. Use of these "new" intermediates from column 3 allows the categorization implied by G0-G3 to be ignored. Thus, the character set shifting controls, such as Shift In (SI), Shift Out (SO), Single Shifts (SSn), and Locking Shifts (LSn, LSnL and LSnR) are not supported. This is true regardless of which tail format is chosen.
The character sets listed in the following table are required to be supported in all ReGIS implementations. The indicated designating tails are the column three tails, and are the preferred tails for use by new ReGIS creators. The older column two tails are allowed, but their use should be phased out.
| Tail | Name of set/⁠Source standard |
|---|---|
| 00 | DEC Special Graphics |
| 04 | DEC Dutch NRCS (optional) |
| 05 | DEC Finnish NRCS |
| 07 | DEC Swedish NRCS |
| 09 | DEC French-Canadian NRCS |
| 0= | DEC Swiss NRCS |
| 0> | DEC Technical |
| 0A | British NRCS/BS 4730 |
| 0B | ASCII/ANSI X3.4-1986 |
| 0I | JIS Katakana/JIS X 0201 |
| 0J | JIS Roman/JIS X 0201 |
| 0K | German NRCS/DIN 66 003 |
| 0R | French NRCS/AFNOR NF Z 62-010 [1973] |
| 0Y | ISO Italian NRCS |
| 0Z | ISO Spanish NRCS |
| 0` | Norwegian/Danish NRCS/NS 4551-1, DS 2089 |
| 0%5 | DEC Supplemental/DEC STD 169 |
| 0%6 | DEC Portuguese NRCS |
| 1A | ISO Latin Alphabet Nr 1 Supplemental |
"Latin-1" is an allowed synonym for "Latin Alphabet Nr 1." DEC Dutch is not required to be supported in ReGIS, but '04' is the approved tail if it is supported.
ReGIS devices supporting the Kanji Display Extension must also support the following character sets and designators.
| Tail | Name of set/⁠Source standard |
|---|---|
| 20 | DEC Kanji 1978 |
| 22 | DEC Kanji 1983 |
| 2@ | JIS Kanji 1978/JIS X0208-1978 |
| 2@ | JIS Kanji 1983/JIS X0208-1983 |
The default state of the ReGIS character set table shall be that specified by the command
T(A(L"0B",R"1A")).
This is equivalent to the 8-bit set Latin-1.
The command
T(A(L"0J",R"0I"))
puts JIS (Japanese) Roman in the left half and JIS Katakana in the right half of the ReGIS in-use table.
This selection methodology extends to multi-byte support.
The command
T(A(L"(J",R"$+@"))
uses the column two tails and selects JIS Roman into the left half and JIS X0208 (Kanji) into the right.
The command
T(A(R"5A1A"))
uses a multiple tail to modify the selection of a multinational character set into the right half by preceding the Latin-1 Supplemental tail with a version identifying tail. The above sequence would specify the second revision of the ISO Latin-1 set. [This is just an example - as far as is known, the first revision hasn't even been considered yet.]
5.7 Report Instruction
The Report function is included to allow the user software to interrogate the ReGIS device for state elements of interest.
5.7.1 Position Arguments
There is no meaning assigned to bracketed position arguments to the Report command in Base ReGIS.
5.7.2 Numeric Arguments
There is no meaning assigned to numeric arguments to the Report command in Base ReGIS.
5.7.3 Quoted String Arguments
There is no meaning assigned to quoted string arguments to the Report command in Base ReGIS.
5.7.4 Options
5.7.4.1 R(M(x)) - Report Macrograph state
The contents of an individual macrograph is reported back to the controlling program by specifying the M option to the R command with a suboption keyletter which is the same as the name of the desired macrograph.
The format of the report is
@=<name><string>@;
which parallels the format of the macrograph definition, with the substitution of an equal sign (=) for the colon (:).
In some systems, unrestricted allowance for reporting of macrograph contents will sometimes result in system security problems. Devices are therefore allowed the freedom to restrict macrograph reports. The preferred fallback is the empty report, that is, just the terminating CR character.
An alternative is to report the macrograph as specified above, replacing each character in the macrograph with SPACE or some other printing character. This allows the user to verify the length of the stored macrograph, and might indicate the proper storage of the macrograph in question.
The macrograph storage allocation may be returned by specifying the command
R(M(=))
which returns a quoted string of the form
"<free>,<total>"
where <free> is the minimum guaranteed amount of space, in characters, still available for macrograph storage, and <total> is the amount of space, in characters, allocated by the device for macrograph storage. It is not required that "<free>" be accurate to the character count level, as long as its value represents a lower bound on the measure of available space.
5.7.4.2 R(P) - Report current Position
The returned report is a bracketed position specifier of the form
[x,y]
representing the current drawing position in the imposed coordinate system. The parts, x and y, return in ReGIS-conforming numeric representations.
If the drawing position has been moved into absolute negative coordinate space, the format of the report includes a signed number indicating this. Hence, in position reports signed numbers represent absolute, not relative, locations.
5.7.5 Further Notes
All reports are terminated by a single carriage return character. Requests for unimplemented reports are acknowledged by the device's returning just a carriage return; this prevents device deadlocks by ensuring that an application will receive some response, even if the requested report cannot be generated.
Multiple options or suboptions to a single R command are interpreted as requests for multiple reports.
All devices must return a report for every option keyletter in the argument stream. Some forms of the report command define a report for every suboption letter as well, as is the case with macrograph reports.
In the case of unimplemented reports, the device may not be able to discern how many reports are due, especially if suboptions are involved (as in the case of the macrograph report). Hence, software should request reports singly and in turn, so that only one report response is outstanding at any time. This will minimize the chance of deadlock or phase error due to unanswered reports.
There are some classes of devices for which reports are not necessary or easily supported. Software to convert ReGIS files to some other graphic form, for example, might not have an identifiable return path for reports. Some devices are meant to be run spooled, and will not have the ability to provide reports in a timely manner, if at all.
Though the ReGIS Report command is part of the ReGIS Base, it clearly cannot be supported in all environments. Lack of support for Reports in such environments does not constitute a failure to conform to the ReGIS standard.
5.8 Fill Instruction
The Fill instruction, keyletter "F", defines bounded areas by their edges. The command colors in only and entirely, subject to area texture or pattern in effect, the area (or areas) bounded by the edges presented.
5.8.1 Position Arguments
There is no meaning assigned for bracketed position arguments to the Fill instruction in Base ReGIS.
5.8.2 Numeric Arguments
There is no meaning assigned for numeric arguments to the Fill instruction in Base ReGIS.
5.8.3 Quoted Text Arguments
There is no meaning assigned for quoted text arguments to the Fill instruction in Base ReGIS.
5.8.4 Options
5.8.4.1 F(C, P, V ) - define filled area
The actions of the P, C, and V commands inside the option extent of a Fill command mimic the actions of the Position, Curve/Circle, and Vector commands at command level. Instead of executing positions and drawing lines to outline an area or shape, these options define the extent of whatever figure would be drawn at command level, and cause that area to be executed as a filled area.
Each P, C, or V option to the F command takes whatever subarguments that would apply at the command level to define a shape and use that same argument in the context of executing the figure as filled, subject to some of the following constraints.
Allowable suboptions V and P are stack controls V(B,E,S) and P(B,E,S); for C, closed and open curves, C(B,S,E), and arcs and circumferential arcs and circles, C(A,C).
Write suboptions are allowable for all of V, P, and C in contexts where they make sense, as described in later sections.
Allowable arguments for V, P, and C are bracketed position specifiers and pixel vectors.
The definition of a polygon boundary is determined by the edges described by the drawing options V, P, and C. These edges are determined by what would be drawn by the V and C options were they executed at command level. The P option modifies how position arguments to V and C may be interpreted, but no position specifier on a P option will be entered into the list of vertex list which describes the border. This implies that the current position in effect at the start of a polygon description is NOT automatically the first vertex of the defined polygon. If the current drawing position is meant to be that vertex, then an option specifier such as V[] (the empty brackets implying current position) must be the first executed position. The termination (closure) of the Fill command will close the polygon to this point. More explicit perhaps, is the form V(B) (with a matching V(E) at the termination) to apply the current position to start the polygon.
During polygon outline definition the current position is updated as if the V, P, and C options to the F command were being executed outside of the F context.
For Fill, no perimeter is drawn as a result of the boundary definition process or of the execution of the area defined. A perimeter, if desired, must be specified separately as a set of ReGIS commands (probably the same set, as macrographs are useful here).
Each device has some implementation limit on the number of vertices which can be stored before the filled figure can be executed. A conforming ReGIS device must provide for a vertex list with a capacity of less than 256 entries, but note that certain other implementation dependencies with regard to curve interpolation (noted below) could result in many fewer than 256 vertices available to software. (On the other hand, a device may save space in the vertex list by allowing consecutive vertices which map to the same physical pixel to be counted as a single vertex.)
If the number of vertices generated exceeds the implementation limit, any additional vertices are ignored and the figure is closed and filled as if it had been terminated at the implementation limit.
The remaining elements in the fill specification will be ignored. No further drawing will be attempted until terminating right parenthesis of the Fill option list is encountered or a synchronizing action is executed.
Polygon fill must accommodate non-convex and self-intersecting polygons. The interior of a polygon, that is, that area filled as a result of the polygon definition, is defined by the "even-odd rule," as follows. From any given point not on an edge of the defined polygon, consider a ray beginning at that point and extending in any direction to infinity. If that constructed ray crosses an odd number of edges, then the specified point is inside the polygon, and it should take on the fill attributes of the polygon. If the ray intersects an even number of edges, the point is outside the defined polygon. Intersection of the ray with a vertex point or complete edge of the polygon provides information useful to resolve the even-odd rule only if the positions of vertexes adjacent to those intersected can be recognized as lying on the same side of the test ray or on opposites sides of it. If a ray intersects one or more vertex points, a new ray may have to be chosen. These rules suffice to distinguish the interior and the exterior of simple polygons, and also nested polygons, as may be described by the use of F(F), (a ReGIS Open extension for filling complex polygons).
The current drawing position is saved at the beginning of an F command, and restored at the end of an F command, whether any drawing takes place or not. This behavior allows some degree of compatibility with older devices that do not implement the F command, and therefore simply ignore it.
The state of the ReGIS position stack is not preserved by F commands. An implication of this activity is that position arguments may be passed into the polygon fill process by pushing them on the stack and popping them inside the fill process, and that position arguments may be passed out of the polygon fill process by pushing them inside and popping them after the Fill is complete.
Any ReGIS command string that changes the state of the position stack within an F command will not be compatible with devices that do not implement the F command. A device that does not implement the F command will not recognize the V, P, and C options to the F command in their proper context, and hence cannot recognize stack operations in the option list either.
The vertex list resulting from the interpretation of positional subarguments always represents a closed figure whether the drawing commands used to specify that vertex list represent a closed figure or not. If the commands used to specify a polygon do not represent a closed figure, for example, because of disconnected start condition on an open curve interpolation, the filling proceeds as if consecutive vertices had been connected by straight lines, possibly causing unexpected results.
Curve and arc interpolations may, depending upon the curve and circle algorithms chosen in a device, generate multiple vertices per specified point. Such intermediate points will have to be counted against the implementation limit of the vertex list of the polygon filling process if the device must save them to compute the filled area boundary. The implication of this is that devices may need an device-dependent number of entries in the vertex list to accommodate a given ReGIS area definition. Devices should provide a greater number of entries in the vertex list to mitigate the adverse effects of such curve algorithm dependencies.
Open curves used to define polygon boundaries must abide by the constraints for such curves defined in the section on the Curve command. For such curves, the current position at the beginning of open curve interpolation does not generate any vertices, but helps determine the slope of the curve at the next specified point. The first specified point does not generate any vertices, since it is the beginning point of the curve. Subsequent specified points then generate some number of intermediate vertices each, as in normal (unfilled) curve interpolation. The last point specified does not generate any vertices; it determines the slope of the curve at the next-to-last point specified. Thus the total number of vertices generated when n points are specified for open curve interpolation is (n-2)*m, where m is the number of intermediate points per specified curve segment.
In order to connect different types of open figures, such as V and C(A) sequences, it is sometimes necessary to use the P option to reset the current drawing position. Repositions via P may also be needed when it is desired to draw both a polygon and its outline using the same command string.
Temporary write options may be specified as options of the of the F command itself, F(W...), or as temporary write suboptions to the C option, F(C(W...)), or V option, F(V(W...)). These forms are all equivalent and all supersede each other. Temporary write options are canceled by a new command keyletter.
A right parenthesis at the option level terminates an option list and causes a filled polygon to be drawn. The filled polygon is drawn using the write options (including temporary write options) in effect at the time the right parenthesis is encountered.
The only element of the write options which takes effect at the time it is encountered, rather than at polygon execution time, is the pixel vector multiplier, which conditions any pixel vectors used in defining the polygon boundary.
The area texture used to fill the polygon is variable by product classification. ReGIS devices that support the Raster Extensions use the interior style set by the area texture argument to the W(S) option, the same option used to enable shading. The "snapshot" of attributes established by enabling shading applies to polygon fill. An area texture is established by invoking shading and disabling it, as by the command fragments W(S1,S0) or W(S"x",S0). See subheading 8.7.2.4.2.3, W(S) - Shading for a description of the shading snapshot.
Devices that do not support the Raster Extensions may elect to fill with a solid color or intensity, or they may define a set of hatch patterns if solid fill is not appropriate.
If a synchronizing semicolon is encountered (or external resynchronization occurs) before the terminating right parenthesis, the F command is aborted and no drawing takes place.
6 The Extended Logical Graphics Device
This section describes extensions to the Logical ReGIS Graphic Device required to accommodate specific graphical features not common to all devices. This section is an illustrative presentation to follow for extending ReGIS to device capabilities not described here. The case of raster CRT devices is covered in some detail to fully illustrate the process of extending ReGIS.
6.1 Dimensional Displays
"Dimensional displays" refers to the class of graphics devices in which the physical size of pixels has a repeatable meaning and allows the user a variety of pixel sizes. Examples of such devices include both paper and photographic plotting devices. ReGIS could be extended to accommodate these devices by allowing definition of the size of pixels in physical dimensions.
By knowing the number of pixels selected by the screen coordinate definition operation and their size, the device is then able to determine the size of paper needed to draw the image. The units of the physical measure should be optionally selectable by the user, with the metric system being a likely default.
These devices also will generally allow (and need) the width of line segments to be user controllable. This feature has been included in Open Extension to ReGIS as an option to the writing attributes instruction.
6.2 Gray Scale And Color
The simplest model of color capability is that of a plotter device using different colored pens to draw on different colors of paper. In this case, the paper represents the background color and the pens represent the foreground colors. Monochrome devices often have the ability to show varying intensity levels of light, called gray scale. More complex devices, such as high resolution color raster devices, have the ability to present a full range of color hues in addition to the gray scale (intensity) capability.
6.2.1 Selection Scheme
To accommodate this broad range of capabilities, the extended ReGIS logical device adopts a scheme to allow the selection of color and gray scale in a simple manner for simple devices, but still has full access to the broad spectrum of attributes of the most capable of the devices.
Each pixel has associated with it a foreground and a background "intensity" attribute which are user controllable. The differentiation between foreground and background is most clear in the case of the plotter, and may have little meaning in a multiplane raster color device.
For simple color devices, the scale of eight intensity values is interpreted as the three primary colors, the three complementary colors and the black and white intensity values.
Mappings between gray scale and color should follow the conventions which have been established for photographic and broadcast television work. These are summarized as:
Gray Scale Color Value 0 Black (dark) 1 Blue 2 Red 3 Magenta 4 Green 5 Cyan 6 Yellow 7 White This mapping is based on the standard RGB to luminance level transformation used in the North American television industry (NTSC color standard). The NTSC RGB to luminance equation is
Y = 0.59*G + 0.30*R + 0.11*Bwhere Y is the luminance value, and G, R, and B are the green, red, and blue components of the color drive, respectively. When normalized to the range 0 to 7, the equation becomes
I = 4.1*G + 2.1*R + 0.8*Bwhere I is the resulting gray scale intensity for that range. The coefficients (rounded to 4, 2, and 1, respectively) lead to the encoding of the table above.
For devices having a full range of color capability, the Hue-Lightness-Saturation system of color definition is adopted. In summary, this system requires three possibly floating point numbers to be used in defining a specific intensity parameter value. These are:
- Hue (H) - the hue of the color expressed as an angle on the color wheel,
- Lightness (L) - the relative brightness of the color expressed as a percentage of full brightness, and
- Saturation (S) - expressed as a percentage of the fully saturated hue.
The intensity parameter may be applied independently to the foreground and to the background of the graphic image. Devices have extreme ranges of implementation of the intensity attributes. ReGIS does not define how many colors or intensity levels must be provided by an implementation which offers color or gray scale support.
6.2.2 Color Specification
There are two methods of specifying color or intensity in a graphics device: color by index, and color by value. Color by index is often used in multiplane bit map displays, or in hard-copy devices whose pens are selected by number. Color by value is used by implementations which have limited knowledge of the drawing hardware being used, but which need to specify colors or intensities to differentiate image components. ReGIS supports both color by index and color by value.
6.2.2.1 Color by Index
Virtually all graphics devices actually implement an indexed method of color selection. This index is translated into visible color by some hardware component, which may or may not be modifiable by user commands. Video devices, for example, translate the index value stored as bit map contents into beam intensity or color gun selector by a digital to analog converter and/or a multiplexer. If the converter/multiplexer is hard-wired, the translation is not user modifiable, and the translation from index to color is fixed. If the converter/multiplexer contains an extra stage of indirection to allow the translation to be dynamic, the device is said to have an output map. If this map can be used to modify the translation of index to color under user control, it is a truly dynamic system. In any case, ReGIS requires that the mapping of index values to visible components be known to the implementation. Colors by index may then be executed into the display medium directly. Color by value specifications are referenced against the index to color translation hardware (or software/firmware translation table) and a resulting index deduced. The index is then executed into the display medium as if it had been directly supplied.
In the case of an unsupported direct color or intensity specifier, the color map, whether hard-wired or user modifiable, should be searched to find the closest available color or intensity specifier. The "closest match" indicates the index value to be used. In monochrome systems, this "closest match" decoding is fairly simple, and either rounding or truncation may be used. The approach taken must be documented.
In color systems, the concept of "closest match" is more complex. For example, if a degree of orange is requested but not supported, the goal should be to present some shade of red or yellow to approximate this request. If only shades of blue and green are available, however, the approximation has no clear solution Efforts should be made to prevent mismatches in requests for a foreground from collapsing to the background. If color mismatches are too great, matches based on the monochrome mappings of those colors might be used. The approach to be taken in such cases is device and device class dependent.
In general, specification by index is implemented in ReGIS by the form
I<index>
where I is the suboption identifier for intensity for both the Screen command, where it sets the background color, and for the Write attributes command, where it sets the foreground. The range of values for <index> is device dependent.
When an index exceeds the bounds of the device, the unimplemented index must be mapped back into the supported range. In systems which support only one visible color or intensity, any non-zero index should map to the visible value, and the zero index should remain zero. In systems with more than one bit of index specification, a modulus scheme should be used, wrapping out of bounds values back into the supported range in a non-monotonic mapping. For instance, given a 4-intensity implementation and an 8-intensity stored picture, the following mapping would result:
| Ask | Get |
|---|---|
| 0 | 0 |
| 1 | 1 |
| 2 | 2 |
| 3 | 3 |
| 4 | 0 |
| 5 | 1 |
| 6 | 2 |
| 7 | 3 |
The device class may determine whether the mapping is purely modular, or whether some other approach is more appropriate.
For example, in a multi-plane bit map, pure modulus arithmetic is the most straightforward. A three plane system can accept indices in the range 0 to 7, as noted in the example table above. Mapping into these three planes by accepting only the low three bits of values greater than 7 is acceptable, though collisions between the wrapped foreground and the background may occur. On the other hand, a pen plotter is less likely to present such a problem, since the color of the paper is not likely to be the same as one of the loaded pens.
6.2.2.2 Color by Value
Specification of color by value in ReGIS is more complex than color by index. Not only are colors more complex, but ReGIS supports two types of color specification, RGB and HLS.
The HLS form is:
I(H<ang>L<pct>S<pct>)where I is the option to Screen and Write attributes commands as noted above, and H, L, and S are the HLS components noted earlier; <ang> is expressed in degrees, 0 to 360; and <pct> in percentage values, 0 to 100.
A hue angle of zero degrees specifies blue, 120 degrees specifies red, and 240 degrees specifies green. The additive complementary colors magenta, yellow, and cyan, are positioned at 60, 180, and 300 degrees, respectively.
The RGB form is:
I(x)where x is a single letter color specifier for the RGB color alphabet: R, G, B, Y, C, M, W, or D for red, green, blue, yellow, cyan, magenta, white, or dark, respectively.
Color suboptions must be completed within one suboption (one parenthesized range), and RGB and HLS color specifiers must not be mixed in the same suboption. RGB specifiers must not be quantified, nor may RGB specifiers be mixed to define color mixing. For example, the specifier RG does not imply Y.
HLS specifiers have the following defaults:
If H or S is specified, but L is not specified or not quantified, L defaults to 50.
If H is specified and quantified, and S is not specified or not quantified, S defaults to 100.
If H is not specified or not quantified, S defaults to 0; H has no default.
If none of H, L, or S is present, there is no default, and no action regarding that color specifier is taken.
This rule will allow for extensions to the color specification alphabet by standardizing as yet unspecified suboption letters; the "no action" requirement protects backwards compatibility.
Specification by index provides the most control over the device where the hardware use of the index can be known to the user, as in specifying plane-by-plane bit map contents. Specification by value provides the greater degree of transportability where the goal is to differentiate information and where the exact mapping of device capabilities is not known beforehand.
6.3 Text Attributes
Text attributes include a wide variety of features associated with the presentation of textual characters, including (but not limited to) any combination of the following:
Variable character size including independent width and height adjustment.
Variable character spacing including proportional spacing and letter-spacing.
Angular orientation of characters and independent angular character spacing.
National language character sets.
Alternate representation fonts (Gothic, Futura, and so forth).
Superscript and subscript capability.
Overstrike (underline, APL characters, and so forth).
ReGIS can be extended to support such features in extension sets. The user should recognize that the degree to which a specific device supports these characteristics is extremely broad and is therefore one of the areas of image generation with the least portability.
To support the majority of these features, an extended ReGIS device may support the definition of the following extended logical device parameters:
WIDTH - The width of the hypothetical parallelogram in which a character is written.
HEIGHT - The height of this parallelogram.
DANG - The direction of the character base line measured as an angle in degrees relative to the horizontal axis.
HANG - The direction of the height side of the character parallelogram measured relative to the baseline direction, such as relative slanting of characters, as for an Italic representation.
TDX - The relative horizontal spacing of two characters.
TDY - The relative vertical spacing of two characters.
FONT - A scalar parameter used to identify which of several possible character representations is currently in use.
6.4 Area Attributes
This class of extensions refers to the general capability of many devices to associate attributes to areas bounded by ReGIS primitive line images. The visual attributes may include shading patterns, similar in concept to line patterns, and color and intensity variation.
These capabilities are covered syntactically by other ReGIS extensions. ReGIS distinguishes three approaches to identifying the boundaries of an area:
SHADEd areas are defined to be the difference between two not-necessarily bounded vector or curve sequences.
FILLed areas are defined by either a connected sequence of vectors or a closed curve, or by a combination of connected vectors and open and closed curves.
FLOODed areas are defined by boundaries existing in an image without regard to what sequence of commands generated the elements of the boundary.
The first case corresponds to the typical approach used to represent data as a "histogram" image. The second case corresponds to the common concept of bounded surface. The third case corresponds to after-the-fact coloring in of areas not necessarily bounded by a single command.
6.5 Dynamic Attributes
The area of dynamic attributes covers a broad spectrum of features which are illustrated at one extreme by "blinking" attributes and at the other extreme by a fully animated cartoon. The common point in ReGIS for such capabilities is that the foreground/background selector function may vary as a function of time. Using this model, the typical blink attribute is interpreted as a time-based modification of foreground and/or background visual attributes, while more complicated dynamic attributes could be considered as selectors acting on separately accessible foregrounds.
7 Required Extensions For Raster Devices
This section describes a standard set of ReGIS instruction extensions to be used with raster CRT graphics devices. All commands under heading 8.5 Base ReGIS Instruction and all commands under this heading must be implemented as specified for a device to be certifiable as a ReGIS Raster Device. Heading 8.8 Open Extensions to ReGIS describes further extensions to ReGIS, some of which are applicable to raster technology, but which are not part of the required raster set.
The additional capabilities addressed here include:
Background and foreground gray scale and color intensity attributes,
Image dependent writing attributes (complement), and other extended writing modes (replace, negate, and erase),
Area attributes for bounded and unbounded areas, and
Text attributes and user definable characters.
All Base ReGIS commands apply to raster devices. Some raster commands modify or extend these base commands. Defaults for such new elements approximate as closely as possible the effects that would be achieved if the extension were not present.
The original intent of ReGIS Raster Extensions was to capture the capabilities found in most raster video devices. Since the original adoption of ReGIS, monochrome bitonal raster printers have become a major presence in the industry. The ReGIS Raster Extensions focus on video-like capabilities, but the limitations of bitonal hard copy is considered as well.
7.1 Screen Instruction
Raster scan extensions to the screen instruction allow setting a background intensity (color and/or gray scale value) and the introduction of a time base for ReGIS execution.
7.1.1 Position Arguments
There is no significance to the presence of a bracketed position argument in the Screen Instruction Extensions for Raster ReGIS.
7.1.2 Numeric Arguments
There is no significance to the presence of a numeric argument in the Screen Instruction Extensions for Raster ReGIS.
7.1.3 Quoted Text Arguments
There is no significance to the presence of quoted text arguments in the Screen Instruction Extensions for Raster ReGIS.
7.1.4 Options
7.1.4.1 S(A[][]) - Screen Address definition
Display address definition in Raster Extensions works as it does in Base ReGIS, but sets to defaults the following Raster Extension state elements:
The device writing mode is set to its device default. This is overlay, if possible, with replace as second choice. Negate mode is disabled.
Equivalent explicit command: W(V,N0) or W(R,N0)
Background color (or gray value) is set to its device dependent default; this default is visually distinct from the default foreground color or gray value.
Equivalent explicit command: typically, S(I0); alternatively, S(I(<default color spec>))
The foreground color (or gray value) is set to its device dependent default; this default is visually distinct from the default background color or gray value.
Equivalent explicit command: typically, W(I<n>), n greater than 0; alternatively, W(I(<default color spec>))
The foreground mask is set to all planes enabled.
Equivalent explicit command: W(F<n>) with n=(2**m)-1, with m the number of planes in the device
Shading state is set to disabled.
Equivalent explicit command: W(S0)
The text attribute set is set to restore individual text defaults if T(E) is encountered before T(B).
Character baseline angle is set to horizontal.
Equivalent explicit command: T(D0)
Character unit cell and display cell sizes are set to the device dependent standard size 1.
Equivalent explicit command: T(S[]U[]), with standard size 1 contents of the bracketed extents
Character slant (italic) angle is set to rectilinear.
Equivalent explicit command: T(I0)
The alphabet selected for drawing is set to alphabet 0.
Equivalent explicit command: T(A0)
The alphabet selected for loading is set to alphabet 1, the first loadable alphabet.
Equivalent explicit command: L(A1)
The following states and stores are NOT AFFECTED by executing an S(A):
The character stores are not affected.
Character set names, as set by L(A'<name>'), are not affected.
7.1.4.2 S(I<n>) Or S(I(<color specifier>)) - background Intensity
The intensity parameter in the screen instruction uniformly changes the background intensity of the graphic image. The result is the same as loading a certain colored piece of paper into a plotting device. This parameter may be changed during the process of drawing the image to define the color value of the "off" pixels in a line pattern, or the background color to the rectangle which encloses a character, but if transportability is to be maintained, no essential information content should be placed in such a dynamically defined background attribute. In either case, the action of a screen erase operation is to use the then current background intensity to uniformly define the background color and/or gray scale.
Refer to subheading 8.6.2 Gray Scale and Color for the distinction between color by index (I<n>) and color by value (I(<color specifier>)), and for the comments on handling values of <n> that exceed the implementation limit.
The default value for background is device dependent, but it must be visually different from the default foreground color. This default value takes effect when a valid S(A) is executed.
7.1.4.3 S(T<n>) - Timer
This option connects timing information to graphical display. The numeric value <n> is the number of device dependent timer "ticks" for which ReGIS interpretation should be suspended. The intent is to allow presentation timing to be done at the end of the transmission latency path, in other words, at the device. The number of ticks <n> is measured from the time the S(T<n>) is interpreted by the device. This is not necessarily the time the command is sent or received. Note that S(T<n>) commands may be cascaded, as S(T60,T60,T60), for extended pauses.
The amount of time represented by each increment of <n> is device dependent, but it should be in the tens of milliseconds range. For video devices, <n> could most likely be measured in frame times. The target increment for timer values should be 20ms +/- 20% (15-25 ms). Devices must accept and properly execute values of <n> as large as 2000. At 60 ticks per second, this allows for pauses of up to about 30 seconds. Longer pauses are not expected to be used to correct for device latency, but for software timing purposes, and must be controlled by host software.
7.2 Writing Attributes Instruction
Raster extensions to the writing attributes instruction allow access to a wide range of capabilities of CRT devices, including color, gray scale, the simple blink dynamic attribute, image memory modification, and area filling.
7.2.1 Position Arguments
There is no significance to the presence of a bracketed position argument in the Writing Attributes Extensions for Raster ReGIS.
7.2.2 Numeric Arguments
There is no significance to the presence of numeric arguments in the Writing Attributes Extensions for Raster ReGIS.
7.2.3 Quoted Strings
There is no significance to the presence of quoted string arguments in the Writing Attributes Extensions for Raster ReGIS.
7.2.4 Options
7.2.4.1 Writing Mode Options
"Writing modes" are the detailed actions of execution into or onto the drawing medium. Some drawing modes are insensitive to the presence of previous image contents, others are intimately coupled to prior contents.
7.2.4.1.1 W(C) - Complement Writing
When writing, use ones in the pattern register or cell to complement the contents of the pixels present in the image. Ignore zeros in the pattern register or cell; ignore the current foreground and background intensity specifiers.
7.2.4.1.2 W(E) - Erase Writing
When writing, ignore the contents of the pattern register, and Erase each pixel to the background specifier if W(N0) is in force, or write each pixel with the foreground specifier if W(N1) is in force.
7.2.4.1.3 W(N<0 or 1>) - Negate Writing
When W(N1) is in effect, the bitwise sense of the linear or area pattern is inverted (complemented) during write operations. In raster devices which use dot matrices for character cells, the bit patterns of these cells are inverted. When W(N0) is in effect, the patterns are used normally. The default value, N0, is set when a valid S(A) is executed.
7.2.4.1.4 W(R) - Replace Writing
When writing, replace the current image by input image. Blanks in a dashed line pattern or zeros in a pattern cell erase (to the background specifier defined by S (I)) the area overwritten on the screen. Ones in the pattern write the foreground specifier.
7.2.4.1.5 W(V) - oVerlay Writing
When writing, overlay ("OR") input onto current image. Blanks in a dashed line pattern or zeros in a pattern cell have no effect on the area overwritten. Overlay is the intended default writing mode in all extended ReGIS implementations, and is set when a valid S(A) is executed.
Four of the writing modes (C = complement, E = erase, R = replace, and V = overlay) are mutually exclusive, each overriding all others; the last one specified takes effect. The fifth mode, N = negate, may be used in combination with other modes. Figure 8-6 shows the effects of each of the writing modes. In each case, the solid block was written first, and the patterned block was written over it in the indicated mode.
7.2.4.2 Non-Writing Mode Options
7.2.4.2.1 W(F<integer>) - Foreground mask
Define the foreground field specifier. The bit encoded integer argument to F defines a mask which is used to enable all plane write and erase operations. Only planes represented by a 1 bit in the mask can be written. Ordering of bit assignments and bit planes affected is implementation dependent, but the numbering of bit planes for purposes of write masking and output mapping (S(M...)) must be consistent with each other. The intent of this command is solely to limit write access to a subset of planes in a multiplane device. It does not affect plane readback (S(H)) or those planes which can be moved by screen scrolling (S[]). The default value for this option is "all planes enabled," and this default is set when any valid S(A) is executed.
7.2.4.2.2 W(I<n>) or W(I<color specifier>) - foreground Intensity
Refer to the notes under the Screen command S(I) and subheading 8.6.2 Gray Scale and Color for details of <n> and <color specifier>. The default value for the foreground specifier is device dependent, but must be visible and distinguishable from the default value specified for the background by S(I). The default value is set whenever a valid S(A) is executed.
7.2.4.2.3 W(S<suboption><arguments>) - Shading
Shading is an area fill operation which is executed in conjunction with the Vector and Curve drawing commands. As indicated by Figure 8-7, shading is executed to a horizontal reference line.
Shading is different from both fill and flood. Fill colors in a bounded area as it is defined. Flood colors in a bounded area after it is drawn, and is not supported in Raster ReGIS. Shading colors in a solid or textured area that is not explicitly bounded. Shading may be used to execute a fill-like function, but the burden of defining and controlling the area so filled is on the application using ReGIS.
A bracketed position specifier defines the location to which shading will be executed. In Raster ReGIS, it is possible to shade only to a horizontal line, and hence only the Y part of this specifier is significant. Open Extensions to ReGIS allow shading to a vertical line or to a point, so that either or both parts of the specifier may be significant. This mode selection is controlled by suboptions to this option. Pixel vector specifiers cannot be used as addresses for shading reference definition, as the numeric arguments to the S option have a different meaning. If this argument is not specified, the current drawing position is assumed.
A numeric argument to the S option is interpreted as a boolean switch. A non-zero value causes shading to take on the characteristics of the currently specified linear pattern. A zero value turns shading off. Shading is, by definition, an area operation. Use of a linear pattern to shade in an area requires adding a second dimension to the linear pattern. Shading is intended to be implemented by drawing lines from each distinct point on the drawing path, as described by Vector and Curve commands, to the shading reference. It is these lines, not the path line, which must take on the shading pattern. Furthermore, these shading lines should be registered so that the shading pattern is independent of the defining path. Figure 8-7 shows how the shading pattern reflects a vertical orientation of the chosen line pattern. Note how the vertical line next to the shaded area matches the pattern of the shaded area.
A single quoted character to the S option causes the shading pattern to be taken from the two dimensional pattern specified by the cell for that character from the alphabet currently selected by the A option to the T (text) command. The Text unit cell size currently in effect specifies the granularity of the shading pattern as it is applied to shading. Any Text option which affects the cell unit size is reflected in this granularity. These are T(U[]), T(M[]), T(H<n>), and T(S<n>), but not T(S[]). T(S[]) is excluded because it sets only the display cell, not the unit cell size. The text pattern is referenced to a known point in the display so that patterns of adjacent shaded areas match where the areas abut. To facilitate the development of patterns that match reliably when replicated left to right and top to bottom, only the top square part of the storage cell is applied in a shading context. Thus crosshatching patterns may be defined without consideration being given to the storage cell aspect ratio of the characters being used for shading.
When shading is enabled, with either a linear or a cellular pattern, certain state variables are "snapshot." These variables are used with the values they had at the time the shading was enabled, regardless of how these values change during the time shading remains enabled.
If shading is re-enabled without being disabled, then a new snapshot is taken of the state, and the old snapshot state is lost. This allows shading state to be set up and "locked," while the state variables for text are changed to allow interspersed execution of shaded drawing and normal text, such as for drawing labeled bar graphs. Execution of text is not affected by enabling the shading state. Even if shading is disabled, the snapshot established by its enabling remains in effect for use by polygon fill through the F command.
The following states are snapshot for use by shading when shading is enabled:
Linear pattern, set by W(P<n>)
Linear pattern multiplier, set by W(P(M<n>))
Text alphabet selection, set by T(A<n>)
Text size, as set by any of T(S<n>), T(H<n>), T(S[]), T(U[]), or T(M[])
The following two states are NOT part of the snapshot, and if they are changed while shading is enabled, they will be appropriately applied in subsequent path-oriented actions:
Writing mode, as set by any of W(E, V, R, C, N, W)
Writing colors, as set by either of W(I) or S(I)
Shading state is cleared (disabled) on any occurrence of W(S0), S(E), or a valid S(A). If shading is enabled as part of a W option to a drawing command, then the shading state is cleared when the drawing command is terminated by encountering a command keyletter at command level, or by synchronization.
7.3 Text Instruction
Extensions for graphics text include user definable character parameters and user definable alphabets.
7.3.1 Position Arguments
Position arguments to the Text command in Raster ReGIS are treated as character escapement values, just as in Base ReGIS.
7.3.2 Numeric Arguments
Numeric arguments are treated as character oriented pixel vector operations in Raster ReGIS, just as in the Base, but differ from the Base in regard to the effect of option extensions. In Raster ReGIS, a character and character string orientation option is present. The direction of the pixel vector operations in Base Raster ReGIS is referenced against this string direction, not against the absolute horizontal. Hence, Text pixel vector direction 0 is parallel to and in the direction of the character baseline, direction 2 is perpendicular the base line (and NOT affected by the italic angle), direction 1 is forward and up, and so on.
7.3.3 Quoted String Arguments
Just as in the Base, the text arguments to be displayed are passed as quoted string arguments, and the four ASCII control codes (carriage return, line feed, horizontal tab, and backspace) are interpreted by ReGIS when encountered within quoted strings.
Backspace (BS) moves the drawing position one character escapement increment backwards, both horizontally and vertically.
Line feed (LF) moves the drawing position one character height down, perpendicular to the character baseline; LF also saves the resulting drawing position for restoration upon occurrence of a subsequent carriage return in the same quoted extent.
Carriage return (CR) moves the drawing position back to the position it had at the start of the current quoted extent, or to that saved at the most recent LF, whichever was more recent.
Horizontal tab (HT) moves the drawing position one character increment forward along the baseline.
ReGIS text does not automatically scroll or wrap at screen borders. The drawing point advances by character escapement increments and abides by the addressing constraints outlined in the S(A[][]) Screen Address Setup Command description.
An error character will be displayed for any of the following occurrences:
An attempt to print characters from a nonexistent or undefined character set (for example, T(A4)'x', where alphabet 4 has not yet been defined by an appropriate L(A4) command).
An attempt to print characters from outside the defined extent of a character set (for example, L(A1,E64) followed by T(A1)'a').
An attempt to print not-yet-defined characters from within the defined extent of a character set.
The error character may be device dependent, and need not be the same for each error above. Solid block characters or checkerboard characters are acceptable. The reverse question mark error character used in certain text protocols may not be a good choice, as the rotations and transformations allowed in graphics text may negate the advantages of its otherwise unique shape.
7.3.4 Options
7.3.4.1 T(A<integer>) - select Alphabet <integer>
The default value for <integer> is zero, and this value is restored on a valid S(A).
If a received value of <integer> exceeds the range implemented in a device, or <integer> is not specified, then the option is ignored and the previous state value is left unchanged. For suboptions R and L (described in the ReGIS Base), <n> is restricted to have a value of 0. [Note that ReGIS alphabets are not now and have never been coupled to ANSI G-set selection; ReGIS alphabet numbering is an independent character set enumeration scheme.] Should the R or L suboptions be specified without a numeric on their A-option, the last set selected by T(A) is still selected. If the <n> in the last T(A<n>) was not 0, then the suboption is ignored.
Refer to the description under the Load alphabet command for possible device dependent contents of the non-default alphabets.
7.3.4.2 T(B) - save Text attributes
Start a temporary text attributes range. The state of all Text option settings, including character set selection and the state of the in-use character table, but not including temporary writing options, are saved on a one-deep text attributes stack, to be restored by an E option in the current or a subsequent Text commands.
7.3.4.3 T(D<ang>) - set Text baseline Direction
Orient the baseline of each character at <ang> degrees to the horizontal.
An acceptable fallback is to limit angular resolution to a device dependent value, typically either 45 or 90 degree increments. When used in conjunction with the S option, string baseline is established. The default value is 0 degrees to the horizontal. This value is restored when a valid S(A) is executed.
7.3.4.4 T(E) - restore saved Text attributes
Restore text attributes that were in effect when the last previous B option was encountered.
If there was no previous B option specified, the default values for all states are restored. Repeated T(E) commands without intervening T(B) commands will restore whatever was saved by the last T(B), or the defaults if there has been no previous T(B) since power up.
7.3.4.5 T(H<number>) - set Text Height
Set the character height to be half of <number> times the standard-size-1 cell height, leaving the character width unchanged.
T(S) changes the entire character display cell size; T(H) changes only the height, the width remaining as set by T(S). The value may have a fractional part, but truncation to the next lower integer is allowable. Devices must accept values for <number> in the range of 1 to 25; conforming software will not use values outside of this range. Values larger than 16 should be implemented by use of the T(S[]) construct. This state has no default value, as the default for T(S) applies.
7.3.4.6 T(I<ang>) - set Text Italic slant
Slant subsequent characters by <ang> degrees, referenced from the perpendicular to the baseline and measured from the upper left corner of the character cell.
Positive angles cause the characters to appear to slant backwards. A zero <ang> returns the specifier to rectilinear. Resolution of italic angle may be device dependent, and angles greater than 45 degrees (positive or negative) may be taken to be exactly 45 degrees (positive or negative). The default value for this state is 0 degrees (upright); this default is restored when a valid S(A) is executed.
7.3.4.7 T(M[<hint,vint>]) - set Text pixel Multiplier
Multiply each pixel from the stored character image width by hint, and each pixel from the stored character height by vint.
This is a non-positional use of bracketed extents. Both the standard-size-1 unit cell (character image) and the standard-size-1 display cell (character image plus intercharacter background) are scaled according to these multipliers. If either <hint> or <vint> is missing, that value is interpreted as whatever value is appropriate for standard size 1. This function provides for compatibility with older implementations of ReGIS. The preferred mode of character scaling is by use of cell unit size and cell display size, T(U) and T(S), respectively.
7.3.4.8 T(S[<width,height>]) - set Text display cell Size
Set display cell size in the current screen addressing coordinates, but oriented with respect to the value of T(D) in effect.
This is a non-positional use of bracketed extents. The display cell is that area of the display affected by the writing of a character. It comprises the unit cell (see T(U[]), below) and whatever background area is required to achieve the extent defined as the display cell. Display cell size must be executed to within one physical pixel of the size specified; there is no fallback, as is allowed for the scaling of the unit cell. Refer to "further notes," below, for more on display and unit cells. If either <width> or <height> is missing, the missing values default to the values that correspond to the (device dependent) standard size 1, as would be set by T(S1). Maximum values of <width> and <height> are determined by the arithmetic capacity of the ReGIS device and the current imposed coordinate space, that is, 16 bit integer arithmetic. Default text display cell size is device dependent, and the default is restored on execution of a valid S(A).
7.3.4.9 T(S<number>) - set standard Text display cell Size
Use one of the "standard character sizes". Set the character width to be <number> times standard size 1 character width, and the height to be three-quarters of <number> times character height standard size 1. This element also sets a device dependent character escapement value; this escapement is relative to the character direction specified by the D option. "Standard size zero", S0, is implemented as the smallest possible character rendering on the device. As for the H option, the argument may be fractional, but may be truncated to the next lower integer if the implementor chooses. Devices must accept values for <number> in the range of 0 to 16; conforming software will not use values outside of this range. A value of zero for <number> may have special, device dependent meaning. Values larger than 16 should be implemented by use of the T(S[]) construct.
7.3.4.10 T(U[<width,height>]) - set Text Unit cell size
Set unit cell size in the current screen addressing coordinates, but oriented with respect to any T(D) in effect.
This is a non-positional use of bracketed extents. Unit size is the size to which the character image is meant to be set. Allowable fallback is to scale the unit cell down to the next executable size smaller than that specified. If the unit cell size specified is bigger in either dimension than the display cell, the unit cell is truncated to the borders of the display cell. Refer to "further notes," below, for more on display and unit cells. If either <width> or <height> is missing, the missing values default to the values that correspond to the (device dependent) standard size 1, as would be set by T(S1). Maximum values of <width> and <height> are determined by the arithmetic capacity of the ReGIS device and the current imposed coordinate space, that is, 16 bit integer arithmetic. Default text unit cell size is device dependent, and the default is restored on execution of a valid S(A).
7.3.4.11 T(W(<suboption>)) - temporary Write options
Set temporary writing controls, as in the Vector command.
7.3.5 Further Notes
A text "display cell", specified in terms of height and width (using screen addressing coordinates) by T(S[]), is the screen area to be written for each character.
A text "unit cell", specified similarly by T(U[,]), is the screen area in which the image from character storage is drawn. See Figure 8-8. If these two cells are not of identical size, the unit cell is upper-left justified in the display cell, with any display cell area not filled by the character image explicitly filled with the background color. If the unit cell is larger than the display cell, only the upper left portion of the character image is drawn; that is, the unit cell is clipped to fit in the display cell.
In the computational limit (that is, where the granularity of scaling arithmetic is continuous and not bound by pixel increments), the display cell and the unit cell should map to identical sizes. An acceptable fallback for less capable systems restricts Unit cell sizes to integral multiples of the character storage cell defined for the character set by Load Pattern command, L[,]. A unit size that does not represent such an integral multiple may be rounded down to the nearest integral multiple value. Implementations may choose to round up if the target size is only slightly less than the closest realizable size, and if the resulting unit cell would not exceed the display cell. The display cell must be executed to within one physical pixel of its specified size.
The L command defines bit patterns; these are invoked by the T command and as area shading patterns in the W(S'x') command. Alphabet set 0 contains an 8-bit character in-use set. The content of this set is as determined by the ReGIS Base command T(A(L"*",R"*")). All sets except alphabet 0 may be loaded using the L command. See the description of the Load command for further information.
Different alphabets may be simultaneously available for loading and execution.
7.4 Report Instruction
There is one option to the report command in Raster ReGIS not in the ReGIS Base. It reports back the saved names of the loadable character sets.
7.4.1 R(L) - Report selected Loading alphabet
Report back the name of the pattern set currently selected for loading. The format of the report is (A'<name>') where <name> is the name provided in the L(A'<name>') command.
7.5 Load Character Set Instruction
A ReGIS device may implement several alphabets. These alternate alphabets are selected for drawing using the "A" option with a numeric subargument in the text instruction. The alphabet numbered 0 may not be modified, though the defined font is implementation dependent.
ReGIS allows the non-Base alphabets to be loadable. If the Load character set command is implemented, then provision for at least three loadable alphabets must be made. Loadable alphabets and name tables, as defined by L(A<n>"name"), may have device dependent initial contents, but they must be volatile and subject to overwriting.
The general syntax of a load instruction is the letter "L" followed by the ASCII character index, as a quoted character, which will be used to refer to the character. This is then followed by a sequence of numeric parameters, each individual numeric specifying a single row in the character pattern.
The most significant bit is the leftmost displayed pixel; the first parameter is the top row of the character. Parameters are hexadecimal integers separated by commas.
7.5.1 Position Arguments
A bracketed coordinate specifier defines the storage size, in bits per character, to be used with the selected alphabet. This is a non-positional use of bracketed extents. The selected alphabet is cleared when its storage size is specified. The storage size determines how many bits, and how many rows of bits, are encoded into the character mask arguments of the Load command. The storage size maps to the unit cell size when characters are displayed. Negative values are not allowed in storage cell sizes, and the default values for storage cell sizes are device dependent.
7.5.2 Numeric Arguments
Each character cell is redefined by a string of bit patterns expressed as groups of ASCII hex digits (0 ... 9, A ... F or a ... f). A cell is terminated by a semicolon or a successive parenthesized option specifier or quoted character specifier.
Groups of hex digits, each of which specify the contents of one scan line of the character cell, are separated by commas, or by exceeding the maximum number of hex digits needed to specify one scan line. If, in a given device, the default storage size were 12 horizontal by 10 vertical, 3 is the maximum number of hex digits needed to specify one scan line. A fourth consecutive hex digit would be applied to the next scan line whether or not an intervening comma were encountered. Where the default storage size is not known, storage size should be specified, or commas should be used to separate scan line specifiers.
Cells are always loaded one row at a time using hex-ASCII characters. A cell map is specified from the top down, more significant bits leftmost in the specifier string.
If more hex digits are specified than are needed for a single line of the mask, the extra digits are used on the next line.
However, if the width of the character cell is not a multiple of four, any unneeded, low order bits of the last hex digit applied to that row are discarded, and NOT carried over to the next row. Each raster row is begun with a new digit.
If too few digits are specified to fill a row, they fill the low order portion of the mask, setting the high order portion to zero.
If fewer mask lines are specified than exist in a cell, the unspecified portion of the cell is cleared to zero.
If more lines are specified than will fit in the storage cell, these extra lines are ignored - NOT overflowed into the next sequential character.
Figure 8-9 shows the format of the raster-oriented character storage cell.
7.5.3 Quoted String Arguments
A single quoted character serves as the index into the character set selected for storage. It will be the same character used for recovery of the loaded cell in the Text and Write attributes Shading commands. If more than one character is present in a string, the first is used, and the rest are discarded. Separate character arguments are required to specify multiple mappings.
7.5.4 Options
7.5.4.1 L(A<integer>) - select Loading Alphabet
Select alphabet set <integer> for loading. If loadable alphabets are provided, at least three must be provided, and they must be numbered 1, 2, and 3. Different alphabets may be simultaneously selected for access (by T(A)) and loading (by L(A)). L(A) and T(A) have no effect on each other. The default character set selected for loading is 1, and this default is set when a valid S(A) is executed. If a specified value for <integer> exceeds the implementation limit, the value is ignored and the alphabet selected for loading is the same as the one selected before the out of range value was received.
7.5.4.2 L(A"<name>") - associate <name> with Alphabet
Associate <name>, which may be up to ten characters long, with the character set currently selected for loading. Both <name> and <integer> may be specified in the same option, but if <name> is specified first, it is associated with the currently selected set, not necessarily the one specified by <integer>.
7.5.4.3 L(E<integer>) - specify character set Extent
The <integer> parameter determines the greatest number of characters which can be stored as part of the selected alphabet. The selected alphabet is cleared when the extent is redefined.
The range of the extent begins with the space character (code value 2/0), and comprises <integer> characters. The ninety-fifth character position is code 7/14, the ninety-sixth is 7/15, the ninety-seventh is 10/0, the 191st is 15/14, and the 192nd is 15/15. Codes progress in order between those values. Extents greater than 96 represent character values beyond the 7-bit set, and these characters must be accessed by 8-bit codes.
Codes 7/15 and 15/15 might not be encodeable in quoted string arguments depending upon the ReGIS user's environment, but devices shall make these code positions available.
The default extent for each loadable alphabet is 96 characters. This default is set only at power up.
8 Open Extensions To ReGIS
The following specifies functions of ReGIS which have been used in product implementations or are standardized for future implementations, but are not required for conformance with any particular level of ReGIS. Extensions related to device technology not necessarily universal to devices which use that technology are described, as well as extensions which are potentially useful but not clearly called for on a cost/benefit analysis.
8.1 Screen Instruction
Position arguments to the Screen control command allow the devices the dynamic capability of performing screen motion, as in the case of text scrolling or "strip chart" generation. The range of implementation is very broad, ranging from no implementation at all to the full scale "panning" operation of allowing the operator to move the viewing window through a much larger image definition.
There are two models for the scrolling of data in a display:
Coupling the displayed data and display addressing, and decoupling both of these from the display.
A displayed entity has a fixed relationship to the address at which it is written. A line drawn from location [100,120] to [200,250], for example, will always maintain those end points, regardless of how the display addresses are moved about the display. This model is similar to drawing a picture on graph paper and viewing it through a rectangular window that can expose all or part of the graph paper behind it. Any new information is written on the graph paper, and the lines on the graph paper are used to address the display space. The origin is always fixed in relation to the graph paper, but the paper can be moved about behind the viewing rectangle, modifying the viewer's perception. If the viewing rectangle exceeds the boundaries of the graph paper, either the opposite edge of the graph paper wraps in, or the view is truncated.
Coupling the display addressing and the display, and decoupling these from the displayed data.
The display (the viewing window in the example above) and its addressing scheme are coupled. When data move, they do so in a manner which moves them from the address at which they were executed.
This follows the addressing scheme of most text terminals. As data are entered at the bottom, for example, on line 24, old data move up through the address space to line 1 and off the top. Line 1 is always at the top, and line 24 is always at the bottom. Recovery of data moved off the display by scrolling in the opposite direction cannot be guaranteed.
In summary, the windowing model may extend into a general window to viewport model, the scrolling model mimics the use of text terminals for display. The appropriateness of either model depends upon the goals and capabilities of the underlying hardware. Neither model is preferable or prerequisite to the other. Neither model is required; devices may elect to not move data in their displays at all.
8.1.1 Position Arguments
In the first data movement model above (the windowing model), position arguments specify an address in the display address space where the origin of the viewing rectangle is to be positioned. Data appear to move left as the origin moves to the right, but since the data and addresses move together, data are generally recoverable by reversing the direction of the movement.
In the second data movement model above (the scrolling model), position arguments specify an address in the display address space which will become the new origin. As in the windowing model, data appear to move to the left as the origin is moved to the right, but in this model the data cannot necessarily be recovered by reversing the scrolling, since the data may have been moved off and erased from the display medium.
If data movement is supported in a ReGIS implementation, the choice of models used is device dependent. If the hardware can support both models, the model in effect is chosen by the S(D) option, described below.
8.1.2 Numeric Arguments
Numeric arguments to the Screen control command are treated as pixel vector specifiers. They are considered to be equivalent to relative address specifiers and are executed as a relative bracketed position argument. The data movement model chosen is the same for pixel vectors as it is for position specifiers.
8.1.3 Quoted String Arguments
There is no significance to quoted string arguments to the S command in Open Extensions to ReGIS.
8.1.4 Options
8.1.4.1 S(A) - screen Address definition
The prime function of the screen addressing command in Open Extentions to ReGIS is as it is in the Base. The following states representing Open Extensions are reset to defaults as a result of the execution of the execution of a valid S(A).
The equivalent ReGIS command that would institute this setting is shown after the defined action.
Blink attribute is set to off.
Equivalent explicit command: W(A0)
Line width is set to nominal.
Equivalent explicit command: W(L1)
Shading state is set to disabled.
Equivalent explicit command: W(S0)
The clip rectangle is set to the range indicated by S(A), and clipping is disabled.
Equivalent explicit command: S(R[][]0) <[][] as in enabling S(A[][])>
The display offset or scroll state is set to match the first coordinate of the S(A[][]) to the upper left hand corner of the display.
Data movement control is set to its device dependent value.
Equivalent explicit command: S(D1), scrolling (if supported; else S(D0), windowing)
Cursor visibility is set to ON, and the default cursors are selected.
Equivalent explicit command: S(C(H1)(I1)1)
Screen scaling is set to 1.
Equivalent explicit command: S(S1)
The color output map is NOT AFFECTED by executing an S(A).
8.1.4.2 S(C) - visible Cursor control
Most interactive devices support a visible cursor that identifies either or both of the current drawing position or an input track position. The C option to the Screen control command implements access to this facility. A numeric subargument to the C option enables and disables the visible cursor. S(C1) enables the cursor display, S(C0) disables it. The default value for cursor visibility is enabled.
Suboptions and subarguments to the S(C) command allow for the selection among different cursor representations, and simultaneously different cursor representations for output and input tracking indicators.
Suboption S(C(H<n>)) allows for selection among various styles of output cursor. The value of <n> selects among predefined cursor styles. A value of zero or one for <n> selects a diamond shaped cursor with a small crosshair inscribed. This is the default cursor shape, and is selected after a valid S(A) has been executed. The diamond cursor is normally no more than a half inch or so in size. A value of 2 for <n> selects a full screen cross hair cursor. This cursor is composed of two lines, one horizontal, one vertical, that intersect at the drawing position.
Suboption S(C(I<n>)) allows for selection among various styles of input cursor. The value of <n> selects among predefined cursor styles. A value of zero or 1 for <n> selects a the diamond cursor identical to the diamond output cursor. This too is the default cursor, and is selected after a valid S(A) has been executed. A value of 2 for <n> selects a full screen cross hair cursor, again identical to the related output cursor. A value of 3 for <n> selects a rubber band line, and a value of 4 selects a rubber band rectangle as the input echo cursor. The two rubber band styles are anchored (the first end of the line and one corner of the rectangle) at the output drawing position in effect at the start of the input operation. The other end of the line and the diagonally opposite corner of the rectangle track the input position.
Additional subarguments to the S(C(I)) and S(C(H)) commands allow for program defined cursors. The cursor is defined by a pair of characters (a single quoted string) and an offset position. The two characters are overlaid, with each one being rendered in a different color or intensity if color or gray scale is supported. If the implementation chooses to blink its cursors, the two characters should alternate between the two colors in opposite phase. The characters come from the alphabet currently selected for drawing by T(A). The offset is the distance, in character cell pixels, from the origin of the character cell to the point that will be tracked for output or input. This distance is always relative to the displayed location of the overlaid character pair. For example,
S(C(I[+4,+8]"?="))defines and selects an input cursor composed of an overlaid ? and =, with an offset of four horizontal pixels and eight vertical pixels from the corner of the overlaid cells to the tracking position. The command
S(C(H[+0,+0]"OX"))defines and selects an output cursor composed of an overlaid O and X, with the tracking location at the upper left hand corner of the character cells.
Applying the offset and quoted string subarguments of the S(C(H)) and S(C(I)) forms to the S(C) command directly, as by S(C"XO"[+4,+4]), enables the capabilities as described immediately above, but for all possible cursors at once. This is an acceptable fallback for devices that do not have separate output and input tracking cursors, or may be used as a shorthand way of controlling both cursors at once. Note that the anchor point for rubber band output cursors is not specified by this standard. Likely choices might be the screen origin, the screen center, or the top point of the current position stack.
8.1.4.3 S(D<integer>) - data movement control
For devices supporting both data movement models, the D option switches between them. The <integer> argument to D is 0 for systems which couple data and addresses, and allows data to be recovered by reverse scrolling. This is the windowing model, and is most useful in conjunction with the Screen Scaling option, S(S), below. An <integer> argument of 1 indicates that the scrolling model should be used, where the address space and the visible display are coupled, and the data change addresses as they move about the screen. If neither model is implemented, the option is ignored. If a device supports both modes, the default value is 1 (scrolling model); this default is set when a valid S(A) is executed.
8.1.4.4 S(H(<suboptions>)[][]) - retransmit Hard copy
The hard-copy option retransmits the visible image on the display surface to a second display device. This command is primarily for dot matrix transfer of images to hard-copy devices, but may also be used to store the image on another medium. The format of the retransmission, its encoding, or its media are all excluded from specification by ReGIS, though Sixels are the implementation choice in video terminals and host-based ReGIS systems. The hard-copy option may have up to two bracketed position specifier arguments which specify two opposite corners of a rectangular subset of the screen area. These position specifiers delimit the area of the display surface to be retransmitted. If only one position specifier is given, the rectangle is defined by that position and the current drawing position. If no position specifiers are given, the whole visible screen is output. Numeric arguments to the H option are NOT interpreted as pixel vector specifiers for purposes of specifying an area of the display for output.
A suboption P[,] specifies a starting offset for the graphics image when output is re-directed. The value specified refers to the offset to be executed on the device to which output is redirected. The values specified in the brackets are not necessarily those of the imposed coordinate space, but are implementation- and retransmission protocol- dependent. The upper left corner of the area retransmitted will be offset by the amount indicated in the P[,]. The value set by the suboption remains set until changed by the next occurrence of the P suboption, or until it is returned to its default by power up or execution of a valid S(A).
S(H[][]) is a non-positional use of bracketed extents. The value specified is always interpreted absolutely, whether signed or not. Any missing part of the bracketed extent is interpreted as 0. The default value for the state set by (P[,]) suboption is [0,0].
There is no standardized way to change the hard-copy offset without generating a dump, as the presence of the H option, necessary for the interpretation of the (P) suboption, has the primary meaning of "execute dump."
The amount of graphic information retransmitted may, at the implementor's option, be limited by the visibility of the image on the primary presentation medium. For example, if, in a two plane video device, the output map (controlled by S(M)) is set such that only the data in one of the two planes is visible on the primary output medium, the implementation may choose to only retransmit the visible information. In such cases, the method and limitations chosen must be clearly outlined in the product documentation.
8.1.4.5 S(M<index>(<color specifier>)) - modify the color Map
This command modifies the output map for devices with modifiable output maps. Value <index> specifies a device index, and <color specifier> is the HLS or RGB definition of that entry. The suboption alphabet for color specifiers is R, G, B, C, M, Y, W, and D for red, green, blue, cyan, magenta, yellow, white, and dark, respectively, and HLS for hue, saturation, and lightness. The interpretation for <index> is the same as for the indexed values to the foreground and background color index specifiers, W(I) and S(I). If <index> exceeds the number of entries in the selected map, it is mapped into the realized range as are the foreground and background indexes.
Suboption A<n> indicates which map is to be loaded for devices which have multiple maps. If A is not present, the primary map is used. If A is present without subargument, the primary alternate map is used. A color specifier must be complete in one suboption. The selected entry will generally be marked for loading when the terminating ")" is encountered, but the implementation may batch a series of <index>(<color specifier>) sets and load all specified entries at once to reduce undesired image "staging" due to piecemeal map changes.
The initial contents of all maps in a device is device dependent, but each entry in the map should be visually distinct from every other entry (and from the background, if it is mapped separately). This applies unless there are more entries than supported colors, or unless the number of colors supported approaches or exceeds the number visually distinguishable.
Color maps are set to their defaults only at device power up.
8.1.4.6 S(R<n>[][]) - define and enable/disable a clip Rectangle
A clip rectangle is a region of the display that can be used to limit the area that can be written. The S(R) command in ReGIS allows such a rectangle to be defined, and to enable and disable the limiting action.
The bracketed extents in the S(R) command define the two opposite corners of a rectangle, the sides of which are parallel to the ReGIS coordinate axes. These are positional specifiers, and may use relative addressing. Both corners must be specified. If only one specifier is present, the extent of the clip rectangle is not changed. If more than two are present, only the last two are used.
The numeric argument to the option is a switch to enable and disable clipping action. If <n> is equal to zero, then clipping is disabled, and drawing actions can take place everywhere in the display. If <n> is greater than zero, drawing actions are limited to the interior of the specified clip rectangle. The "interior" of the clip rectangle is defined to include what would be drawn as the boundary of the clip rectangle.
As an extension, values of <n> less than zero indicate that drawing activity is limited to the exterior of the clip rectangle. This action is called "shielding." The exterior of the clip rectangle includes all the drawing area not in the interior (in particular, the boundary is NOT part of the exterior).
The extent of the clip rectangle can be set by an instance of the command without changing the enabled state. For example, the command S(R[][+200,+200]) sets the clip rectangle to an extent 200 square, starting at the current drawing position, but it does not affect the state of the clipping activity. A subsequent S(R1) will enable clipping to this area, or S(R0) will disable clipping, without changing the extent.
The clip rectangle maintains its position in the coordinate space, even if the display supports scrolling. The effect is that the clip rectangle moves with the data if the windowing model, S(D0), is supported, and the data move through the clip rectangle if the scrolling model, S(D1), is supported. In the latter case, data that move out of the clip rectangle never disappear just because of movement out of the clipping rectangle.
Screen erase, S(E), always erases the entire display, regardless of the clipping state. Erase mode writing, on the other hand, is bounded by the clip rectangle if clipping (or shielding) is enabled.
The default clip area is the extent defined by the last valid S(A) or the entire display surface, if no S(A) has yet been encountered. The default clip state is disabled, allowing writing to the entire display surface. Both defaults are restored by valid S(A) commands.
8.1.4.7 S(S<n>(<suboptions>)) - Scale the visible image
This option is used for devices which can scale images after they are displayed. Taking the model of pixel replication, the subargument <n> is treated as a multiplicative scale factor for each pixel in the display. When the S(S<n>) form is used, the display is scaled isotropically. There are two suboptions (X<n>) and (Y<n>) for scaling independently in X and Y. The display can be rescaled only by respecifying a scale factor of 1. This option is most useful with the windowing data movement model described above. The S(S) option causes the display medium (the bit map, for example) to become bigger than the display surface. S(S) and S[] then combine to move a small window through a large display space.
Negative values for scaling factors are not allowed. A value which exceeds the implementation limit in a device is mapped to the implementation limit. The default value for scaling factors is 1, and is restored by the execution of a valid S(A).
8.1.4.8 S(W(<suboptions>)) - temporary Write options
This command sets temporary writing controls just as in the Vector command. The only useful temporary writing control within the Screen command is S(W(M)), which sets the pixel vector multiplier. The pixel vector multiplier affects the granularity of the display motion generated by S<pixel vector> commands.
8.2 Position Instruction
8.2.1 P(P<n>) - select drawing surface
Some devices have multiple separate drawing surfaces. Programs may select among these separate surfaces with the P option to the P command, P(P<n>). The value of <n> identifies the drawing surface selected. All drawing surfaces share the same state store, that is, current drawing color, selected text alphabet, macrograph store, position stack, and so on.
8.3 Writing Attributes Instruction
There are four options extensions to the Write attributes instruction.
8.3.1 W(A<n>) - Alternate (blink)
This option enables the blink (or "alternate") attribute. For values of <n> greater than zero, set the blink attribute on all foreground data drawn until blink is disabled. Application of the blink attribute is disabled by W(A0), S(E), or valid S(A). Clearing the subsequent application of the blink attribute by W(A0) does not change the blinking status of any displayed elements, any more than changing the foreground specifier with W(I) changes the color or intensity of any pre-existing data on the display.
The visible action of blink is implementation dependent. The alternation may be between foreground and background intensities, or between foreground and some other device-dependent setting. Interaction of the blink attribute with Complement and other image-content dependent writing modes is device dependent. Blink frequency and duty cycle are device dependent.
8.3.2 W(L<n>) - Line width control
This option controls the width or weight of lines and curves. The value <n> is a multiplier of the device's nominal line width. Nominal line width is device dependent, and is normally the device's default line width. W(L2) sets a width twice the nominal width, W(L3) three times, and so on.
Fractional line widths are allowed. For example, W(L0.5) specifies a width 50% less than nominal, and W(L1.5) specifies a width 50% greater than nominal. Devices that do not support fractions may truncate to the next lower integer or round to the nearest integer, just as they do for other numerics. W(L0) selects the minimum imageable line width.
8.3.3 W(S(<suboptions>)) - Shading
The Shading option to the W command accepts subarguments indicating a shading reference line and shading texture. There are also suboptions to the W(S) form which indicate whether shading takes place to a horizontal line (the default), a vertical line, or to a point. The form W(S(Y)...) indicates that the shading takes place to a horizontal reference line; this is the default. See Figure 7. The form W(S(X)...) indicates that the shading takes place to a vertical reference line. The form W(S(P)...) indicates that the shading is to a point. These suboptions are volatile, that is, every invocation of shading assumes that shading is to a horizontal baseline unless a countering (X) or (P) suboption is provided.
8.3.4 W(W) - microcoded Writing modes
Detailed control of multiplane writing is enabled with the Write control option to the W command, W(W). The option W accepts a numeric index and suboptions P<j> and N<k>. The form of the instruction extension is W(W<i>(P<j> N<k>)). The values <i>, <j>, and <k> are indices for memory contents, typically bit plane values. If a pixel to be written has value <i> before the write operation, it is written to value <j> if the next value from the pattern register, area pattern, or character cell is a 1, or to value <k> if the next masking value is a 0.
These settings override the last specified write mode control option (R, C, V, N, or E), but only those entries explicitly loaded take effect. Any entries not loaded retain their settings as determined by the last effected Writing mode command.
Any Writing mode command overrides all detailed settings.
The default writing modes are reset when a valid S(A) is executed.
8.4 Text Instruction
[This section became blank as a result of the movement of 8-bit character support to Base ReGIS.]
8.5 Report Instruction
8.5.1 R(E) - Report Error
This command reports back the last error encountered by the ReGIS parser. The format of the error report is "n,m", where n is a decimal digit string representing the error code, and m is a decimal digit string returning supplementary information. Except where noted below, this supplementary information is the decimal equivalent of the character code of the character flagged as causing the error. When it cannot be determined exactly what caused the error, 0 is returned in the error character field. Only the most recent error code is kept in the error report register. The error report register is cleared when ReGIS is synchronized by a ";" or by activation synchronization. The error report register is not cleared when the report is sent. The following are the reportable error codes:
0 = no_error: No error has occurred since the last synchronizing operation. The supplementary error field returns 0.
1 = ignore_character: An unexpected character was encountered and ignored.
2 = extra_option_coordinates: A command option that supports paired bracketed extents (such as S(H[][]) or S(A[][])) contained more than two coordinate pairs. The supplementary error field returns 0.
3 = extra_coordinate_elements: The syntax [,] contained more than one comma. Characters after the second comma up to the right square bracket (]) were ignored. The supplementary error field returns 0.
4 = alphabet_out_of_range: The syntax L(An) or T(An) contained an alphabet number "n" that was less than 0 or more than the implementation limit.
5 = alphabet_attribute_error: At least one of the following is true:
In the syntax L(An)[h,w] or L(An,Ex), the alphabet number "n" was zero. The attributes of the default alphabet (alphabet 0) may not be modified.
In the syntax L[h,w], the height "h" exceeded the implementation limit.
In the syntax L[h,w], the width "w" exceeded the implementation limit.
In the syntax L(En), the alphabet extent "n" exceeded the implementation limit.
6 = reserved code
7 = begin/start_overflow: The implementation limit for position stack depth was exceeded, that is, a V(B), V(S), P(B), or P(S) could not be processed because the stack was full.
8 = begin/start_underflow: A V(E) or P(E) was encountered without a matching V(B), V(S), P(B), or P(S) preceding it.
8.5.2 R(I<n>) - Input processing mode
This extension selects between separate or overlapped input and output processing. R(I0) selects "one-shot" mode. In this mode, which is the default mode and is set by executing a valid S(A), processing of ReGIS output is suspended by the device while interactive input (R(P(I)) is pending. Furthermore, input data can be transmitted by the device only once per R(P) or R(P(I)) command.
R(I1) selects "multiple input" mode. In this mode, the device can report positions with or without receipt of R(P) or R(P(I)) commands. The device reports on operator actions on the input devices, typically a mouse or graphics tablet. While in multiple input mode, the device can continue to execute output commands as received.
The commands R(I0) or S(A) exit multiple input mode.
8.5.3 R(P(I)) - Report Position Interactive
This extension differs from the Report Position command in the Base ReGIS in that it enables local interaction with an input device. This command puts the ReGIS device into input mode. In this mode an input device, such as a data tablet, mouse, or cursor keys cause an echoing cursor to be shown on the display surface. This echo tracks the input device, and generates a position report when the user generates a break condition. This break is usually effected by enabling an auxiliary control, such as a control button, associated with the device.
There are three responses allowed to the R(P(I)) command:
The normal bracketed coordinate specifier, just as from the normal R(P) command - This is the result from a non-interactive device.
An empty report - Only the terminating CR is sent. This is in response to a special break condition set by the user, indicating that NO INPUT was to be returned.
A normal bracketed response preceded by a break condition indicator - This indicator may be a single character code or a numeric string. This passes more details of the break condition to the application.
This command is purposely underspecified because of the wide variety of input device and input/output device couplings.
8.6 Flood/Fill Instruction
The Flood/ Fill command, keyletter "F", specifies general area operations in ReGIS. As was the case with Circles and Curves both being expressed by a single keyletter, Fill and Flood are really different commands in similar guises. Mixing of options intended to affect Flood (B) with those intended to affect Fill (P, V, and C) is non-conforming usage, and the effects of such mixing are not standardized.
Flood "colors in" a bounded area already present in the bit map with variable pattern or texture. Refer to 8.6.4 Area Attributes for a discussion of the various area coloring modes. Flooding is implemented in devices with read-write display media, such as bit map raster displays, since the display medium must be interrogated to discern seed values and boundary values.
Fill defines bounded areas by their edges and colors in only and entirely, subject to area texture or pattern in effect, the area (or areas) bounded by the edges presented. Fill is defined in Base ReGIS, and is extended here. Implementations which support the F command may elect to support either Flood or Fill or both at their option.
8.6.1 Position Arguments, Numeric Arguments
A position specifier to the F command, either a bracketed coordinate specifier or a pixel vector digit, specifies the location of the "seed" pixel from which a Flood is executed. The border of the flooding operation is as determined by the last previous F(B()) encountered. If more than one specifier is given, each is executed in turn. The current position does not change as the result of any flood operations.
8.6.2 Quoted String Arguments
There is no meaning assigned to the presence of quoted character arguments in Fill or Flood commands.
8.6.3 Options
8.6.3.1 Flood
8.6.3.1.1 F(B(<suboption>)) - flood Boundary condition
This option sets Boundary conditions for the definition of the closed area to be flooded. If the <suboption> is F0, a flood will bounded by image areas represented by the background. If it is F1, the flood is bounded by any foreground value different from the seed value, or any foreground if the seed location has the background attribute. If the <suboption> is I<integer> or I(<color/intensity spec>), the flood is bounded by parts of the image with the attribute so specified.
The default boundary for a flood is as set by F(B(F1)), that is, any foreground setting different from the seed value. This default is restored upon execution of a valid S(A).
8.6.3.2 Fill
Extended Fill acts as Fill defined in Base ReGIS, with an extension to support complex polygons.
8.6.3.2.1 F(...F...) - fill complex polygon
A "complex polygon" is defined as a closed figure described by an explicitly disconnected set of edges. Many letterform shapes fall into this category. The letter "O," for example, may be described as two roughly concentric closed curves defining the outer and inner perimeters of the letter shape. The letter "B" may be described as two polygons within a third. Because of the interior rules for polygons, the letter "i" may be defined as a complex polygon with disconnected but nested definitions for the body of the i and its dot. See Figure 8-11, below.
The F option to the F command provides for a one-level deep recursion of polygon definition to allow for the description of such complex polygons. Further subarguments to the F option are the same V, P, and C options described above. The presence of the F option decouples the edge streams from one another. This allows nested polygons to be defined without the need for an invisible edge to connect the edge list definitions. The recursion of the F option need only be one deep because of the interior rules for polygons. The position of the F option within the F command is not critical as regards the ordering of the subpolygons. This is because of the interior rules and the deferred execution of polygons until the polygon fill terminator is encountered.
Complex polygons must abide by the same constraints as simple polygons as regards the number of entries in the vertex list. The total number of vertices is the critical parameter. There need not be a separate vertex list for the nested polygons. Multiple nested polygons using the F(...F...) option are shown in Figure 8-11. Note that as the inner loop of the complex polygon is moved out of the outer, its interior takes on the interior attribute, until, when entirely outside, it becomes a disjoint polygon.
8.6.3.3 Common
8.6.3.3.1 F(W(<suboption>)) - temporary Write options
Set temporary write options, as in the other drawing commands.
8.6.4 Further Notes
The Flood command uses as a flood pattern the last selected area shading pattern as defined by W(S<n>), which selects a pattern defined by the linear pattern specifier W(P), or W(S"x"). This is true even if shading has been subsequently disabled by W(S0). Shading should be disabled before a flood or fill operation is initiated. The currently selected write mode and intensity specifier are used. These may be changed by the temporary write options to the Flood command.
The boundary conditions for the flood operation may be expressed in one of three ways:
As a specific attribute condition.
As any change in attribute with respect to the seed location attribute value.
In the single plane system, any change between the foreground and the background state.
The flooded area does not include the boundary. For example, if a red (unfilled) circle is on the display, and the current write mode is solid green, a flood of the interior of the circle will leave a green circle with a red circumference. This allows the edge of other objects to be used as a boundary without modifying that other object.
If the area in which the seed location is found is not closed with respect to the boundary conditions set, the flood will "leak out", causing a writing action that could cover the entire display. Note that non-solid vectors written in overlay mode do not necessarily form closed boundaries.
Areas may have complex boundaries, such as the area between two concentric circles, or the area between bounded figures on a background.
A boundary need only be connected by diagonally adjacent pixels to define closure for Floods.
9 Installation Environments
This section contains an outline of the requirements for environmental support for ReGIS.
For the purposes of this section, assume that ReGIS addresses two environments for the application of the graphics instructions:
Descriptor code enveloped in ANSI escape sequences and transmitted on character oriented data paths, or
Use in a bounded graphics system.
9.1 ANSI Encoding
The ReGIS command syntax is specified as if it were a seven bit encoding. Allowance for an eight bit encoding is an environmental issue. For example, ReGIS may be encoded into either the left or right half of an eight bit code table, and only character codes of the proper sense could be passed to the parser. However, ReGIS shall accept eight bit codes within quoted strings for use as arguments to text-related or text-indexed commands.
For communication to devices or interpreters that accept ReGIS as, perhaps, one of many device syntaxes, ReGIS commands shall be introduced by a DEC-private parameterized form of the ANSI escape sequences Device Control String (DCS) and terminated the ANSI escape sequence String Terminator (ST).
For communication to interpreters that accept only ReGIS, such as dedicated software for ReGIS translation, or that are capable of identifying the data syntax in a file by other means (such as file type flagging), ReGIS commands need not be delimited in any way.
The DEC-private parameterized form of DCS is
ESC P<n><protocol selector>
where <n> represents an ANSI X3.64-like parameter string encoding device controls, and the <protocol selector> for ReGIS is lower case "p".
A ReGIS interpreter must recognize two flags encoded in the first numeric parameter <n> if one is present in the invocation stream.
If the least significant bit of the numeric value is a '1', then the interpreter shall force an environmental resynchronization before interpreting any following ReGIS instructions. This level of resynchronization takes place regardless of the previous state of the interpreter, and returns the interpreter to the highest command level with no quoted strings or macrograph definitions in process. This resynchronizing mechanism shall be implemented in all ReGIS interpreters that use DCS/ST delimiting.
If the second least significant bit of the numeric is '1', the interpreter shall process the ReGIS instructions as it otherwise would, but should also pass along the source ReGIS stream to a text display process for display as text. This simultaneous display action is useful for debugging software using ReGIS on terminals and other interactive devices. This concurrent display action is not mandatory for ReGIS interpreters, and is obviously not applicable in all instances.
ST is encoded as
ESC \
and is the standard terminator for the collection of ANSI escape sequence strings.
All characters within this sequence following the protocol selector, up to but not including the string terminator are interpreted as ReGIS instructions. Although an entire screen image does not have to be included in one invocation of these sequences, individual instructions should not be broken up across escape sequence boundaries.
Some implementations may require that leaving ReGIS and re-entering via ST and DCS cause the parser to resynchronize, as if a semicolon were encountered within the instruction stream or as if a resynchronizing parameter were included in the invoking DCS.
Some devices scan for and parse ANSI-mode escape and control sequences while interpreting ReGIS. Some of these devices execute escape sequences as if the devices were not in ReGIS mode, and return to ReGIS mode after such execution. Other devices use the occurrence of any escape code, code position 1/11 or 8/* or 9/*, as reason to exit the ReGIS mode. Such use may be necessary to support non-conforming software, but such use is deprecated by this standard.
9.2 Bounded Systems
ReGIS is also intended for use in bounded systems even if no remote communications link is involved. Therefore, images defined in a bounded system may be used in distributed systems and vice versa.
In the realm of such bounded systems, ReGIS should be considered for the following purposes:
Graphics text file definition of a graphic image.
Direct use of ReGIS instructions in high level languages when no embedded graphics statements are provided.
Communication of a graphics image to a separate graphics device.
It is assumed that such a device should have a ReGIS interface "driver" to convert the character strings originating at any of these sources to the native graphics hardware instructions of the system.
10 ReGIS Command Complement
The following sections summarize the assigned ReGIS command elements. Each section outlines a separate command.
In ReGIS, a command keyletter can take four forms of argument: bracketed extent, numeric, quoted string, and parenthesized options.
Numeric arguments are classified by semantic use, as pixels vector, scalar value, boolean, switch, or other use.
Parenthesized options contain keyletters, each of which can be followed by any of the four argument forms.
Indenting of the construct identifiers indicates its applicability and scope, as if in an outline.
Thus indented under each keyletter will be one or more of [] (for bracketed extent), n (for numeric), "" (for quoted string), and () (for options and further nesting). Under a () line or subline will be the subarguments and suboptions that apply in that option.
The text on the right describes the capability encoded by the construct(s) on the left. Part of this description will be an indication of where that construct is defined and what conformance level of ReGIS it applies to. The notation {B} indicates the construct is part of the ReGIS Base; {R} indicates the construct is part of Raster ReGIS, and {O} indicates the construct is part of Open extensions to ReGIS. Unless otherwise indicated, all constructs have the conformance level of their parent construct.
10.1 Screen Instruction
S | screen control commands {B} |
[] | screen data movement {O} |
n | pixel vector, screen data movement {O} |
() | |
A | screen coordinate definition {B} |
[] | coordinate extent (two [] required) {B} |
C | cursor control {O} |
n | boolean - cursor enable/disable |
"" | text character used for cursor |
() | |
H | drawing position cursor control |
"" | (as for S(C"")) |
[] | (as for S(C[])) |
I | input tracking cursor control |
"" | (as for S(C"")) |
[] | (as for S(C[])) |
D | data movement mode {O} |
n | data movement mode selector |
E | erase display {B} |
F | feed medium/image complete {B} |
n | value, frames to advance medium |
H | image retransmit {O} |
[] | area of display to retransmit (1 or 2) |
() | |
P | destination image offset |
[] | destination image offset vector |
I | background intensity selector {R} |
n | value, background index |
() | color/intensity specifier |
RGBCYMHLSDW | (the ReGIS color/intensity alphabet) |
M | load output color map {O} |
n | value, output map entry index |
() | |
A | select alternate output map |
n | value,alternate map id |
RGBCYMHLSDW | (the ReGIS color/intensity alphabet) |
R | control drawing clip area {O} |
n | tri-state value: shield, clip, disable |
[] | define clip area (2 needed) |
S | scale display {O} |
n | value, scale factor |
() | |
X | scale in X direction |
n | X direction scale factor |
Y | scale in Y direction |
n | Y direction scale factor |
T | suspend interpretation for a time {R} |
n | value, suspension interval |
W 1
| temporary write options |
- Temporary write options apply as they would if set by a W at command level, but only for the duration of the current command.
10.2 Position Instruction
All Position components are defined in the Base, except as noted.
P | Position instruction |
[] | drawing point destination |
n | pixel vector, drawing point destination |
() | |
B | position stack push |
E | position stack pop |
P | change drawing/display surface {O} |
S | position stack push |
W 1
| temporary write options |
- Temporary write options apply as they would if set by a W at command level, but only for the duration of the current command.
10.3 Writing Attributes Instruction
W | Write attributes instruction {B} |
() | |
A | set writing mode to blinking {O} |
n | boolean, enable/disable blink |
C | set writing mode to complement {R} |
E | set writing mode to erase {R} |
F | enable foreground planes {R} |
n | value, foreground mask |
I | select foreground color/intensity {R} |
n | value, foreground index |
() | foreground color/intensity value |
RGBCYMHLSDW | (the ReGIS color/intensity alphabet) |
L | define line width {O} |
n | value, line width |
M | set pixel vector multiplier {B} |
n | value, pixel vector multiplier |
N | set writing mode negate {R} |
n | boolean, negate enable/disable |
P | select line drawing pattern {B} |
n | value or bit pattern, selects pattern |
() | |
M | select pattern element multiplier |
n | value, pattern element multiplier |
R | set writing mode replace {R} |
S | set area operation shading {R} |
n | boolean, enable/disable shading |
"" | select area pattern for shading |
[] | select shading baseline |
() | modify shading baseline selection {O} |
X | shade to X |
Y | shade to Y |
P | shade to point |
V | select writing mode overlay {R} |
W | set microcoded writing modes {O} |
n | before-writing pixel contents |
() | after-writing pixel contents |
P | if pattern element is 1 |
n | value of new pixel contents |
N | if pattern element is 0 |
n | value of new pixel contents |
10.4 Vector Instruction
All Vector components are defined in the Base.
V | Vector instruction |
[] | draw line to end point |
n | pixel vector, draw line to end point |
() | |
B | position stack push |
E | draw to position stack top entry, pop |
S | push empty entry to position stack |
W 1
| temporary write options |
- Temporary write options apply as they would if set by a W at command level, but only for the duration of the current command.
10.5 Curve Instruction
All Curve and Circle components are defined in the Base.
C | Curve/Circle instruction |
[] | operating point of curve or circle |
n | pixel vector, operating point |
() | |
A | limit circles to circular arcs |
n | value, degrees of circular arc |
B | begin closed curve interpolation |
C | circumferential circles |
E | end curve interpolation |
S | start open curve interpolation |
W 1
| temporary write options |
- Temporary write options apply as they would if set by a W at command level, but only for the duration of the current command.
10.6 Text Instruction
T | Text Instruction {B} |
[] | set character-to-character escapement {B} |
n | pixel vector, character position offset {B} |
"" | text to draw {B} |
() | |
A | select character set {B} |
n | select alternate character set {R} |
() | |
L | select standard character set into GL {B} |
"" | character set identifier |
R | select standard character set into GR {B} |
"" | character set identifier |
B | save current text state {R} |
D | set character/ line baseline direction {R} |
n | value, angle of baseline direction |
E | restore saved text state {R} |
H | set character drawing height {R} |
n | value, character drawing height |
I | select character slant {R} |
n | value, character slant angle |
M | select character mask pixel multiplier {R} |
[] | pixel mask multiplier |
S | set character drawing size {R} |
n | value, character drawing size multiplier |
[] | character display cell size |
U | set character unit size {R} |
[] | character unit size |
W 1
| temporary write options |
- Temporary write options apply as they would if set by a W at command level, but only for the duration of the current command.
10.7 Report Instruction
R | Report instruction {B} |
() | |
E | report error status {O} |
L | report alphabet selected for loading {R} |
I | set input mode {O} |
n | boolean, input mode |
M | report macrograph contents {B} |
() | |
x | macrograph name |
P | report drawing position {B} |
() | |
I | report input position {O} |
10.8 Fill/Flood Instruction
F | Fill instruction {B} / Flood {O} |
[] | flood source position {O} |
n | pixel vector, flood source position {O} |
() | |
B | flood boundary condition {O} |
() | |
F | flood to foreground or background |
n | boolean, foreground/background selector |
I | flood to index |
n | value, index of flood boundary condition |
() | color/intensity of flood boundary |
RGBCYMHLSWD | (ReGIS color/intensity alphabet) |
F | fill complex figure {O} |
() | (as for normal fill option list) |
PVC 2
| specify filling boundary {B} |
W 1
| temporary writing options |
- Temporary write options apply as they would if set by a W at command level, but only for the duration of the current command.
- Filling boundary is specified by the same Position, Vector, and Curve/Circle formats as would be used to draw the outline alone.
10.9 Load Character Set Instruction
All Load character set components are specified in Raster ReGIS.
L | Load character cell |
[] | specify character cell size |
n | numeric (special radix), character cell data |
() | |
A | select alphabet for loading |
"" | associate name reporting name with alphabet |
n | value, alphabet to be loaded |
E | set size of character set to be loaded |
n | value, number of characters |