[ Previous | Next | Contents | Glossary | Home | Search ]
GL3.2 for AIX: Graphics Library (GL) Technical Reference

writemask Subroutine

Purpose

Grants write permission to available bitplanes.

Libraries

Graphics Library

C (libgl.a)

FORTRAN (libfgl.a)

C Syntax

void writemask(Colorindex writem)

FORTRAN Syntax

SUBROUTINE WRITEM(writem)
INTEGER*4 writem

Description

The writemask subroutine sets the bitplane writemask in color map mode. Writemasks are used to shield portions of the frame buffer from being written into. A writemask is a small set of bits (8 bits or 12 bits, depending on the frame buffer configuration), one bit for each bitplane of the frame buffer.

If a bit is set (1), the corresponding bitplane is enabled for writing, and any routine that draws into the frame buffer will be able to write into that bitplane. If a bit is reset (0), the corresponding bitplane is marked as read only, and the values stored in that bitplane are not changed.

Note that the writemask protects planes in the color frame buffer. Thus, writemasks essentially prevent certain colors from being written into the frame buffer. Colors that are drawn while a writemask is enabled appear different, depending on the color, the writemask, and the color value currently stored in the frame buffer (at a given pixel).

Writemasks are useful for emulating overlay/underlay planes.

Note: This subroutine is intended for use only in color map mode. To set the writemask in RGB mode, use the RGBwritemask subroutine.

Parameter

writem Specifies the mask that controls which bitplanes are available for drawing and which are read only. The mask contains one bit per available bitplane.

Example

The example C language program vlsi.c uses the writemask subroutine to draw a rectangle in one of four colors by enabling writing into only one of four bitplanes.

The example C language program circuit.c uses the writemask subroutine to draw power circuitry into several bitplanes.

Implementation Specifics

This subroutine is part of GL in the AIXwindows Environment/6000 Version 1, Release 2 with AIXwindows/3D Feature.

Files

/usr/include/gl/gl.h Contains C language constant and variable type definitions for GL.
/usr/include/gl/fgl.h Contains FORTRAN constant and variable type definitions for GL.

Related Information

Specifying the target frame buffer for drawing subroutines with the drawmode subroutine.

Returning the current writemask with the getwritemask subroutine.

Granting write access to a subset of available bitplanes with the RGBwritemask subroutine.

Specifying the RGBA writemask with a single packed integer with the wmpack subroutine.

Configuring the Frame Buffer.

Writemasks and Logical Operations, and Working in Color Map and RGB Modes.


[ Previous | Next | Contents | Glossary | Home | Search ]