Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Starbase Device Drivers Manual - Vol2: HP 9000 Series 700 Computers > Chapter 5 Computer Graphics Metafile

Introduction

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

This section describes the CGM driver, which produces an ANSI/ISO standard Computer Graphics Metafile (CGM). The CGM is a metafile for capturing and storing device independent picture descriptions. It may contain multiple pictures. For further details and examples about the CGM driver, you may refer to the Starbase Graphics Techniques manual.

There also exists a CGM interpreter that reads a CGM and outputs to graphics devices. See cgm_to_starbase(3g) in the Starbase Reference. For an overview of CGM, see the CGM chapter of the Starbase Graphics Techniques.

Functionality and Encodings

The CGM standard defines nineteen primitives (lines, markers, text, circles, etc.) and thirty-five primitive attributes (text color, line pattern, interior style, etc.) for describing the contents of pictures. The CGM standard describes these capabilities in an abstract manner and defines three methods of encoding the elements. The hpcgm device driver supports the following three encoding methods (see also “Parameters for gescape ” CGMESC_ENCODING later in this chapter).

  • The Binary encoding is reasonably compact and is optimized for CPU efficiency in generating and interpreting CGMs, but it is not human readable and may cause difficulties in some communications environments.

  • The Clear Text encoding is human readable (for example, CIRCLE (573,721) 95;) and can be produced with a normal text editor. It is good for debugging and quick demonstrations but is not compact. It is relatively inefficient for CPUs to generate and interpret code using this method.

  • The Character encoding method codes all data as ASCII characters. It is compact and good for communications, and probably lies between the Binary and Clear Text in CPU efficiency.

More information on CGM may be found in the ANSI X3.122-1986 and ISO 8632/1-4.

Precisions

The CGM defines elements for varying the precisions, types, and modes of data in a metafile. The hpcgm driver encodes coordinate data as type integer, and allows selection of low or high precision (16 bits or 32 bits per coordinate) See “Parameters for gescape ” CGMESC_VDC_PREC later in this driver).

Mode

The CGM allows such things as marker size (as well as line width and edge width) to be expressed in one of two modes: scaled or absolute. Absolute mode means that size (width) is measured in coordinate units. Scaled mode means that the given size is a scale factor to be applied to the nominal marker size of the device upon which the CGM is displayed. CGM only allows one mode per picture. The hpcgm driver uses scaled mode. Any absolute sizes received from Starbase are converted to a scale factor.

The CGM standard also allows color to be selected either by index into a table (and provides a color table definition element) or by an RGB (Red, Green, Blue) triple. The hpcgm driver maps all Starbase color requests into RGB triples.

Picture

A CGM consists of one or more logically independent pictures. A picture consists of the graphical actions that occur between Starbase clear_view_surface calls. The hpcgm driver responds to a clear_view_surface call by terminating the current picture and initiating a new picture.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© Hewlett-Packard Development Company, L.P.