metafiles - TeraScan overlay and plot metafiles

SYNOPSIS

lib/libetmeta.a

include/etmeta.a

DESCRIPTION

In TeraScan, drawing vector graphics is a two-step process:

Generate a vector graphics metafile.

Render the metafile in the appropriate window.

There are two types of metafiles, ET metafiles and XY metafiles. ET metafiles are created relative to the earth transform of a given dataset and are intended for use as image overlays. Coastlines and latitude/longitude grids are typical examples of ET metafiles.

Vector coordinates are stored in ET metafiles NOT as image coordinates, but rather as earth transform coordinates, i.e., either map projection (y,x) coordinates in kilometers or sensor scan 1-relative (line,sample) coordinates.

     a[0] * et y + a[2] * et x + b[0] = image line
     a[1] * et y + a[3] * et x + b[1] = image samp

The conversion from earth transform coordinates and image coordinates is defined by the earth transform's affine mapping. (See etx).

Using the earth transform coordinates instead of image coordinates makes ET metafiles invariant to image sub-sectioning, sub-sampling, and rotation. Functions that transform a dataset's dimensions always update the dataset's earth transform affine map to reflect the changes.

XY metafiles are used to create XY plots. The plotting area is defined to be the unit square [0,1]x[0,1]; vector coordinates other than axis drawing and annotation metafiles should fall in this range.

Metafiles are implemented as one-dimensional dataset variables containing a stream of metafile primitive codes and their integer, real, and text values. Integer and real values are stored using 4 bytes each. Primitive codes are always aligned on 4-byte boundaries.

Both ET and XY metafiles are generated using the routines in lib/libetmeta.a. The primitives supported by these routines are defined in include/etmeta.h and are listed here:

POLYLINE
polyline starting point (2 reals)
LINE_COLOR
int line color index in [0,255]
LINE_TYPE
int line type code
LINE_WIDTH
int line width in window pixels
 
POLYGON
polygon starting point (2 reals)
FILL_COLOR
int fill color index in [0,255]
 
POLYMARKER
poly marker starting point (2 reals)
MARKER_COLOR
int marker color index in [0,255]
MARKER_TYPE
int marker type codes
MARKER_SIZE
real marker height in window pixels
 
TEXT_START
text starting point (2 reals)
TEXT_COLOR
int text color index in [0,255]
TEXT_ALIGN_H
int horizontal text alignment code
TEXT_ALIGN_V
int vertical text alignment code
TEXT_HEIGHT
real text height in window pixels
TEXT_ANGLE
real counter-clockwise angle [-180,180]
TEXT_TYPE
int text type codes
TEXT_DATA
integer length, string
 
DRAW_NEXT
next polyline, polymarker or polygon point (2 reals)
 
COLOR_WEDGE
color bar (wedge) origin (2 reals), opposite corner (2 reals), base and step fraction (2 reals in [0, 1]) and direction code
 
ETMETA_END
no value

Points are either earth transform (y,x) coordinates, or unit square (x,y) coordinates.

The maximum length of text data is 255 characters, not including a \ terminator.

Codes for coded primitives are also defined in include/etmeta.h:

LINE_TYPE
SOLID_LINE, DASHED_LINE, DOTTED_LINE, DASHDOT_LINE
 
MARKER_TYPE
DOT_SYMBOL, PLUS_SYMBOL, ASTERISK_SYMBOL, CIRCLE_SYMBOL, CROSS_SYMBOL
 
TEXT_TYPE
PLAIN_TEXT, BOLD_TEXT, ITALIC_TEXT
 
TEXT_ALIGN_H
TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER, TEXT_ALIGN_RIGHT
 
TEXT_ALIGN_V
TEXT_ALIGN_TOP, TEXT_ALIGN_CAP, TEXT_ALIGN_HALF, TEXT_ALIGN_BASE, TEXT_ALIGN_BOTTOM, TEXT_ALIGN_ABOVE, TEXT_ALIGN_BELOW
 
COLOR_WEDGE
WEDGE_GOING_UP, WEDGE_GOING_DOWN, WEDGE_GOING_LEFT, WEDGE_GOING_RIGHT
Vertical text alignment is illustrated below
+-----------+	TEXT_ALIGN_BELOW
|           |
|           |
+===========+	TEXT_ALIGN_TOP
|           |
| xxx       |	TEXT_ALIGN_CAP
|  x        |
|  x     x  |   TEXT_ALIGN_HALF
|  x        |
|  x     x  |
+-xxx----x--+	TEXT_ALIGN_BASE
|     x  x  |
|      xx   |
+===========+	TEXT_ALIGN_BOTTOM
|           |
|           |
|           |
|           |
|           |
|           |
+-----------+	TEXT_ALIGN_ABOVE

FILES

lib/libetmeta.a, include/etmeta.h

SEE ALSO

emseti, cmdgraphics

NOTES

Marker and text height are real-valued for historical reasons. Text and marker size used to change with window size; this is no longer the case.

Applications using variable height text (e.g., contouring) draw text as a series of polylines.

XY metafiles will be replaced by an industry standard metafile (i.e., CGM) as soon as practical. Currently, only the xvu application generates XY metafiles.


Last Update: $Date: 1999/05/10 21:16:35 $