core  array_cache  math  swrast  swrast_setup  tnl  tnl_dd 
Main Page   Data Structures   File List   Data Fields   Globals   Related Pages  

teximage.h File Reference

Texture images manipulation functions. More...

#include "mtypes.h"

Internal functions

GLint _mesa_base_tex_format (GLcontext *ctx, GLint internalFormat)
 Return the simple base format for a given internal texture format. More...

gl_texture_image_mesa_new_texture_image (GLcontext *ctx)
 Allocate a texture image structure. More...

void _mesa_delete_texture_image (struct gl_texture_image *teximage)
 Free texture image. More...

void _mesa_init_teximage_fields (GLcontext *ctx, GLenum target, struct gl_texture_image *img, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum internalFormat)
 Initialize basic fields of the gl_texture_image struct. More...

void _mesa_set_tex_image (struct gl_texture_object *tObj, GLenum target, GLint level, struct gl_texture_image *texImage)
 Store a gl_texture_image pointer in a gl_texture_object structure according to the target and level parameters. More...

gl_texture_object_mesa_select_tex_object (GLcontext *ctx, const struct gl_texture_unit *texUnit, GLenum target)
 Get the texture object that corresponds to the target of the given texture unit. More...

gl_texture_image_mesa_select_tex_image (GLcontext *ctx, const struct gl_texture_unit *texUnit, GLenum target, GLint level)
 Get the texture image struct which corresponds to target and level of the given texture unit. More...

gl_texture_image_mesa_get_tex_image (GLcontext *ctx, const struct gl_texture_unit *texUnit, GLenum target, GLint level)
 Like _mesa_select_tex_image() but if the image doesn't exist, allocate it and install it. More...

gl_texture_image_mesa_get_proxy_tex_image (GLcontext *ctx, GLenum target, GLint level)
 Return pointer to the specified proxy texture image. More...

GLint _mesa_max_texture_levels (GLcontext *ctx, GLenum target)
 Get the maximum number of allowed mipmap levels. More...

GLboolean _mesa_test_proxy_teximage (GLcontext *ctx, GLenum target, GLint level, GLint internalFormat, GLenum format, GLenum type, GLint width, GLint height, GLint depth, GLint border)
 This is the fallback for Driver.TestProxyTexImage(). More...


API entry point functions

void GLAPIENTRY _mesa_TexImage1D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
void GLAPIENTRY _mesa_TexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
void GLAPIENTRY _mesa_TexImage3D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
void GLAPIENTRY _mesa_TexImage3DEXT (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
void GLAPIENTRY _mesa_GetTexImage (GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels)
 Get texture image. More...

void GLAPIENTRY _mesa_TexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels)
void GLAPIENTRY _mesa_TexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)
void GLAPIENTRY _mesa_TexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels)
void GLAPIENTRY _mesa_CopyTexImage1D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border)
void GLAPIENTRY _mesa_CopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
void GLAPIENTRY _mesa_CopyTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width)
void GLAPIENTRY _mesa_CopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
void GLAPIENTRY _mesa_CopyTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
void GLAPIENTRY _mesa_CompressedTexImage1DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data)
void GLAPIENTRY _mesa_CompressedTexImage2DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data)
void GLAPIENTRY _mesa_CompressedTexImage3DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data)
void GLAPIENTRY _mesa_CompressedTexSubImage1DARB (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data)
void GLAPIENTRY _mesa_CompressedTexSubImage2DARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data)
void GLAPIENTRY _mesa_CompressedTexSubImage3DARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data)
void GLAPIENTRY _mesa_GetCompressedTexImageARB (GLenum target, GLint lod, GLvoid *img)


Detailed Description

Texture images manipulation functions.


Function Documentation

GLint _mesa_base_tex_format GLcontext   ctx,
GLint    internalFormat
 

Return the simple base format for a given internal texture format.

For example, given GL_LUMINANCE12_ALPHA4, return GL_LUMINANCE_ALPHA.

Parameters:
ctx  GL context.
internalFormat  the internal texture format token or 1, 2, 3, or 4.
Returns:
the corresponding \u base internal format (GL_ALPHA, GL_LUMINANCE, GL_LUMANCE_ALPHA, GL_INTENSITY, GL_RGB, or GL_RGBA), or -1 if invalid enum.
This is the format which is used during texture application (i.e. the texture format and env mode determine the arithmetic used.

void GLAPIENTRY _mesa_CompressedTexImage1DARB GLenum    target,
GLint    level,
GLenum    internalformat,
GLsizei    width,
GLint    border,
GLsizei    imageSize,
const GLvoid *    data
 

void GLAPIENTRY _mesa_CompressedTexImage2DARB GLenum    target,
GLint    level,
GLenum    internalformat,
GLsizei    width,
GLsizei    height,
GLint    border,
GLsizei    imageSize,
const GLvoid *    data
 

void GLAPIENTRY _mesa_CompressedTexImage3DARB GLenum    target,
GLint    level,
GLenum    internalformat,
GLsizei    width,
GLsizei    height,
GLsizei    depth,
GLint    border,
GLsizei    imageSize,
const GLvoid *    data
 

void GLAPIENTRY _mesa_CompressedTexSubImage1DARB GLenum    target,
GLint    level,
GLint    xoffset,
GLsizei    width,
GLenum    format,
GLsizei    imageSize,
const GLvoid *    data
 

void GLAPIENTRY _mesa_CompressedTexSubImage2DARB GLenum    target,
GLint    level,
GLint    xoffset,
GLint    yoffset,
GLsizei    width,
GLsizei    height,
GLenum    format,
GLsizei    imageSize,
const GLvoid *    data
 

void GLAPIENTRY _mesa_CompressedTexSubImage3DARB GLenum    target,
GLint    level,
GLint    xoffset,
GLint    yoffset,
GLint    zoffset,
GLsizei    width,
GLsizei    height,
GLsizei    depth,
GLenum    format,
GLsizei    imageSize,
const GLvoid *    data
 

void GLAPIENTRY _mesa_CopyTexImage1D GLenum    target,
GLint    level,
GLenum    internalformat,
GLint    x,
GLint    y,
GLsizei    width,
GLint    border
 

void GLAPIENTRY _mesa_CopyTexImage2D GLenum    target,
GLint    level,
GLenum    internalformat,
GLint    x,
GLint    y,
GLsizei    width,
GLsizei    height,
GLint    border
 

void GLAPIENTRY _mesa_CopyTexSubImage1D GLenum    target,
GLint    level,
GLint    xoffset,
GLint    x,
GLint    y,
GLsizei    width
 

void GLAPIENTRY _mesa_CopyTexSubImage2D GLenum    target,
GLint    level,
GLint    xoffset,
GLint    yoffset,
GLint    x,
GLint    y,
GLsizei    width,
GLsizei    height
 

void GLAPIENTRY _mesa_CopyTexSubImage3D GLenum    target,
GLint    level,
GLint    xoffset,
GLint    yoffset,
GLint    zoffset,
GLint    x,
GLint    y,
GLsizei    width,
GLsizei    height
 

void _mesa_delete_texture_image struct gl_texture_image   teximage
 

Free texture image.

Parameters:
teximage  texture image.
Free the texture image structure and the associated image data if it's not marked as client data.

struct gl_texture_image* _mesa_get_proxy_tex_image GLcontext   ctx,
GLenum    target,
GLint    level
 

Return pointer to the specified proxy texture image.

Note that proxy textures are per-context, not per-texture unit.

Returns:
pointer to texture image or NULL if invalid target, invalid level, or out of memory.

struct gl_texture_image* _mesa_get_tex_image GLcontext   ctx,
const struct gl_texture_unit   texUnit,
GLenum    target,
GLint    level
 

Like _mesa_select_tex_image() but if the image doesn't exist, allocate it and install it.

Only return NULL if passed a bad parameter or run out of memory.

void GLAPIENTRY _mesa_GetCompressedTexImageARB GLenum    target,
GLint    lod,
GLvoid *    img
 

void GLAPIENTRY _mesa_GetTexImage GLenum    target,
GLint    level,
GLenum    format,
GLenum    type,
GLvoid *    pixels
 

Get texture image.

Called by glGetTexImage.

Parameters:
target  texture target.
level  image level.
format  pixel data format for returned image.
type  pixel data type for returned image.
pixels  returned pixel data.

void _mesa_init_teximage_fields GLcontext   ctx,
GLenum    target,
struct gl_texture_image   img,
GLsizei    width,
GLsizei    height,
GLsizei    depth,
GLint    border,
GLenum    internalFormat
 

Initialize basic fields of the gl_texture_image struct.

Parameters:
ctx  GL context.
target  texture target.
img  texture image structure to be initialized.
width  image width.
height  image height.
depth  image depth.
border  image border.
internalFormat  internal format.
Fills in the fields of img with the given information. Note: width, height and depth include the border.

GLint _mesa_max_texture_levels GLcontext   ctx,
GLenum    target
 

Get the maximum number of allowed mipmap levels.

Parameters:
ctx  GL context.
target  texture target.
Returns:
the maximum number of allowed mipmap levels for the given texture target, or zero if passed a bad target.
See also:
gl_constants.

struct gl_texture_image* _mesa_new_texture_image GLcontext   ctx
 

Allocate a texture image structure.

Called via ctx->Driver.NewTextureImage() unless overriden by a device driver.

Returns:
a pointer to gl_texture_image struct with all fields initialized to zero.

struct gl_texture_image* _mesa_select_tex_image GLcontext   ctx,
const struct gl_texture_unit   texUnit,
GLenum    target,
GLint    level
 

Get the texture image struct which corresponds to target and level of the given texture unit.

Parameters:
ctx  GL context.
texUnit  texture unit.
target  texture target.
level  image level.
Returns:
pointer to the texture image structure on success, or NULL on failure.
See also:
gl_texture_unit.

struct gl_texture_object* _mesa_select_tex_object GLcontext   ctx,
const struct gl_texture_unit   texUnit,
GLenum    target
 

Get the texture object that corresponds to the target of the given texture unit.

Parameters:
ctx  GL context.
texUnit  texture unit.
target  texture target.
Returns:
pointer to the texture object on success, or NULL on failure.
See also:
gl_texture_unit.

void _mesa_set_tex_image struct gl_texture_object   tObj,
GLenum    target,
GLint    level,
struct gl_texture_image   texImage
 

Store a gl_texture_image pointer in a gl_texture_object structure according to the target and level parameters.

Parameters:
tObj  texture object.
target  texture target.
level  image level.
texImage  texture image.
This was basically prompted by the introduction of cube maps.

GLboolean _mesa_test_proxy_teximage GLcontext   ctx,
GLenum    target,
GLint    level,
GLint    internalFormat,
GLenum    format,
GLenum    type,
GLint    width,
GLint    height,
GLint    depth,
GLint    border
 

This is the fallback for Driver.TestProxyTexImage().

Test the texture level, width, height and depth against the ctx->Const limits for textures.

A hardware driver might override this function if, for example, the max 3D texture size is 512x512x64 (i.e. not a cube).

Parameters:
target  one of GL_PROXY_TEXTURE_1D, GL_PROXY_TEXTURE_2D, GL_PROXY_TEXTURE_3D, GL_PROXY_TEXTURE_RECTANGLE_NV, GL_PROXY_TEXTURE_CUBE_MAP_ARB.
level  as passed to glTexImage
internalFormat  as passed to glTexImage
format  as passed to glTexImage
type  as passed to glTexImage
width  as passed to glTexImage
height  as passed to glTexImage
depth  as passed to glTexImage
border  as passed to glTexImage
Returns:
GL_TRUE if the image is acceptable, GL_FALSE if not acceptable.

void GLAPIENTRY _mesa_TexImage1D GLenum    target,
GLint    level,
GLint    internalformat,
GLsizei    width,
GLint    border,
GLenum    format,
GLenum    type,
const GLvoid *    pixels
 

void GLAPIENTRY _mesa_TexImage2D GLenum    target,
GLint    level,
GLint    internalformat,
GLsizei    width,
GLsizei    height,
GLint    border,
GLenum    format,
GLenum    type,
const GLvoid *    pixels
 

void GLAPIENTRY _mesa_TexImage3D GLenum    target,
GLint    level,
GLint    internalformat,
GLsizei    width,
GLsizei    height,
GLsizei    depth,
GLint    border,
GLenum    format,
GLenum    type,
const GLvoid *    pixels
 

void GLAPIENTRY _mesa_TexImage3DEXT GLenum    target,
GLint    level,
GLenum    internalformat,
GLsizei    width,
GLsizei    height,
GLsizei    depth,
GLint    border,
GLenum    format,
GLenum    type,
const GLvoid *    pixels
 

void GLAPIENTRY _mesa_TexSubImage1D GLenum    target,
GLint    level,
GLint    xoffset,
GLsizei    width,
GLenum    format,
GLenum    type,
const GLvoid *    pixels
 

void GLAPIENTRY _mesa_TexSubImage2D GLenum    target,
GLint    level,
GLint    xoffset,
GLint    yoffset,
GLsizei    width,
GLsizei    height,
GLenum    format,
GLenum    type,
const GLvoid *    pixels
 

void GLAPIENTRY _mesa_TexSubImage3D GLenum    target,
GLint    level,
GLint    xoffset,
GLint    yoffset,
GLint    zoffset,
GLsizei    width,
GLsizei    height,
GLsizei    depth,
GLenum    format,
GLenum    type,
const GLvoid *    pixels
 


Generated on Sun May 16 15:55:12 2004 for Mesa Core by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001