core | glapi | vbo | math | shader | swrast | swrast_setup | tnl | tnl_dd

mipmap.h File Reference

#include "mtypes.h"

Functions

void _mesa_generate_mipmap_level (GLenum target, GLenum datatype, GLuint comps, GLint border, GLint srcWidth, GLint srcHeight, GLint srcDepth, const GLubyte *srcData, GLint srcRowStride, GLint dstWidth, GLint dstHeight, GLint dstDepth, GLubyte *dstData, GLint dstRowStride)
 Down-sample a texture image to produce the next lower mipmap level.
void _mesa_generate_mipmap (GLcontext *ctx, GLenum target, struct gl_texture_object *texObj)
 Automatic mipmap generation.
void _mesa_rescale_teximage2d (GLuint bytesPerPixel, GLuint srcStrideInPixels, GLuint dstRowStride, GLint srcWidth, GLint srcHeight, GLint dstWidth, GLint dstHeight, const GLvoid *srcImage, GLvoid *dstImage)
 Helper function for drivers which need to rescale texture images to certain aspect ratios.
void _mesa_upscale_teximage2d (GLsizei inWidth, GLsizei inHeight, GLsizei outWidth, GLsizei outHeight, GLint comps, const GLchan *src, GLint srcRowStride, GLchan *dest)
 Upscale an image by replication, not (typical) stretching.


Function Documentation

void _mesa_generate_mipmap ( GLcontext ctx,
GLenum  target,
struct gl_texture_object texObj 
)

Automatic mipmap generation.

This is the fallback/default function for ctx->Driver.GenerateMipmap(). Generate a complete set of mipmaps from texObj's BaseLevel image. Stop at texObj's MaxLevel or when we get to the 1x1 texture. For cube maps, target will be one of GL_TEXTURE_CUBE_MAP_POSITIVE/NEGATIVE_X/Y/Z; never GL_TEXTURE_CUBE_MAP.

void _mesa_generate_mipmap_level ( GLenum  target,
GLenum  datatype,
GLuint  comps,
GLint  border,
GLint  srcWidth,
GLint  srcHeight,
GLint  srcDepth,
const GLubyte *  srcData,
GLint  srcRowStride,
GLint  dstWidth,
GLint  dstHeight,
GLint  dstDepth,
GLubyte *  dstData,
GLint  dstRowStride 
)

Down-sample a texture image to produce the next lower mipmap level.

Parameters:
comps components per texel (1, 2, 3 or 4)
srcRowStride stride between source rows, in texels
dstRowStride stride between destination rows, in texels

void _mesa_rescale_teximage2d ( GLuint  bytesPerPixel,
GLuint  srcStrideInPixels,
GLuint  dstRowStride,
GLint  srcWidth,
GLint  srcHeight,
GLint  dstWidth,
GLint  dstHeight,
const GLvoid *  srcImage,
GLvoid *  dstImage 
)

Helper function for drivers which need to rescale texture images to certain aspect ratios.

Nearest filtering only (for broken hardware that can't support all aspect ratios). This can be made a lot faster, but I don't really care enough...

void _mesa_upscale_teximage2d ( GLsizei  inWidth,
GLsizei  inHeight,
GLsizei  outWidth,
GLsizei  outHeight,
GLint  comps,
const GLchan *  src,
GLint  srcRowStride,
GLchan *  dest 
)

Upscale an image by replication, not (typical) stretching.

We use this when the image width or height is less than a certain size (4, 8) and we need to upscale an image.


Generated on Sun Sep 27 06:47:46 2009 for Mesa Main by  doxygen 1.5.4