Visualization, Spring'98, Yap
LECTURE 5: PIXEL PIPELINE
-
INTRODUCTION
OpenGL is justly touted as a
3-D Graphics API, as its 3D geometry pipeline
architecture is quite sophisticated.
However, OpenGL
also provides important support
for direct pixel manipulation, bypassing
most of this pipeline. We need to understand
this alternative pipeline in this course.
-
BITMAPS and IMAGES
-- Pixel manipulation operates on two kinds of data arrays:
- Bitmaps are 0/1 rectangular arrays.
- Images are basically RGBA-valued rectangular arrays.
--
The bottom-left corner of such an array is called
its origin.
--
These arrays are stored in row-major order, starting
from the origin, from left to right,
bottom row to top row.
--
See [Guide, ch.8] for more details.
-
CURRENT RASTER POSITION
-- The OpenGL state includes a current raster position,
important for pixel-based commands.
--
We can specify this position using
glRasterPos*(x, y, ...)
|
---|
E.g.,
glRasterPos4f(10.0, 20.0, 0.0, 1.0)
|
---|
--
When we draw a bitmap or image, the origin of the array
will be made to coincide with the current raster position.
--
More on current raster position
-
USING BITMAPS
--
Useful in defining fonts (in conjunction with
display lists [Angel, ch.2][Guide, ch.2].
--
Basic command:
glBitmap(width, ht, x_0, y_0, x_mov, y_mov, raster)
|
---|
--
More details
-
MANIPULATING IMAGES
-- THREE BASIC COMMANDS:
-- Besides direct display,
images are also useful for texture maps.
--
OTHER USEFUL COMMANDS
[PREVIOUS LECTURE]
[NEXT LECTURE]
[ALL LECTURES]
[CLASS PAGE]