Returns values of specific pixels in color map mode.
FORTRAN (libfgl.a)
Int32 readpixels(Int16 number, Colorindex colors[ ])
INTEGER*4 FUNCTION READPI(number, colors) INTEGER*4 number INTEGER*2 colors(number)
The readpixels subroutine returns values of specific pixels from the frame buffer in color map mode. It reads them into the array starting from the current character position along a single scan line (constant y) in the direction of increasing x.
The number parameter returns the number of pixels read, which is the number requested if the starting point is a valid character position (inside the current viewport.
The system must be in color map mode for the readpixels subroutine to function. Use the readRGB subroutine to read pixels in RGB mode.
The readpixels subroutine returns zero if the starting point is not a valid character position. The values of pixels read outside the viewport or the screen are undefined. The subroutine updates the current character position to one pixel to the right of the last one read. The current character position is undefined if the new position is outside the viewport.
In double buffer mode, only the back buffer is read by default. Use the readsource subroutine to specify which buffer is read.
When the system is in SINGLEMAP mode, only the lowest 12 bits contain valid data, and the 4 upper bits of a color value (an element of the array in the colors parameter) are undefined. When the system is in MULTIMAP mode, only the lowest 8 bits contain valid data, and the upper 8 bits of a color value are undefined.
The rectread subroutine provides significantly better performance for pixel block transfers. Even when only one row of pixels needs to be read, use the rectread subroutine.
number | Specifies the number of pixels to be read by the function. |
colors | Specifies the array in which the pixel values are to be stored. |
The number of pixels actually read. A returned function value of 0 (zero) indicates that the starting point is not a valid character position.
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. |
Returning the value of specific pixels in RGB mode with the readRGB subroutine.
Specifying the source for pixels to be read with the readsource 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 color map mode with the writepixels subroutine.
AIX Graphics Library Overview, Reading and Writing Pixels, Using Viewports and Screenmasks, and Working in Color Map and RGB Modes.