• Aucun résultat trouvé

USER-DEFINED FILL PATTERNS

Dans le document 4110 SERIES HOST PROGRAMMERS (Page 90-95)

Selecting Color Coordinate Systems

USER-DEFINED FILL PATTERNS

You can define your own fill patterns for panel filling. The fill pattern definition uses the RASTER-WRITE and

RUNLENGTH-WRITE commands.

The BEGIN-FILL-PATTERN Command

To open a fill pattern definition, use the command BEGIN-FILL-PATTERN. This command opens a numbered fill pat-tern, defines the height and width of the fill patpat-tern, and establishes the bits-per-pixel value used by the RASTER~

WRITE and RUNLENGTH-WRITE commands.

The number for your fill pattern can be the same as the number of a predefined fill pattern; You can delete your fill pattern by defining it to have 0 height.

8-18

The fill pattern is a rectangular array of color indices. The height of the fill pattern can be any value from 0 to the maximum Y -dimension of the screen in pixels. If you specify a height of 0, you will delete the fill pattern definition.

The width of the fill pattern is also defined in pixels, and should be 1, 2,4, 8, 16, or 32 pixels for the 4112 or 4113 (the 4115 allows a fill pattern to extend across the entire screen.) Other widths in this range will not give a terminal error, but the terminal always generates the fill pattern width as a power of 2. If you give a width that is not a power of 2, the terminal will complete the fill pattern with Index 0 to the next larger power of 2.

The parameter that gives the number of bits per pixel con-trols the number of color indices you can transmit in the pixel encoding commands RUNLENGTH-WRITE and RAS-TER-WRITE. The number of bits per pixel determines the number of color indices you can use in your fill pattern just as the number of bit planes on a surface determines the number of color indices you can define. For example, with one bit per pixel, you can only define one color index; with three bits per pixel, you can define seven color indices. Us-ing six bits per pixel is often convenient as this number fits each color index in a RASTER-WRITE command into one ASCII character.

If you want to open a fill pattern definition for Pattern 32 and give it a width of four pixels, a height of four pixels, and six bits per pixel for encoding, use the sequence:

EcMD 32,4,4,6

The END-FILL-PATTERN Command

The command END-FILL-PATTERN closes the fill pattern definition. If you have filled the entire fill pattern, you do not need to use this command. If you have not completely filled the pattern, the END-FILL-PATTERN command writes the remaining cells of the fill pattern with Index O.

4110 SERIES HOST

c

c

An Example of a User-Defined Fill Pattern

As a simple example of a user-defined fill pattern, let us define the pattern shown in Figure 8-14. You can fill a panel with a uniform mixture of two colors if you arrange two indi-ces as shown.

Choosing Pattern number 32 for our fill pattern, and Indices 1 and 2 for colors, the pattern is two pixels high and two pixels wide. Using six bits per pixel to encode the indices, we begin the fill pattern definition.

1. Open the pattern definition with the sequence:

EcMD 32 2 2 6

2. Encode the pixel indices for the RASTER-WRITE command:

Index 1 encodes to the ASCII character "1"

Index 2 encodes to the ASCII character "2"

4. Send four pixel definitions with the RASTER-WRITE command:

EcRP 4,4,1,2,2,1

5. Ending the fill pattern definition with the END-FILL-PAT-TERN command is not necessary, since we have filled the entire fill pattern.

Figure 8-14 . A User-Defined Fill Pattern.

4110 SERIES HOST

RASTER GRAPHICS

VIEWS

PREVIEW

• Terminals work in many spaces. These include:

• Terminal space (12-bit space)

• Extended terminal space (32-bit space)

• Pixel space (terminal dependent)

• Normalized screen space (12-bit space)

• GIN space (12-bit space)

• A view is a collection of attributes, identified by an integer from 1 to 64, that define a transformation from a terminal space window to a viewport.

• Each view has its own set of independent attributes.

• A terminal can remember up to 64 views and can switch from one to another.

• You can address only one view at a time.

• You can manipulate a group of views as a view cluster.

• You can select the circumstances under which the termi-nal renews the display by setting the fixup level.

8-19

RASTER GRAPHICS

CONCEPTS AND DEFINITIONS

Space

A space is a coordinate system used by the terminal for a graphics operation. Each space has a coordinate system that bounds the maximum and minimum values that you can pass to the terminal's graphics commands.

Terminal Space. Terminal space, also called world or win-dow-coordinate space, is an imaginary plane bounded by the terminal's addressing limits. The concept of terminal space originated with DVST terminals where graphics are drawn directly on the face of the viewing screen. DVST ter-minals can typically address the display with a resolution of 4096 x 4096 pOints, thus the X and V coordinates can range from 0 to 4095. As this is the resolution that can be ex-pressed in a twelve bit binary number, terminal space is also referred to as I2-bit space.

Extended Terminal Space. The 4115 can address a much larger terminal space than 4096 by 4096; its coordinates can range from _231 to 231 -ion each axis. This extended terminal space is also referred to as 32-bit space.

Pixel Space. Pixel space is the addressable space on the display screen. The terms pixel space, raster memory space, and raster space interchangeable. The size of pixel space depends upon the terminal. Table 8-1 summarizes the pixel space on 4110 Series terminals.

Table 8-1

PIXEL SPACE FOR VARIOUS TERMINALS Terminal X-Axis Address V-Axis Address

Range Range

4112 0-639 0-479

4113 0 - 639 0-479

4115 0-1279 0-1023

8-20

Normalized Screen Space. Normalized screen space is the coordinate set of terminal space mapped onto pixel space.

When you use normalized screen space, you are operating in pixel space, but giving the coordinates in terms of 12-bit terminal space. The terminal performs the conversion from 12-bit to pixel coordinates.

Normalized screen space is 4096 x 4096. Using normalized screen space allows you to address areas on the viewing screen without needing to convert to actual pixel numbers for different terminals.

GIN Space. Terminals perform GIN ( graphics input) func-tions in a 12-bit space similar to terminal space. See Section 9, GIN, for more information. The 4115 also performs GIN in 32-bit space.

Views

A view is a set of attributes that define a transformation from terminal space to pixel space. The terminal stores the set of attributes that defines the view. This stored information includes:

• view number: an integer from 1 to 64

c'

• window: a rectangular area in terminal space (

• viewport: a rectangular area in normalized screen space

• view surface: the surface that will store the results of the transform

• wipe index: the color index the viewport will be set to when the view is renewed before the window contents are displayed

• border index: the color index of the border when it Is visible

• Border visibility: an attribute that determines whether or not the border is visible.

4110 SERIES HOST

-- - - ----..

---.~-(

Window

A window is a rectangular area in terminal space that you define with the SET-WINDOW command. A window can cover all or part of terminal space. Graphics primitives, whether or not they are part of segments, that lie partially or wholly within the bounds of the window are mapped into the viewport by the window-viewport transform.

The window-viewport transform scales and clips graphics primitives within the window, then writes the result into pixel space. When the terminal displays a graphics primitive that it maps into the viewport, the affected pixels on the view's surface are changed to the primitive's color index.

RASTER GRAPHICS

Your program can zoom and pan on segment graphics by moving the size and location of the window. You can scale or distort the image in the viewport by changing the aspect ratio of the window. However, if you set either the height or the width of the window to zero, the terminal will automati-cally set the aspect ratio of the window equal to the aspect ratio of the viewport. Figure 8-15 shows several windows in terminal space.

1 - - - ,

4110 SERIES HOST

I I

I I

I I

I I

I I I I

r--I---I

I

!

L_

I

1 _ _ _ _ _ _ _ _ _ _ _ _ _ _

I I I

---,

I I I

I I I I

: I

- - --1--- - --,--,

I

I

0

: I I

---:---- -I--.J

i

1

: I

~

___________ J I

----~

Figure 8-15. Windows in Terminal Space.

8-21

RASTER GRAPHICS

Viewport

A viewport is a rectangular area of a surface that can occupy either all or part of that surface.

The SET-VIEWPORT command defines a viewport. Al-though viewports exist in pixel space, you don't give the viewport coordinates in pixel space coordinates, but rather as normalized screen space coordinates. The terminal cre-ates the viewport on the current view's surface.

If you want several views on the screen at one time, allot each one a portion of the screen with the SET-VIEWPORT command.

/

/

~~---:-!/

/ _ '

/

_ - - - - . J

VIEWPORT 1

A

VIEWPORT 2

NOTE

You can define overlapping viewports on the same surface, but when the terminal renews one view, it will destroy graphics on any other view where they overlap.

You can create a view on any defined surface. If a surface is visible, all views on that surface are visible in the composite display.

Figure 8-16 shows two viewports on the screen mapped to different windows in terminal space.

,

/

? H I C S

Figure 8-16. TWQ ViewPQrts Mapped tQ TWQ WindQws.

8-22 4110 SERIES HOST

(

Dans le document 4110 SERIES HOST PROGRAMMERS (Page 90-95)

Documents relatifs