Скачиваний:
47
Добавлен:
17.03.2015
Размер:
2.46 Mб
Скачать

3.7. BITMAPS

147

group component values that are outside the representable range.

If the Minmax sink parameter is FALSE, minmax operation has no effect on the stream of pixel groups being processed. Otherwise, all RGBA pixel groups are discarded immediately after the minmax operation is completed. No pixel fragments are generated, no change is made to texture memory contents, and no pixel values are returned. However, texture object state is modified whether or not pixel groups are discarded.

3.6.6 Pixel Rectangle Multisample Rasterization

If MULTISAMPLE is enabled, and the value of SAMPLE BUFFERS is one, then pixel rectangles are rasterized using the following algorithm. Let (Xrp, Yrp) be the current raster position. (If the current raster position is invalid, then DrawPixels is ignored.) If a particular group (index or components) is the nth in a row and belongs to the mth row, consider the region in window coordinates bounded by the rectangle with corners

(Xrp + Zx n, Yrp + Zy m)

and

(Xrp + Zx (n + 1), Yrp + Zy (m + 1))

where Zx and Zy are the pixel zoom factors specified by PixelZoom, and may each be either positive or negative. A fragment representing group (n, m) is produced for each framebuffer pixel with one or more sample points that lie inside, or on the bottom or left boundary, of this rectangle. Each fragment so produced takes its associated data from the group and from the current raster position, in a manner consistent with the discussion in the Conversion to Fragments subsection of section 3.6.4. All depth and color sample values are assigned the same value, taken either from their group (for depth and color component groups) or from the current raster position (if they are not). All sample values are assigned the same fog coordinate and the same set of texture coordinates, taken from the current raster position.

A single pixel rectangle will generate multiple, perhaps very many fragments for the same framebuffer pixel, depending on the pixel zoom factors.

3.7Bitmaps

Bitmaps are rectangles of zeros and ones specifying a particular pattern of fragments to be produced. Each of these fragments has the same associated data. These data are those associated with the current raster position.

Version 2.0 - October 22, 2004

3.7. BITMAPS

148

 

 

 

!

!

 

 

 

 

 

 

 

 

 

 

!

!

 

 

 

 

 

 

 

"

"

#

#

 

 

 

 

 

 

 

 

"

"

#

#

 

 

 

 

 

 

 

 

$

$

%

%

 

 

 

 

 

 

 

 

$

$

%

%

 

 

 

 

 

 

 

 

&

&

'

'

 

 

 

 

 

 

 

 

&

&

'

'

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

h = 12

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

ybo = 1.0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

xbo

 

= 2.5

 

 

 

 

 

 

 

 

w = 8

Figure 3.9. A bitmap and its associated parameters. xbi and ybi are not shown.

Bitmaps are sent using

void Bitmap( sizei w, sizei h, float xbo, float ybo, float xbi, float ybi, ubyte *data );

w and h comprise the integer width and height of the rectangular bitmap, respectively. (xbo, ybo) gives the floating-point x and y values of the bitmap’s origin. (xbi, ybi) gives the floating-point x and y increments that are added to the raster position after the bitmap is rasterized. data is a pointer to a bitmap.

Like a polygon pattern, a bitmap is unpacked from memory according to the procedure given in section 3.6.4 for DrawPixels; it is as if the width and height passed to that command were equal to w and h, respectively, the type were BITMAP, and the format were COLOR INDEX. The unpacked values (before any conversion or arithmetic would have been performed) form a stipple pattern of zeros and ones. See figure 3.9.

A bitmap sent using Bitmap is rasterized as follows. First, if the current raster position is invalid (the valid bit is reset), the bitmap is ignored. Otherwise, a rectangular array of fragments is constructed, with lower left corner at

(xll, yll) = (bxrp − xboc, byrp − yboc)

Version 2.0 - October 22, 2004

Соседние файлы в папке OpenGL