Movatterモバイル変換


[0]ホーム

URL:


Up to cover page |Back to Introduction |On to Intelligent Content

WebCGM 2.1 — WebCGM Concepts


2. WebCGM concepts

This chapter is informative (non-normative).

Contents

2.1 The structure of aWebCGM

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 ofWebCGM, and simplify the production of WebCGM interpreter (viewer) tools.

A WebCGM 2.1 instance, as shown in Figure 1, consists of a singlePicture.

Properties which apply to the whole metafile are defined in the MetafileDescriptor. These include descriptive information about the metafile, theprecisions of numbers, as well as identifiers for fonts and such resources.Properties which apply to the elements in the body of the picture arecontained in the Picture Descriptor. These include such information aspicture size and scaling, specification modes for aspects such as line width,and background color. Because WebCGM 2.1 allows only a single picture permetafile, the distinction -- whole-metafile versus picture-specific -- maynot seem useful. However, because a WebCGM 2.1 metafile must be a valid ISOCGM: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 objectswithin the picture, which are comprised of groups of graphical primitives.These intelligent objects may contain attributes or properties. WebCGMdefines several types of intelligent objects - "graphical object","paragraph", "layer", and "sub-paragraph" - as well as a few properties whicheach group may have.

WebCGM 2.1 also contains a purelygraphical grouping mechanism, "graphical node", which groups graphicalprimitives as an Application Structure, but disallows the attributes orproperties that associate intelligence with objects.


Figure 1. WebCGM File Structure
Figure 1. WebCGM File Structure

2.2 Picture content andusage

2.2.1 Raster and vectorcontent

CGM supports both raster and vector graphics in the same picture. WebCGMpermits the use of popular raster compression methods — ITU-T Group 4,JPEG, and the deflate (LZ77 derivative) method of PNG — for rastercontent embedded within the picture.

For information about scaling of WebCGM pictures in Web documents, seesection"WebCGM and theobject element".

2.2.2 Drawing model

This section presents an informative description of the normative drawingmodel of theISO CGM standard,as well as registered extensions that have been incorporated into the WebCGMprofile.

Elements rendered first may be wholly or partially hidden by elementsrendered later. In theISO CGMstandard, the writing mode of primitives is "replacement mode" —content is rendered opaquely on top of previous content. To meetper-primitive (and per-pixel) transparency requirements, WebCGM includes aregistered extension forAlpha transparency, as well asregistered color modelsRGB-alpha and sRGB-alpha.

Implementations of WebCGM are expected to behave as though they implementa drawing model corresponding to the one described below. A realimplementation is not required to implement the model in this way, but theresult on any device supported by the implementation shall match thatdescribed by this model.

WebCGM uses a painters model of rendering. Colors are applied insuccessive operations to the output device. When an area overlaps apreviously colored area the new color partially or completely obscures theold. When the color is not completely opaque the result on the output deviceis defined by the following (mathematical) rules for compositing (all colorvalues use premultiplied alpha):

Pr, Pg, Pb    — Primitive color valuePa            — Primitive alpha valueCr, Cg, Cb    — Canvas color value (before blending)Ca            — Canvas alpha value (before blending)Cr', Cg', Cb' — Canvas color value (after blending)Ca'           — Canvas alpha value (after blending)Ca' = 1 - (1 - Pa) * (1 - Ca)Cr' = (1 - Pa) * Cr + PrCg' = (1 - Pa) * Cg + PgCb' = (1 - Pa) * Cb + Pb

Alpha compositing is performed in the current COLOUR MODEL (seeT.16.19).

Primitives in a WebCGM document have an implicit drawing order, with thefirst primitives in the WebCGM document getting drawn first. Subsequentprimitives are drawn on top of previously drawn primitives.

Primitives which have a value for theregistered Escape 45 otherthan fully opaque, have the effect of producing a temporary separate canvasinitialized to transparent black onto which the primitive is drawn. Thecanvas is then composited into the background, taking into account the Escape45 value. The presence of APS in the primitive list has no effect on therendering. No temporary canvas is created. It is identical to the case of noAPS.

2.2.3 Overlaying apicture

In the ISO CGM:1999 standard, a picture has an implicit or explicit opaquebackground. Graphic elements within the picture are rendered in the orderthey appear in the metafile. It is a requirement of a 2D graphics format forWeb documents that pictures may be overlaid on previous content. For this, itmust be controllable whether the picture background is opaque or transparent(both cases are needed), or "translucent" (partially opaque).

Conceptually, a CGM picture's background is handled as follows. When apicture's canvas is first created in the compositing model ofsection 2.2.2, it is initialized to transparentblack (0,0,0,0). Before the drawing of the first foreground primitives, thecanvas is then filled per the equations in section 2.2.2 with theeffective background color of the metafile.

In metafiles that use the RGB-alpha color model, the effective backgroundcolor may be directly set in the Picture Descriptor to any valid (r,g,b,a),including transparent black (0,0,0,0). In RGB metafiles, the same effects maybe achieved by including the registered Escape 45 (alpha transparency)element in the Picture Descriptor, which is then combined with the definedRGB background color to achieve any valid (r,g,b,a) effective backgroundcolor.

2.3 Intelligence — Objects,Layers, Hyperlinks, Metadata

2.3.1 Overview

Within a WebCGM picture, groups of graphical primitives can be definedwhich structure graphics to meet the requirements of integration into Webdocuments. Groups in WebCGM are realized as standard Version 4 ApplicationStructures (APS) of ISO CGM.

To meet the requirements of intelligent graphics, four specific grouptypes are defined and allowed in WebCGM: 'grobject', 'layer', 'para', and'subpara'. WebCGM allows a fifth group type, 'grnode', as a convenience forauthoring tools to preserve their graphical grouping functions. The detailednormative syntax and semantics of the group types, including viewer behavior,is defined inChapter 3 and in thePPF. Below is a brief conceptual summary.

Every group has at least one explicit property, its unique identifier (aparameter of the Begin APS element). WebCGM groups other than 'grnode' mayhave several explicit attributes associated with them. These attributes arerealized as standard Version 4 (V4) Application Structure Attribute elements(APS Attributes) of ISO CGM.

Chapter 3 normatively defines the detailed content model for version 4elements in WebCGM using EBNF notation. See section,"WebCGM Content Model", for aninformative (non-normative), all-at-once presentation of the content modelusing XML DTD notation.

2.3.2 WebCGM defined grouptypes

WebCGM defines a set of allowable group (APS) types, to support the Webdocument operations of hyperlinking, layered pictures, and text search withingraphics. See Chapter 3 for thedetailed normative syntax andsemantics of the allowable group types. Brief conceptual descriptionsfollow (each item is linked to its Chapter 3 normative definition):

WebCGM does allow one other group type for the convenience of authoringtools:

Note that 'grnode' was not present in WebCGM 1.0, but was added to WebCGM2.0 to allow for better hierarchical structure in WebCGM documents. The'grnode' ("graphical node") APS allows illustration authoring tools topreserve in the WebCGM metafile instance the graphical groupings that areoften used by such tools.

WebCGM does not allow private group types in WebCGM instances. Externalprivate metadata can be associated, by id or by name, with all group (APS)types other than 'grnode' within a WebCGM. A standard external mechanism isdefined in theXML CompanionFile section.

2.3.3 Usage of WebCGM objectsfor navigation

Groups of types 'para', 'subpara', and 'grobject' may be used for pickingand navigation operations in hyperlinked Web documents. These three APS typesare called "objects" in WebCGM.

Objects may contain an explicit 'region' APS Attribute, which provides theboundary for picking operations. This is known as theoverlay modelof object identification (for picking, mouseover screentip display, etc). Itis useful in cases where the picking region of an object can not be definedby existing geometry, for example on line art drawings or raster content.

Objects which contain graphical content have an implicit property: theboundary or bounding extent of the enclosed graphical object. This extent isused for picking and navigation operations in hyperlinked Web documents, inthe absence of a 'region' attribute. Use of this implicit boundary propertyfor picking and navigation operations in Version 4 CGM instances is referredto as theembedded model.

Objects may also be the target of a link. Viewers will generally move theAPS into view and scale them to fit into the viewer's rectangle. The exactviewer behavior is controlled by a set ofobject behavior keywordsassociated with the link, and the presence or absence of certainAPS Attributes on the object('viewcontext', 'region', etc.)

2.3.4 WebCGM defined groupproperties

Explicit properties or attributes of WebCGM groups are encoded as APSAttribute elements. Each APS Attribute has a "type" parameter, whichidentifies the attribute. See Chapter 3 for thedetailed normative syntax andsemantics of the allowable APS Attributes. Brief conceptual descriptionsfollow (each item is linked to its Chapter 3 normative definition):

WebCGM does not allow private attribute types in WebCGM instances.External private metadata, including attributes as well as elements, can beassociated by id or by name with all group (APS) types other than 'grnode'within a WebCGM. A standard external metadata binding mechanism is defined intheXML Companion File chapter.

2.3.5 Content Model

The detailed normative syntax and semantics are presented later(Chapter 3) in this specification. Thestructure and relationships of the intelligent content are illustrated in thefollowing diagrams. In the following, "picbody" is not a specific WebCGMobject type, but rather a convenience to refer to that part of the CGMpicture which is between the Begin Picture Body element and the End PictureElement, exclusive. Boxes with heavy borders indicate elements that aredecomposed further, and offset boxes indicate attributes associated with anelement. Similarly, gdata is not an object type, but rather a catch-allreference to zero or more CGM graphical elements which WebCGM allows, andwhich are valid at such a position according to the rules of CGM. The cgmprimattribute associated with gdata represents an entity that associates thegraphical primitives to the model. See Figure 2.


Figure 2a. WebCGM File Structure - picbody
Figure 2a. WebCGM File Structure - PICBODY

Figure 2b. WebCGM File Structure - layer
Figure 2b. WebCGM File Structure - LAYER

Figure 2c. WebCGM File Structure - grobject
Figure 2c. WebCGM File Structure - GROBJECT

Figure 2d. WebCGM File Structure - para
Figure 2d. WebCGM File Structure - PARA

Figure 2e. WebCGM File Structure - subpara
Figure 2e. WebCGM File Structure - SUBPARA

Figure 2f. WebCGM File Structure - grnode
Figure 2f. WebCGM File Structure - GRNODE

Figure 2g. WebCGM File Structure - gdata
Figure 2g. WebCGM File Structure - GDATA

2.3.6 Hyperlinking

WebCGM supports object-to-object hyperlinking within individual WebCGMinstances, between WebCGM instances, from WebCGM instances to other Web mediatypes, and from other media types to WebCGM instances.

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 supportslinking from other media to WebCGM files and objects.

Links from WebCGM objects are realized as 'linkuri' APS Attribute elementscontained within the definitions of the objects. The address of the link (a'linkuri' parameter) is an Internationalized Resource Identifier (IRI) [RFC 3987], and is described in thenormative 'linkuri' section andfragment syntax subsections.

Objects may contain multiple 'linkuri' APS attribute instances,for which case the associated Link Title parameter is available to help theuser select the destination. WebCGM prescribes a uniform viewer requirementto offer destination choice to the user for such multi-destination cases.

The target of a link, either from within a WebCGM or from another mediatype (e.g., HTML text), may be a WebCGM instance. WebCGM defines an optional"fragment syntax" for addressingobjects within a WebCGM metafile.

The fragment syntax, in full generality, is:

<base-IRI>#<pict-part>.<obj-part>

The <pict-part> is identified by a keyword and has two pieces, thepicture locator (either the 'PictureId' string parameter of the CGM, or thepicture sequence number), and viewer behavior upon navigating to the picture.With the WebCGM restriction of one picture per metafile (since WebCGM version2.0), the <pict-part> is not useful anymore, but is maintained in thesyntax for backward compatibility with WebCGM 1.0 metafiles and WebCGM 1.0implementations.

The <obj-part> similarly is identified by a keyword and has twopieces, the Id parameter of the object (APS), and viewer behavior.

The syntax is well-defined so that in many common cases, keywords andpieces can be eliminated and defaulted. So, for example,<base-IRI>#<string> unambiguously identifies the object (APS)whose Id parameter is "<string>" in the first (only) picture of themetafile pointed to by "<base-IRI>".

See thenormative specifications ofChapter 3 for complete details and examples.

2.4 Encodings

Supported ISO CGM encodings. ISO CGM defines two encodings of the CGMfunctionality: Binary, and Clear Text. WebCGM, like other leading industryprofiles of CGM, limits the encoding to Binary for the purposes of conforminginterchange. It is the Binary encoding which is registered as a MIME type.Using available encoding converters, the Clear Text encoding can be used fordebugging, hand authoring, demonstration, etc.

GZIP compression. WebCGM data may be compressedfor transmission using gzip compression. See "7.1 Conformancedefinitions" for normative specifications regarding GZIPcompression.

WebCGM has no rules regarding filenamesor filename extensions. It is a common convention that normal (uncompressed)WebCGM instances use the filename extension ".cgm", and thatgzip-compressed WebCGM files usethe extension ".cgz". However, these are only conventions and care should beexercised not to break existing links when compression is introduced intoexisting environments.

2.5 Graphical content ofWebCGM

The graphical content of WebCGM is chosen to balance the requirements ofhigh expressive power, and simplicity to implement. It is a subset of theModel Profile (MP) of the CGM standard.

The WebCGMProfile Pro-forma (PPF),later in this document, gives the complete normative graphical contentdetails. Following is a conceptual summary.

2.5.1 Graphicalprimitives

The most obvious aspect of a graphics format is the collection ofgraphical primitives - those drawing elements which define the geometric andother presentation content of the format. CGM:1999 contains a rich selectionof vector graphics primitives, plus fully integrated state-of-the-artcompressed tile raster content.

WebCGM includes most of the significant graphical drawing primitives ofCGM:1999.

In CGM:1999 but excluded from the present version of WebCGM are:

2.5.2 Attributes andcontrols

Attribute elements and control elements determine the details of theappearance of graphical primitives.

The following attribute and control features of CGM:1999 are excluded fromWebCGM.

There are some CGM Version 3 attribute and control elements for which itis desirable to override the default value in CGM:1999, when an explicitdefinition of the value is not present in the CGM file. This would also allowdefinition of the rendering behavior of CGM Version 1 and Version 2 files,where those attribute and control elements are not allowed, as well as allowdefinition in CGM Verson 3 files where the elements are not declared.

This is accomplished in WebCGM using a standard XML DTD to encode theallowable elements and their values in an XML instance. Examples and moredetails can be found in the WebCGM chapter onApplication Configurable Items.

2.5.3 Color andtransparency

The normal behavior of CGM:1999 viewers is to render later occurringprimitives completely opaquely on top of earlier primitives. Several notionsof transparency are supported in WebCGM. Seesection2.2.2 and2.2.3 for discussion of the CGMdrawing model and transparency options.

The full range of standard CGM:1999 color models is limited in WebCGM. Thedefault RGB model is included, as well as the models: RGB-alpha; thecolorimetric RGB space of the Web, sRGB; and sRGB-alpha. The latter three areregistered in the ISO Register of Graphical Items.

2.5.4 Character encodings andfonts

Fully international text is supported in WebCGM by:

The defaultcharacterencoding ("character set" in the now-archaic terminology of the originalCGM:1987) isISOLatin1. This default is mandated by the ISO CGM:1999standard.

A core set of 13 fonts, the same as those in the ISO CGM Model Profile(MP), are required in WebCGM implementations.

In order to facilitate font interchange, WebCGM defines a format tospecify the mapping of font names during the import process.

This mapping is accomplished in WebCGM using standard XML DTD. Examplesand more details can be found in the WebCGM chapter onApplication Configurable Items.

2.6 WebCGM XMLCompanion File (XCF)

The XML Companion File (XCF) component of WebCGM was added in the WebCGM2.0 release. The WebCGM XCF provides a standard way to externalize metadatafrom a WebCGM instance, while maintaining a tight binding of that metadata toobjects (APSs) in the WebCGM instance.

The WebCGM XCF was designed with three main usage scenarios in mind. AWebCGM companion file:

  1. can be used to bind application specific metadata (such as a part number) to a particular Application Structure in a WebCGM illustration.
  2. could also be used to update metadata in a WebCGM illustration via the WebCGM DOM (see DOM sectionRelationship with XML companion file for more information).
  3. could be used as a partial inventory of a WebCGM illustration by enumerating the Application Structures IDs, types and (most) attributes. (Note that it is out-of-scope of this version of WebCGM XCF to fully mirror the hierarchical structure of a CGM graphic (see "Structure overview" in the XCF chapter.)

Examples and more details may be found in theWebCGM XML Companion File (XCF)chapter, the complete normative definition of the WebCGM XCF.

The normative definition of XCF includes a base and generic DTD. TheWebCGM XCF is designed to be extensible, by other profiles derived fromWebCGM, as well as applications of WebCGM. In particular, this allowsindustry specific metadata to be added to the WebCGM object model. See thenormative XCF definition for details.

The XCF is a mechanism to bind external metadata to objects in WebCGMinstances. Accordingly, unlike hierarchical tree structured WebCGM instances,the structure of the XML Companion File is mostly flat. See the normativesection,Relationship with XMLcompanion file, for more details.

2.7 WebCGMDocument Object Model (DOM)

2.7.1 Motivation

The Document Object Model (DOM) component of WebCGM was added in theWebCGM 2.0 release. An interface for programmatic access to WebCGM contentsand structure, as well as facilities to manipulate a standardized WebCGM XMLCompanion File, were perhaps the strongest driving requirements for theWebCGM 2.0 release. Virtually all of the WebCGM viewer and user agentimplementations had already defined and implemented a proprietary applicationprogramming interface (API) for such functionality.

2.7.2 Scope of WebCGM DOM

Compared with detailed, complete DOM specifications such as W3C'sXML DOM Level 3, or the DOM of theSVG 1.1 Recommendation, the WebCGMDOM has limited scope. A full DOM would support query and discovery of allobjects and entities in a target content (graphic) instance, right down tothe leaf nodes of the structure tree. It would also support symmetric,detailed modification and manipulation capabilities for changing theobject.

The functionality available in the WebCGM DOM is somewhat more limited.The WebCGM DOM exposes the document graphic structure down to the ApplicationStructure (APS) level — APS's are the fundamental addressable graphicalobjects in WebCGM, and are the building blocks of the hierarchical structuretree of a WebCGM. Other capabilites available via WebCGM DOM include:

Temporary changes to the presentation style of graphical objects may bemade via DOM and XCF "Style Properties". Recognizing similar capabilities inCSS, potential relationships between WebCGM and CSS werestudied in detail prior to theaddition of DOM-accessible and XCF-accessible Style Properties to WebCGM.Ultimately, a lean and minimal WebCGM-specific model was chosen, thatnevertheless borrowed heavily from applicable CSS concepts (such asinheritance.)

Similar temporary changes to APS Attributes — which representnon-graphical metadata associated with graphical objects — aresupported by DOM and XCF access.

DOM functionality supports query and discovery of the structure of aWebCGM, enumeration of its graphical objects, extraction of associatedmetadata (e.g., hyperlinking data) from documents, and provides users withstandard ways to add more interactivity to WebCGM documents than waspreviously possible. It also provides users withstandard ways toadd more interactivity to WebCGM documents than was previously possible.

DOM functionality also supports manipulation and application of standardWebCGM XML Companion Files, described in theprevious section.

The WebCGM DOM supports a number of usage scenarios and gives access to anumber of useful capabilities. Collectively, theWebCGM 2.0 Requirementsand theWebCGM 2.1Requirements documents give details about the in-scope andout-of-scope capabilities of WebCGM DOM.


Back to top of chapter



[8]ページ先頭

©2009-2025 Movatter.jp