19 August 1998
Copyright 1998 CGM Open Consortium Inc.
A WebCGM is a Version 1, 2, 3, or 4 CGM as defined in ISO/IEC 8632:1992, with some restrictions. The restrictions improve the interoperability of WebCGM, and simplify the production of WebCGM interpreter (viewer) tools.
A WebCGM, as shown in Figure 1, consists of one or more Pictures. Each picture contains CGM graphic elements, as well as (optionally) Application Structures. Application Structures define objects within each picture, which are comprised of groups of graphical primitives. These intelligent objects may contain attributes or properties. WebCGM defines several types of groups - "graphical object", "layer", and "paragraph" - as well as a few properties which each group may have.
Figure 1. WebCGM File Structure
The picture is a basic building block of a WebCGM file. In the CGM standard, pictures are independent graphical presentations. In particular, as defined in the ISO standard, each picture has an implicit or explicit opaque background.
Many pictures may be stored in a single metafile. Properties which apply to all pictures are defined in the Metafile Descriptor. These include descriptive information about the metafile, the precisions of numbers, as well as identifiers for fonts and symbol libraries.
Properties which apply to the elements in the body of a single 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.
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 pictures.
For more information about scaling of WebCGM pictures in Web documents, see section "WebCGM and the OBJECT Tag".
Graphic elements within pictures are rendered in the order they appear in the metafile. 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" - content is rendered opaquely on top of previous content. To meet per-primitive (and per-pixel) transparency requirements, WebCGM includes a (currently being) registered extension for Alpha transparency, as well as (currently being) registered colour models RGB-alpha and sRGB-alpha.
It is a requirement of a 2D graphics format for Web documents that pictures may be overlayed 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 Tag"). Second, the Alpha-transparency ESCAPE element (currently being registered by ISO) may be included in the Picture Descriptor and applied to the background colour of the picture.
WebCGM also contains provisions to use pictures in an external "Symbol Library Metafile" as symbols, and to instance them into another picture. The mechanism is identical to that of [grex24], and details may be found in the PPF and detailed normative clauses later in this document.
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.
Four specific group types are defined and allowed in WebCGM (Edition 1.0): 'grobject', 'layer', 'para', and 'supara'. The detailed syntax and semantics of these, including viewer behavior, is defined in Section 2 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 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.
WebCGM defines a detailed content model for the V4 content, both in the form of a "SGML fragment", and in tabular form. See section, "WebCGM 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 syntax and semantics are presented later in this profile. WebCGM Edition 1.0 does not allow private group types. External private metadata can be associated, by ID, with 'grobject' APSs within a WebCGM. The mechanisms and semantics of such private metadata are beyond the scope of WebCGM Edition 1.0.
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 and linking). It is useful in cases of badly structured legacy graphics, raster content, and in some cases to optimize picking operations.
Objects which contain graphical content have an implicit property: the boundary or bounding extent of the enclosed graphical object. This extent is used for 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 - a powerful model for newly authored Web documents.
Objects may also be the target of a link. Viewers will move the APS into view and probably scale them to fit into the viewer's rectangle. If the APS contains a 'ViewContext' attribute the rectangle described therein will be moved and scaled to fit into the viewer's rectangle.
Explicit properties or attributes of WebCGM groups are encoded as APS Attribute elements. Each APS Attribute has a "type" parameter, which identifies the property or attribute. WebCGM defines the following allowable group APS Attribute types:
WebCGM Edition 1.0 does not allow private attribute types. External private metadata can be associated, by ID, with APSs within a WebCGM. The mechanisms and semantics of such private metadata are beyond the scope of WebCGM Edition 1.0.
The detailed normative syntax and semantics are presented later in this profile. The structure and relationships of the intelligence content are illustrated in the following diagrams.
WebCGM supports bi-directional hyperlinking between WebCGM instances, and either other WebCGM content or Web media types.
In-line linking is supported, from WebCGM objects (APS of type 'grobject', 'para', and 'subpara') to WebCGM graphic files, pictures and objects, as well as to text and other media types. WebCGM fully supports linking from other media to WebCGM files, pictures, 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 1738.
Objects may contain multiple 'linkURI' APS attribute instances, for which case the associated 'LinkTitle' parameter is available to help the user select the destination. The WebCGM profile 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. This WebCGM profile defines an optional "fragment syntax" for addressing pictures and objects within a WebCGM metafile. A "#" character terminates the base URL, and following the "#" is the WebCGM syntax for picture and object addressing, and for specifying viewer behavior upon execution of the link.
The fragment syntax, in full generality, is:
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. 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> unambigously identifies the object (APS) whose Id parameter is "<string>" in the first picture of the metafile pointed to by "<base-URL>".
See the normative clauses of Section 3 for complete details and examples.
ISO CGM defines three encodings of the CGM functionality: Binary, Character, and Clear Text encodings for WebCGM files. 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.
The graphical content of WebCGM is a subset of the ATA profile, [grex24], and the Model Profile (MP) of the CGM standard. It is chosen to balance the requirements of high expressive power, and simplicity to implement. The WebCGM graphical content comprises a subset of CGM Version 1, 2, and 3 elements which has been recommended by a strong consensus of the CGM Open Consortium, as meeting those criteria and representing state of the art in current CGM technology.
The Profile Pro-forma (PPF), later in this document, gives the content details. Following is a summary at the functional level.
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:1992 contains a rich selection of vector graphics primitives, plus fully integrated state-of-the-art compressed tile raster content.
WebCGM Edition 1.0 includes a large subset of these primitives, deemed to be the most useful for Web vector graphics and the most implementable.
WebCGM Edition 1.0 has excluded some of the graphical drawing power of CGM:1992, to achieve the desired balance of expressive power, implementability, and current commercial implementation support. An upward compatible (superset) WebCGM Edition 2.0 may include many of these, as well as some of the excluded attribute and structuring capabilities.
In CGM:1992 but excluded from WebCGM Edition 1.0 are:
Attribute elements and control elements determine the details of the appearance of graphical primitives.
The following attribute and control features of CGM:1992 have been excluded from WebCGM 1.0. Inclusion of many of these in WebCGM Edition 2.0 is anticipated.
The normal behavior of CGM:1992 viewers is to render later occurring primitives completely opaquely on top of earlier primitives. Three notions of transparency are supported in WebCGM, as described previously. First, a WebCGM picture can be placed with transparent background via the TRANSPARENT parameter of the OBJECT tab; second, the same can be done via an Escape element (currently in registration by ISO) for Polysymbols instanced into a picture; third, per-element and per-pixel translucency (on a continuum between fully opaque and fully transparent) can be defined via an alpha-transparency Escape element (currently in registration in ISO).
The full range of standard CGM:1992 color models is limited in WebCGM Edition 1.0. The [grex24] 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 being registered in ISO for CGM reference.
Fully international text is supported in WebCGM by:
The default character sets are "ISOLatin1" and "Symbol", as in [grex24] and the ISO CGM Model Profile (MP). A core set of 13 fonts, the same as those in the MP and [grex24], are required in WebCGM implementations.