Silicon Graphics

[Prev] [TOC] [Next]



(-) OpenGL Programming Guide
(-) Chapter 8Drawing Pixels, Bitmaps, Fonts, and Images
(-) Images

Magnifying or Reducing an Image

Normally, each pixel in an image is written to a single pixel on the screen. However, you can arbitrarily magnify or reduce an image by using glPixelZoom(). void glPixelZoom(GLfloat zoomx, GLfloat zoomy);

Sets the magnification or reduction factors for pixel-write operations, in the x- and y-dimensions. By default, zoomx and zoomy are 1.0. If they're both 2.0, each image pixel is drawn to 4 screen pixels. Note that fractional magnification or reduction factors are allowed, as are negative factors.

Advanced

During rasterization, each image pixel is treated as a zoomx × zoomy quadrilateral, and fragments are generated for all the pixels whose centers lie within the quadrilateral. More specifically, let (xrp, yrp) be the current raster position. If a particular group of elements (index or components) is the nth in a row and belongs to the mth column, consider the region in window coordinates bounded by the rectangle with corners at

(xrp + zoomxn, yrp + zoomym) and (xrp + zoomx(n+1), yrp + zoomy(m+1))

Any fragments whose centers lie inside this rectangle (or on its bottom or left boundaries) are produced in correspondence with this particular group of elements.


[Prev] [TOC] [Next]

OpenGL Programming Guide


Maintained by Maintainer: Send e-mail to .htm">name@address.