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

For each of the function syntaxes in clauses 5 and 6 of ISO/IEC 9636-2 to 9636-6, an encoding is specified in terms of an opcode and a sequence of parameters of specified data types. For each of these data types, an explicit representation in terms of bits, 8-bit and 16-bit entities is specified. This binary encoding will, in many circumstances, reduce the effort required to generate and interpret the data stream as compared to other encodings.

Technologies de l'information — Infographie — Interfaces pour l'infographie — Interfaces du flux de données CGI — Partie 2: Codage binaire

General Information

Status
Published
Publication Date
09-Dec-1992
Current Stage
9093 - International Standard confirmed
Start Date
22-Sep-2021
Completion Date
30-Oct-2025

Overview

ISO/IEC 9637-2:1992, "Information technology - Computer graphics - Interfacing techniques for dialogues with graphical devices (CGI) - Data stream binding - Part 2: Binary encoding," defines a standardized binary encoding for the Computer Graphics Interface (CGI) data stream. For every CGI function syntax (as specified in ISO/IEC 9636 parts 2–6) the standard prescribes an opcode and a precise sequence of parameter data types and bit/byte representations. The Binary Encoding maps abstract CGI types to explicit bit, 8‑bit (octet) and 16‑bit (word) entities to optimize generation and interpretation of graphics command streams across systems.

Key Topics

  • Opcode + parameter model: Each function/response is encoded with a class/id opcode, a length, and parameter data.
  • Octet and word organization: The octet (8-bit) is the fundamental unit; the word (16-bit) is used for alignment. Representations are word-aligned and padded as needed.
  • Representation headers: The standard defines short-form, long-form and extended-form representation headers and encoding functions to identify and parse partitions.
  • Primitive data forms: Explicit binary formats for signed/unsigned integers (8/16/24/32-bit variants), octets, fixed-point and floating-point reals (IEEE 754 referenced).
  • Precision and special rules: Mechanisms for encoding precision settings, strings, fixed strings, data records, point lists, transformation matrices, color specifiers, and local color precision.
  • Efficiency features: Run-length encoding for repeated colors and packed list encodings to pack values tightly for compact streams.
  • Extensibility and compatibility: Opcode/class assignment supports future growth; designed to be compatible with CGM/Metafile binary encodings where semantics match.
  • Response handling: Soliciting functions and associated response opcodes are defined so interpreters can recognize and correlate requests and replies.

Applications and Who Uses It

  • Graphics system implementers: Developers of CGI interpreters, graphics libraries and device drivers use this standard to implement efficient binary command streams.
  • Middleware and tool vendors: Metafile, metafile-to-device converters, and rasterization tools adopt the encoding for interoperability and performance.
  • System integrators and embedded graphics: Environments where CPU or bandwidth is constrained benefit from lower processing overhead of binary encodings.
  • Standards engineers and QA teams: Use the specification to verify conformance, alignment, and correct type representation.

Benefits include reduced processing effort, consistent cross-platform interchange, and compact, high-performance data streams for graphical dialogues.

Related Standards

  • ISO/IEC 9637-1 (Character encoding)
  • ISO/IEC 9636-2–6 (CGI functional specifications)
  • ISO/IEC 8632-3 (CGM Binary Encoding / Metafile)
  • ISO 646 and ISO 2022 (character set rules)
  • ANSI/IEEE 754 (floating-point representation)

Keywords: ISO/IEC 9637-2, Binary encoding, CGI, data stream binding, opcode, octet, word-aligned, IEEE 754, computer graphics interoperability.

Standard

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

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

Frequently Asked Questions

ISO/IEC 9637-2:1992 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 2: Binary encoding". This standard covers: For each of the function syntaxes in clauses 5 and 6 of ISO/IEC 9636-2 to 9636-6, an encoding is specified in terms of an opcode and a sequence of parameters of specified data types. For each of these data types, an explicit representation in terms of bits, 8-bit and 16-bit entities is specified. This binary encoding will, in many circumstances, reduce the effort required to generate and interpret the data stream as compared to other encodings.

For each of the function syntaxes in clauses 5 and 6 of ISO/IEC 9636-2 to 9636-6, an encoding is specified in terms of an opcode and a sequence of parameters of specified data types. For each of these data types, an explicit representation in terms of bits, 8-bit and 16-bit entities is specified. This binary encoding will, in many circumstances, reduce the effort required to generate and interpret the data stream as compared to other encodings.

ISO/IEC 9637-2:1992 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-2:1992 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)


INTERNATIONAL
ISO/IEC
STANDARD
9637-2
First edition
1992-I Z-01
Information technology - Computer
graphics - Interfacing techniques for
dialogues with graphical devices (CGI) -
Data stream binding -
Part 2:
Binary encoding
Technologies de /‘information - lnfographie - Interfaces pour
l’infographie - Interface du flux de donnkes CGI -
Partie 2: Codage binaire
Reference number
lSO/IEC 9637-2:1992(E)
ISO/IEC 963702:1992 (E)
Page
CONTENTS
Foreword , . . . , . . . . . . . . . . . , . . . . . . . . . . . . . iv
V
Introduction . . , . . . . . . . . . . . . . . . . . e . . . . . . .
1 Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2 Normative References . . . . . . . . . . 0 . . . . . . . . . . . .
3 Definitions. . . . . . . . . . . . . . . . . . . . . . . . . . . 4
. . . . .I. Y . . . . . 5
4 Overall structure
4.1 General form of the data’s&&& . . a . . . . .I 5
4.2 General structure of the Binary Endoding’ . . . . . . . D . .
. . . . 7
4.3 Encoding functions
4.3.1 General structure’of the ~epresen;a;ion*h~a~er . . . .
4.3.2 Basic short-form representation header . . . . . . . .
4.3.3 Basic long-form representation header . . . . . . . .
4.3.4 Extended-form representation header . . . . . s . . .
4.4 Encoding parameter data . . . . . . . . . . . . . . . . . . .
4.5 Encoding function response data . . . . . . . . . . . . . W .
4.5.1 Structure of response representations . . . . . . . .
5 Binary Encoding primitive data forms . . . . . . .
5.1 Signed Integer . .
5.1.1 Signed Integer at’8ibit’predision’ . .
5.1.2 Signed Integer at 16-bit precision . .
5.1.3 Signed Integer at 24--bit precision . .
5.1.4 Signed Integer at 32-bit precision . . . , . . 3 . . l
5.2 Unsigned Integer .
5.2,1 Unsigned Integei &‘8~bit’pre&sion’ .
5.2.2 Unsigned Integer at 16-bit precision .
5.2.3 Unsigned Integer at 24-bit precision .
5.2.4 Unsigned Integer at 3%bit precision . 16
5.3 Octet . . . . . . . . . . . . . . a. .
5.4 Fixed Point Real’ .
5.4.1 Fixed PointReal &‘8~-bit precision .
5.4.2 Fixed Point Real at 64--bit precision . 17
5.4.3 Values of Fixed Point Real . . . , . . 18
5.5 Floating Point Real . . . . . . . . . . . . . 18
o ISO/IEC 1992
All rights reserved. No part of this publication may be reproduced or utilized in any form or
by any means, electronic or mechanical, including photocopying and microfilm, without per-
mission in writing from the publisher.
lSO/lEC Copyright Office l Case Postale 56 l CH-1211 Gen&e 20 l Switzerland
Printed in Switzerland
ii
@lSO/IEC ISO/IEC 963702:1992 (E)
6 Representation of abs tract parameter data types l . . I . . . . .
6.1 Special Binary Encoding rules . . . . . . . . . . . . . . . .
6.1.1 Encoding the precision functions . . . . . . . . . . l
6.1.1.1 Binary Encoding precision functions
6.1.2 Encoding strings, fixed strings, and data records. . .
6.1.2.1 Encoding data record contents .
6.1.2.2 String parameters and character sets .
6.1.3 Encod ng input functions .
6.1.4 INHER TANCE FILTER enumerated values .
6.1.5 Encod ng point lists .
6.1.6 Encod ng transformation matrix components .
6.1.7 Encod ng local colour precision .
6.1.7.1 Encoding CELL ARRAY and PATTERN TABLE
local colour precision .
6.1.7.2 Encoding PIXEL ARRAY local colour precision . .
6.1.8 Colour specifier lists . . . . . . . . . . . I . . . .
6.1.8.1 Encoding colour specifier lists 37
6.1.8.2 Encoding lists of input colour values’and’lock’ 37
colour precision . . . . . . . . . . . . . . . . 38
6.1.9 Encoding PATTERN TABLE and INQUIRE PATTERN
colour specifiers. . . . . . . . . . . . . . . . . . . 38
7 Representation of each function and response . 39
7.1 Qpcode assignments . 39
7.1.1 Class code assignments . 39
7.1.2 Function id code assignments .
8 Defaults . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
9 Classification and designation . 63
9.1 Conformance . 63
A Algorithms and rules for class code assignment . . . . . . . I . . 64
B Encoding examples . . . . . . . . . . . . . . . . . . . . . . . 66
iii
ISO/IEC 963702:1992 (E) @lSO/IEC
Foreword
IS0 (the International Organization for Standardization) and IEC (the Inter-
national 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 com-
mittees collaborate in fields of mutual interest. Other international organ-
izations, 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, lSO/IEC JTC 1. Draft International Standards adopted
by the joint technical committee are circulated to national bodies for vot-
ing. Publication as an International Standard requires approval by at least
75 % of the national bodies casting a vote.
International Standard lSO/IEC 9637-2 was prepared by Joint Technical
Committee lSO/IEC JTCI, Information technology.
lSO/IEC 9637 consists of the following parts, under the general title In-
formation technology
- Computer graphics - Interfacing techniques for
dialogues with graphical devices (CGI) - Data stream binding
- Part I: Character encoding
- Part 2: Binary encoding
Annex A forms an integral part of this part of lSO/IEC 9637. Annex B is for
information only.
@lSO/IEC
ISO/IEC 963792:1992 (E)
Introduction
Purpose
The Binary Encoding of the Computer Graphics Interface (CGI), ISO/IEC 9636,
provides a data stream representation of the CGI function 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 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. On
most computer systems processing 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 ISO/IEC 9636-l.
Objectives
This encoding has the following features:
a) Partitioning of parameter lists: function/response representations
are coded in the Binary Encoding by one or more partitions (see clause
the first (or only) partition of a representation contains the
;
4)
opcode (class code and id code);
b) Alignment of function representations and response representations:
every function/response representation begins on a 16-bit boundary.
Alignment of representations which follow partitions that require an
odd number of 8-bit entities may require a partition to be padded with
an 8-bit entity with all bits zero;
c) Uniformity of format: all function representations and response data
As a result, it is
records have an associated parameter length value.
possible to ignore function representations which are not supported by
the interpreter;
d) Efficiency of encoding parameter data: parameter data such as
coordinates, indexes and colours are encoded as one or more 8-bit
entities. The precision of every parameter is determined by the
appropriate default precision or as set by a precision setting CC1
function;
@lSO/IEC
ISO/IEC 963702:1992 (E)
e) Extensibility: the arrangement of opcode class and id values has been
designed to allow future growth;
real numbers are encoded using either IEEE
f) Format of real data:
floating point representation or a fixed-point representation;
g) Run length encoding option: if many adjacent colours have the same
value, efficient encoding is possible. For each run a cell count is
specified followed by the colour (or colour index);
h) Packed list encoding option: if adjacent colours do not have the same
value, bit-stream lists are provided in which the values are packed as
closely as possible;
i) Encoding of soliciting functions: the assignment of opcodes to
functions which require a response has been designed so that all such
functions can be recognized by a CGI interpreter;
responses to soliciting functions have been assigned
j) Response Data:
different opcodes from their associated soliciting functions.
the response opcode can be derived in a straightforward
However,
manner from the soliciting function opcode;
k) Lists of data: there is a standard technique for representing lists
of any type of data (with a few specific exceptions);
Relationship to other standards
This encoding is guided by the same objectives as the Computer Graphics
For each CGI function which
Metafile Binary Encoding, ISO/IEC 8632-39992.
is identical in both semantics and parameterization to a CGM element, the
That is, the opcodes will be identical and the
encoding will be identical.
parameters will use the same data type and appear in the same order. The
extension mechanism defined in this encoding is also compatible with the
CGM Binary Encoding.
The floating point representation of real data in this part of the Standard
is that in ANSI/IEEE 7544986.
The representation of character data in this part of the Standard follows
the rules of IS0 646 and IS0 2022.
For certain functions and response data, the CGI defines parameter value
ranges as being reserved for registration. The values and their meanings
will be defined using the procedures established in IS0 TR 997%
vi
I NTERNAT I ONAL STANDARD olSo’lEC
ISO/IEC 963702:1992 (E)
Information technology - Computer graphics -
Interfacing techniques for dialogues with graphical
devices (CGI)
- Data stream binding -
Part 2: 9
Binary encoding
1 scope
This part of ISO/IEC 9637 specifies a Binary Encoding of the Computer Graphics
Interface (CGI) data stream. For each of the function syntaxes in clause 5
and clause 6 of ISO/IEC 9636-2, ISOAEC 9636-3, ISO/IEC 9636-4, ISO/IEC
9636-5, and ISO/IEC 9636-6, an encoding is specified in terms of an opcode and
a sequence of parameters of specified data types. For each of these data
an explicit representation in terms of bits, 8-bit and 16-bit entities
types 9
is specified. For some data types, the exact representation depends on a type
and/or precision for the data as used in the data stream.
The Binary Encoding of the Computer Graphics Interface data stream will, in
many circumstances, reduce the effort required to generate and interpret the
data stream as compared to other encodings.
ISOAEC 963792:1992 (E) @lSO/IEC
2 Normative references
through reference in this text,
The following standards contain provisions which,
At the time of publication,
constitute provisions of this part of ISO/IEC 9637.
All standards are subject to revisions, and
the editions indicated were valid.
of ISO/IEC 9637 are encouraged to
parties to agreements based on this part
investigate the possibility of applying the most recent editions of the standards
Members of IEC and IS0 maintain registers of currently valid
listed below.
International Standards.
ISO/IEC 646 : 1991, Information technology - IS0 7-bit coded character set for information
interchange.
IS0 2022 : 1986, Information processing - IS0 7-bit and &bit coded character sets - Code
extension techniques.
ISO/IEC 7942:1985/Amd.l:1991, Information processing systems - Computer graphics -
Graphical Kernel System (GKS) functional description - Amendment 1
IS0 8632-l : 1992, Information technology - Computer graphics - Metafile for the storage and
transfer of picture description information - Part 1: Functional specification.
IS0 8632-3 : 1992, lnformation technology - Computer graphics - Metafile for the storage and
transfer of picture description information - Part 3: Binary encoding.
ISO/IEC 9636-l : 1991, Information technology - Computer graphics - Interfacing techniques
for dialogues with graphical devices(CG1) - Functional specification - Part 1: Overview,
profiles and conformance.
ISO/IEC 9636-2 : 1991, Information technology - Computer graphics - Interfacing techniques
for dialogues with graphical devices(CG1) - Functional specification - Part 2: Control.
ISO/IEC 9636-3 : 1991, lnformation technology - Computer graphics - Interfacing techniques
for dialogues with graphical devices(CG1) - Functional specification - Part 3: Output.
ISO/IEC 9636-43991, Information technology - Computer graphics - interfacing techniques
for dialogues with graphical devices(CG1) - Functional specification - Part 4: Segments.
Information technology - Computer graphics - interfacing techniques
ISO/IEC 9636-52991,
for dialogles with graphical devices(CG1) - Functional specification - Part 5: Input and echoing.
ISOAEC 963792:1992 (E)
@lSO/IEC
Normative References
ISO/ IEC 9636-6 : 1991, lnformation technology - Computer graphics - Interfacing techniques
for dialogues with graphical devices(CG1) - Functional specification - Part 6: Raster.
ISO/IEC 9637-l : 1992, Information technology - Computer graphics - interfacing techniques
for dialogues with graphical devices(CG1) - Data stream binding - Part 1: Character encoding.
ISO/IEC TR 9973 : 1988, Information technology - Computer graphics - Procedures for
registration of graphical items.
ANSI / IEEE 754, Standard for Binary Flouting Point Arithmetic.

3 Definitions
Portion of a binary-encoded function or response representation
3.1 representation:
class plus function/response id) and
that contains the opcode (function/response
(See 4.3.4.)
parameter length information.
3.2 octet: 8-bit entity in which all bits are significant. The bits are numbered
from 7 (most significant) to 0 (least significant).
3.3 word: 16-bit entity in which all bits are signif icant. The bi ts are numbered
from 15 (most significant) to 0 (least significant).
it begins on a word (16-bit)
3.4 word-aligned: An entity is word-aligned when
boundary within the data stream.
Within this part of ISO/IEC 9637, the terms "octet", 8VwordJq, and “word-aligned" have specific
NOTE -
These meanings may not match those of a particular computer system on which this encoding of
meanings.
the data stream is used.
@lSO/IEC
ISOAEC 963792:1992 (E)
4 Overallstructure
This encoding specifies representations for each of the CGT functions of ISO/IEC
9636 as well as any associated responses. 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,
41 . General form of the data stream
All function representations in the data stream are encoded using a uniform
scheme S These are represented as variable length data structures, each consisting
of opcode information (function class plus function id) designating the particular
function representation, the length of its parameter data and finally the parameter
data itself (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 information (response class plus response id) designating the
particular response representation, the length of its return parameter data and
finally the data itself.
4.2 General structure of the Binary Encoding
The octet is the fundamental unit of organization of the binary data stream. The
Binary Encoding of the CC1 data stream is a logical data structure consisting of a
sequential collection of octets. Fields of two different sizes are defined within
the Binary Encoding structure. These two sizes correspond to the octet, an 8-bit
field, and the word, a 16-bit field, These fields are used in the remainder of
this part of ISO/IEC 9637 for illustrating the contents and structure of function
representations and parameters. The parameter list length of a function or
response representation is expressed as a number of octets.
To optimize processing of the binary data stream on a wide collection of computers,
data stream function and response representations are required to consist of an
even number of octets, This forces the alignment of representations in the Binary
Encoding data stream to word boundaries. It is necessary to pad a representation
with null octets or bits to the word boundary if the parameter data does not fill
to such a boundary. This padding of an extra octet or bits does not affect any
parameter list length counts within a representation.
Parameter data can be organized into subgroups called partitions.
Partitions are
data larger
used to accommodate parameter than that supported by the basic
Partitions need not begin on a word
long-form representation, as described below.
boundary.
Overall structure General structure of Binary Encoding
The bits of an octet are numbered 0 to 7, with 7 being the most significant. The
bits of a word are numbered 0 to 15, with 15 being the most significant.
octet :
msb lsb
word :
lsb
msb
Figure 1 - Bit numbering for octets and words
If the consecutive bits of the binary data structure are numbered I,.N, the
are numbered l-~/8 (rounded to next
consecutive octets integer), and the
consecutive words are numbered I, .~/16 (rounded to next integer), then the logical
and words in the binary data structure
correspondence of bits, octets, is as
illustrated in table 1.
Binary data structure
Table 1 -
Word
Data stream Octet
.
i
b i t bit b t
number
number number
1 by/octet1 bWword1
. I .
.
8 bWoc;etl b8/wordl
9 by/octet2 bVwordl
. . .
16 bWoctet2 bo/wkdl
17 by/octet3 bWword2
. l .
.
24 bWoctet3 b8/word2
25 bVoctet4 bVword2
. I .
. . I
@lSO/IEC
Encoding functions
Overall structure
4.3 Encoding functions
The function descriptions in clause 5 and clause 6, as well as the formal grammars,
of ISO/IEC 9636-2, ISOAEC 9636-3, ISO/IEC 9636-4, ISO/IEC 9636-5, and ISO/IEC
9636-6, provide the basic syntax needed to encode each CC1 function, They contain
the function name and the input and output parameters, along with their abstract
data types and value ranges. The order in which the parameters are specified in
clause 5 and clause 6 is significant.
This is the exact order in which they will
be encoded in a representation with very few exceptions. These special parameter
encoding cases are specifically detailed.
(See 6.1.)
The Binary Encoding scheme has two basic components:
the representation header and
the parameter data. The representation header provides information concerning the
function opcode (function class and function id) and the amount (in octets) of
parameter data that is being supplied in the function representation.
There are
one or more function representation headers for each function representation in the
data stream. There may be no parameter data, a fixed amount of parameter data or
an indefinite amount of parameter data depending on the function being represented.
CC1 functions and their In parameters, if any, are encoded as function
representations consisting of one or more representation headers 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
response representation, consisting of one or more representation headers followed
by the Out parameter data. (See 4.5.)
The formats of the various function and response representations and the rules for
their encoding into the binary data stream are described below.
4.3.1 General structure of the representation header
Representations in the Binary Encoding have four forms - basic short-form
representations, basic long-form representations, extended short-form
representations and extended long-form representations. The forms differ in format
with regard to the amount of parameter data accommodated and the number of function
class and function id values accommodated. Specifically, the differences are :
--
the short-form representation always contains the complete function
representation, including its parameter list data. The long-form
representation is used to supply an indefinite amount of parameter data
through the use of data partitions;
--
the short-form representation only accommodates parameter list data up to
30 octets in length, The long-form representation accommodates lengths up
to 32767 octets per data partition with an indefinite number of partitions.
--
the basic form representations accommodate only 14 function classes and 127
function ids. The extended form representations accommodate an unlimited
number of function classes and function ids.
ISO/IEC 963702:1992 (E) @lSO/IEC
Encoding functions
Overall s true tufe
forms also differ in the format of the representation headers.
The representation
to each type of representation header, that
There are specific fields, unique
identify the type of representation header. There are also differences in how the
function opcode (function class and function id) and the parameter list length are
encoded.
4.3.2 Basic short-form representation header
For the basic short-form, the representation header consists of a single word
function class, function id and parameter list length.
divided into three fields:
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Word I ( func. class 1 function id 1 parm list len 1
Figure 2 - Format of a basic short-form representation header.
The fields in the basic short-form representation header are as follows:
bits 15-12 function class (value range O-14)
bits 11-5 function id (value range O-127)
bits 4-O parameter list length: the number of octets of
parameter data that follow for this command (value
range O-30)
4.3.3 Basic long-form representation header
The representation header of the basic long-form representation consists of two
The first word of the basic long-form representation has the same structure
words.
as the first word of the basic short-form representation with the difference that
the parameter list length field contains the binary value 11111 (decimal 31). This
value indicates that the header is a basic long-form representation header rather
than a basic short-form representation header. The second word contains the length
data partition and a flag that indicates if the
of the following parameter
parameter data partition is followed by another data partition or not.

IEC
Overall structure
Encod .ing functions
An indefinite number of parameter partitions can be accommodated by the long-form
bit 15 of the second word of the header
representation. When the partition flag,
has the value 1, it indicates that there will be another parameter data partition
of the function representation is
to follow. Each subsequent data partition
preceded by a word composed of a partition flag and the partition’s parameter list
The
length in the same format as the second word of the representation header.
is indicated by the partition
final data partition of a function representation
flag being set to zero.
data partitions
The parameter list length supplied in each of the parameter
specifies the length of that partition in octets and not the length of the complete
function representation data. Partitions need not start on a word boundary,
therefore no padding octet needs to be appended to the data in a data partition
which contains an odd number of octets for its parameter list length.
15 14 13 12 11 10 9 3 7 6 5 4 3 2 1 0
Word 1 func class 1 function id 111111
Word 2 P I parameter list length
Figure 3 - Format of a basic long-form representation header.
The fields in the basic long-form representation header are as follows:
Word 1
bits 15-12 function class (value range O-14)
bits 11-5 function representation id (value range O-127)
bits 4-O binary value 11111 (decimal 31) indicating long-form
Word 2
bit 15 P, partition flag
-
0 if ‘final’ partition
-
1 if ‘not final’ partition
bits 14-o parameter list length: the number of octets of
parameter data that follow for this partition
(value range O-32767).
ISO/IEC 963702:1992 (E)
WWIEC
Overall structure Encoding functions
4.3.4 Extended-form representation header
The extended-form representation header is composed of one or more extender headers
followed by either a basic short-form or a basic
long-form representation header.
If the last header is a basic short-form header,
the representation header is
referred to as an extended short-form representation header.
If the last header is
a basic long-form header, the representation header is referred to as an extended
long-form representation header.
The first extender header is recognized by having a binary value of 1111 (decimal
15) in the field normally containing the function class code in a basic header,
bits 12 through 15. Each succeeding extender header also has this value in this
field. The extender header is also composed of an extension field selector (FS), a
final extension header flag (FE), extension data, and a six bit constant with the
value of zero. A value of 1 for FE, bit 10 of the extender header, indicates that
there are more extender headers to follow. A value of 0 for FE indicates that this
is the final extender header and the next word in the data stream will be one of
the basic representation headers. A value of 0 for FS, bit 11 of the extender
header, indicates that the extension data is to be used in constructing the
function class code. A value of 1 for FS indicates that the extension data is to
be used in constructing the function id code.
An extended function class is constructed from the extender headers by appending
the bits in the extension data to the bits in the class code already accumulated.
As each extender header that composes a particular extended function class is
encountered in the data stream, the extension data bits are accumulated. That is,
the higher order bits are encoded in the extender headers encountered earlier in
the data stream. The bits in the class code field of the short-form or long-form
basic function respresentation header trailing the last extender header are
appended to the accumulated function class value to form the final function class
code. An extended function id code is constructed in the same manner.
Extender headers for constructing function class and function id codes can be
transmitted in order relative to one another as long as the
any
higher-order-bits-first rule is followed. That is, it does not matter if the
extender headers forming a function class code are transmitted intermixed with the
extender headers forming a function id code.
@lSO/IEC
Encoding functions
Overall s true ture
15 14 13 12 11 10 9 8 7
6 5 4 3 2 1 0
Word 1 1 1 1
1 1 ] FS] FElextension data]0 0 0 0 0 1
Figure 4 -
Format of an extender header.
The fields in the extender header are as follows.
bits 15-12 binary value 1111 (decimal 15) indicating
an extender header
bit 11 FS, extension field selector
-
0 if extension data applies to class code
-
1 if extension data applies to id code
bit 10 FE, final extension header flag
-
0 if ‘final’ extender header
-
1 if ‘not final’ extender header
bits 9-5 extension data
bits 4-O binary value 00000
Note that while the function class code field of a representation header normally
uses the binary value 1111 to indicate an extender header, an exception is made
when the value of this field is in the basic header representation that follows a
set of extender headers. This is the only means of specifying a function class
with a binary value of 1111 (decimal 15) in bits 15-12. (See clause B.8.)
Also note that the use of extender headers to specify the class and id codes will
not necessarily result in a unique Binary Encoding of a particular representation
opcode. Refer to annex B for examples.
Theoretically, this extension technique is infinitely extensible, however, for this
part of ISO/IEC 9637, a CGI interpreter wi 11 be expected to parse only a limited
number of extender headers. Specifically, no CGI interpreter will be expected to
accumulate more than two extension data fields for extending the class code. This
allows for 16384 possible class code values. Likewise, no CGI interpreter will be
expected to accumulate more than two extension data fields for extending the id
code and no assigned id code will exceed 65535 (16-bits in size).
ISO/IEC 963702:1992 (E) @lSO/IEC
Overall Structure Encoding parameter data
44 . Encoding parameter data
When present in a function or response representation, the parameter values follow
the parameter list length portion of a representation header for each
representation form, The parameter list length is determined by the number of
parameters and the type and precision of the parameters. Parameter values have the
format illustrated in clause 5 of this part of ISO/IEC 9637. The possible
parameter types are as specified in 5.2.10 of ISO/IEC 9636-l. Parameters are
encoded in a function representation in exactly the same order as they are listed
in a CGI function description in clause 5 of ISO/IEC 9636-2, ISO/IEC 9636-3,
ISO/IEC 9636-4, ISO/IEC 9636-5, and ISO/IEC 9636-6. There are a few exceptions to
this rule.
These special cases are described in 6.1.
Every representation is constrained to begin on a word boundary. This necessitates
padding a representation with a single null octet at the end if it contains an odd
number of octets,
In addition, in function representations with parameters whose
precisions are shorter than one octet (i.e. those containing a ‘local colour
precision’ parameter) it is necessary to pad the low order bits of the last
In all
data-containing octet with null bits if the data does not fill the octet.
cases, the parameter list length is the count of octets actually containing
It is
parameter data - it does not include the padding octet if one is present.
only at the end of a representation that padding is performed, with the exception
which encode their
of the function representations and response representations
colour specifier list using the run length list mode or the packed list mode. (See
6.1.7.)
4.5 Encoding function response data
These
CGI functions which have Out parameters are called soliciting functions.
functions return the Out parameter values in associated response representations.
The function id code for a soliciting function and its associated response
representation are identical. The class code for each of these differs only in bit
4 of the accumulated class code. In the response representation, this bit has a
value of 1; in the function representation, this bit has a value of 0. The
response class code is derived by adding decimal 16 to the soliciting function
class code.
response
All soliciting CGI f unc t ions have as their first return parameter a
validity value. When the response validity is INVALID, no additional r&urn
parameters need to be encoded in the response representation. If any other return
parameters are present in the response representation, they should be regarded as
undefined.
@lSO/IEC ISO/IEC 963702:1992 (E)
Structure of response representations Overall strut ture
4.5.1 Structure of response representations
Response representations have exactly the same structure and encoding rules
data as function representations. Both
for their headers and parameter
soliciting function representations and response representations can always be
All soliciting functions
recognized as such by their assigned class codes.
All responses will have
will have bit 5=1 and bit 4=0 in their class code.
bit 5=1 and bit 4=1 in their class code. (See annex A,)
5 Binary Encoding primitive data forms
The Binary Encoding uses five primitive data forms to represent the various
abstract data types used to describe parameters in ISO/IEC 9636-2 through 6. The
primitive data forms and the symbols used to represent them are as follows.
SI Signed Integer
UI Unsigned Integer
0 Octet
FX Fixed Point Real
FP Floating Point Real
Each of these primitive data forms (except Octet) may be used in a variable number
of precisions. CGI functions have been defined to effect changes in these
precisions. (See 6.1.1.)
The following terms are used in the following diagrams when displaying the form of
numeric values.
msb Most significant bit
1s b Least significant bit
S Sign bit (0 = non-negative; 1 = negative)
where the sign bit (S) is the high order bit for signed integer values.
The primitive data forms in the following diagrams are illustrated for the case
that the parameter begins on a data stream word boundary. In general, parameters
may align on odd or even octet boundaries because they can be preceded by an odd or
even number of octets of other parameter data. Function representations containing
a local colour precision parameter may have parameters shorter than one octet. It
is possible in such cases that the individual parameters will not align on octet
(See 6.1.7.)
boundaries.
5.1 Signed Integer
Four
Signed Integer data forms are represented in two’s complement format.
8-bit, 16-bit, W-bit and 32--bit.
precisions are available for Signed Integers:
@lSO/IEC
Binary Encoding primitive data forms
Signed Integer
51.1 Signed Integer at 8-bit precision
The range is -128 < value < 127. The sign bit is 1
Each value occupies one octet.
- -
for negative values.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1sblSl value i+l
value i lsbl
ISI
51.2 Signed Integer at M-bit precision
Each value occupies two successive octets.
The range is -32,768 < value < 32,767. The sign bit is 1 for negative values.
- -
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Word 1 S value i lsb
value i+l
Word 2 S lsb
5.1.3 Signed Integer at 24-bit precision
Each value occupies three successive octets.
The range is -8,388,608 < value < 8,388,607. The sign bit is 1 for negative values.
-
-
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Word 1 ISI value i
value id
Word 2 value i 1sblSl
lsbl
Word 3 value id
5.1.4 Signed Integer at 32-bit precision
Each value occupies four successive octets.
< 2,147,483,647. The sign bit is 1 for
The range is -2,147,483,648 < value
-
-
negative values.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
value i
Word 1 ISI
lsbl
value i
Word 2
value i+l
Word 3 ISI
lsb(
value id
Word 4
@lSO/IEC
ISOAEC 9637-2:1992 (E)
Unsigned Integer
Binary Encoding primitive data forms
5.2 Unsigned Integer
Four precisions may be specified for Unsigned Integer data forms:
s-bit, 16-bit,
%&--bit and z&-bit.
5.2.1 Unsigned Integer at 8-bit precision
Each value occupies one octet. The range is 0 < value < 255.
- -
15 14
13 12 11 10 9 8 7 6 5 4 3 2 1 0
ms value i lsblmsb value i+l lsbl
I b
52.2 Unsigned Integer at 16-bit precision
Each value occupies two successive octets.
The range is 0 < value < 65,535.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
msb value lsbl
5.2.3 Unsigned Integer at 24-bit precision
Each value occupies three successive octets.
The range is 0 < value < 16,777,215.
- -
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Word 1 lmsb value i
Word 2 value i lsblmsb value i-4
Word 3 value i+l lsbl
52.4 Unsigned Integer at 32-bit precision
Each value occupies four successive octets,
The range is 0 < value < 4,294,967,295.
-
-
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Word 1 lmsb
value i
Word 2 lsbl
value i
@lSO/IEC ISOAEC 9637-2:1992 (E)
Octet Binary Encoding primitive data forms
5.3 Octet
Each Octet primitive data form occupies a single octet,
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Octet i Octet i+l
5.4 Fixed Point Real
Fixed Point Real data forms are composed of a single Signed Integer data form
followed by a single Unsigned Integer data form. The first integer represents the
whole part and the second integer represents the fractional part. Two precisions
may be specified for Fixed Point Reals: X-bit or 64-bit.
5.4.1 Fixed Point Real at 32.bit precision
The first 2 octets form a 16-bit Signed
Each value occupies 4 successive octets.
The remaining 2 octets form a 16-bit Unsigned Integer data form.
Integer data form,
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Whole part
Word 1 SI lsb
Fraction part
Word 2 msb lsb
54.2 Fixed Point Real at 64-bit precision
Each value occupies 8 successive octets. The first 4 octets form a 32-bit Signed
Integer data form. The remaining 4 octets form a %&-bit Unsigned Integer data form.
15 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Word 1 ISI Whole part
Word 2 Whole part lsbl
Word 3 lmsb Fraction part
Word 4 Fraction part lsbl
ISOAEC 963702:1992 (E) @lSO/IEC
Binary Encoding primitive data forms Fixed Point Real
5.4.3 Values of Fixed Point Real
The values of the represented real numbers are given by:
(UI >
for 32 bits: real value = SI + {F}
w >
for 64 bits: real value = SI + (232)
SI stands for the whole part and UI stands for the fractional part in these
equations. SI, the whole part, is the largest integer less than or equal to the
real number being represented.
5.5 Floating Point Real
Floating Point Real data forms are represented in the floating point format of
ANSI/IEEE standard 754. This format contains three parts:
-
a sign bit;
a biased exponent part;
-
a fraction part.
Two precisions may be specified for Floating Point Reals: Z-bit or 64-bit. The
The 64-bit precision occupies 8
32-bit precision occupies 4 successive octets.
successive octets.
@lSO/IEC ISO/IEC 9637-2:1992 (E)
6 Representation of abstract parameterdatatypes
Table 2 shows, for each of the CGI basic data types, how it is represented in the
Binary Encoding of the CGI in terms of primitive data forms. Table 3 shows, for
each of the CGI abstract data types, how it is represented in terms of the CGI
basic data types or other abstract data types. The columns of tables 2 and 3 are
as follows:
as it is specified in clause 5, ISO/IEC
1) The symbol for the data type,
9636-l ;
type is constructed in terms of the primitive data
2) The way the parameter
the CGI basic data types or other CC1 abstract data types, at the
forms,
The order in which the primitive data forms and
appropriate precisions.
basic or abstract data types are constructed is important. The precisions
Refer to clause 8 for the
are those defined in clause 5, ISO/IEC 9636-2.
default precisions for this encoding;
3) The formula for computing the number of octets required to represent one
instance (occurrence) of the given parameter, at the given precision.
In table 2, the following sample notation will be used:
- n0 denotes ‘n’ octets;
- 3UI denotes 3 unsigned integers;
- E,I,R denotes an enumerated value, an integer and a real;
-
VDC,VDC denotes a pair of VDC values.
@lSO/IEC
ISO/IEC 963792:1992 (E)
Representation of abstract parameter data types
Table 2 - Representation of basic data types
Basic Parameter Formula for computing number
data type construction from of octets per parameter data type
Svmbo 1 Drimitive forms
CD 3UI at 3*dcp/8 (Note 1,2)
colour precision
(dcp)
CI UI at colour index tip/8 (Note 2)
precision (tip)
CSN SI at client specified csnp/8
name precision (csnp)
D UI ,nO n+3 (Note 3)
E SI at fixed 2 (Note 4)
precision (16-bit)
I SI at integer ip/8
precision (ip)
ICO (Note 5)
IF8 SI at fixed 1
precision (8-bit)
IF16 SI at fixed 2
precision (16-bit)
IF32 SI at fixed 4
precision (32-bit)
IX SI at index ixp/8
precision (ixp)
R FP or FX at real sum(rp)/8 (Note 6)
precision (rp)
S UI g-20 (Note 8)
SF UI ,nO (Note 9)
VDC SI at VDC integer vip/8
precision (vip)
or or (Note 7)
FP or FX at VDC
_ real precision (vrp) (Note 6)
sum[vrp)/8
NOTES
1 A direct colour is a triple of values, each of which is abstractly
a real in the range [O,l]. This value is normalized onto the
unsigned range [O,Zdcp-11.
2 Certain CGI functions, which transmit large numbers of CD or CI
values, from and to the client, make provision for local colour
precision. (See 6.1.7 to 6.1.9 inclusive.)
3 Data records are encoded as a count (unsigned integer) followed by
octets of data. The symbols UI,nO in the table refer to the octet
count followed by VP octets. Note that this formula only applies
to data within a single partition. (See 61.2.)
@lSO/IEC
ISO/IEC 963702:1992 (E)
Table 2 - Representation of basic data types - (concluded)
NOTES
The general rule for assigning integer values to an enumerated is
based on the order in which they appear in enumerated type lists in
the function specification in clauses 5 and 6 of ISO/IEC 9636-2,
ISO/IEC 9636-3, ISO/IEC 9636-4, ISO/IEC 9636-5, and ISO/IEC 9636-6.
The first enumerated in a list is assigned value 0, the second
enumerated is assigned value 1, and so on. Special enumerated
assignments have been made for the INHERITANCE FILTER filter
selection list parameter. (See 6.1.4.) Private (non-standard)
values of enumerated parameters shall use negative integers.
5 The abstract data type ICO, input colour, obtains its representa-
tion and precision based on the Colour and Bits Per Colour entries
in the Raster LID State List. When Colour is YES, realization is
identical to CD with local colour precision = Bits Per Colour.
When Colour is NO, realization is UI at local colour precision =
Bits Per Colour. When Colour is YES, realization is 3UI at local
colour precision = Bits Per Colour. (See 6.1.8.2.)
6 The REAL PRECISION function is encoded as an indicator (fixed or
floating point) and two precision components. The symbol ?um(rp)"
in the table indicates the sum of the number of bits specified in
the two components. The same considerations apply to the encoding
of the VDC REAL PRECISION function and the symbol ?sum(vrp)" in the
table. The VDC REAL PRECISION control function representation may
cause 'vrp' to be updated in the body of data stream. (See 6.1.1.)
7 The abstract data type VDC, a single VDC value, is either a real
or an integer, depending on the VDC TYPE in effect.
8 Strings are encoded as a count (unsigned integer) followed by
octets of character data. The symbols UI,nO in the table refer to
the
...

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

제목: ISO/IEC 9637-2:1992 - 정보 기술 - 컴퓨터 그래픽스 - 그래픽 디바이스와의 대화를 위한 인터페이싱 기술 (CGI) - 데이터 스트림 바인딩 - 제2 부: 이진 인코딩 내용: ISO/IEC 9637-2에서는 함수 구문에 대한 각 인코딩이 opcode와 지정된 데이터 타입의 매개 변수 시퀀스로 지정된다. 각 데이터 유형에 대해 비트, 8비트 및 16비트 개체를 기준으로 명시적인 표현이 지정된다. 이 이진 인코딩은 많은 경우에 다른 인코딩과 비교하여 데이터 스트림을 생성하고 해석하는 데 필요한 작업을 줄일 수 있다.

The article discusses ISO/IEC 9637-2:1992, which is a standard related to computer graphics and interfacing techniques for dialogues with graphical devices. It focuses specifically on data stream binding and binary encoding. The article mentions that the binary encoding specified in the standard makes it easier to generate and interpret the data stream, as it provides an explicit representation in terms of bits, 8-bit, and 16-bit entities. This can reduce the effort required compared to other encodings.

記事のタイトル: ISO/IEC 9637-2:1992 - 情報技術 - コンピュータグラフィックス - グラフィカルデバイスとのダイアログインターフェース技術(CGI)- データストリームバインディング - 第2部: バイナリエンコーディング 記事の内容: ISO/IEC 9637-2では、関数構文ごとにオペコードと指定されたデータタイプのパラメータのシーケンスによるエンコーディングが指定されている。各データタイプについては、ビット、8ビット、および16ビットのエンティティに対する明示的な表現が指定されている。このバイナリエンコーディングは、他のエンコーディングと比較して、データストリームの生成と解釈に必要な作業を多くの場合で削減することができる。