GEM VDI: Summary from the Encyclopedia of Graphics File Formats

GEM VDI File Format Summary

Also Known As: GEM Vector, VDI, .GDI


Type Metafile
Colors 256
Compression Uncompressed
Maximum Image Size 32Kx32K
Multiple Images Per File No
Numerical Format Big-endian
Originator Digital Research
Platform GEM GUI running under MS-DOS, some Ataris
Supporting Applications GEM Artline, GEM Draw Plus, GEM Scan, others
See Also GEM Raster

Usage
Illustration, drawing, and desktop publishing applications, and some data interchange.

Comments
A vector format with good support at one time, associated with the GEM GUI from Digital Research. If you are thinking of supporting this format, be prepared to draw Bezier curves. It also has support for embedded bitmaps.

Vendor specifications are available for this format.


Although often called the GEM Vector format, GEM VDI is actually a metafile format and is closely associated with the functioning of the GEM user interface. The GEM system provides a metafile driver that is accessed from within the GEM programming system through a documented API. Display requests to the driver result in items being written to a metafile buffer in GEM's standard metafile format. Metafile elements thus consist of calls to the GEM display system.

Contents:
File Organization
File Details
For Further Information

Supporting GEM VDI is similar to supporting many other metafile formats. Be prepared to duplicate the functionality of the host system, in this case GEM, or at least a reasonable subset of it, before you're through.

File Organization

We would like to have more information on this format. Information provided by DISCUS (see "For Further Information" below) indicates that the file consists of a header followed by a stream of standard-format metafile items.

File Details

The structure for the GEM VDI header is shown below.

typedef struct _GemVdiHeader
{
	WORD Identifier;     /* Magic number. Always FFFFh */
	WORD LengthOfHeader  /* Length of the header in 16-bit WORD */
	WORD Version;        /* Format version number */
	WORD Transform;      /* Image origin */
	WORD Coords[4];      /* Size and position of image */
	WORD PageSize[2];    /* Physical page size */
	WORD Bounds[4];      /* Limits of coordinate system */
	WORD Flags;          /* Bit image opcode flag */
} GEMVDIHEADER;

Identifier is the magic number of GEM VDI image files. This value is always FFFFh.

LengthOfHeader is the size of the header described as the number of 16-bit WORDs it contains. This value is typically 0Fh.

Version is the version number of the file format. This value is calculated using the formula: 100 * major version number + minor version number.

Transform is the NDC/RC transformation mode flag. This value is 00h if the origin of the image is in the lower-left corner of the display ("Normalized Device Coordinates") and 02h if the origin is in the upper-left corner ("Raster Coordinates").

Coords are four WORDs indicating the minimum and maximum coordinate values of data in the file. These values indicate the size of the image and its position on the display and are stored as: minimum X, minimum Y, maximum X, maximum Y.

PageSize is the size of the physical printed page the image will cover in 1/10 of millimeters. This value is 00h if the page size is undefined by the application creating the image.

Bounds are four WORDs that describe the maximum extent of the coordinate system used by the image and defined by the application. These values are stored as: lower-left X, lower-left Y, upper-right X, upper-right Y.

Flags contains the bit image opcode flag. The values for this field are 00h if no bit image is included in the file and 01h if a bit image is included. Bits 2 through 15 in Flags should always be set to 0.

Standard format metafile items consist of control, integer, and vertex parameters. This structure is described below.

Word

Value

Description

0

control[0]

Opcode

1

control[1]

Vertex count

2

control[3]

Integer parameter count

3

control[5]

Sub-opcode or zero

4

ptsin[0-n]

Input vertex list (if provided)

...

n+4

intin[0-m]

Input integer (if provided)

...

Table GEM VDI-1 shows the correspondence of standard metafile items and their opcodes to the display commands accepted by the GEM display subsystem. Arguments appear to be documented only in the GEM Programmer's Toolkit, but you might be able to recover them through diligent application of trial and error.

Table GEM VDI-1: GEM Metafile Items and Commands

Routine

Code

Subcode

Metafile Object

v_alpha_text

05

19

Output Printer Alpha Text

v_alpha_text

0b

19

Output Printer Alpha Text

v_arc

0b

02

Arc

v_bar

0b

01

Bar

v_bit_image

05

17

Output Bit Image File

v_bit_image

0b

17

Output Bit Image File

v_circle

0b

04

Circle

v_clear_disp_list

05

16

Clear Display List

v_clrwk

03

NA

Clear Workstation

v_ellarc

0b

06

Elliptical Arc

v_ellipse

0b

05

Ellipse

v_ellpie

0b

07

Elliptical Pie Slice

v_entercur

05

03

Enter Alpha Mode

v_entercur

0b

13

Enter Alpha Mode

v_exitcur

05

02

Exit Alpha Mode

v_fillarea

09

NA

Fill Area

v_form_adv

05

14

Form Advance

v_form_adv

0b

14

Form Advance

v_justified

0b

0a

Justified Graphics Text

v_line

06

NA

Polyline

v_output_window

05

15

Output Window

v_pieslice

0b

03

Pie

v_pieslice

0b

08

Rounded Rectangle

v_pmarker

07

NA

Polymarker

v_qtext

08

NA

Text

v_rfbox

0b

09

Filled Rounded Rectangle

v_updwk

04

NA

Update Workstation

vr_recfl

73

NA

Fill Rectangle

vs_color

0e

NA

Set Color Representation

vsf_clip

81

NA

Set Clipping Rectangle

vsf_color

19

NA

Set Fill Color Index

vsf_interior

17

NA

Set Fill Interior Style

vsf_perimeter

68

NA

Set Fill Perimeter Visibility

vsf_style

18

NA

Set Fill Style Index

vsf_updat

70

NA

Set User Fill

vsl_color

11

NA

Set Polyline Color Index

vsl_ends

6c

NA

Set Polyline End Styles

vsl_type

0f

NA

Set Polyline Type

vsl_udsty

71

NA

Set User Line Style

vsl_width

10

NA

Set Polyline Width

vsm_color

14

NA

Set Polymarker Color Index

vsm_height

13

NA

Set Polymarker Height

vsm_type

12

NA

Set Polymarker Type

vst_alignment

27

NA

Set Graphic Text Alignment

vst_color

16

NA

Set Text Color Index

vst_effects

6a

NA

Set Graphics Text Effects

vst_font

15

NA

Set Text Font

vst_height

0c

NA

Set Character Height

vst_point

6b

NA

Set Character Height (points)

vst_rotation

0d

NA

Set Character Baseline Vector

vswr_mode

20

NA

Set Writing Mode

There are also two non-standard metafile items:

v_opnwk Open Workstation
v_clswk Close Workstation

There are three metafile escape functions:

v_meta_extents Update Metafile Extents
v_write_meta Write Metafile Item
vm_filename Change GEM VDI Filename

There are several inquire functions:

vq_chcells Inquire Addressable Character Cells
vq_color Inquire Color Representation
vq_attributes Inquire Current Polyline Attributes
vq_extnd Extended Inquire

Several metafile sub-opcodes are reserved for the Digital Research GEM Output application:

Physical Page Size
Coordinate Window

Several metafile sub-opcodes are also reserved for the Digital Research GEM Draw Plus application:

Group
Set No Line Style
Set Attribute Shadow On
Set Attribute Shadow Off
Start Draw Area Type Primitive
End Draw Area Type Primitive

Also associated with the GEM VDI format is a standard keyboard mapping.

For Further Information

The GEM VDI format originated at Digital Research, which is now owned by Novell, and GEM VDI is currently being supported by DISCUS Distribution Services, a service organization. Note that DISCUS will provide support only if you have first purchased the GEM Programmer's Toolkit from Digital Research. You can contact DISCUS at:

DISCUS Distribution Services, Inc.
8020 San Miguel Canyon Road
Salinas, CA 93907-1208
Voice: 408-663-6966

You may still be able to get some information from Novell/Digital Research at:

Novell/Digital Research, Inc.
P.O. Box DRI
Monterey, CA 93942
Voice: 408-649-3896
Voice: 800-848-1498
BBS: 408-649-3896

We have also been able to include information on Atari support of GEM VDI on the CD-ROM.


This page is taken from the Encyclopedia of Graphics File Formats and is licensed by O'Reilly under the Creative Common/Attribution license.

More Resources