ISO 8632-2:1987
(Main)Information processing systems - Computer graphics - Metafile for the storage and transfer of picture description information - Part 2: Character encoding
Information processing systems - Computer graphics - Metafile for the storage and transfer of picture description information - Part 2: Character encoding
Systèmes de traitement de l'information — Infographie — Métafichier de stockage et de transfert des informations de description d'images — Partie 2: Codage des caractères
General Information
Relations
Frequently Asked Questions
ISO 8632-2:1987 is a standard published by the International Organization for Standardization (ISO). Its full title is "Information processing systems - Computer graphics - Metafile for the storage and transfer of picture description information - Part 2: Character encoding". This standard covers: Information processing systems - Computer graphics - Metafile for the storage and transfer of picture description information - Part 2: Character encoding
Information processing systems - Computer graphics - Metafile for the storage and transfer of picture description information - Part 2: Character encoding
ISO 8632-2:1987 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.
ISO 8632-2:1987 has the following relationships with other standards: It is inter standard links to ISO 8632-2:1987/Amd 1:1990, ISO/IEC 8632-2:1992; is excused to ISO 8632-2:1987/Amd 1:1990. Understanding these relationships helps ensure you are using the most current and applicable version of the standard.
You can purchase ISO 8632-2:1987 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)
IS0
INTERNATIONAL STANDARD
8632-2
First edition
1987-08-0 1
INTERNATIONAL ORGANIZATION FOR STANDARDIZATION
ORGANISATION INTERNATIONALE DE NORMALISATION
M EXnY HAPOAH AR OPrAH M3Ai4MR Il0 CTAHAAPTMSAUM M
Information processing systems - Computer graphics -
Metafile for the storage and transfer of picture
description information -
Part 2 :
Character encoding
Systèmes de traitement de l'information - Infographie - Métafichier de stockage et de transfert
des informations de description d'images -
Partie 2 : Codage des caractères
Reference number
IS0 8632-2 : 1987 (E)
Foreword
IS0 (the International Organization for Standardization) is a worldwide federation of
national standards bodies (IS0 member bodies). The work of preparing International
Standards is normally carried out through IS0 technical committees. Each member
body interested in a subject for which a technical committee has been established has
the right to be represented on that committee. International organizations, govern-
mental and non-governmental, in liaison with ISO, also take part in the work.
Draft International Standards adopted by the technical committees are circulated to
the member bodies for approval before their acceptance as International Standards by
the IS0 Council. They are approved in accordance with IS0 procedures requiring at
least 75 % approval by the member bodies voting.
International Standard IS0 8632-2 was prepared by Technical Committee ISO/TC S7,
information processing systems.
Users should note that all International Standards undergo revision from time to time
and that any reference made herein to any other International Standard implies its
latest edition, unless otherwise stated.
O International Organization for Standardization, 1987
Printed in Switzerland
IS0 8632-2 : 1987 (E)
CONTENTS
O Introduction . . .
.. ..
0.1 Purpose of the character encoding .
0.2 Objectives . . .
..
0.3 Metafile characteristics . .
0.4 Relationship to other International Standards . . .
0.5 Status of annex . . .
..
1 Scope and field of application . .
2 References . . .
.. .. 4
3 Notational conventions .
.. 4
3.1 7-Bit and 8-Bit code tables . .
3.2 Code extension techniques vocabulary . . . 5
3.2.1 CO sets . . .
.. 5
3.2.2 C1 sets . .
3.2.3 G-sets . . . 5
4 Entering and leaving the metafile environment . . . .
4.1 Implicitly entering the metafile environment . . .
4.2 Designating and invoking the CGM coding environment from IS0 2022
5 Method of encoding opcodes .
5.1 Encoding technique of the basic opcode set .
5.2 Extension mechanism .
5.3 Opcode assignments .
6 Method of encoding parameters . 13
6.1 Basic format . 13
6.2 Bitstream format . 14
6.3 Coding integers .
6.4 Coding real numbers . 15
0 6.5 Coding VDCs and points . 16
6.6 Coding point list parameters .
6.6.1 Displacement mode .
6.6.2 Incremental mode .
6.6.3 Incremental mode encoding .
6.7 Colour specifiers .
6.8 Colour lists . 22
6.8.1 Normal format (coding type=O) .
6.8.2 Bitstream format (coding type=l) .
6.8.3 Runlength format (coding type=2) . 23
6.8.4 24
Runlength bitstream format (coding type=3) .
6.8.5 Examples . 24
6.9 String parameters . 25
6.9.1 Overall string parameter format . 25
6.9.2 Bit combinations permitted within string parameters of text elements 25
6.9.3 CO control within string parameters .
6.9.4 Using G-sets in string parameters . .
6.10 Enumerated parameters .
6.11 Index parameters .
6.12 Data record parameters . 17
8 Representation of each element . 30
........................ 31
8.1 Delimiter elements
8.1.1 BEGINMETAFILE . 31
...................... 31
8.1.2 ENDMETAFILE
8.1.3 BEGIN PICTURE . 31
8.1.4 BEGIN PICTURE BODY . 31
8.1.5 ENDPICTURE . 31
8.2 Metafile descriptor elements . 32
8.2.1 METAFILE VERSION . 32
8.2.2 METAFILE DESCRIPTION . 32
8.2.3 VDCTYPE . 32
8.2.4 INTEGER PRECISION . 32
8.2.5 REAL PRECISION . 32
..................... 33
8.2.6 INDEX PRECISION
8.2.7 COLOUR PRECISION . 33
8.2.8 COLOUR INDEX PRECISION . 33
8.2.9 MAXIMUM COLOUR INDEX . 33 O
8.2.10 COLOUR VALUE EXTENT . 34
8.2.11 MÉTAFILE ELEMENT LIST . 34
8.2.12 METAFILE DEFAULTS REPLACEMENT . 34
8.2.13 FONT LIST . 34
8.2.14 CHARACTER SET LIST . 35
8.2.15 CHARACTER CODING ANNOUNCER . 36
8.3 Picture descriptor elements . 37
8.3.1 SCALINGMODE . 37
8.3.2 COLOUR SELECTION MODE . 37
8.3.3 LINE WIDTH SPECIFICATION MODE . 37
8.3.4 MARKER SIZE SPECIFICATION MODE . 37
8.3.5 EDGE WIDTH SPECIFICATION MODE . 37
8.3.6 VDCEXTENT . 37
8.3.7 BACKGROUND COLOUR . 38
8.4 Control elements . 39
8.4.1 VDC INTEGER PRECISION . 39
8.4.2 VDCREALPRECISION . 39
8.4.3 AUXILIARY COLOUR . 40 0
8.4.4 TRANSPARENCY . 40
8.4.5 CLIPRECTANGLE . 40
8.4.6 CLIPINDICATOR . 40
8.5 Graphical primitive elements . - . 41
8.5.1 POLYLINE . 41
8.5.2 DISJOINTPOLYLINE . 41
8.5.3 POLYMARKER . 41
8.5.4 TEXT . 41
8.5.5 RESTRICTED TEXT . 41
TEXT . 42
8.5.6 APPEND
8.5.7 POLYGON . 42
...................... 42
8.5.8 POLYGONSET
8.5.9 CELLARRAY . 42
8.5.10 GENERALIZED DRAWING PRWIITNE . 44
8.5.11 RECTANGLE . 44
8.5.12 CIRCLE . 44
8.5.13 CIRCULAR ARC 3 POINT . 44
8.5.14 CIRCULAR ARC 3 POINT CLOSE . 44
IS0 8632-2 : 1987 (E)
8.5.16 CIRCULAR ARC CENTRE CLOSE 45
.........
8.5.17 ELLIPSE 45
8.5.18 ELLIPTICAL ARC . 45
8.5.19 ELLIPTICAL ARC CLOSE . 45
8.6 Attribute elements . 46
8.6.1 LINE BUNDLE INDEX .
8.6.2 LINETYPE . 46
8.6.3 LINE WIDTH . 46
8.6.4 LINE COLOUR .
8.6.5 MARKERBUNDLEINDEX . 46
8.6.6 MARKER TWE . 47
8.6.7 MARKER SIZE . 47
8.6.8 MARKER COLOUR . . 47
8.6.9 TEXTBUNDLEINDEX . 47
8.6.10 TEXT FONT INDEX .
8.6.11 TEXT PRECISION . 47
8.6.12 CHARACTER EXPANSION FACTOR 48
8.6.13 CHARACTER SPACING . 48
8.6.14 TEXT COLOUR .
8.6.15 CHARACTER HEIGHT . 48
8.6.16 CHARACTER ORIENTATION . 48
8.6.17 TEXT PATH . 48
8.6.18 TEXT ALIGNMENT .
8.6.19 CHARACTERSETINDEX . 49
8.6.20 ALTERNATE CHARACTER SET INDEX 49
8.6.21 FILL BUNDLE INDEX . 49
8.6.22 INTERIOR STYLE .
8.6.23 FILL COLOUR .
8.6.24 HATCH INDEX .
8.6.25 PATTERN INDEX . 50
8.6.26 EDGE BUNDLE INDEX .
8.6.27 EDGETYPE .
8.6.28 EDGEWIDTH . 51
8.6.29 EDGE COLOUR . 51
8.6.30 EDGE VISIBILITY . 51
8.6.31 FILL REFERENCE POINT . 51
8.6.32 PATTERN TABLE .
8.6.33 PATTERN SIZE . 52
8.6.34 COLOUR TABLE . 52
8.6.35 ASPECT SOURCE FLAGS . 52
8.7 Escape elements . 54
8.7.1 ESCAPE . 54
8.7.2 DOMAIN RING . 54
8.8 External elements . 55
8.8.1 MESSAGE . 55
8.8.2 APPLICATION DATA . 55
9 Defaults .
O Conformance . 57
A Formal grammar . 58
1NTERNATIONAL.STANDARD IS0 8632-2 : 1987 (E)
Information processing systems - Computer graphics -
Metafile for the storage and transfer of picture
description information -
Part 2 :
Character encoding
O Introduction
0.1 Purpose of the character encoding
The Character Encoding of the Computer Graphics Metafile (CGM) provides a representation of the
Metafile syntax intended for situations in which it is important to minimize the size of the metafile or
transmit the metafile 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 IS0 8632/3 may be more appropriate. If human readability is the most
important criterion, an encoding such as the Clear Text Encoding in IS0 8632/4 may be more appropri-
ate.
0.2 Objectives
This encoding was designed with the following objectives:
regular syntax: All elements of the metafile should be encoded in a uniform way so that parsing
a)
the metafile is simple;
compactness: The encoding should provide a highly compact metafile, suitable for systems with
b)
restricted storage capacity or transfer bandwidth;
extensibility: the encoding should allow for future extensions;
c)
transportability: the encoding should be suitable for use with transport mechanisms designed
d)
for character-oriented data based on a standard national character set derived from IS0 646.
0.3 Metafile characteristics
Each CGM command follows a simple regular syntax. Thus, new commands can be added in a future
revision of IS0 8632 such that existing CGM interpreters can recognize (and ignore) the new commands.
Also, new operands can be added to existing commands in the future revision of the standard such that
existing CGM interpreters can recognize (and ignore) the additional operands.
Each CGM operand follows a simple regular syntax. Operands are variable in length. This permits
small values to be represented by the smallest number of bytes.
A certain range of operand values of standard commands have been reserved for private use; the
remaining range is either standardized or reserved for future standardization.
0.4 Relationship to other International Standards
The Character Encoding has been developed in collaboration with the IS0 subcommittee responsible for
character sets and coding, ECMA, and CEPT. The encoding conforms to the rules for code extension
specified in IS0 2022 in the category of complete coding system.
The representation of character data in IS0 8632/2 follows the rules of IS0 646 and IS0 2022.
For certain elements, the CGM defines value ranges as being reserved for registration. The values and
their meanings will be defined using the established procedures (see IS0 8632/1, sub-clause 4.11.)
0.5 Status of annex
The annex does not form an integral part of,this part of IS0 8632/2 but is included for information
only. .
This part of IS0 8632 specifies a character encoding of the Computer Graphics Metafile. For each of
the elements specified in IS0 8632/1 an encoding is specified.
This encoding of the Computer Graphics Metafile provides a highly compact representation of the
metafile, suitable for applications that reqiiiire the metafile to be of minimum size and suitable for
transmission with character-oriented transmission services.
*
IS0 8632-2 : 1987 (E)
2 References
IS0 646, Information processing-IS0 7-bit coded character set for information interchange.
extension tech-
IS0 2022, Information processing-IS0 7-bit and &bit coded character sets-Code
niques.
of escape sequences.
IS0 2375, Data processl'ng-Procedure for registration
IS0 6429, Information processing-IS0 ?'-bit and 8-bit coded character sets-Additional control func-
tions for character-imaging devices.
ECMA 96, Data Syntax for a multiple Workstation Interface.
Graphics
CEPT, Rev. of T/CD 6.1 Videotex Presentation Layer Data Syntax.
IS0 8632-2 : 1987 (E)
I
3 Notational conventions
b4 b3 bl
Bit: b7 b6 b5 b2
Weight: 64 32 16 8 4 2 1
Bit: b8 b7 b6 b5 b4 b3 b2 bl
Weight: 128 64 32 16 8 4 2 1
IS0 8632-2 : 1987 (E)
7-Bit and 8-Bit code tables
Notational conventions
An example illustrates the 8-bit code: 04/01 represents the 8-bit byte 01000001, whereas 4/1 represents
the 7-bit byte 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 CGM, these terms, and the concepts to
which they refer, apply only within the string parameters of the TEXT, APPEND TEXT, and RES-
TRICTED TEXT metafile elements.
3.2.1 CO sets
A CO set is a set of 30 control characters represented in a 7-bit code by 0/0 to 1/15, except 0/14 and
OO/OO to 01/15, except 00/14 and 00/15 which shall
0/15 which shall be unused, and in an 8-bit code by
be usused. CO sets occupy columns O and 1 of a 7-bit code table or columns O0 and O1 of an 8-bit code
table. The meanings of CO controls within string parameters are described in 6.9.3.
3.2.2 C1 sets
A C1 set is a set of up to 32 control chazacters represented by bit combinations 08/00 to 09/15 in an 8-
bit code. C1 sets occupy columns 08 and O9 of the 8-bit code table. In a 7-bit code the C1 control func-
tions are represented by 2-byte escape sequences. This CGM encoding reserves the bit combinations 9/8
and 9/12 (ESC 5/8 and ESC 5/12 in a 7-bit environment, ESC = 1/11); these shall not be part of the
content of string parameters. Other C1 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, G1, G2, G3) are coded character sets of 94 or 96 characters. CHARACTER SET
is to be the GO set. ALTERNATE CHARACTER SET INDEX
INDEX designates which character set
designates a character set to be used as both the G1 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 CGM uses the GO and G1/G2 sets within string parame-
ters. The G3 set may be used within the string parameters of cvnforming metafiles; this requires selec-
tion of the extended 7-bit or extended %bit mode in the CHARACTER CODING ANNOUNCER. The
CGM does not provide an element to explicitly designate the G3 sets; this may be done within a text
IS0 2022, or by other means agreed upon by the interchanging parties.
string in accordance with
IS0 8632-2 : 1987 (E)
Notational conventions
Code extension techniques vocabulary
1 1 1 1
O O
1 1
O O
1 1
O 1 O 1
O 1
2 3 4 5 6 7
D
THE
A G-SET OF
CO
94 OR 96
SET
BIT COMB I NAT1 ONS
Figure 1. The 7-bit code table.
IS0 8632-2 : 1987 (E)
Notational conventions
Code extension techniques vocabulary
30 O1 02 03 04 05 06 O7 O8 O9
10 11 12 13 14 15
-
-
O
10/0 I
"GR" SET OF
CO "GL" SET OF
c1
94 OR 96
94 OR 196
8 SET
SET
BIT COMB I NATI ONS
B IT COMB I NATI ONS
1m
-
Figure 2.
The 8-bit code table.
IS0 8632-2 : 1987 (E)
4 Entering and leaving the metafile environment
4.1 Implicitly entering the metafile environment
The CGM coding environment may be entered implicitly, by agreement between the interchanging par-
ties. This is suitable only if there is not to be any interchange with services using other coding tech-
niques.
4.2 Designating and invoking the CGM coding environment from IS0 2022
For interchange with services using the code extension techniques of IS0 2022, the CGM coding environ-
ment shall be designated and invoked from IS0 2022 environment by the following escape sequence:
ESC 2/5 F
where ESC is the bit combination 1/11, and F refers to a bit combination that will be assigned by the
IS0 Registration Authority for IS0 2375.
The first bit combination occuring after this escape sequence will then represent the opcode of a CGM
metafile element.
After the end of one or more metafiles (i.e., after the END METAFILE element) or between pictures
END PICTURE element), the following escape sequence may be used to return to the IS0
(i.e., after the
2022 coding environment:
ESC 2/5 4/0
This not only returns to the IS0 2022 coding environment, but also restores the designation and invoca-
tion of coded character sets to the state that existed prior to entering the CGM coding environment
with the ESC 2/5 F sequence. (The terms "designation" and "invocation" are defined in IS0 2022.)
IS0 8632-2 : 1987 (E)
5 Method of encoding opcodes
Each metafile element is composed of one lopcode and parameters as required. The opcodes are coded as
a sequence of bit combinations from columins 2 and 3 of the code chart. The encoding technique supplies:
- the basic opcode set;
- extension opcode sets.
5.1 Encoding technique of the bask opcode set
The basic opcode set consists of single-byte and double-byte opcodes. Single-byte opcodes are from
Bits b4 to bl are used to encode the opcode. The format is as follows:
column 2 of the code chart.
b8 bl
+-+-----+------- +
!XI0 1 olb b b bl
0 +-+-e--- + ------- +
The "X' bit (bit b8) is the parity bit (or omitted bit) in a ?-bit environment. In an %bit environment it
is O. For double-byte opcodes the first byhe 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:
b8 bl b8 bl
+*+- - - - -+- - - - - - - + +-+---+ ---------
+
lXl0 1 lib b b bi lXl0 l]b b b b b]
+-+-----+---e--- + +-+---+ -------
- -+
The bit combination 3/15, the EXTEND OPCODE SPACE (EOS) allows extension of the basic opcode
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 3 except bit combination 3/15, second
byte from column 2 or 3).
O
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, 3/15).
The N-th extension opcode set consists of opcodes of the basic opcode set, prefixed with n times the code
EOS. The three possible formats of an opcode from the N-th extension opcode set are:
Opcode format Extension codes Basic opcode set codes
1 sEOS> . . .
I I
I -------
I
I
I
n t imes
2 . . . <3/y> <2/z>
I I
I --_----
I
I
I
n t imes
IS0 8632-2 : 1987 (E)
I
Extension mechanism Method of encoding opcodes
3 dms>. . .aDs> <3/y> <3/z>
I I
I -------
I
I
I
n t imes
= 3/15
x = 0,1,.,15
y = 0,1,.,14
z = 0,1,.,15
n = 0,1, .
n = O selects the basic opcode set.
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+1), where n is the number of extension sets. (Each extension set has 496 opcodes - 16 single-
byte opcodes plus 480 double-byte codes.)
e
5.3 Opcode assignments
Table 1 lists the opcode assignments for the CGM elements. All opcodes are from the basic opcode set.
as follows: single-byte opcodes are assigned to Graphical Primitive elements
They have be organized
except for some of the Circular and Elliptical output elements, where double-byte opcodes with combi-
nation 3/4 for the first byte have been assigned. All other metafile elements have double-byte opcodes
with the following bit combinations for the first byte:
3/0 for Delimiter Elements
for Metafile Descriptor Elements
3/1
for Picture Descriptor Elements
3/2
for Control Elements
3/3
3/5 and 3/6 for Attribute Elements
for Escape and External Elements
3/7
IS0 8632-2 : 1987 (E)
Opcode assignments
Method of encoding opcodes
Table 1 - Opcodes for metafile elements.
‘-Bit coding 8-Bit coding
Opcode
03/0 02/0
BEGIN METAFILE opcode
3/0
03/0 02/1
END METAFILE opcode
3/0
BEGIN PICTURE opcode 03/0 02/2
3/0
03/0 02/3
BEGIN PICTURE BODY opcode
3/0
END PICTURE opcode 03/0 02/4
3/0
METAFILE VERSION opcode 03/1 02/0
3/1
03/1 02/1
METAFILE DESCRIPTION opcode
3/1
VDC TYPE opcode 03/1 02/2
3/1
03/1
INTEGER PRECISION opcode 02/3
3/1
02/4
03/1
REAL PRECISION opcode
3/1
03/1 02/5
INDEX PRECISION opcode
3/1
03/1 02/6
COLOUR PRECISION opcode
3/1
03/1 02/7
COLOUR INDEX PRECISION opcode
3/1
MAXIMUM COLOUR INDEX opcode 03/1 02/8
3/1
COLOUR VALUE EXTENT opcode 03/1 02/9
3/1
03/1 02/10
METAFILE ELEMENT LIST opcode
3/1
BEGIN METAFILE DEFAULTS REPLACEMENT opcode 03/1 02/11
3/1
02/12
END METAFILE DEFAULTS REPLACEMENT opcode 03/1
3/1
03/1 02/13
FONT LIST opcode
3/1
CHARACTER SET LIST opcode 03/1 02/14
3/1
03/1 02/15
CHARACTER CODING ANNOUNCER opcode
3/1
03/2 02/0
SCALING MODE opcode
3/2
03/2 02/1
COLOUR SELECTION MODE opcode
3/2
03/2 02/2
LINE WIDTH SPECIFICATION MODE opcode
3/2
02/3
MARKER SIZE SPECIFICATION MODE opcode 03/2
3/54
03/2 02/4
EDGE WIDTH SPECIFICATION MODE opcode
3/2
VDC EXTENT opcode 03/2 02/5
3/2
03/2 02/6
BACKGROUND COLOUR opcode
3/2
VDC INTEGER PRECISION opcode 03/3 02/0
3/3
03/3 02/1
VDC REAL PRECISION opcode
3/3
03/3 02/2
AUXILIARY COLOUR opcode
3/3
03/3 02/3
TRANSPARENCY opcode
3/3
03/3 02/4
CLIP RECTANGLE opcode
3/3
,
03/3 02/5
CLIP INDICATOR opcode
3/3
POLYLINE opcode 02/0
2/0
DIS JOINT POLYLINE opcode 02/1
2/1
02/2
POLYMARKER opcode
2/2
02/3
TEXT opcode
2/3
RESTRICTED TEXT opcode 02/4
2/4
02/5
APPEND TEXT opcode
2/5
POLYGON opcode 02/6
2/6
POLYGON SET opcode 02/7
2/7
CELL ARRAY opcode 02/8
2/8
GENEWIZED DRAWING PRIMITIVE opcode 02/9
2/9
RECTANGLE opcode 02/10
2/10
IS0 8632-2 : 1987 (E)
Method of encoding opcodes
Opcode assignments
Table 1 - Opcodes for metafile elements (concluded).
8-Bit coding
‘-Bit coding
Opcode
03/4 02/0
CIRCLE opcode
3/4 2/0
03/4 02/1
CIRCULAR ARC 3 POINT opcode
3/4 2/1
03/4 02/2
CIRCULAR ARC 3 POINT CLOSE opcode
3/4 2/2
03/4 02/3
CIRCULAR ARC CENTRE opcode
3/4 2/3
03/4 02/4
CIRCULAR ARC CENTRE CLOSE opcode
3/4 2/4
03/4 02/5
ELLIPSE opcode
3/4 2/5
03/4 02/6
ELLIPTICAL ARC opcode
3/4 2/6
03/4 02/7
ELLIPTICAL ARC CLOSE opcode
3/4 2/7
03/5 02/0
LINE BUNDLE INDEX opcode
3/5 2/0
03/5 02/1
LINE TYPE opcode
3/5 2/1
03/5 02/2
LINE WIDTH
3/5 2/2
03/5 02/3
LINE COLOUR opcode
3/5 2/3
03/5 02/4
MARKER BUNDLE INDEX opcode
3/5 2/4
03/5 02/5
MARKER TYPE opcode
3/5 2/5
03/5 02/6
MARKER SIZE opcode
3/5 2/6
MARKER COLOUR opcode 03/5 02/7
3/5 2/7
03/5 03/0
TEXT BUNDLE INDEX opcode
3/5 3/0
03/5 03/1
TEXT FONT INDEX opcode
3/5 3/1
03/5 03/2
TEXT PRECISION opcode
3/5 3/2
03/5 03/3
CHARACTER EXPANSION FACTOR opcode
3/5 3/3
03/5 03/4
CHARACTER SPACING opcode
3/5 3/4
03/5 03/5
TEXT COLOUR opcode
3/5 3/5
03/5 03/6
CHARACTER HEIGHT opcode
3/5 3/6
03/5 03/7
CHARACTER ORIENTATION opcode
3/5 3/7
03/5 03/8
TEXT PATH opcode
3/5 3/8
TEXT ALIGNMENT opcode 03/5 03/9
3/5 3/9
03/5 03/10
CHARACTER SET INDEX opcode 3/5 3/10
ALTERNATE CHARACTER SET INDEX opcode 03/5 03/11
3/5 3/11
03/6 02/0
FILL BUNDLE INDEX opcode
3./6 2/0
INTERIOR STYLE opcode 03/6 02/1
3/6 2/1
03/6 02/2
FILL COLOUR opcode
3/6 2/2
HATCH INDEX opcode 03/6 02/3
3/6 2/3
03/6 02/4
PATTERN INDEX opcode
3/6 2/4
03/6 02/5
EDGE BUNDLE INDEX opcode
3/6 2/5
03/6 02/6
EDGE TYPE opcode
3/6 2/6
03/6 02/7
EDGE WIDTH opcode
3/6 2/7
EDGE COLOUR opcode 03/6 02/8
3/6 2/8
03/6 02/9
EDGE VISIBILITY opcode
3/6 2/9
03/6 02/10
FILL REFERENCE POINT opcode
3/6 2/10
03/6 02/11
PATTERN TABLE opcode 3/6 2/11
03/6 02/12
PATTERN SIZE opcode
3/6 2/12
03/6 03/0
COLOUR TABLE opcode
3/6 3/0
03/6 03/1
ASPECT SO.URCE FLAGS opcode
3/6 3/1
ESCAPE opcode 03/7 02/0
3/7 2/0
3/7 3/0 03/7 03/0
DOWN RING opcode
MESSAGE opcode 03/7 02/1
3/7 2/1
03/7 02/2
APPLICATION DATA opcode
3/7 2/2
IS0 8632-2 : 1987 (E)
6 Method of encoding parameters
The parameter part of a CGM element may contain one or more parameters, each parameter consisting
of one or more bytes.
All parameters are coded in columns 4 through 7. (However, the coded representation of a 'string'
parameter may include bit combinations from other columns of the code table - see the description of
string parameters in 6.9). The general format of a parameter byte is:
b8 bl
+-+-+----------- +
IXlilb b b b b bl
+-+-+----------- +
The "X (bit b8) is the parity bit (or omitted bit) in a 7-bit environment. In an 8-bit environment it is
O. Bit b7 is the parameter flag.
Except for (string' and 'data record' parameters all parameters are encoded using one or both of two
formats, Basic format or Bitstream format.
6.1 Basic format
Each Basic format parameter is coded as a sequence of one or more bytes, structured as follows:
b8 bl
+-+-+-+-+ -------
+
IXfllefslb b b bl first byte
+-+-+-+-+ ---- ---+
b8 bl
+-+-+-+- -- - -----
+
fXllfefb b b b bf last byte
+-+-+-+- --------
+
The "X' (bit b8) is the parity bit (or omitted bit) in a 7-bit environment. In an 8-bit environment it is
0 O. Bit b7 is the parameter flag.
"e" (b6 of each byte) is the extension flag. For single byte parameters, the extension flag is O. In multi-
byte parameters, the extension flag is 1 in all bytes except the last byte, where it is O.
Bits b5 through bl are the data bits of the parameter.
"s" is the sign bit; if equal to O then the integer is non-negative and if equal to 1 then the integer is
as "plus zero" 4/0. The *'minus zero" coding is
negative. The number zero shall always be coded
reserved for special usage (see 6.6.3).
The Basic format is used to encode:
a) enumerated types (E);
b) colour indices (CI);
(X);
indices other than colour indices
c)
d) integers (I);
e) real numbers (R);
f) non-incremental coordinates.
IS0 8632-2 : 1987 (E)
Method of encoding parameters
Basic format
The most significant part of the parameter is coded in the first byte. The least significant part of the
parameter is coded in the last byte.
6.2 Bitstream format
Each Bitstream format parameter is encoded as a sequence of one or more bytes, structured as follows:
b8 bl
+-+-+----------- +
IXfllb b b b b bl first byte
+
b8 bl
+-+-+----------- +
lXlllb b b b b bl last byte
+-+-+-----------
+ e
The "XI' is the parity bit (or omitted bit) in a 7-bit environment. In an 8-bit environment it is O. Bit b7
is the parameter flag.
Bits b6 through bl are the data bits of the parameter.
The Bitstream format is used to encode:
incremental mode coordinates (see 6.6.2);
a)
b) colour direct (see 6.8);
colour index lists (see 6.8).
c)
Bitstream data are packed in consecutive databits starting from high-numbered bits to lower-numbered
bits of the first byte for the most significant part of the bitstream data.
The end of a Bitstream format parameter cannot be derived from the Bitstream format itself (the for-
mat is not self-delimiting). Instead,
-
for incremental mode coordinates, the end of the data (which identifies the end of the Bitstream
format parameter) is identified by the code;
e
-
for colour index lists, the number of bits needed to encode the colour index list (which identifies
the end of the Bitstream format parameter) is set by the COLOUR INDEX PRECISION element,
or by the LOCAL COLOUR PRECISION parameter (for those elements which contain such a
parameter);
-
for colour direct data, the number'of bits needed to encode the data (which identifies the end of
the Bitstream format operand) is set by the COLOUR PRECISION element, or by the LOCAL
COLOUR PRECISION parameter (for those elements which contain such a parameter).
6.3 Coding integers
Integers are coded as sequences of bytes in the range from 4/0 to 7/15 in the Basic format. If a byte is
from columns 4 or 5 of the code table, it is either the last byte in the integer's coded representation or it
is a single-byte integer. A multi-byte integer begins with a byte from columns 6 or 7 of the code table.
The structure of integer parameters is as illustrated for Basic format (see 6.1). "bbb ." are bits
representing the magnitude of the integer. The most significant part of the parameter is coded in the
first byte. The least significant part of the parameter is coded in the last byte.
Any integer can be' coded with leading most significant bits which are all zero. For example, 4/3 and
6/0 6/0 4/3 are both valid codings for the integer "+3"; however, efficient metafile generators should
avoid such redundant codings.
IS0 8632-2 : 1987 (E)
Method of encoding parameters Coding integers
The size of integer parameters is limited by the current INTEGER PRECISION value.
Integers in the range of -15 to +15 can be coded as single bytes.
(integer: +1) = 4/1 (integer: -1) = 5/1
(integer: +15) = 4/15 (integer: -15) = 5/15
Larger integers require more bytes.
(integer: +16) = 6/0 5/0 (integer: -16) = 7/0 5/0
(integer: +1034) = 6/1 6/0 4/10 (integer: -1034) = 7/1 6/0 4/10
6.4 Coding real numbers
Each real number is coded as an integer mantissa followed by an optional exponent, both coded in the
Basic format. The exponent is the power of two by which the integer mantissa is to be multiplied.
The exponent may be implicitly defined as a default exponent, which is then omitted in the Real format,
or the exponent may be coded explicitly as the second part of the Real format:
= []
Depending on the "exponent allowed" parameter of the REAL PRECISION element, one of the bits in
the first byte of the mantissa tells whether the exponent follows. If the "exponent follows" bit in the
mantissa is zero, or if REAL PRECISION has specified that there is to be no "exponent follows" bit,
then the exponent is omitted and a default value is assumed which is set by another parameter of the
REAL PRECISION element.
Note that the coding of real VDC coordinates is controlled by VDC REAL PRECISION, not by REAL
PRECISION, and that the rules for default exponents in real VDC coordinates are slightly different (see
6.5 and 6.6).
The mantissa is an integer which is coded in the Basic format. The first byte takes one of two forms,
depending on whether or not REAL PRECISION has specified that an "exponent follows" bit is to be
included. The format is as follows (first byte):
bû bl
+-+-+-+-+-+ ----- + {if explicit exponent allowed = 'allowed',
fXfllelsfpib b bf i.e. the exponent-follows bit is present}
+-+-+-+-+-+ -----
+
or
,
b8 bl
+-+-+-+-+ ------- + {if explicit exponent allowed = 'forbidden',
fXllielslb b b bf i.e. there is no exponent-follows bit}
+-+-+-+-+ -------
+
b8 bl
+-+-+-+ ----- ----
+
lXllfelb b b b bf {last byte}
+-+-+-+ ---------
+
"e" is the extension flag, see 6.1 for a description.
"s" is the sign bit (bit b5 of the first byte): O for a positive mantissa, 1 for a negative mantissa.
Here "p" is the exponent-follows bit. If the current "explicit exponent allowed" value of the REAL PRE-
CISION element is 'allowed', bit b4 of the first byte of a mantissa is used as the '*exponent follows" bit:
IS0 8632-2 : 1987 (E)
Method of encoding parameters
Coding real numbers
1 if an explicit exponent follows, O if no exponent follows the mantissa (then the default exponent set by
REAL PRECISION is assumed). If the current "explicit exponent allowed" value of the REAL PRECI-
SION element is 'forbidden', bit b4 of the first byte is used as a databit and the default exponent set by
REAL PRECISION is assumed.
The exponent is coded as an integer in Basic format, see 6.3.
Mantissas or exponents of "minus zero" are not allowed and reserved for future use.
For example, suppose that REAL PRECISION has specified that each real parameter is to be coded
with an "exponent follows" bit in its mantissa. In that case, the binary numeral +1.110010110011 is
coded as follows:
(real: binary +1.11 00101 10011)
= (mantissa: +iii 00101 10011, "exponent-follows")
(exponent: -12)
+-+---+-+-+ ----- + +-+-+-+ --------- + +-+-+-+---------+
= IXlifilOlili 1 il lX;l;ilo 0 i 0 1; IXliloli 0 0 1 il {mantissa}
+-+---+-+-+ ----- + +-+-+-+--------- + +-+-+-+--------- +
+-+-+-+-+ -------
+
tXlilOlil1 1 O 01 {exponent}
+-+-+-+-+ -------
+
= 6/15 6/5 5/3 5/12
Again, suppose that REAL PRECISION has specified that real parameters are to be coded without
exponents and without exponent-follows bits in their mantissas, and that the default exponent is to be
-13. In that case, binary +1.110010110011 is coded as follows:
(real: binary +l.llOOlOllOOll)
= (mantissa: +il10 01011 00110)
= 6/14 6/11 4/6
6.5 Coding VDCs and points
A point is a pair of VDC scalars. A VDC scalar is either an integer or real number according to
whether VDC TYPE is integer or real.
When VDC TYPE is integer, the encodings of the VDC and point data types are as described in 6.3,
Coding Integers. The size of the VDC and point parameters is limited by the current VDC INTEGER
PRECISION value.
When VDC TYPE is real, the encodings of the VDC and point data types are as described in 6.4, Cod-
ing Real Numbers. The size of the VDC and point parameters is limited by the current VDC REAL
PRECISION value. Whether or not "exponent follows" bits are included in the mantissas of VDCs and
a parameter of VDC REAL PRECISION. The default value for an omitted
points is determined by
exponent in a VDC is determined by the "default exponent" parameter in VDC REAL PRECISION. If
the exponent is omitted from a point data type, a default exponent is assumed as follows.
-
If the point is not in a point list, or is the first point of a point list, the omitted exponent assumes
the default value exponents of VDC parameters, as specified by VDC REAL PRECISION.
IS0 8632-2 : 1987 (E)
Method of encoding parameters Coding VDCs and points
-
If the point is in a point list, but is not the first point of that point list, an omitted exponent may
assume a different value as follows: if the exponent is omitted from the x-component of a real
it defaults to the value of the exponent in the preceding x-component; similarly, an
point,
exponent omitted from a y-component assumes the value of the exponent in the preceding y-
coordinate.
6.6 Coding point list parameters
Point lists may be coded with one or both of the following coding structures. These structures are
called ‘Displacement Mode’ and ‘Incremental Mode’. Both formats may be used within a single point
list.
Individual points and the first point of each point list are always be coded in Displacement Mode. The
displacement values delta-x and delta-y are displacements measured from the origin, i.e. absolute posi-
tions. For points after the first point in a point list, each displacement is measured from the preceding
point of the point list (this is true regardless of whether the preceding point was coded in Displacement
Mode or in Incremental Mode).
O
6.6.1 Displacement mode
In Displacement Mode, each point is coded as a sequence of two VDCs. The first VDC value gives the
x-component of the point’s displacement from the preceding point, while the second VDC value specifies
the y-component of that displacement.
=
6.6.2 Incremental mode
The Incremental Mode is defined as a Differential Chain Code (DCC). The data in this mode does not
reflect actual coordinates, but defines steps (increments) from one coordinate position to another. These
increments are identified by points on a Ring. A Ring is a set of points on a square whose centre is the
previously identified point. The first centre point is encoded in Displacement Mode.
A Ring is characterized by its Radius (R) in Basic Grid Units (BGU), its Angular resolution (by a factor
p) and its Direction (D). The maximum number of points on a Ring is 8R. The actual number of points
on a Ring with a given Angular resolution factor p follows from:
O
8R
N=-, p=0,1,2,3
2p
N is required to be even.
The points on the Ring are numbered, starting at the Direction point D, counter clockwise from O to M-
1 and clockwise from -1 to -M, with M=N/2.
Following are examples of two Rings, both having Radius R=3. The Ring on the left has Angular reso-
lution factor p=O and the one on the right has Angular resolution factor p=l.
IS0 8632-2 : 1987 (E)
Method of encoding parameters
Coding point list parameters
4 3 2
9. .3
10 . .2 5. .1
11 . .1
-6 . .O
.O
- 12
centre
centre
. -1
- 11
-10 . . -2 -5 . . -1
-9 . . -3
-8 -7 -6 -5 -4 -4 -3 -2
e
The Direction of the Ring is given by the position of the point with number ZERO. The initial position
of this point is on the positive x-axis of VDC space, while the Cartesian axes are drawn through the cen-
tre point of the Ring. The Direction of the Rings following the initial one is dependent on the direction
of the increments. This Direction is determined in the following way:
P2 be the current centre point and P1 the previous one, i.e., P2 is a point on the Ring with cen-
Let
tre in P1. The Direction of the Ring is obtained by drawing a line from Pi through P2; where this
direction ray intersects P2's Ring is the ZERO point of that Ring. So the Direction of the Ring is
dependent on the direction of the line to be displayed.
In the DCC only the differences between points on the consecutive Rings are coded. The position of
point P3, i.e., the increment on the new Ring (centre P2) is described by the difference between the posi-
tion of point P2 on the previous Ring and the position of the new point P3 on the current Ring, the
positions numbered with respect to the previous Ring. As shown in example below, the position of point
P3 is defined by the difference: P3 - P2 = -1. P3 and P2 being point numbers on the two Rings, num-
bered as given in the previous figure. The Direction (position of the point with number ZERO) is
identified by D.
. . . . . . .
*D
...... * P3
* P2
I
* P1
. . . . . . .
, . . . . . .
Change of direction with k3
The basic Radius of the Ring, as used in Incremental mode, is dependent on the BGU. The BGU is the
set by the VDC INTEGER or REAL
smallest nonzero value that can be expressed within the precision
PRECISION element. For VDC TYPE integer, basic Radius (=BGU) = 1. For VDC TYPE real the size
of the BGU is set by a parameter of VDC REAL PRECISION, called smallest-real code: letting "src"
BGU=2"'. The basic Radius is a multiple of the BGU, i.e. it is a positive
stand for smallest-real code,
integer. For VDC TYPE real the default value for the basic Radius follows from:
I
'
IS0 8632-2 : 1987 (E)
Method of encoding parameters Coding point list par ameters
smallest-real code basic Radius
>g
2g
BGU
where g is a nominal smallest-real code. A value of g = -8 is used in IS0 8632/2.
The basic Radius and the Angular resolution factor may be changed with the DOMAIN RING element.
If the basic Radius is set to a value less than ONE, the value ONE is assumed for the basic Radius.
The encoding used in Incremental Mode makes use of the DCC property by using variable length code-
words (Huffman Code). The encoding also allows changing of the Radius and the Angular resolution
factor. The Radius can have a value of R, 2R, 4R or 8R, where R is the defined Radius. The Angular
resolution factor p can be O, 1, 2, or 3, the default value is O.
The Huffman Code table (see table 2) used in the Incremental mode is a fixed length table. To allow the
encoding of more points on a Ring two Escape codes are defined. With these Escape codes the points
outside the Huffman Code table can be addressed. The end of the Incremental mode data is indicated by
an End of Block value in the Huffman Code table.
IS0 8632-2 : 1987 (E)
Method of encoding parameters
Coding point list parameters
Table 2 - Hufiinan code table for incremental mode.
Length Code-word Point number
O0 O
2 10 1
O1 -1
4 1100
4 1101 -2
6 11 1000 3
6 111001 -3
6 111010
6 111011 -4
11 110000 5
8 1 1 1 10001 -5
8 11 110010
8 11 11001 1 -6
8 11 1 10100
8 11110101 -7
8 11110110 8
8 11110111 -8
10 9
10 1111100001 -9
10 10
10 1111100011 -10
10 1111100100 11
10 111 1100101 -1 1
10 1111100110 12
1111100111 -12
10 1111101000 13
10 1111101001 -13
10 1111101010 14
10 1111101011 -14
10 1111101100 15
10 1111101101 -15
1111101110 16
10 1111101111 -16
1 1 1 1 1 10000 17
10 1111110001 -17
1111110010 18
10 1111110011 -18
10 1111110100 19
10 1111110101 -19
10 1111110110 c1
10 1111110111 -20
10 1111111Ooo c2
10 1111111001 c3
10 1111111010 c4
1111111011 c5
10 1111111100 C6
10 1111111101 IM-ESC 1
10 1111111110
IM-ESC 2
10 1111111111 End of Block
The code from the Huffman Code ta
'le identifies the end of the Incremental mode
data. Remaining bits in the last Incremental mode data byte have no meaning; they are required to be
zero.
IS0 8632-2 : 1987 (E)
Coding point list parameters
Method of encoding parameters
The Incremental Mode escape codes and are used to extend the addressable
number of points, e.g. points outside the range -20 to 19. The code adds +20 or -20 to the
following code, depending on the sign of that following point. The code adds +40 or -40
to the following code, depending on the sign. The escape codes can follow each other in any desired
order. The following examples demonstrate some possible combinations, [n] is a point number.
1> 11 = point number 21
-11 = point number -21
141 = point number 54
= point number -52
-121
= point number (20+40+6) = 66
-181 = point number (-40-20-18) = -78
The codes C1 up to C6 are used to change the parameters that define the Ring to be used. The values of
R are taken from the range RO, 2R0, 4R0 and 8R0, where RO is the value of the Ring Radius before
entering the Incremental Mode. The values of p are taken from the range O, 1, 2 and 3. The function
of these codes is as follows:
Change the Ring parameters, R and p, to the next higher value, e.g. if the Radius is RO it is
c1
set to 2R0, if the Angular resolution is p=O it is set to p=l. R cannot become greater than
8R0 and p cannot become greater than 3. For example if the current Ring Radius is 8R0
and the current Angular resolution factor 3, the code has no effect.
Change the Ring parameters, R and p, to the next lower value. The effect of the code
c2
is the inverse of code . R cannot become smaller than RO and p canno
...








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...