ISO 8632-3:1987
(Main)Information processing systems — Computer graphics — Metafile for the storage and transfer of picture description information — Part 3: Binary encoding
Information processing systems — Computer graphics — Metafile for the storage and transfer of picture description information — Part 3: Binary encoding
Systèmes de traitement de l'information — Infographie — Métafichier de stockage et de transfert des informations de description d'images — Partie 3: Codage binaire
General Information
Relations
Standards Content (Sample)
IS0
INTERNATIONAL STANDARD
8632-3
First edition
11 987-08-01
INTERNATIONAL ORGANIZATION FOR STANDARDIZATION
ORGANISATION INTERNATIONALE DE NORMALISATION
MEXAYHAPOAHAR OPrAHM3AuMR Ti0 CTAHAAPTM3A!&îM
Information processing systems - Computer graphics -
Metafile for the storage and transfer of picture
description information -
Part 3 :
Binary encoding
Systèmes de traitement de l'information - Infographie - Métafichier de stockage et de transfert
des informations de description d'images -
Partie 3 : Codage binaire
Reference number
IS0 8632-3 : 1987 (E)
---------------------- Page: 1 ----------------------
Foreword
IS0 (the International Organization for Standardization) is a worldwide federation of
national standards bodies (IS0 member bodies). The work of preparing International
IS0 technical committees. Each member
Standards is normally carried out through
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-3 was prepared by Technical Committee ISO/TC 97,
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.
0 International Organization for Standardization, 1987 0
Printed in Switzerland
Il
---------------------- Page: 2 ----------------------
IS0 8632-3 : 1987 (E)
CONTENTS
...... 1
.. ..
O Introduction .
..
..
0.1 Purpose of the Binary Encoding .
.. ..
0.2 Objectives .
.. ...... 2
..
0.3 Relationship to other International Standards . .
...... 2
.. ..
0.4 Status of annexes .
...... 3
.. ..
1 Scope and field of application .
.. ...... 4
2 References . .
...... 5
.. ..
3 Notational conventions .
.. .. ...... 6
4 Overall structure .
...... 6
.. ..
4.1 General form of metafile .
.. ...... 6
..
4.2 General form of pictures .
...... 6
.. ..
4.3 General structure of the binary metafile .
...... 7
.. ..
4.4 Structure of the command header .
.. ...... 10
... ..
5 Primitive data forms .
...... 10
... .. ..
5.1 Signed integer .
.. ...... 10
5.1.1 Signed integer at 8-bit precision . . . .
.. ...... 10
... ..
5.1.2 Signed integer at 16-bit precision .
...... 10
.. ..
5.1.3 Signed integer at 24-bit precision . .
.. ...... 11
5.1.4 Signed integer at 32-bit precision . . .
.. .. ...... 11
5.2 Unsigned integer . .
...... 11
... .. ..
5.2.1 Unsigned integers at 8-bit precision .
.. .. ...... 11
5.2.2 Unsigned integers at 16-bit precision .
.. ...... 11
5.2.3 Unsigned integers at 24-bit precision . .
...... 12
... .. ..
5.2.4 Unsigned integers at 32-bit precision
.. .. ...... 12
5.3 Character . .
...... 12
... .. ..
5.4 Fixed point real .
.. .. ...... 12
5.4.1 Fixed point real at 32-bit precision . .
.. ...... 12
5.4.2 Fixed point real at 64-bit precision . . .
.. .. ...... 13
5.4.3 Value of fixed point reals . .
...... 13
... .. ..
5.5 Floating point .
.. .. ...... 13
5.5.1 Floating point real at 32-bit precision .
.. ...... 14
5.5.2 Floating point real at 64-bit precision . .
...... 15
.. ..
6 Representation of abstract parameter types .
.. .. ...... 19
7 Representation of each element . .
.. ...... 19
7.1 Method of presentation . . . .
...... 20
7.2 Delimiter elements . . . .
........ .. .. ...... 21
7.3 Metafile descriptor elements
.. .. ...... 24
7.4 Picture descriptor elements .
...... 26
7.5 Control elements . . . .
...... 28
........ .. ..
7.6 Graphical primitive elements
.. ...... 32
7.7 Attribute elements . . .
...... 38
7.8 Escape element . . . .
.. .. ...... 39
7.9 External elements . .
8 Defaults . . . . 40
.. .. ...... 41
9 Conformance .
---------------------- Page: 3 ----------------------
IS0 8632-3 : 1987 (E)
A Formal grammar . . 42
...... 44
B Examples .
B.l Example 1 : BEGIN METAFILE ‘Example 1’ . . 44
.......... ...... 44
B.2 Example 2 : BEGIN PICTURE ‘Test’
45
B.3 Example 3 : POLYLINE from O. 2 to 1. 3 to 2. 1 to O. 2 . .
.......... ...... 45
B.4 Example 4 : TEXT ‘Hydrogen’ at O. 1
B.5 Example 5 : Partitioned POLYLINE with 50 points . . 46
B.6 Example 6 : METAFILE DEFAULT REPLACEMENT linewidth 0.5 . 47
.....
B.7 Example 7 : Application Data # 655 with 10K octets (chars) of data 47
........ ...... 48
C List of binary encoding metafile element codes
---------------------- Page: 4 ----------------------
INTERNATIONAL STANDARD IS0 8632-3 : 1987 (E)
Information processing systems - Computer graphics -
Metafile for the storage and transfer of picture
description information -
Part 3 :
Binary encoding
O Introduction
0.1 Purpose of the Binary Encoding
The Binary Encoding of the Computer Graphics Metafile (CGM) provides a representation of the
Metafile syntax that can be optimized for speed of generation and interpretation, while still providing a
standard means of interchange among computer systems. The encoding uses binary data formats that
are much more similar to the data representations used within computer systems than the data formats
of the other encodings.
Some of the data formats may exactly match those of some computer systems. In such cases processing
is reduced very much relative to the other standardized encodings. On most computer systems process-
ing requirements for the Binary Encoding will be substantially lower than for the other encodings.
In cases where a computer system’s architecture does not match the standard formats used in the
Binary Encoding, and where absolute minimization of processing requirements is critical, and where
interchange among dissimilar systems does not matter, it may be more appropriate to use a private
encoding, conforming to the rules specified in clause 7 of IS0 8632/1.
0.2 Objectives
This encoding has the following features.
Partitioning of parameter lists: metafile elements are coded in the Binary Encoding by one or
more partitions (see clause 4); the first (or only) partition of an element contains the opcode
(Element Class plus Element Id).
Alignment of elements: every element begins on a word boundary. Alignment of partitions that
require an odd number of octets is effected by padding with an octet with all bits zero. A no-op
element is available in this encoding; it is ignored. It may be used to align data on machine-
dependent record boundaries for speed of processing.
Uniformity of format: all elements have an associated parameter length value. The length is
specified as an octet count. As a result, it is possible to scan the metafile, without interpreting
it, at high speed.
Alignment of coordinate data: at default precisions and by virtue of alignment of elements,
coordinate data always start on word boundaries.
This minimizes processing by ensuring, on a
wide class of computing systems, that single coordinates do not have to be assembled from
pieces of multiple computer words.
Efficiency of encoding integer data: other data such as indexes, colour and characters are
encoded as one or more octets. The precision of every parameter is determined by the appropri-
ate precision as given in the METAFILE DESCRPTOR.
Order of bit data: in each word, or unit within a word, the bit with the highest number is the
most significant bit. Likewise, when data word are accessed sequentially, the least significant
word follows the most significant.
1
---------------------- Page: 5 ----------------------
IS0 8632-3 : 1987 (E)
Objectives Introduction
Extensibility: the arrangement of Element Class and Element Id values has been designed to
g)
allow future growth, such as new graphical elements.
Format of real data: real numbers are encoded using either IEEE floating point representation
h)
or a metafile fixed-point representation.
Run length encoding: if many adjacent cells have the same colour (or colour index) efficient
i)
encoding is possible. For each run, the colour (or colour index) is specified, followed by a cell
count.
Packed list encoding: if adjacent colour cells do not have the same colour (or colour index) the
j)
metafile provides bit-stream lists in which the values are packed as closely as possible.
0.3 Relationship to other International Standards
The floating point representation of real data in this part of IS0 8632 is that in ANSI/IEEE 754-1986.
The representation of character data in this part of IS0 8632 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, 4.11.)
0.4 Status of annexes
The annexes do not form an integral part of this part of IS0 8632 but are included for information only.
---------------------- Page: 6 ----------------------
IS0 8632-3 : 1987 (E)
1 Scope and field of application
This part of IS0 8632 specifies a binary encoding of the Computer Graphics Metafile. For each of the
elements specified in IS0 8632/1, an encoding is specified in terms of a data type. For each of these
data types, an explicit representation in terms of bits, octets and words is specified. For some data
types, the exact representation is a function of the precisions being used in the metafile, as recorded in
the METAFILE DESCRIPTOR.
This encoding of the Computer Graphics Metafile will, in many circumstances, minimize the effort
required to generate and interpret the metafile.
3
---------------------- Page: 7 ----------------------
IS0 8632-3 : 1987 (E)
2 References
IS0 646, Information Processing-IS0 7-bit coded character set for information interchange.
IS0 2022, Information Processing-IS0 7-bit and 8-bit coded character sets-Code extension tech-
niques.
ANSI/IEEE 754, Standard for Binary Floating Point Arithmetic.
4
---------------------- Page: 8 ----------------------
IS0 8632-3 : 1987(E)
3 Not at ional convent ions
/
"Command Header" is used throughout this part to refer to that portion of a Binary-Encoded elemen4
that contains the opcode (element class plus element id) and parameter length information (see clayhe
4).
Within this part, the terms "octet" and "word" have specific meanings. These meanings may not match
those of a particular computer system on which this encoding of the metafile is used.
An octet is an 8-bit entity. All bits are significant. The bits are numbered from 7 (most significant) to
û (least Significant).
A word is a 16-bit entity. All bits are significant. The bits are numbered from 15 (most significant) to O
(least significant).
5
---------------------- Page: 9 ----------------------
IS0 8632-3 : 1987 (E)
4 Overall structure
4.1 General form of metafile
All elements in the metafile are encoded using a uniform scheme. The elements are represented as vari-
able length data structures, each consisting of opcode information (element class plus element id) desig-
nating the particular element, the length of its parameter data and finally the parameter data (if any).
The structure of the metafile is as follows. (For the purposes of this diagram only, MF is used as an
abbreviation for METAFILE.)
I BEGINMF I MD I
Questions, Comments and Discussion
Ask us and Technical Secretary will try to provide an answer. You can facilitate discussion about the standard in here.