Up to cover page | Back to Introduction | On to Intelligent Content
This chapter is informative (non-normative).
A WebCGM is a Version 1, 2, 3, or 4 CGM as defined in ISO/IEC 8632:1999, with some restrictions. The restrictions improve the interoperability of WebCGM, and simplify the production of WebCGM interpreter (viewer) tools.
A WebCGM 2.0 instance, as shown in Figure 1, consists of a single Picture.
Properties which apply to the whole metafile are defined in the Metafile Descriptor. These include descriptive information about the metafile, the precisions of numbers, as well as identifiers for fonts and such resources. Properties which apply to the elements in the body of the picture are contained in the Picture Descriptor. These include such information as picture size and scaling, specification modes for aspects such as line width, and background color. Because WebCGM 2.0 allows only a single picture per metafile, the distinction -- whole-metafile versus picture-specific -- may not seem useful. However, because a WebCGM 2.0 metafile must be a valid ISO CGM:1999 metafile, the ISO CGM:1999 metafile structure is observed.
The WebCGM picture contains CGM graphic elements, as well as (optionally) Application Structures. Application Structures define intelligent objects within the picture, which are comprised of groups of graphical primitives. These intelligent objects may contain attributes or properties. WebCGM defines several types of intelligent objects - "graphical object", "paragraph", "layer", and "sub-paragraph" - as well as a few properties which each group may have.
CGM supports both raster and vector graphics in the same picture. WebCGM
permits the use of popular raster compression methods - CCITT group 4, JPEG,
and the deflate (LZ77 derivative) method of PNG - for raster content embedded
within the picture. For information about scaling of WebCGM pictures in Web
documents, see section "WebCGM and the
object
element".
Elements rendered first may be wholly or partially hidden by elements rendered later. In the ISO CGM standard, the writing mode of primitives is "replacement mode" - content is rendered opaquely on top of previous content. To meet per-primitive (and per-pixel) transparency requirements, WebCGM includes a registered extension for Alpha transparency, as well as registered color models RGB-alpha and sRGB-alpha.
In the ISO CGM:1999 standard, a picture has an implicit or explicit opaque background. Graphic elements within the picture are rendered in the order they appear in the metafile. It is a requirement of a 2D graphics format for Web documents that pictures may be overlaid on previous content. For this, it must be controllable whether the picture background is opaque or transparent (both cases are needed), or "translucent" (partially opaque).
This may be handled in two ways with WebCGM. First, the "TRANSPARENT"
parameter of the OBJECT tag may be used (see section "WebCGM and the object
element"). Second, the registered Alpha-transparency ESCAPE element may
be included in the Picture Descriptor and applied to the background color of
the picture.
Within a WebCGM picture, groups of graphical primitives can be defined which structure graphics to meet the requirements of integration into Web documents. Groups in WebCGM are realized as standard Version 4 Application Structures (APS) of ISO CGM.
To meet the requirements of intelligent graphics, four specific group types are defined and allowed in WebCGM: 'grobject', 'layer', 'para', and 'subpara'. WebCGM 2.0 allows a fifth group type, 'grnode', as a convenience for authoring tools to preserve their graphical grouping functions. The detailed normative syntax and semantics of the group types, including viewer behavior, is defined in Chapter 3 and in the PPF. Below is a brief conceptual summary.
Every group has at least one explicit property, its unique identifier (a parameter of the Begin APS element). WebCGM groups other than 'grnode' may have several explicit attributes associated with them. These attributes are realized as standard Version 4 Application Structure Attribute elements (APS Attributes) of ISO CGM.
Throughout Chapter 3, WebCGM normatively defines a detailed content model for the V4 content in the form of an "XML fragment". See section, "WebCGM Content Model", for an informative (non-normative), all-at-once presentation of the content model.
WebCGM defines the following allowable group (APS) types, to support the Web document operations of hyperlinking, layered pictures, and text search within graphics:
The detailed normative syntax and semantics are presented later in this profile. WebCGM 2.0 does allow one other group type for the convenience of authoring tools:
Note. 'Grnode' was not present in WebCGM 1.0, but has been added to WebCGM 2.0 to allow for better hierarchical structure in WebCGM documents. The 'grnode' ("graphical node") APS allows for preservation in the WebCGM metafile instance of the graphical grouping facilities that are typical in illustration authoring tools.
WebCGM does not allow private group types in WebCGM instances. External private metadata can be associated, by id or by name, with all group (APS) types other than 'grnode' within a WebCGM. A standard external mechanism is defined in the XML Companion File section.
Groups of types 'para', 'subpara', and 'grobject' may be used for picking and navigation operations in hyperlinked Web documents. These three APS types are called "objects" in WebCGM.
Objects may contain an explicit 'region' APS Attribute, which provides the boundary for picking operations. This is known as the overlay model of object identification (for picking, mouseover screentip display, etc). It is useful in cases where the picking region of an object can not be defined by existing geometry, for example on line art drawings or raster content.
Objects which contain graphical content have an implicit property: the boundary or bounding extent of the enclosed graphical object. This extent is used for picking and navigation operations in hyperlinked Web documents, in the absence of a 'region' attribute. Use of this implicit boundary property for picking and navigation operations in Version 4 CGM instances is referred to as the embedded model.
Objects may also be the target of a link. Viewers will generally move the APS into view and scale them to fit into the viewer's rectangle. The exact viewer behavior is controlled by a set of object behavior keywords associated with the link, and the presence or absence of certain APS Attributes on the object ('viewcontext', 'region', etc.)
Explicit properties or attributes of WebCGM groups are encoded as APS Attribute elements. Each APS Attribute has a "type" parameter, which identifies the attribute. WebCGM defines the following APS Attribute types (all of which are optional, except 'layername', which must be present in each 'layer' APS):
WebCGM does not allow private attribute types in WebCGM instances. External private metadata, including attributes as well as elements, can be associated by id or by name with all group (APS) types other than 'grnode' within a WebCGM. A standard external metadata binding mechanism is defined in the XML Companion File chapter .
The detailed normative syntax and semantics are presented later (Chapter 3) in this specification. The structure and relationships of the intelligence content are illustrated in the following diagrams. In the following, "picbody" is not a specific WebCGM object type, but rather a convenience to refer to that part of the CGM picture which is between the Begin Picture Body element and the End Picture Element, exclusive. Boxes with heavy borders indicate elements that are decomposed further, and offset boxes indicate attributes associated with an element. Similarly, gdata is not an object type, but rather a catch-all reference to zero or more CGM graphical elements which WebCGM allows, and which are valid at such a position according to the rules of CGM. The cgmprim attribute associated with gdata represents an entity that associates the graphical primitives to the model. See Figure 2.
WebCGM supports bi-directional hyperlinking within individual WebCGM instances, between WebCGM instances and other Web media types.
In-line linking is supported, from WebCGM objects (APS of type 'grobject', 'para', and 'subpara') to WebCGM graphic files, objects, as well as to text and other media types. WebCGM fully supports linking from other media to WebCGM files and objects.
Links from WebCGM objects are realized as 'linkuri' APS Attribute elements contained within the definitions of the objects. The address of the link (the first parameter of the 'linkuri') is any valid URL according to the rules of RFC 3986.
Objects may contain multiple 'linkuri' APS attribute instances, for which case the associated Link Title parameter is available to help the user select the destination. WebCGM prescribes a uniform viewer requirement to offer destination choice to the user for such multi-destination cases.
The target of a link, either from within a WebCGM or from another media type (e.g., HTML text), may be a WebCGM instance. WebCGM defines an optional "fragment syntax" for addressing objects within a WebCGM metafile. A "#" character terminates the base URL, and following the "#" is the WebCGM syntax for object addressing, and for specifying viewer behavior upon execution of the link.
The fragment syntax, in full generality, is:
<base-URL>#<pict-part>.<obj-part>
The <pict-part> is identified by a keyword and has two pieces, the picture locator (either the 'PictureId' string parameter of the CGM, or the picture sequence number), and viewer behavior upon navigating to the picture. With the WebCGM 2.0 restriction of one picture per metafile, the <pict-part> is not useful, but is maintained in the syntax for backward compatibility (with WebCGM 1.0 implementations).
The <obj-part> similarly is identified by a keyword and has two pieces, the Id parameter of the object (APS), and viewer behavior.
The syntax is well-defined so that in many common cases, keywords and pieces can be eliminated and defaulted. So, for example, <base-URL>#<string> unambiguously identifies the object (APS) whose Id parameter is "<string>" in the first (only) picture of the metafile pointed to by "<base-URL>".
See the normative specifications of Chapter 3 for complete details and examples.
ISO CGM defines two encodings of the CGM functionality: Binary, and Clear Text. WebCGM, like other leading industry profiles of CGM, limits the encoding to Binary for the purposes of conforming interchange. It is the Binary encoding which is registered as a MIME type. Using available encoding converters, the Clear Text encoding can be used for debugging, hand authoring, demonstration, etc.
The graphical content of WebCGM is chosen to balance the requirements of high expressive power, and simplicity to implement. It is a subset of the Model Profile (MP) of the CGM standard.
The WebCGM Profile Pro-forma (PPF), later in this document, gives the complete normative graphical content details. Following is a conceptual summary.
The most obvious aspect of a graphics format is the collection of graphical primitives - those drawing elements which define the geometric and other presentation content of the format. CGM:1999 contains a rich selection of vector graphics primitives, plus fully integrated state-of-the-art compressed tile raster content.
WebCGM 2.0 includes most of the significant of the graphical drawing primitives of CGM:1999.
In CGM:1999 but excluded from WebCGM 2.0 are:
Attribute elements and control elements determine the details of the appearance of graphical primitives.
The following attribute and control features of CGM:1999 are excluded from WebCGM 2.0.
The normal behavior of CGM:1999 viewers is to render later occurring primitives completely opaquely on top of earlier primitives. Two notions of transparency are supported in WebCGM 2.0:
The full range of standard CGM:1999 color models is limited in WebCGM. The default RGB model is included, as well as the models: RGB-alpha; the colorimetric RGB space of the Web, sRGB; and sRGB-alpha. The latter three are registered in the ISO Register of Graphical Items.
Fully international text is supported in WebCGM by:
The default character set is "ISOLatin1". A core set of 13 fonts, the same as those in the ISO CGM Model Profile (MP), are required in WebCGM implementations.
The WebCGM XML Companion File (XCF) is a new significant new component of WebCGM, forecast in 1.0 and added in the 2.0 upgrade. The WebCGM XCF provides a standard way to externalize metadata from a WebCGM instance, while maintaining a tight binding of that metadata to objects (APSs) in the WebCGM instance.
The WebCGM XCF was designed with three main usage scenarios in mind. A WebCGM companion file:
Examples and more details may be found in the WebCGM XML Companion File (XCF) chapter, the complete normative definition of the WebCGM XCF.
The normative definition of XCF includes a base and generic DTD. The WebCGM XCF is designed to be extensible, by other profiles derived from WebCGM 2.0, as well as applications of WebCGM 2.0. In particular, this allows industry specific metadata to be added to the WebCGM object model. See the normative XCF definition for details.
The XCF is a mechanism to bind external metadata to objects in WebCGM instances. Accordingly, unlike hierarchical tree structured WebCGM instances, the structure of the XML Companion File is mostly flat. See the normative section, Relationship with XML companion file, for more details.
An interface for programmatic access to WebCGM contents and structure, as well as facilities to manipulate a standardized WebCGM XML Companion File, were perhaps the strongest driving requirements for the upgrade of WebCGM 1.0 to WebCGM 2.0. Virtually all of the WebCGM viewer and user agent implementations had already defined and implemented a proprietary application programming interface (API) for such functionality. Such an interface is part of a Document Object Model (DOM) for WebCGM.
Compared with detailed, complete DOM specifications such as W3C's XML DOM Level 3, or the DOM of the SVG 1.1 Recommendation, the WebCGM DOM has limited scope. A full DOM would support query and discovery of all objects and entities in a target content (graphic) instance, right down to the leaf nodes of the structure tree. It would also support symmetric, detailed modification and manipulation capabilities for changing the object.
The functionality available in the WebCGM DOM is somewhat more limited. The WebCGM DOM exposes the document graphic structure down to the Application Structure (APS) level -- APS's are the fundamental addressable graphical objects in WebCGM, and are the building blocks of the hierarchical structure tree of a WebCGM.
The WebCGM DOM supports transient manipulation of the APS attributes -- which represent non-graphical metadata associated with the objects -- and transient changes to presentation style of graphical objects. The WebCGM DOM therefore provides the functionality to query and discover the structure of a WebCGM, enumerate its graphical objects, extract associated metadata (e.g., hyperlinking data) from documents, and finally provides users with standard ways to add more interactivity to WebCGM documents than was possible in WebCGM 1.0.
The WebCGM DOM also provides functionality for manipulation and application of standard WebCGM XML Companion Files, described in the previous section.
The WebCGM DOM supports a number of usage scenarios and gives access to a number of useful capabilities -- see the WebCGM 2.0 Requirements for details about the in-scope and out-of-scope capabilities of WebCGM DOM.