Information technology - Computer graphics - Interfacing techniques for dialogues with graphical devices (CGI) - Data stream binding - Part 1: Character encoding

Specifies a character encoding of the computer graphics interface. For each of the functions specified in ISO/IEC 9636 an encoding is specified. The encoding provides a highly compact representation of the data, suitable for applications that require the data to be of minimum size and suitable for transmission with character-oriented transmission services.

Technologies de l'information — Infographie — Techniques interfaciales de dialogues avec dispositifs graphiques (CGI) — Liaison de courant D — Partie 1: Codage des caractères

General Information

Status
Published
Publication Date
02-Mar-1994
Current Stage
9093 - International Standard confirmed
Start Date
16-Jun-2021
Completion Date
30-Oct-2025

Overview

ISO/IEC 9637-1:1994, "Information technology - Computer graphics - Interfacing techniques for dialogues with graphical devices (CGI) - Data stream binding - Part 1: Character encoding," defines a compact character encoding for the Computer Graphics Interface (CGI). Designed to minimize data size and to work over character-oriented transmission services, this standard maps every CGI function (as specified in ISO/IEC 9636) to a compact, transportable character-stream representation suitable for storage and low-bandwidth transfer.

Note: in this context CGI = Computer Graphics Interface (not web CGI).

Key Topics

  • Purpose & objectives: regular syntax for simple parsing, maximum compactness, extensibility and transportability for character-based networks.
  • Overall structure: general form of the data stream and rules for entering/leaving the CGI environment.
  • Function encoding: method for encoding opcodes, extension mechanisms, and soliciting functions; an annex lists CGI opcodes and escape sequences.
  • Parameter encoding: formats for integers, real numbers, Virtual Device Coordinates (VDC/points), point lists, color specifiers and color lists, string parameters, enumerated and index parameters, client-specified names, input-color parameters, and data record parameters.
  • Bitstream formats: 7-bit/8-bit code tables, bitstream, run-length and displacement/incremental modes for efficient coordinate and color data.
  • Compatibility and conformance: conforms to ISO 2022 code-extension rules and follows ISO/IEC 646 character-set conventions.
  • Auxiliary material: examples, defaults, classification and designation rules; annexes with opcode and escape-sequence listings.

Applications

  • Efficient transfer of graphical commands between systems over character-oriented links (e.g., legacy terminals, narrow-band networks, serial links).
  • Storage and archival of compact graphics command streams where file size matters.
  • Implementations of CGI-compliant device drivers, graphics interpreters and metafile converters that must interoperate with ISO/IEC 9636 functional definitions.
  • Embedded graphics systems and device controllers with constrained memory or bandwidth that benefit from compact opcode and parameter encodings.
  • Tooling for graphics interchange, translation between character, binary (ISO/IEC 9637-2), and clear-text (ISO/IEC 9637-3) encodings.

Related Standards

  • ISO/IEC 9636 (CGI functional specification)
  • ISO/IEC 9637-2 (Binary encoding) and ISO/IEC 9637-3 (Clear text encoding)
  • ISO 2022 (Code extension techniques) and ISO/IEC 646 (7-bit character set)
  • ISO/IEC 8632-2 (CGM character encoding), ISO/IEC 6429 and ISO/IEC 7942 (GKS)

This standard is essential reading for graphics protocol designers, implementers of device interfaces, and anyone needing a compact, standards-based character encoding for computer-graphics command streams.

Standard

ISO/IEC 9637-1:1994 - Information technology -- Computer graphics -- Interfacing techniques for dialogues with graphical devices (CGI) -- Data stream binding

English language
63 pages
sale 15% off
Preview
sale 15% off
Preview

Frequently Asked Questions

ISO/IEC 9637-1:1994 is a standard published by the International Organization for Standardization (ISO). Its full title is "Information technology - Computer graphics - Interfacing techniques for dialogues with graphical devices (CGI) - Data stream binding - Part 1: Character encoding". This standard covers: Specifies a character encoding of the computer graphics interface. For each of the functions specified in ISO/IEC 9636 an encoding is specified. The encoding provides a highly compact representation of the data, suitable for applications that require the data to be of minimum size and suitable for transmission with character-oriented transmission services.

Specifies a character encoding of the computer graphics interface. For each of the functions specified in ISO/IEC 9636 an encoding is specified. The encoding provides a highly compact representation of the data, suitable for applications that require the data to be of minimum size and suitable for transmission with character-oriented transmission services.

ISO/IEC 9637-1:1994 is classified under the following ICS (International Classification for Standards) categories: 35.140 - Computer graphics. The ICS classification helps identify the subject area and facilitates finding related standards.

You can purchase ISO/IEC 9637-1:1994 directly from iTeh Standards. The document is available in PDF format and is delivered instantly after payment. Add the standard to your cart and complete the secure checkout process. iTeh Standards is an authorized distributor of ISO standards.

Standards Content (Sample)


ISO/IEC
INTERNATIONAL
9637-l
STANDARD
First edition
1994-03-01
Information technology - Computer
- Interfacing techniques for
graphics
dialogues with graphical devices (CGI) -
Data stream binding -
Part 1:
Character encoding
Technologies de /‘information - Infographie - Techniques
intetiaciales de dialogues avec dispositifs graphiques (CGI) - liaison
de courant D -
Partie 7: Codage des caractbres
Reference number
0 ISO/IEC
ISO/IEC 9637~1:1994 (E)
CGI Character Encoding
Contents
Contents
iv
Foreword .
V
...............................................................................................................
Introduction
V
...............................................................................
0’1 . Purpose of the character encoding
V
02 . Objectives .
V
...........................................................
03 . Relationship to other International Standards
1 Scope .
Normative references .
Notational conventions .
7-Bit and 8-Bit code tables .
31 .
....................................................................... 4
Code extension techniques vocabulary
CO sets .
3'2 . 1
Cl sets .
3'2 . 2
G sets .
3'2 . . 3
Overall structure .
.................................................................................
41 . General form of the data stream
...............................................................
42 Entering and leaving the CGI environment
...................................................................
4:2.1 Implicitly entering the CGI environment
..................
4.2.2 Designating and invoking the CGI coding environment from IS0 2022
......................................................................................................
43 . Encoding functions
................................................................................. 8
Method of encoding opcodes
Encoding technique of the basic opcode set .
51 .
Extension mechanism .
52 .
Opcode assignments .
53 .
..................................................................................
54 . Opcodes for soliciting functions
.........................................................................
6 Method of encoding parameters
61 . Basic format .
62 . Bitstream format .
Coding integers (I, IF8, IF16, IF32) .
63 .
Coding real numbers (R) .
64 .
........................................ 25
Coding Virtual Device Coordinates and Points (VDC, P)
65 .
.............................................................................
66 Coding point list parameters (nP)
....................................................................................................
6'6 . 1 Displacement mode
......................................................................................................
6'6 . 2 Incremental mode
6'6 . . 3 Incremental mode encoding .
67 . Colour specifiers (CI, CD) .
68 Colour lists (nC1, nCD) .
6'8 . 1 Normal format (coding type=O) .
Bitstream format (coding type=l) .
6'8 . 2
Runlength format (coding type=2) .
6'8 . 3
...........................................................
6'8 . . 4 Runlength bitstream format (coding type=3)
o ISO/IEC 1994
All rights reserved. Unless otherwise specified, no part of this publication may be
reproduced or utilized in any form or by any means, clcctronic or mechanical, including
photocopying and microfilm, without permission in writing from the publisher.
ISO/IEC Copyright Office l Case postale 56 l CH-1211 Genkve 20 l Switzerland
Printed in Switzerland
ii
@ ISO/IEC ISO/IEC 963711:1994 (E)
Contents
CGI Character Encoding
6.8.5 Examples .
69 String arameters (S, SF) . 36
6'9 . 1 Overal P string parameter format . 36
6'9 . 2 Bit combinations permitted within string parameters of text functions .
6'9 . 3 CO control within string parameters . 37
6'9 4 Using G-sets in string parameters . 37
6:9:4.1 String parameters and character sets . 37
6.9.4.2 String parameters of other CGI functions . 38
6.10 Enumerated parameters (E) . 38
6.11 Index parameters (IX) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Client-specified name parameters (CSN) . 39
6.12
6.13 Input colour parameters (ICO, nIC0) . 40
Data record parameters (D) . 40
6.14
Character substitution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
8 Representation of CGI functions . 44
81 . Soliciting functions . 44
82 . Enumerated parameters . 45
83 Functions not specified in ISO/IEC 9636 . 45
8'3 . 1 DOMAIN RING . 45
8'3 . 2 INTEGER PRECISION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
8'3 . 3 REAL PRECISION ~. 46
. INDEX PRECISION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
8'3 4
COLOUR PRECISION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
8'3 . 5
8'3 . 6 COLOUR INDEX PRECISION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
VDC INTEGER PRECISION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
8'3 . 7
VDC REAL PRECISION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
8'3 . 8
8'3 . . 9 CLIENT SPECIFIED NAME PRECISION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Encoding of matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
84 .
Defaults . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
10 Classification and designation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Annex Ar List of CGI Opcodes . 52
Annex B: List of escape sequences . 63
0.0
ISO/IEC 9637-lt1994 (E) @ ISO/IEC
Foreword CGI Character Encoding
Foreword
for Standardization) and IEC (the
IS0 (the International Organization
International Electrotechnical Commission) form the specialized system for
worldwide standardization. National bodies that are members of IS0 or IEC
participate in the development of International Standards through technical
committees established by the respective organization to deal with particular
fields of technical activity. IS0 and IEC technical committees collaborate in
fields of mutual interest. Other international organizations, governmental and
non-governmental, in liaison with IS0 and IEC, also take part in the work.
In the field of information technology, IS0 and IEC have established a joint
technical committee, ISO/IEC JTC 1. Draft International Standards adopted by
the joint technical committee are circulated to national bodies for voting.
Publication as an International Standard requires approval by at least 75 % of the
national bodies casting a vote.
International Standard ISO/IEC 9637-l was prepared by Joint Technical
Committee ISO/IEC JTC 1, Information technology, Sub-Committee SC 24,
Computer graphics and image processing, in collaboration with the European
Computer Manufacturers Association (ECMA) and the European Conference of
Postal and Telecommunications Administration (CEPT).
ISO/lEC 9637 consists of the following parts, under the general title Information
Computer graphics - Interfacing techniques for dialogues with
technology -
graphical devices (CGI) - Data stream binding:
- Part 1: Character encoding
- Part 2: Binary encoding
- Part 3: Clear text encoding
Annexes A and B of this part of ISO/IEC 9637 are for information only.
iv
@ 1s0/xEc
ISO/IEC 9637~ltl994 (E)
CGI Character Encoding
Introduction
Introduction
0.1 Purpose of the character encoding
The character encoding of the Computer Graphics Interface (CGI) provides a data stream represen-
tation of the CGI function syntax intended for situations in which it is important to minimize the
size of the encoded data or transmit the data through character-oriented communications services.
The encoding uses compact representation of data that is optimized for storage or transfer between
computer systems.
If minimizing the processing overhead is more important than data compaction, an encoding such
as the binary encoding contained in ISO/IEC 9637-2 may be more appropriate.
0.2 Objectives
This encoding was designed with the following objectives:
a) regular syntax: All CGI functions are encoded in a uniform way so that parsing the en-
coded data is simple;
compactness: the encoding provides a highly compact data stream, suitable for systems
b)
with restricted storage capacity or transfer bandwidth
c) extensibility: the encoding allows for future extensions;
d) transportability: the encoding is suitable for use with transport mechanisms designed
for character-oriented data based on a standard national character set derived from
ISO/IEC 646.
0.3 Relationship to other International Standards
The character encoding has been developed in collaboration with the ISO/EIC JTClBC2. The en-
coding conforms to the rules for code extension specified in IS0 2022 in the category of complete
coding system.
The representation of character data in this part of ISO/IEC 9637 follows the rules of ISO/IEC 646
and IS0 2022.
For certain functions, ISO/IEC 9636 defmes value ranges as being reserved for registration. The
values and their meanings will be defined using the established registration procedures (see
ISO/IEC 9636-l).
This encoding is based on that for the Computer Graphics Metafile ISO/IEC 8632-2. Wherever pos-
sible, the opcodes and parameter representations of CGM elements have been followed.
V
@ ISO/IEC
CGI Character Encoding
Introduction
vi
INTERNATIONAL STANDARD @ IsO/IEC
ISOhEC 9637=1:1994(E)
Information technology - Computer graphics
- Interfacing
techniques for dialogues with graphical devices (CGI) -
Data
stream binding -
Part 1:
Character encoding
1 Scope
This part of ISO/IEC 9637 specifies a character encoding of the Computer Graphics Interface. For
each of the functions specified in ISO/IEC 9636 an encoding is specified.
This encoding of the Computer Graphics Interface provides a highly compact representation of the
data, suitable for applications that require the data to be of minimum size and suitable for trans-
mission with character-oriented transmission services.

ISO/IEC 9637-lrl994 (E) @ ISO/IEC
2 Normative references CGI Character Encoding
2 Normative references
The following standards contain provisions which, through reference in this text, constitute provi-
sions of this part of ISO/IEC 9637. At the time of publication the editions indicated were valid. All
standards are subject to revision, and parties to agreements based to this part of ISO/IEC 9637 are
encouraged to investigate the possibility of applying the most recent editions of the standards listed
below. Members of IS0 and IEC maintain registers of currently valid international standards.
ISO/IEC 646:1991, Information technology - IS0 7-bit coded character set for information in-
terchange.
IS0 7-bit and 8-bit coded character sets - Coded
IS0 2022:1986, Information processing -
extension techniques.
IS0 23751985, Data processing - Procedure for registration of escape sequences.
Control functions for coded character sets.
ISO/IEC 6429:1992, Information technology -
IS0 7942:1985, Information processing systems - Computer graphics - Graphical Kernel
System (GKS) functional description.
ISO/IEC 8632-2: 1992, Information technology - Computer graphics - Metafile for the storage and
transfer ofpicture description information - Part 2 : Character encoding.
ISO/IEC 9636-1:1991, Information technology - Computer graphics - Interfacing techniques for
dialogues with graphical devices (CGI) - Functional specification - Part 1:
Overview, profiles and conformance.
ISO/IEC 9636-2:1991, Information technology - Computer graphics - Interfacing techniques for
dialogues with graphical devices (CGI) - Functional specification - Part 2:
Control.
ISOLIEC 9636-3:1991, Information technology - Computer graphics - Interfacing techniques for
dialogues with graphical devices (CGI) - Functional specification - Part 3:
output.
ISO/IEC 9636-4:1991, Information technology - Computer graphics - Interfacing techniques for
dialogues with graphical devices (CGI) - Functional specification - Part 4:
Segments.
ISO/IEC 9636-51991, Information technology - Computer graphics - Interfacing techniques for
dialogues with graphical devices (CGI) - Functional specification - Part 5:
Input and echoing.
ISO/IEC 963696:1991, Information technology - Computer graphics - Interfacing techniques for
dialogues with graphical devices (CGI) - Functional specification - Part 6:
Raster.
Information technology - Computer graphics - Interfacing techniques for
ISO/IEC 9637-2:1992,
dialogues with graphical devices (CGI) - Data stream binding - Part 2: Bi-
nary encoding.
- Procedures for Registration of Graphical Items.
ISO/IEC TR 9973:1988, Information processing
ECMA 96, Graphics Data Syntax for a multiple Workstation Interface.
CEPT, Rev. of TICD 6.1 Videotex Presentation Layer Data Syntax.
@ ISO/IEC
ISO/IEC 9637-lt1994 (E)
CC1 Character Encoding
3 Notational conventions
3 Notational conventions
3.1 ‘I-Bit and ES-Bit code tables
The bits of the bit combinations of the 7-bit code are identified by b7, b6, b5, b4, b3, b2, and bl,
where b7 is the highest-order, or most-significant, bit and bl is the lowest-order, or least-
significant, bit.
The bit combinations may be interpreted to represent integers in the range 0 to 127 in binary nota-
tion by attributing the following weights to the individual bits:
Bit . .
.
b7 b6 b5 b4 b3 b2 bl
Weight: 64 32 16 8 4 2 1
, \
In this part of ISO/IEC 9637 the bit combinations of a 7-bit code are identified by notation of the
form x/y, where x is a number in the range 0 to 7 and y is a number in the range 0 to 15. The
correspondence between the notations of the form x/y and the bit combinations consisting of the
bits b7 to bl is as follows:
- x is the number represented by b7, b6, and b5 where these bits are given the weights 4, 2,
and 1 respectively;
- y is the number represented by b4, b3, b2, and bl where these bits are given the weights 8,
4,2, and 1 respectively.
The notations of the form x/y are the same as those used to identify code table positions, where x is
the column number and y is the row number.
A ‘I-bit code table consists of 128 positions arranged in eight columns and sixteen rows. The col-
umns are numbered 0 to 7 and the rows are numbered 0 to 15. Figure 1 shows a ‘I-bit code table.
An example illustrates the 7-bit code: l/11 refers to the bit combination in column 1, row 11 of the
code table, binary 0011011.
The bits of the bit combinations of the 8-bit code are identified by b8, b7, b6, b5, b4, b3, b2, and bl,
where b8 is the highest-order, or most-significant, bit and bl is the lowest-order, or least-
significant, bit.
The bit combinations may be interpreted to represent integers in the range 0 to 255 in binary nota-
tion by attributing the following weights to the individual bits:
Bit . .
.
b8 b7 b6 b5 b4 b3 b2 bl
128 64 32 16 8 4 2 1
Weight:
Using these weights, the bit combinations of the 8-bit code are interpreted to represent numbers in
the range 0 to 255.
In this part of ISO/IEC 9637 the bit combinations of an 8-bit code are identified by notation of the
ISO/IEC 963701:1994 (E) @ 1s0/IEc
3 Notational conventions CGI Character Encoding
form zlyy, where XX and yy are numbers in the range 00 to 15. The correspondence between the
notations of the form ~lyy and the bit combinations consisting of the bits b8 to bl is as follows:
- xx is the number represented where these bits are given the weights 8
by b8, b7, b6, and b5
4,2, and 1 respectively;
- yy is the number represented by b4, b3, b2, and bl where these bits are given the weights 8,
4, 2, and 1 respectively.
The notations of the form xxlyy are the same as those used to identify code table positions, where
XX is the column number and yy is the row number. An 8-bit code table consists of 256 positions
arranged in sixteen columns and sixteen rows. The columns and rows are numbered 00 to 15. Fig-
ure 2 shows an 8-bit code table.
An example illustrates the 8-bit code: 04/01 represents the 8-bit octet 01000001, whereas 4/l repre-
sents the 7-bit octet 1000001.
3.2 Code extension techniques vocabulary
In describing the characters that may occur within string parameters, certain terms imported from
other standards (e.g., IS0 2022) are useful. In the context of the CGI, these terms, and the concepts
to which they refer, apply only within the string parameters of the functions listed in 6.9.4.1.
3.2.1 CO sets
A CO set is a set of 30 control characters represented in a 7-bit code by O/O to l/15, except O/14 and
O/15 which shall be unused, and in an 8-bit code by OO/OO to 01/15, except 00/14 and 00/15 which
shall be unused. CO sets occupy columns 0 and 1 of a 7-bit code table or columns 00 and 01 of an
8-bit code table. The meanings of CO controls within string parameters are specified in 6.9.3.
3.2.2 Cl sets
A Cl set is a set of up to 32 control characters represented by bit combinations 08/00 to 09/15 in an
8-bit code. Cl sets occupy columns 08 and 09 of the 8-bit code table. In a 7-bit code the Cl control
functions are represented by 2-byte escape sequences. This CGI encoding reserves the bit combina-
tions 9/8 and 9/12 (ESC 5/8 and ESC 5/12 in a 7-bit environment, ESC = l/11); these shall not be
part of the content of string parameters. Other Cl control characters from other standards, such as
IS0 6429, may be used within string parameters by agreement between the interchanging parties.
3.2.3 G sets
The G-sets (GO, Gl, G2, G3) are coded character sets of 94 or 96 characters. CHARACTER SET
INDEX designates which character set is to be the GO set. ALTERNATE CHARACTER SET IN-
DEX designates a character set to be used as both the Gl and G2 sets. The G-sets may be “invoked
into” (caused to occupy) columns 2 through 7 of a 7-bit code table, or columns 02 through 07 and 10
through 15 of an 8-bit code table. This encoding of the CGI uses the GO and GlfG2 sets within
string parameters. The G3 set may be used within the string parameters of a conforming CGI data
stream; this requires selection of the extended 7-bit or extended 8-bit mode in the CHARACTER
CODING ANNOUNCER. ISO/IEC 9636 does not provide a diction to explicitly designate the G3
sets; this may be done within a text string in accordance with IS0 2022, or by other means agreed
upon by the interchanging parties.

0 ISO/IEC
CGI Character Encoding
3 Notational conventions
b7 -
0 0
.
b6 - 0 0
Bit
0 1
b5 11111)
0 1
+
0 0 0 0 0
0001 1
OOlOl 2
A G-Set
m The
of 94 or 96
co
.
0111 7
Bit
1000 8 Set
1001 9
Combinations
1010 10
1011 11
1100 12
1101 13
1110 14
1111 15
Figure l- The 7-bit code table.
00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15
--I
GL-Set GR-Set
co
of 94 or 96 of 94 or 96
Set
Set
Bit Combinations Bit Combinations
l- 07115 I 15/x
Figure 2 - The &bit code table.
ISO/IEC 9637~ltl994 (E) @ ISO/IEC
4 Overall structure CGI Character Encoding
4 Overall structure
This encoding specifies representations for each of the CGI functions of ISO/IEC 9636 as well as
any associated response. A function representation is the encoded representation of a function with
its In parameters. A response representation is the encoded representation of the Out parameters
of a soliciting function.
4.1 General form of the data stream
All function representations in the data stream are encoded using a uniform scheme. These are rep-
resented as variable length data structures, each consisting of opcode information designating the
particular function representation, and the parameter data (if any).
All response representations in the return data stream are encoded using the same uniform
scheme. These are represented as variable length data structures, each consisting of opcode infor-
mation designating the particular response representation, and its return parameter data.
4.2 Entering and leaving the CGI environment
4.2.1 Implicitly entering the CGI environment
between the interchanging
The CGI coding environment may be entered implicitly, by agreement
services using other coding
parties. This is suitable only if there is not to be any interchange with
techniques.
4.2.2 Designating and invoking the CGI coding environment from
IS02022
For interchange with services using the code extension techniques of IS0 2022, the CGI coding en-
vironment shall be designated and invoked from IS0 2022 environment by the following escape se-
quence:
ESC 215 F
where ESC is the bit combination l/11, and F refers to a bit combination that will be assigned by
the IS0 registration authority for IS0 2375.
The first bit combination occurring after this escape sequence will then represent the opcode of a
CGI function.
After the end of the CGI data (i.e., after the TERMINATE function) the following escape sequence
may be used to return to the IS0 2022 coding environment:
ESC 215 4/O
This not only returns to the IS0 2022 coding environment, but also restores the designation and
invocation of coded character sets to the state that existed prior to entering the CGI coding environ-
ment with the ESC 215 F sequence. (The terms designation and invocation are defined in IS0 2022.)
4.3 Encoding functions
The function descriptions in clause 5 and clause 6, as well as the formal grammars, of ISO/IEC
@ ISO/IEC ISOLIEC 963791:1994 (E)
CGI Character Encoding 4 Overall structure
9636-2, ISO/IEC 9636-3, ISO/IEC 9636-4, ISO/IEC 9636-5, and ISO/IEC 9636-6, provide the basic
syntax needed to encode each CGI function. They contain the function name and the input and out-
put parameters, along with their abstract data types and value ranges. The order in which the pa-
rameters are specified in clause 5 and clause 6 is significant. This is the exact order in which they
will be encoded in a representation.
The character encoding scheme has two basic components: the opcode and the parameter data.
There may be no parameter data, a fixed amount of parameter data or an indefinite amount of pa-
rameter data depending on the function being represented.
CGI functions and their In parameters, if any, are encoded as function representations consisting of
the opcode followed by any In parameter data. Functions with Out parameters are called soliciting
functions. Their Out parameters are considered response data and are encoded in a separate re-
sponse representation, consisting of an opcode followed by the Out parameter data (see 5.4).
representations and the rules for their encoding
The formats of the various function and response
in the character data stream are described below.

@ 1s0/IEc
ISOLIEC 963791:1994 (E)
CGI Character Encoding
5 Method of encoding opcodes
5 Method of encoding opcodes
Each CGI function representation and response representation is composed of one opcode and pa-
rameters as required. The opcodes are coded as a sequence of bit combinations from columns 2 and
3 of the code chart. The encoding technique supplies:
the basic opcode set;
extension opcode sets.
Parameter bytes are coded in columns 4 to 7 (with the exception of strings, which are otherwise
delimited). This scheme permits an interpreter to skip the parameters of an function representation
which it does not recognize or support. The interpreter can in such circumstances skip bytes until
another opcode is encountered.
5.1 Encoding technique of the basic opcode set
The basic opcode set consists of single-byte and double-byte opcodes. Single-byte opcodes are from
column 2 of the code chart. Bits b4 to bl are used to encode the opcode. The format is as follows:
The “X” bit (bit b8) is the parity bit (or omitted bit) in a ‘I-bit environment. In an 8-bit environment
it is 0. For double-byte opcodes the first byte is from column 3 and the second byte is from column 2
or 3 of the code chart. Bits b4 to bl of the first byte and bits b5 to bl of the second byte are used to
encode the opcode:
The bit combination 3115, the EXTEND OPCODE SPACE (EOS) allows extension of the basic op-
code space (see 5.2).
The basic opcode set, supplied by this encoding technique consists of 496 opcodes, being:
- 16 single-byte opcodes (from column 2);
- 15 x 32 = 480 double-byte opcodes (first byte from column except bit
3 combination 3115,
second byte from column 2 or 3).

0 ISO/IEC ISO/IEC 963711:1994 (El
CGI Character Encoding 5 Method of encoding opcodes
5.2 Extension mechanism
The basic opcode set can be extended with an unlimited number of extension opcode sets by means
of the EXTEND OPCODE SPACE code (EOS, 3115).
The N-th extension opcode set consists of opcodes of the basic opcode set, prefixed with N instances
of the code EOS. The three possible formats of an opcode from the N-th extension opcode set are
Extension codes Basic opcode set codes
Opcode format
1 .
<2/x>
I I
n instances
<3/y 2/z>
.
I
I
n instances
. . . <3/y 3/z>
I
I
n instances
x = 0,1,.,15
= 3115
y = 0,1,.,14
n = 0 selects the basic opcode set,
2 = 0,1,.,15
n = 1 selects the first extension opcode set,
n = N selects the N-th extension opcode set
The number of opcodes supplied by this encoding technique (basic opcode set plus extension opcode
sets) is 496*(n+l), where n is the number of extension sets. (Each extension set has 496 opcodes: 16
single-byte opcodes plus 480 double-byte codes.)
5.3 Opcode assignments
CGI opcodes overlap with opcodes from CGM and GKS. Where the same function, with identical
parameters and identical semantics exists in two of them, then the same opcode (and parameterisa-
tion) is used.
Whereas all CGM and GKS opcodes are one and two-byte opcodes from the basic opcode set, some
CGI opcodes extend into the first extension opcode set. These are three-byte opcodes, commencing
with the byte 3115.
5.4 Opcodes for soliciting functions
CGI functions which have Out (i.e. return) parameters have distinct opcodes in this encoding for
the outward data, sent from generator to interpreter, and the return data, or ‘response’, returned
from the interpreter.
There is a simple relationship between the outward opcode and the response opcode of a soliciting
function. For all soliciting functions with an outward opcode x/k a I b, the response opcode will be of
ISO/IEC 9637-lr1994 (E) 0 ISO/IEC
5 Method of encoding opcodes
CGI Character Encoding
the form x/k+2 alb. For inquiry functions, which are in the first extension set, the outward opcode
is 3/15 x I k a I b and the response opcode is 3fl5 xl k+2 a I b.
NOTE 1 The allocation of opcodes to CGI functions is rather scattered due to the need for consistency with
opcodes from CGM and GKS, ISO/IEC 8632-2 and IS0 7942.
Table 1 lists the complete set of 7-bit opcode assignments for CGI functions and responses. To de-
termine the 8-bit opcode, a zero should be added in front of the column specification (e.g., 03/O 02/10
instead of 3/O 2/10).
@ ISO/IEC ISO/IEC 9637~lt1994 (E)
CGI Character Encoding
5 Method of encoding opcodes
Table 1 - Opcodes and Response Opcodes of CGI Functions
Response
Function
Opcode
Omode
INITIALIZE 3/O 312
TERMINATE 3/o 313
EXECUTE DEFERRED ACTIONS 3/O 316
DEFERRAL MODE 3/o 317
PREPARE DRAWING SURFACE 3/o 314
END PAGE 3/o 315
VDC TYPE 3/l 212
V-DC INTEGER PRECISION (*) 313 2/o
V-DC INTEGER PRECISION REQUIREMENT 313 316
V-DC! REAL PRECISION (*) 313 2/l
VDC REAL PRECISION REQUIREMENTS 313 317
VDC EXTENT 312 215
DEVICE VIEWPORT 312 217
DEVICE VIEWPORT SPECIFICATION MODE 312 218
DEVICE VIEWPORT MAPPING 312 219
DRAWING SURFACE CLIP RECTANGLE 313 314
DRAWING SURFACE CLIP INDICATOR 313 315
DEQUEUE ERROR REPORTS 3/112/o 3113 2/o
ERROR HANDLING CONTROL 3/l 3114
INTEGER PRECISION (*) 3/l. 213
INTEGER PRECISION REQUIREMENT 3/l 318
REAL PRECISION (*) 3/l 214
3/l 319
REAL PRECISION REQUIREMENTS
3/12/5
INDEX PRECISION (*)
3/I 3llO
INDEX PRECISION REQUIREMENT
3/l 216
COLOUR PRECISION (*)
3/l 311.1.
COLOUR PRECISION REQUIREMENT
COLOUR INDEX PRECISION (*) 3/l 217
3/l. 3112
COLOUR INDEX PRECISION REQUIREMENT
CLIENT SPECIFIED NAME PRECISION (*) 3/l 3/o
3/l 3113
CLIENT SPECIFIED NAME PRECISION REQUIREMENT
317 211
MESSAGE
ESCAPE 317 2/o
3114 2l14
GET ESCAPE 3112 2114
STATE LIST INQUIRY SOURCE 313 318
INQUIRE DEVICE IDENTIFICATION 3l15 3/o 2/o 3115 312 2/O
INQUIRE DEVICE DESCRIPTION 3115 3/o 2/l 3115 312 2/l
LOOKUP FUNCTION SUPPORT 311.5 3/o 212 3115 312 212
LOOKUP PROFILE SUPPORT 3115 312 213
3115 3/o 2l3
INQUIRE LIST OF PROFILE SUPPORT INDICATORS 3115 312 214
3115 3/o 2l4
3115 312 2l5
INQUIRE SUPPORTED V-DC TYPES 3115 3/o 2l5
3115 3/O 2l6 3115 312 216
INQUIRE DEVICE CONTROL CAPABILITY
ISO/.lEC 9637~lt1994 (E) 0 1s0/IEc
5 Method of encoding opcodes CGI Character Encoding
Table 1 (continued)
Response
Function
Opcode
Otxode
I I
LOOKUP ESCAPE SUPPORT
3115 3/o 2l7 3115 312 217
LOOKUP GET ESCAPE SUPPORT
3115 3/o 218 3115 312 218
INQUIRE CONTROL STATE 3115 314 2/o 3115 316 2/O
I
INQUIRE CURRENT PRECISIONS REQUIREMENTS 3115 314 2/l 3115 316 211
INQUIRE VDC TO DEVICE MAPPING 3115 314 212 3115 316 212
INQUIRE ERROR HANDLING 3115 314 213 3115 316 213
INQUIRE MISCELLANEOUS CONTROL STATE 313.5 314 214 3115 316 214
POLYLINE 2/o
DISJOINT POLYLINE
2/l
CIRCULAR ARC 3 POINT 314 2/l
CIRCULAR ARC CENTRE 314 213
CIRCULAR ARC CENTRE REVERSED 314 218
ELLIPTICAL ARC
314 216
CONNECTING EDGE
314 219
POLYMARKER 212
TEXT 213
RESTRICTED TEXT 214
APPEND TEXT 215
POLYGON 216
POLYGON SET 217
RECTANGLE 2110
CIRCLE 314 2/o
CIRCULAR ARC 3 POINT CLOSE 314 212
CIRCULAR ARC CENTRE CLOSE 314 214
ELLIPSE 314 215
ELLIPTICAL ARC CLOSE 314 217
CELL ARRAY
GENERALIZED DRAWING PRIMITIVE (GDP)
LINE BUNDLE INDEX
315 2/o
LINE TYPE
315 211
LINE WIDTH
315 212
LINE COLOUR
315 213
LINE CLIPPING MODE
313 216
MARKER BUNDLE INDEX
315 214
MARKERTYPE
315 215
MARKER SIZE
315 216
MARKER COLOUR
315 217
MARKER CLIPPING MODE
313 217
TEXT BUNDLE INDEX
315 3/o
TEXT FONT INDEX
315 3/l
TEXT PRECISION
315 312
CHARACTER EXPANSION FACTOR
315 313
CHARACTER SPACING
315 314
@ ISO/IEC ISO/IEC 9637~lt1994 (E)
CGI Character Encoding 5 Method of encoding opcodes
Table 1 (continued)
Function
Opcode
TEXT COLOUR 315 315
CHARACTER HEIGHT 315 316
CHARACTER ORIENTATION 315 317
TEXT PATH 315 318
TEXT ALIGNMENT 315 319
CHARACTER SET INDEX 315 3110
ALTERNATE CHARACTER SET INDEX 315 3111
CHARACTER CODING ANNOUNCER 3/l 2115
FILL BUNDLE INDEX 316 2/O
INTERIOR STYLE 316 2/l.
FILL COLOUR 316 212
HATCH INDEX 316 213
PATTERN INDEX 316 214
FILL REFERENCE POINT 316 2110
PATTERN SIZE 316 2112
EDGE BUNDLE INDEX 316 215
316 216
EDGE TYPE
EDGE WIDTH 316 217
EDGE COLOUR 316 218
EDGE CLIPPING MODE 313 218
EDGE VISIBILITY 316 219
CLIP INDICATOR 313 215
CLIP RECTANGLE 313 214
LINE WIDTH SPECIFICATION MODE 312 212
MARKER SIZE SPECIFICATION MODE 312 213
EDGE WIDTH SPECIFICATION MODE 312 214
COLOUR SELECTION MODE 312 211
COLOUR VALUE EXTENT 3/l 219
BACKGROUND COLOUR 313 319
AUXILIARY COLOUR 313 212
TRANSPARENCY 313 213
316 3/O
COLOUR TABLE
312 2110
LINE REPRESENTATION
312 2111
MARKER REPRESENTATION
TEXT REPRESENTATION 312 2112
FILL REPRESENTATION 312 3/O
EDGE REPRESENTATION 312 3/l
312 312
DELETE BUNDLE REPRESENTATION
ASPECT SOURCE FLAGS 316 311
316 2/U.
PATTERN TABLE
313 3113
DELETE PATTERN
3/l 2113
FONT LIST
3/l. 2114
CHARACTER SET LIST
5 Method of encoding opcodes
CGI Character Encoding
Table 1 (continued)
Response
Function
Opcode
Omode
SAVE PRIMITIVE ATTRIBUTES 313 3110
RESTORE PRIMITIVE ATTRIBUTES 313 3111
DELETE PRIMITIVE ATTRIBUTE SAVE SET 313 3112
BEGIN FIGURE 3/O 217
END FIGURE 3/O 218
NEW REGION 313 219
GET TEXT EXTENT 3111 211 3113 2/l
INQUIRE PRIMITIVE SUPPORT LEVELS 3115 3/o 219 3115 312 219
LOOKUP GDP SUPPORT 3115 3/o 2110 3115 312 2110
INQUIRE GDP ATTRIBUTES 3115 3/o 2111 3115 312 2l11
INQUIRE LINE CAPABILITY 3115 3/o 2/12 3115 312 2112
INQUIRE LIST OF AVAILABLE LINE TYPES 3115 3/o 2f13 3115 312 2113
INQUIRE LIST OF AVAILABLE SCALED LINE WIDTHS 3115 3/O 2114 3115 312 2114
INQUIRE MARKER CAPABILITY 3115 3/O 2115 3115 312 2115
INQUIRE LIST OF AVAILABLE MARKER TYPES 3115 3/o 3/o 3115 312 3/O
INQUIRE LIST OF AVAILABLE SCALED MARKER SIZES 3/15 3/o 3/l 3115 312 3/l
INQUIRE TEXT CAPABILITY 3115 3/O 312 3115 312 312
INQUIRE LIST OF AVAILABLE CHARACTER SETS 3115 3/o 313 3115 312 313
INQUIRE LIST OF AVAILABLE TEXT FONTS 3115 3/o 314 3115 312 314
INQUIRE FONT CAPABILITIES 3115 3/o 315 3115 312 315
INQUIRE LIST OF AVAILABLE
3115 3/O 316 3115 312 316
CHARACTER EXPANSION FACTORS
3115 3/o 317 3115 312 317
INQUIRE LIST OF AVAILABLE CHARACTER SPACINGS
3115 3/O 318 3115 312 318
INQUIRE LIST OF AVAILABLE CHARACTER HEIGHTS
INQUIRE LIST OF AVAILABLE
3115 3/o 319 3115 312 319
CHARACTER ORIENTATIONS
INQUIRE FILL CAPABILITY 3115 3/o 3110 3115 312 3110
30.5 312 3111
INQUIRE LIST OF AVAILABLE HATCH STYLES 3115 3/o 3111
3115 312 3112
INQUIRE EDGE CAPABILITY 3115 3/O 3112
3115 312 3113
INQUIRE LIST OF AVAILABLE EDGE TYPES 3115 3/o 3113
INQUIRE LIST OF AVAILABLE SCALED EDGE WIDTHS 3115 3/o 3114 3115 312 3114
INQUIRE COLOUR CAPABILITY ~ 3115 3/o 3115 3115 312 3115
INQUIRE CIE CHARACTERISTICS ~ 3115 3/I 2/o 3115 313 2/o
INQUIRE MAXIMUM NUMBER OF SIMULTANEOUSLY
SAVED ATTRIBUTE SETS 3115 3/l 2/l 3115 313 2/l
’ INQUIRE ARRAY OF SUPPORTED CHARACTER
CODING ANNOUNCERS 3115 3/l 212 3115 313 212
INQUIRE LINE ATTRIBUTES 3115 314 215 ’ 3115 316 215
INQUIRE LIST OF LINE BUNDLE INDICES 3115 314 216 3115 316
0 ISO/IEC
ISO/JEC 9637-lt1994 (E)
CGI Character Encoding 5 Method of encoding opcodes
Table 1 (continued)
Response
Function
Opcode
Opcode
INQUIRE LINE REPRESENTATION 3115 314 217
3115 316 217
INQUIRE MARKER ATTRIBUTES 3115 314 218
3115 316 2l8
INQUIRE LIST OF MARKER BUNDLE INDICES 3115 314 219
3115 316 219
INQUIRE MARKER REPRESENTATION 3115 314 2110
3115 316 200
INQUIRE TEXT ATTRIBUTES 3115 314 2lll
3115 316 2111
INQUIRE LIST OF TEXT BUNDLE INDICES 3115 314 2l12
3115 316 2l12
3115 314 2/13
INQUIRE TEXT REPRESENTATION 3115 316 2l13
INQUIRE FILL ATTRIBUTES 3115 314 2l14
3115 316 2114
3115 314 2/15
INQUIRE PATTERN DIMENSIONS 3115 316 2115
INQUIRE PATTERN 3115 314 3/o 3115 316 3/O
INQUIRE LIST OF PATTERN INDICES 3115 314 3/l 3115 316 311
INQUIRE LIST OF FILL BUNDLE INDICES 3115 314 312 3115 316 312
INQUIRE FILL REPRESENTATION 3115 314 313 3115 316 313
INQUIRE EDGE ATTRIBUTES 3115 314 314 3115 316 314
3115 314 315 3115 316 315
INQUIRE LIST OF EDGE BUNDLE INDICES
3115 314 316 3115 316 316
INQUIRE EDGE REPRESENTATION
3115 314 3/7 3115 316 317
INQUIRE OUTPUT STATE
3115 314 318 3115 316 318
INQUIRE OBJECT CLIPPING
3115 314 319 3115 316 319
INQUIRE LIST OF ATTRIBUTE SET NAMES IN USE
3115 316 3110
INQUIRE COLOUR STATE 3115 3/4 3110
3115 316 3/U.
INQUIRE LIST OF COLOUR TABLE ENTRIES 3115 314 3/u.
3115 316 3112
INQUIRE FONT LIST 3115 314 3112
INQUIRE CHARACTER SET LIST 3115 314 3113 3115 316 30.3
LOOKUP ASPECT SOURCE FLAGS 3115 314 3114 3115 316 3114
GET NEW SEGMENT IDENTIFIER 3/112/2 3113 212
CREATE SEGMENT 318 2113
REOPEN SEGMENT 318 2114
CLOSE SEGMENT 318 2115
COPY SEGMENT 318 2/O
DELETE SEGMENT 318 217
DELETE ALL SEGMENTS 318 312
RENAME SEGMENT 318 218
318 219
DRAW ALL SEGMENTS
IMPLICIT SEGMENT REGENERATION MODE 318 3/O
RESET REGENERATION PENDING 318 3/l.
316 312
PICK IDENTIFIER
318 2110
SEGMENT VISIBILITY
SEGMENT TRANSFORMATION 318 213
SEGMENT HIGHLIGHTING 318 214
SEGMENT DISPLAY PRIORITY 318 215
SEGMENT DETECTABILITY 318 2111
SEGMENT PICK PRIORITY 318 216
@ ISO/IEC
5 Method of encoding opcodes CGI Character Encoding
Table 1 (continued)
Response
Function
Opcode
Opcode
3ll.l 213 3113 213
SIMULATE PICK
318 2/l
INHERITANCE FILTER
318 212
CLIPPING INHERITANCE
3115 3/l. 213 3115 313 213
INQUIRE SEGMENT CAPABILITY
3115 316 3115
INQUIRE SEGMENT STATE
3115 317 2/o
INQUIRE LIST OF INHERITANCE FILTER SETTINGS
3115 317 211
INQUIRE CLIPPING INHERITANCE
3115 317 212
INQUIRE LIST OF SEGMENT IDENTIFIERS IN USE
3115 315 213 3115 317 213
INQUIRE INDIVIDUAL SEGMENT STATE
319 2/o
INITIALIZE LOGICAL INPUT DEVICE
319 2/l
RELEASE LOGICAL INPUT DEVICE
319 212
ECHO CONTROLS
319 213
PUT CURRENT LOCATOR MEASURE
319 214
PUT CURRENT STROKE MEASURE
319 215
PUT CURRENT VALUATOR MEASURE
PUT CURRENT CHOICE MEASURE 319 216
PUT CURRENT PICK MEASURE 319 217
PUT CURRENT STRING MEASURE 319 218
PUT CURRENT RASTER MEASURE 319 219
PUT CURRENT GENERAL MEASURE 319 2110
ECHO DATA 319 2ll.1
LOCATOR DEVICE DATA 319 2112
STROKE DEVICE DATA 319 2113
VALUATOR DEVICE DATA 319 2114
CHOICE DEVICE DATA 319 2115
PICK DEVICE DATA 319 3/o
STRING DEVICE DATA 319 3/l
RASTER DEVICE DATA 319 312
GENERAL DEVICE DATA 319 313
ASSOCIATE TRIGGERS 319 314
GET ADDITIONAL STROKE DATA 3ll.1 214 3113 214
GET ADDITIONAL PICK DATA 3111 215 3113 215
GET ADDITIONAL STRING DATA 3111 216 3113 216
GET ADDITIONAL RASTER DATA 3ll.1 217 3113 217
REQUEST LOCATOR 3111 218 3113 218
REQUEST STROKE 3/n 219 3113 219
REQUEST VALUATOR 3/112/10 3113 2110
REQUEST CHOICE 3/u. 2ll.1 3113 2/n
REQUEST PICK 3/112/12 3113 2112
REQUEST STRING 3/H. 2113 3113 2113
@ ISO/IEC ISO/IEC 9637~1:1994 (E)
CGI Character Encoding 5 Method of encoding opcodes
Table 1 (continued)
Response
Function
Opcode
Omode
3/112/14 3113 2114
REQUEST RASTER
3/112/15 3113 2115
REQUEST GENERAL
SAMPLING STATE 319 315
3113 3/o
SAMPLE LOCATOR 3ll.l. 3/o
3113 3/l.
SAMPLE STROKE 3/113/1
3113 312
SAMPLE VALUATOR 3111 312
SAMPLE CHOICE 3111 313 3113 313
3113 314
SAMPLE PICK 3111 314
3113 315
SAMPLE STRING 3/u. 315
3113 316
SAMPLE RASTER 3111 316
3113 317
SAMPLE GENERAL 3l11 317
INITIALIZE ECHO REQUEST 319 316
3113 318
ECHO REQUEST LOCATOR 3111 318
3113 319
ECHO REQUEST STROKE 3111 319
3113 3110
ECHO REQUEST VALUATOR 3/113/10
3113 3111
ECHO REQUEST CHOIC
...

Questions, Comments and Discussion

Ask us and Technical Secretary will try to provide an answer. You can facilitate discussion about the standard in here.

Loading comments...