• Aucun résultat trouvé

GSS-ORIVERS Graphics Functions

Dans le document The information (Page 26-32)

The graphics functions, supported by GSS-DRIVERS, can be divided into five functional areas:

o Control functions o Output functions o Attribute functions o Input functions o Inquiry functions

Control Functions

The control functions allow the application program to control various aspects of the graphics subsystem. The major control functions are:

Open

Initializes a graphics device and sets defaults for attributes. It also returns information to the caller about the characteristics and capabilities of the device. This must be the first graphics operation performed in a program.

Terminates graphics operations to a device. This must be the last graphics operation performed in a program.

Clears the surface of the workstation. It clears a CRT screen, prompts for new paper on a plotter, or displays all pending graphics to a printer and advances to top-of-form.

Displays all pending graphics.

Output Functions

Output primitives are functions that generate graphics objects on the display surface. Point locations are specified by giving X, Y coordinates in Normalized Device Coordinate (NDC) space-a 2-4 The GSS Graphics Reference Model

Cartesian space with values ranging from 0 to 32767 on each axis. (Locations outside this range may generate unpredictable and device-dependent results.) Output primitives include:

Polyline Draws single vector or series of connected vectors specified by their vertices. A polyline must have at least a beginning and end point specified.

Polymarker Graphics Text

Cursor Text

Draws a marker symbol at specified locations.

Displays a text string at a specified location.

Characters come in multiple fonts, and may be rotated or scaled (unlike alpha or cursor text).

Displays a text string on a fixed rectangular grid.

For form fill-out, cursor text is available in only one size and font, is not rotatable, and cannot be combined with graphics text, alpha text, or graphics.

Cursor text is typically positioned on a discrete, device-dependent grid of rows and columns.

(Typical values are 24 rows by 80 columns.) Alpha Text Displays a text string at a specified location.

Alpha text has multiple fonts, variable interline spacing, underlining capabilities and other attributes used for generating formal documents.

Filled Area Causes an area bounded by a specified set of vertices to be "painted" with a fill pattern.

Bar Draws a bar (rectangular area) defined by two diagonally opposite vertices. The interior is painted with a fill pattern.

Arc Draws an arc defined by a center point, the radius, and the starting and ending angles.

Pie Slice Draws a pie slice defined by the center, radius and starting and ending angles. The interior is painted with a fill pattern.

Circle Draws a circle defined by a center point and the radius. The interior is painted with a fill pattern.

Cell Array Draws a rectangular array of pixels of a specified size at a specified position. The pixel colors that make up the array are defined by a set of color indices.

The GSS Graphics Reference Model 2·5

Attribute Functions

Primitive attributes modify the appearance of output primitives.

GSS-DRIVERS provides the following groups of primitive attribute functions:

Character attributes fall into two groups: graphics text attributes and alpha text attributes.

Graphics text attributes control:

o height

o base line rotation

o color

o font o alignment

Alpha text attributes control:

o position o line space

o font and size o color

o subscript/superscript

o underline o overstrike

o output quality (draft or final) Polyline control:

Fill

Assigns color values specified in red, green and blue primaries to color index numbers. Color attributes are then selected by index number.

Sets color index for display background.

Input Functions

Input functions return information from the operator. Input functions operate in two modes: sample and request mode. In the sample mode, the input, if any, is returned immediately. In the request mode, the operator must complete the input function by actuating some control on the graphics input device (such as a button on a mouse). There are five types of graphics input:

Input Locator The Input Locator Function returns the point location of the graphics input device (mouse, crosshair, joystick, trackball, cursor, etc.) in NDC units.

The Input Valuator Function returns a scalar value between 0 and 32767, corresponding to the status of a valuator device (potentiometer, slide control, etc.).

The Input Choice Function returns the status of a choice device (switch, function key, etc.) as an integer between 0 and 32767.

The Input String Function allows text input from the keyboard.

The Read Cursor Movement Keys function returns the direction of cursor movement.

The GSS Graphics Reference Model 2· 7

Inquiry Functions

Inquiry functions return information about the current state of the graphics subsystem including device capabilities and current attributes. Inquiry functions are provided to determine:

Graphics 0 current polyline attributes primitives

o current polymarker attributes o current fill area attributes o current graphics text attributes

o the number of addressable character cells

o the current cursor address

o alpha text capabilities

o alpha text position

o alpha text font availability o alpha text string length

o cursor text position (direct cursor text

addressing-relative and absolute cursor text movement)

o cursor text string and screen erase o reverse video

o graphics input cursor display o hard copy output

o plotter pen speed

o raster writing mode (sixteen Boolean

operations between source and destination are supported)

The details of all the GSS-DRIVERS graphics functions are provided in the subsequent reference parts.

2-8 The GSS Graphics Reference Model

Besides creating a basis for development of graphics standards, the Reference Model provides the programmer with a conceptual framework to aid in organizing an application. It also aids the programmer in communicating with other programmers and users and to interpret graphics tools, such as GSS-DRIVERS, by providing a structural context. The rest of this manual is based on the organization defined by the Graphics Reference Model.

The GSS Graphics Reference Model 2-9

Dans le document The information (Page 26-32)

Documents relatifs