glCopyTexImage2DEXT(3G) OpenGL Reference glCopyTexImage2DEXT(3G)
NAME
glCopyTexImage2DEXT - copy pixels into a 2D texture image
C SPECIFICATION
void glCopyTexImage2DEXT( GLenum target,
GLint level,
GLenum internalformat,
GLint x,
GLint y,
GLsizei width,
GLsizei height,
GLint border )
PARAMETERS
target The target texture. Must be GLTEXTURE2D or
GLDETAILTEXTURE2DSGIS.
level The level-of-detail number. Level 0 is the base image
level. Level n is the nth mipmap reduction image.
internalformat The internal storage format of the texture image. Must
be one of the following symbolic constants: GLALPHA,
GLALPHA4EXT, GLALPHA8EXT, GLALPHA12EXT,
GLALPHA16EXT, GLLUMINANCE, GLLUMINANCE4EXT,
GLLUMINANCE8EXT, GLLUMINANCE12EXT,
GLLUMINANCE16EXT, GLLUMINANCEALPHA,
GLLUMINANCE4ALPHA4EXT, GLLUMINANCE6ALPHA2EXT,
GLLUMINANCE8ALPHA8EXT, GLLUMINANCE12ALPHA4EXT,
GLLUMINANCE12ALPHA12EXT, GLLUMINANCE16ALPHA16EXT,
GLINTENSITYEXT, GLINTENSITY4EXT, GLINTENSITY8EXT,
GLINTENSITY12EXT, GLINTENSITY16EXT,
GLDEPTHCOMPONENT, GLDEPTHCOMPONENT16SGIX,
GLDEPTHCOMPONENT24SGIX, GLDEPTHCOMPONENT32SGIX,
GLRGB, GLRGB2EXT, GLRGB4EXT, GLRGB5EXT,
GLRGB8EXT, GLRGB10EXT, GLRGB12EXT, GLRGB16EXT,
GLRGBA, GLRGBA2EXT, GLRGBA4EXT, GLRGB5A1EXT,
GLRGBA8EXT, GLRGB10A2EXT, GLRGBA12EXT,
GLRGBA16EXT. (Note that the values 1, 2, 3, and 4,
which are accepted by glTexImage2D, are not accepted by
glCopyTexImage2DEXT.)
x The x coordinate of the lower-left corner of the pixel
rectangle to be transferred to the texture array.
y The y coordinate of the lower-left corner of the pixel
rectangle to be transferred to the texture array.
width The width of the texture image.
Page 1
glCopyTexImage2DEXT(3G) OpenGL Reference glCopyTexImage2DEXT(3G)
height The height of the texture image.
border The border width of the texture. Must be 0 or 1.
DESCRIPTION
glCopyTexImage2DEXT defines a two-dimensional texture image with pixels
from the current GLREADBUFFER (rather than from main memory, as is the
case for glTexImage2D).
The screen-aligned pixel rectangle with lower-left corner at (x, y)
having width width+2*border and height height+2*border is used to define
the texture array at the mipmap level specified by level. (But see the
discussion of GLINTERLACESGIX below.) The internal format of the
texture array is selected by internalformat.
The pixels in the rectangle are processed exactly as if glCopyPixels had
been called, but the process stops just before final conversion. At this
point all pixel component values are clamped to the range [0, 1] and then
converted to the texture's internal format for storage in the texel
array.
Pixel ordering is such that lower x screen coordinates correspond to
lower i texture coordinates, and lower y screen coordinates correspond to
lower j texture coordinates.
If any of the pixels within the specified rectangle of the current
GLREADBUFFER are outside the window associated with the current
rendering context, then the values obtained for those pixels are
undefined.
If GLINTERLACESGIX is enabled, then successive rows of the pixel
rectangle define every other row of the texture image, rather than
successive rows of the texture image. That is, row j of the source image
is used to define row 2j of the texture image, while rows (1,3,5,...) are
left undefined. Note, that when GLINTERLACESGIX is enabled the total
height (i.e., the height of interior texture image plus twice the border)
of the defined texture is 2xheight.
If internalformat is one of GLDEPTHCOMPONENT,
GLDEPTHCOMPONENT16SGIX, GLDEPTHCOMPONENT24SGIX, or
GLDEPTHCOMPONENT32SGIX, the pixel values will be read from the depth
buffer instead of the current GLREADBUFFER.
NOTES
glCopyTexImage2DEXT is part of the EXTcopytexture extension. See
glIntro for more information about using extensions.
ERRORS
GLINVALIDENUM is generated when target is not one of the allowable
values.
Page 2
glCopyTexImage2DEXT(3G) OpenGL Reference glCopyTexImage2DEXT(3G)
GLINVALIDVALUE is generated if level is less than zero or greater than
log (max), where max is the returned value of GLMAXTEXTURESIZE.
2
GLINVALIDVALUE is generated if the specified image is too large.
GLINVALIDVALUE is generated if width or height is less than zero,
greater than 2+GLMAXTEXTURESIZE, when width cannot be represented as
k
2 +2border for some integer k, or when height cannot be represented as
k
2 +Ixborder, where I is 2 when GLINTERLACESGIX is disabled and 1
otherwise.
GLINVALIDVALUE is generated if border is not 0 or 1.
GLINVALIDVALUE is generated if internalformat is not one of the
allowable values.
GLINVALIDOPERATION is generated if glCopyTexImage2DEXT is executed
between the execution of glBegin and the corresponding execution of
glEnd.
ASSOCIATED GETS
glGetTexImage
MACHINE DEPENDENCIES
RealityEngine, RealityEngine2, and VTX systems do not support color
matrix transformations on images as they are loaded to or read back from
texture memory.
RealityEngine, RealityEngine2, and VTX systems support glCopyTexImage2D
and glCopyTexImage2DEXT with the following restrictions:
1. Only level 0 is supported; other levels result in a
GLINVALIDVALUE error.
2. glCopyTexImage2D and glCopyTexImage2DEXT cannot be used if a GLX
video source is the current read drawable (see
glXMakeCurrentReadSGI). Executing it will generate a
GLINVALIDOPERATION error.
3. GLINTERLACESGIX is not supported (see glEnable).
4. Borders are not supported; hence the width of the border should
be 0.
On InfiniteReality systems, there is a performance benefit when the width
of the image to be transferred to texture memory is a multiple of 8.
Texture borders are not supported on InfiniteReality systems.
Applications should use borderless textures and GLCLAMPTOEDGESGIS
wrap mode.
Page 3
glCopyTexImage2DEXT(3G) OpenGL Reference glCopyTexImage2DEXT(3G)
The SGIXinterlace extension is supported only on InfiniteReality
systems, on RealityEngine, RealityEngine2, and VTX systems, and on O2
systems.
SEE ALSO
glTexImage2D, glCopyTexSubImage2DEXT, glCopyPixels.
Page 4