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

image.h File Reference

Image handling. More...

#include "mtypes.h"

Functions

void _mesa_swap2 (GLushort *p, GLuint n)
 Flip the order of the 2 bytes in each word in the given array. More...

void _mesa_swap4 (GLuint *p, GLuint n)
GLint _mesa_sizeof_type (GLenum type)
 Get the size of a GL data type. More...

GLint _mesa_sizeof_packed_type (GLenum type)
 Same as _mesa_sizeof_type() but also accepting the packed pixel format data types. More...

GLint _mesa_components_in_format (GLenum format)
 Get the number of components in a pixel format. More...

GLint _mesa_bytes_per_pixel (GLenum format, GLenum type)
 Get the bytes per pixel of pixel format type pair. More...

GLboolean _mesa_is_legal_format_and_type (GLcontext *ctx, GLenum format, GLenum type)
 Test for a legal pixel format and type. More...

GLvoid * _mesa_image_address (const struct gl_pixelstore_attrib *packing, const GLvoid *image, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint img, GLint row, GLint column)
 Get the address of a pixel in an image (actually a volume). More...

GLint _mesa_image_row_stride (const struct gl_pixelstore_attrib *packing, GLint width, GLenum format, GLenum type)
 Compute the stride between image rows. More...

GLint _mesa_image_image_stride (const struct gl_pixelstore_attrib *packing, GLint width, GLint height, GLenum format, GLenum type)
void _mesa_unpack_polygon_stipple (const GLubyte *pattern, GLuint dest[32], const struct gl_pixelstore_attrib *unpacking)
void _mesa_pack_polygon_stipple (const GLuint pattern[32], GLubyte *dest, const struct gl_pixelstore_attrib *packing)
GLvoid * _mesa_unpack_bitmap (GLint width, GLint height, const GLubyte *pixels, const struct gl_pixelstore_attrib *packing)
void _mesa_pack_bitmap (GLint width, GLint height, const GLubyte *source, GLubyte *dest, const struct gl_pixelstore_attrib *packing)
void _mesa_apply_rgba_transfer_ops (GLcontext *ctx, GLuint transferOps, GLuint n, GLfloat rgba[][4])
 Apply various pixel transfer operations to an array of RGBA pixels as indicated by the transferOps bitmask. More...

void _mesa_pack_rgba_span_float (GLcontext *ctx, GLuint n, CONST GLfloat rgba[][4], GLenum dstFormat, GLenum dstType, GLvoid *dstAddr, const struct gl_pixelstore_attrib *dstPacking, GLuint transferOps)
void _mesa_pack_rgba_span_chan (GLcontext *ctx, GLuint n, CONST GLchan rgba[][4], GLenum dstFormat, GLenum dstType, GLvoid *dstAddr, const struct gl_pixelstore_attrib *dstPacking, GLuint transferOps)
void _mesa_unpack_color_span_chan (GLcontext *ctx, GLuint n, GLenum dstFormat, GLchan dest[], GLenum srcFormat, GLenum srcType, const GLvoid *source, const struct gl_pixelstore_attrib *srcPacking, GLuint transferOps)
void _mesa_unpack_color_span_float (GLcontext *ctx, GLuint n, GLenum dstFormat, GLfloat dest[], GLenum srcFormat, GLenum srcType, const GLvoid *source, const struct gl_pixelstore_attrib *srcPacking, GLuint transferOps)
 Same as _mesa_unpack_color_span_chan(), but return GLfloat data instead of GLchan. More...

void _mesa_unpack_index_span (const GLcontext *ctx, GLuint n, GLenum dstType, GLvoid *dest, GLenum srcType, const GLvoid *source, const struct gl_pixelstore_attrib *srcPacking, GLuint transferOps)
void _mesa_pack_index_span (const GLcontext *ctx, GLuint n, GLenum dstType, GLvoid *dest, const GLuint *source, const struct gl_pixelstore_attrib *dstPacking, GLuint transferOps)
void _mesa_unpack_stencil_span (const GLcontext *ctx, GLuint n, GLenum dstType, GLvoid *dest, GLenum srcType, const GLvoid *source, const struct gl_pixelstore_attrib *srcPacking, GLuint transferOps)
void _mesa_pack_stencil_span (const GLcontext *ctx, GLuint n, GLenum dstType, GLvoid *dest, const GLstencil *source, const struct gl_pixelstore_attrib *dstPacking)
void _mesa_unpack_depth_span (const GLcontext *ctx, GLuint n, GLfloat *dest, GLenum srcType, const GLvoid *source, const struct gl_pixelstore_attrib *srcPacking)
void _mesa_pack_depth_span (const GLcontext *ctx, GLuint n, GLvoid *dest, GLenum dstType, const GLfloat *depthSpan, const struct gl_pixelstore_attrib *dstPacking)
void_mesa_unpack_image (GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels, const struct gl_pixelstore_attrib *unpack)
 Unpack image data. More...


Detailed Description

Image handling.


Function Documentation

void _mesa_apply_rgba_transfer_ops GLcontext   ctx,
GLuint    transferOps,
GLuint    n,
GLfloat    rgba[][4]
 

Apply various pixel transfer operations to an array of RGBA pixels as indicated by the transferOps bitmask.

GLint _mesa_bytes_per_pixel GLenum    format,
GLenum    type
 

Get the bytes per pixel of pixel format type pair.

Parameters:
format  pixel format.
type  pixel type.
Returns:
bytes per pixel, or -1 if a bad format or type was given.

GLint _mesa_components_in_format GLenum    format
 

Get the number of components in a pixel format.

Parameters:
format  pixel format.
Returns:
the number of components in the given format, or -1 if a bad format.

GLvoid* _mesa_image_address const struct gl_pixelstore_attrib   packing,
const GLvoid *    image,
GLsizei    width,
GLsizei    height,
GLenum    format,
GLenum    type,
GLint    img,
GLint    row,
GLint    column
 

Get the address of a pixel in an image (actually a volume).

Pixel unpacking/packing parameters are observed according to packing.

Parameters:
image  start of image data.
width  image width.
height  image height.
format  pixel format.
type  pixel data type.
packing  the pixelstore attributes
img  which image in the volume (0 for 1D or 2D images)
row  of pixel in the image
column  of pixel in the image
Returns:
address of pixel on success, or NULL on error.
According to the packing information calculates the number of pixel/bytes per row/image and refers it.

See also:
gl_pixelstore_attrib.

GLint _mesa_image_image_stride const struct gl_pixelstore_attrib   packing,
GLint    width,
GLint    height,
GLenum    format,
GLenum    type
 

GLint _mesa_image_row_stride const struct gl_pixelstore_attrib   packing,
GLint    width,
GLenum    format,
GLenum    type
 

Compute the stride between image rows.

Parameters:
packing  the pixelstore attributes
width  image width.
format  pixel format.
type  pixel data type.
Returns:
the stride in bytes for the given parameters.
Computes the number of bytes per pixel and row and compensates for alignment.

See also:
gl_pixelstore_attrib.

GLboolean _mesa_is_legal_format_and_type GLcontext   ctx,
GLenum    format,
GLenum    type
 

Test for a legal pixel format and type.

Parameters:
format  pixel format.
type  pixel type.
Returns:
GL_TRUE if the given pixel format and type are legal, or GL_FALSE otherwise.

void _mesa_pack_bitmap GLint    width,
GLint    height,
const GLubyte *    source,
GLubyte *    dest,
const struct gl_pixelstore_attrib   packing
 

void _mesa_pack_depth_span const GLcontext   ctx,
GLuint    n,
GLvoid *    dest,
GLenum    dstType,
const GLfloat *    depthSpan,
const struct gl_pixelstore_attrib   dstPacking
 

void _mesa_pack_index_span const GLcontext   ctx,
GLuint    n,
GLenum    dstType,
GLvoid *    dest,
const GLuint *    source,
const struct gl_pixelstore_attrib   dstPacking,
GLuint    transferOps
 

void _mesa_pack_polygon_stipple const GLuint    pattern[32],
GLubyte *    dest,
const struct gl_pixelstore_attrib   packing
 

void _mesa_pack_rgba_span_chan GLcontext   ctx,
GLuint    n,
CONST GLchan    rgba[][4],
GLenum    dstFormat,
GLenum    dstType,
GLvoid *    dstAddr,
const struct gl_pixelstore_attrib   dstPacking,
GLuint    transferOps
 

void _mesa_pack_rgba_span_float GLcontext   ctx,
GLuint    n,
CONST GLfloat    rgba[][4],
GLenum    dstFormat,
GLenum    dstType,
GLvoid *    dstAddr,
const struct gl_pixelstore_attrib   dstPacking,
GLuint    transferOps
 

void _mesa_pack_stencil_span const GLcontext   ctx,
GLuint    n,
GLenum    dstType,
GLvoid *    dest,
const GLstencil   source,
const struct gl_pixelstore_attrib   dstPacking
 

GLint _mesa_sizeof_packed_type GLenum    type
 

Same as _mesa_sizeof_type() but also accepting the packed pixel format data types.

GLint _mesa_sizeof_type GLenum    type
 

Get the size of a GL data type.

Parameters:
type  GL data type.
Returns:
the size, in bytes, of the given data type, 0 if a GL_BITMAP, or -1 if an invalid type enum.

void _mesa_swap2 GLushort *    p,
GLuint    n
 

Flip the order of the 2 bytes in each word in the given array.

Parameters:
p  array.
n  number of words.

void _mesa_swap4 GLuint *    p,
GLuint    n
 

GLvoid* _mesa_unpack_bitmap GLint    width,
GLint    height,
const GLubyte *    pixels,
const struct gl_pixelstore_attrib   packing
 

void _mesa_unpack_color_span_chan GLcontext   ctx,
GLuint    n,
GLenum    dstFormat,
GLchan    dest[],
GLenum    srcFormat,
GLenum    srcType,
const GLvoid *    source,
const struct gl_pixelstore_attrib   srcPacking,
GLuint    transferOps
 

void _mesa_unpack_color_span_float GLcontext   ctx,
GLuint    n,
GLenum    dstFormat,
GLfloat    dest[],
GLenum    srcFormat,
GLenum    srcType,
const GLvoid *    source,
const struct gl_pixelstore_attrib   srcPacking,
GLuint    transferOps
 

Same as _mesa_unpack_color_span_chan(), but return GLfloat data instead of GLchan.

void _mesa_unpack_depth_span const GLcontext   ctx,
GLuint    n,
GLfloat *    dest,
GLenum    srcType,
const GLvoid *    source,
const struct gl_pixelstore_attrib   srcPacking
 

void* _mesa_unpack_image GLsizei    width,
GLsizei    height,
GLsizei    depth,
GLenum    format,
GLenum    type,
const GLvoid *    pixels,
const struct gl_pixelstore_attrib   unpack
 

Unpack image data.

Apply byte swapping, byte flipping (bitmap). Return all image data in a contiguous block. This is used when we compile glDrawPixels, glTexImage, etc into a display list. We need a copy of the data in a standard format.

void _mesa_unpack_index_span const GLcontext   ctx,
GLuint    n,
GLenum    dstType,
GLvoid *    dest,
GLenum    srcType,
const GLvoid *    source,
const struct gl_pixelstore_attrib   srcPacking,
GLuint    transferOps
 

void _mesa_unpack_polygon_stipple const GLubyte *    pattern,
GLuint    dest[32],
const struct gl_pixelstore_attrib   unpacking
 

void _mesa_unpack_stencil_span const GLcontext   ctx,
GLuint    n,
GLenum    dstType,
GLvoid *    dest,
GLenum    srcType,
const GLvoid *    source,
const struct gl_pixelstore_attrib   srcPacking,
GLuint    transferOps
 


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