xenocara/doc/gl-docs/GL/gl/bitmap.3gl
2006-11-29 17:00:35 +00:00

133 lines
4.3 KiB
Plaintext

'\" te
'\"! tbl|eqn | mmdoc
'\"macro stdmacro
.ds Vn Version 1.2
.ds Dt 24 September 1999
.ds Re Release 1.2.1
.ds Dp Jan 14 18:30
.ds Dm 01 bitmap.gl
.ds Xs 23189 6 bitmap.gl
.TH GLBITMAP 3G
.SH NAME
.B "glBitmap
\- draw a bitmap
.SH C SPECIFICATION
void \f3glBitmap\fP(
GLsizei \fIwidth\fP,
.nf
.ta \w'\f3void \fPglBitmap( 'u
GLsizei \fIheight\fP,
GLfloat \fIxorig\fP,
GLfloat \fIyorig\fP,
GLfloat \fIxmove\fP,
GLfloat \fIymove\fP,
const GLubyte \fI*bitmap\fP )
.fi
.EQ
delim $$
.EN
.SH PARAMETERS
.TP \w'\f2width\fP\ \f2height\fP\ \ 'u
\f2width\fP, \f2height\fP
Specify the pixel width and height of the bitmap image.
.TP
\f2xorig\fP, \f2yorig\fP
Specify the location of the origin in the bitmap image.
The origin is measured from the lower left corner of the bitmap,
with right and up being the positive axes.
.TP
\f2xmove\fP, \f2ymove\fP
Specify the \f2x\fP and \f2y\fP offsets to be added to the current raster position
after the bitmap is drawn.
.TP
\f2bitmap\fP
Specifies the address of the bitmap image.
.SH DESCRIPTION
A bitmap is a binary image.
When drawn,
the bitmap is positioned relative to the current raster position,
and frame buffer pixels corresponding to 1's in the bitmap are
written using the current raster color or index.
Frame buffer pixels corresponding to 0's in the bitmap are not modified.
.P
\%\f3glBitmap\fP takes seven arguments.
The first pair specifies the width and height of the bitmap image.
The second pair specifies the location of the bitmap origin relative
to the lower left corner of the bitmap image.
The third pair of arguments specifies \f2x\fP and \f2y\fP offsets to be added
to the current raster position after the bitmap has been drawn.
The final argument is a pointer to the bitmap image itself.
.P
The bitmap image is interpreted like image data for the \%\f3glDrawPixels\fP
command,
with \f2width\fP and \f2height\fP corresponding to the width and height arguments
of that command,
and with \f2type\fP set to \%\f3GL_BITMAP\fP
and \f2format\fP set to \%\f3GL_COLOR_INDEX\fP.
.BP
Modes specified using \%\f3glPixelStore\fP affect the
interpretation of bitmap image data;
modes specified using \%\f3glPixelTransfer\fP do not.
.P
If the current raster position is invalid, \%\f3glBitmap\fP is ignored.
Otherwise,
the lower left corner of the bitmap image is positioned at the window coordinates
.ce
.sp
$ x sub w ~=~ \(lf ~ x sub r ~-~ x sub o ~ \(rf $
.br
.sp
.ce
$ y sub w ~=~ \(lf ~ y sub r ~-~ y sub o ~ \(rf $
.sp
where $ ( x sub r , y sub r ) $ is the raster position
and $ ( x sub o , y sub o ) $ is the bitmap origin.
Fragments are then generated for each pixel corresponding to a 1 (one)
in the bitmap image.
These fragments are generated using the current raster \f2z\fP coordinate,
color or color index, and current raster texture coordinates.
They are then treated just as if they had been generated
by a point, line, or polygon,
including texture mapping,
.br
fogging,
and all per-fragment operations such as alpha and depth testing.
.P
After the bitmap has been drawn,
the \f2x\fP and \f2y\fP coordinates of the current raster position are offset by
\f2xmove\fP and \f2ymove\fP.
No change is made to the \f2z\fP coordinate of the current raster position,
or to the current raster color, texture coordinates, or index.
.SH NOTES
To set a valid raster position outside the viewport, first set a valid
raster position inside the viewport, then call \%\f3glBitmap\fP with NULL
as the \f2bitmap\fP parameter and with \f2xmove\fP and \f2ymove\fP set to
the offsets of the new raster position. This technique is useful when
panning an image around the viewport.
.SH ERRORS
\%\f3GL_INVALID_VALUE\fP is generated if \f2width\fP or \f2height\fP is negative.
.P
\%\f3GL_INVALID_OPERATION\fP is generated if \%\f3glBitmap\fP
is executed between the execution of \%\f3glBegin\fP and the corresponding execution of
\%\f3glEnd\fP.
.SH ASSOCIATED GETS
\%\f3glGet\fP with argument \%\f3GL_CURRENT_RASTER_POSITION\fP
.br
\%\f3glGet\fP with argument \%\f3GL_CURRENT_RASTER_COLOR\fP
.br
\%\f3glGet\fP with argument \%\f3GL_CURRENT_RASTER_DISTANCE\fP
.br
\%\f3glGet\fP with argument \%\f3GL_CURRENT_RASTER_INDEX\fP
.br
\%\f3glGet\fP with argument \%\f3GL_CURRENT_RASTER_TEXTURE_COORDS\fP
.br
\%\f3glGet\fP with argument \%\f3GL_CURRENT_RASTER_POSITION_VALID\fP
.SH SEE ALSO
\%\f3glDrawPixels(3G)\fP,
\%\f3glPixelStore(3G)\fP,
\%\f3glPixelTransfer(3G)\fP,
\%\f3glRasterPos(3G)\fP