image.h revision af69d88d
17117f1b4Smrg/* 27117f1b4Smrg * Mesa 3-D graphics library 37117f1b4Smrg * 4c1f859d4Smrg * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. 57117f1b4Smrg * 67117f1b4Smrg * Permission is hereby granted, free of charge, to any person obtaining a 77117f1b4Smrg * copy of this software and associated documentation files (the "Software"), 87117f1b4Smrg * to deal in the Software without restriction, including without limitation 97117f1b4Smrg * the rights to use, copy, modify, merge, publish, distribute, sublicense, 107117f1b4Smrg * and/or sell copies of the Software, and to permit persons to whom the 117117f1b4Smrg * Software is furnished to do so, subject to the following conditions: 127117f1b4Smrg * 137117f1b4Smrg * The above copyright notice and this permission notice shall be included 147117f1b4Smrg * in all copies or substantial portions of the Software. 157117f1b4Smrg * 167117f1b4Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 177117f1b4Smrg * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 187117f1b4Smrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 19af69d88dSmrg * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20af69d88dSmrg * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21af69d88dSmrg * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22af69d88dSmrg * OTHER DEALINGS IN THE SOFTWARE. 237117f1b4Smrg */ 247117f1b4Smrg 257117f1b4Smrg 267117f1b4Smrg#ifndef IMAGE_H 277117f1b4Smrg#define IMAGE_H 287117f1b4Smrg 297117f1b4Smrg 303464ebd5Sriastradh#include "glheader.h" 317117f1b4Smrg 323464ebd5Sriastradhstruct gl_context; 333464ebd5Sriastradhstruct gl_pixelstore_attrib; 347117f1b4Smrg 357117f1b4Smrgextern void 367117f1b4Smrg_mesa_swap2( GLushort *p, GLuint n ); 377117f1b4Smrg 387117f1b4Smrgextern void 397117f1b4Smrg_mesa_swap4( GLuint *p, GLuint n ); 407117f1b4Smrg 41af69d88dSmrgextern GLintptr 42af69d88dSmrg_mesa_image_offset( GLuint dimensions, 43af69d88dSmrg const struct gl_pixelstore_attrib *packing, 44af69d88dSmrg GLsizei width, GLsizei height, 45af69d88dSmrg GLenum format, GLenum type, 46af69d88dSmrg GLint img, GLint row, GLint column ); 477117f1b4Smrg 487117f1b4Smrgextern GLvoid * 497117f1b4Smrg_mesa_image_address( GLuint dimensions, 507117f1b4Smrg const struct gl_pixelstore_attrib *packing, 517117f1b4Smrg const GLvoid *image, 527117f1b4Smrg GLsizei width, GLsizei height, 537117f1b4Smrg GLenum format, GLenum type, 547117f1b4Smrg GLint img, GLint row, GLint column ); 557117f1b4Smrg 567117f1b4Smrgextern GLvoid * 577117f1b4Smrg_mesa_image_address1d( const struct gl_pixelstore_attrib *packing, 587117f1b4Smrg const GLvoid *image, 597117f1b4Smrg GLsizei width, 607117f1b4Smrg GLenum format, GLenum type, 617117f1b4Smrg GLint column ); 627117f1b4Smrg 637117f1b4Smrgextern GLvoid * 647117f1b4Smrg_mesa_image_address2d( const struct gl_pixelstore_attrib *packing, 657117f1b4Smrg const GLvoid *image, 667117f1b4Smrg GLsizei width, GLsizei height, 677117f1b4Smrg GLenum format, GLenum type, 687117f1b4Smrg GLint row, GLint column ); 697117f1b4Smrg 707117f1b4Smrgextern GLvoid * 717117f1b4Smrg_mesa_image_address3d( const struct gl_pixelstore_attrib *packing, 727117f1b4Smrg const GLvoid *image, 737117f1b4Smrg GLsizei width, GLsizei height, 747117f1b4Smrg GLenum format, GLenum type, 757117f1b4Smrg GLint img, GLint row, GLint column ); 767117f1b4Smrg 777117f1b4Smrg 787117f1b4Smrgextern GLint 797117f1b4Smrg_mesa_image_row_stride( const struct gl_pixelstore_attrib *packing, 807117f1b4Smrg GLint width, GLenum format, GLenum type ); 817117f1b4Smrg 827117f1b4Smrg 837117f1b4Smrgextern GLint 847117f1b4Smrg_mesa_image_image_stride( const struct gl_pixelstore_attrib *packing, 857117f1b4Smrg GLint width, GLint height, 867117f1b4Smrg GLenum format, GLenum type ); 877117f1b4Smrg 887117f1b4Smrg 894a49301eSmrgextern void 904a49301eSmrg_mesa_expand_bitmap(GLsizei width, GLsizei height, 914a49301eSmrg const struct gl_pixelstore_attrib *unpack, 924a49301eSmrg const GLubyte *bitmap, 934a49301eSmrg GLubyte *destBuffer, GLint destStride, 944a49301eSmrg GLubyte onValue); 954a49301eSmrg 967117f1b4Smrg 977117f1b4Smrgextern void 987117f1b4Smrg_mesa_convert_colors(GLenum srcType, const GLvoid *src, 997117f1b4Smrg GLenum dstType, GLvoid *dst, 1007117f1b4Smrg GLuint count, const GLubyte mask[]); 1017117f1b4Smrg 1027117f1b4Smrg 1037117f1b4Smrgextern GLboolean 1043464ebd5Sriastradh_mesa_clip_drawpixels(const struct gl_context *ctx, 1057117f1b4Smrg GLint *destX, GLint *destY, 1067117f1b4Smrg GLsizei *width, GLsizei *height, 1077117f1b4Smrg struct gl_pixelstore_attrib *unpack); 1087117f1b4Smrg 1097117f1b4Smrg 1107117f1b4Smrgextern GLboolean 1113464ebd5Sriastradh_mesa_clip_readpixels(const struct gl_context *ctx, 112cdc920a0Smrg GLint *srcX, GLint *srcY, 1137117f1b4Smrg GLsizei *width, GLsizei *height, 1147117f1b4Smrg struct gl_pixelstore_attrib *pack); 1157117f1b4Smrg 116c1f859d4Smrgextern GLboolean 1173464ebd5Sriastradh_mesa_clip_copytexsubimage(const struct gl_context *ctx, 118c1f859d4Smrg GLint *destX, GLint *destY, 119c1f859d4Smrg GLint *srcX, GLint *srcY, 120c1f859d4Smrg GLsizei *width, GLsizei *height); 121c1f859d4Smrg 1227117f1b4Smrgextern GLboolean 1237117f1b4Smrg_mesa_clip_to_region(GLint xmin, GLint ymin, 1247117f1b4Smrg GLint xmax, GLint ymax, 1257117f1b4Smrg GLint *x, GLint *y, 1267117f1b4Smrg GLsizei *width, GLsizei *height ); 1277117f1b4Smrg 1284a49301eSmrgextern GLboolean 1293464ebd5Sriastradh_mesa_clip_blit(struct gl_context *ctx, 1304a49301eSmrg GLint *srcX0, GLint *srcY0, GLint *srcX1, GLint *srcY1, 1314a49301eSmrg GLint *dstX0, GLint *dstY0, GLint *dstX1, GLint *dstY1); 1324a49301eSmrg 1334a49301eSmrg 1347117f1b4Smrg#endif 135