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

writepixels Subroutine


Paints a row of pixels on the screen in color map mode.


Graphics Library

C (libgl.a)

FORTRAN (libfgl.a)

C Syntax

void writepixels(Int16 number, Colorindex colors[ ])


SUBROUTINE WRITEP(number, colors)
INTEGER*4 number
INTEGER*2 colors(number)
Note: For FORTRAN users, this subroutine accepts long integer parameters (INTEGER*4) when invoked from a FORTRAN program, although it accepts short integers when invoked from a C program. The C and FORTRAN syntax shown here reflect this difference.


The writepixels subroutine paints a row of pixels on the screen in color map mode.The system reads elements from the colors array and writes a pixel of the appropriate color for each.

The starting location for the row of pixels is the current character position. The system updates the current character position to one pixel to the right of the last painted pixel. The system paints pixels from left to right, and clips to the current screenmask. The current character position becomes undefined if the new position is outside the viewport.

The writepixels subroutine does not automatically wrap from one line to the next. It can be used in both single and double buffer modes.

The rectwrite subroutine provides significantly better performance for pixel block transfers. Even when only one row of pixels needs to be read, use the rectwrite subroutine.

  1. This subroutine cannot be used to add to a display list.
  2. The use of this subroutine is deprecated. Do not use the writepixels subroutine in new development.


number Specifies the number of pixels to paint.
colors Specifies an array of color indexes.

Implementation Specifics

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


/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

Returning the value of specific pixels in color map mode with the readpixels subroutine.

Copying a rectangle of pixels with an optional zoom with the rectcopy subroutine.

Reading a rectangular array of pixels into host memory with the rectread subroutine.

Drawing a rectangular array of pixels into the frame buffer with the rectwrite subroutine.

Painting a row of pixels on the screen in RGB mode with the writeRGB subroutine.

AIX Graphics Library Overview, Configuring the Frame Buffer, Creating Animated Scenes, Reading and Writing Pixels, Using Viewports and Screenmasks, and Working in Color Map and RGB Modes.

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