texstore.h revision 5253cf98057dad54e25b4b8c36f8cf24f559314c
1/* 2 * Mesa 3-D graphics library 3 * Version: 6.5.1 4 * 5 * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. 6 * Copyright (c) 2008 VMware, Inc. 7 * 8 * Permission is hereby granted, free of charge, to any person obtaining a 9 * copy of this software and associated documentation files (the "Software"), 10 * to deal in the Software without restriction, including without limitation 11 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 12 * and/or sell copies of the Software, and to permit persons to whom the 13 * Software is furnished to do so, subject to the following conditions: 14 * 15 * The above copyright notice and this permission notice shall be included 16 * in all copies or substantial portions of the Software. 17 * 18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 21 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 22 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 23 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 */ 25 26 27/** 28 * \file texstore.h 29 * Texture image storage routines. 30 * 31 * \author Brian Paul 32 */ 33 34 35#ifndef TEXSTORE_H 36#define TEXSTORE_H 37 38 39#include "mtypes.h" 40#include "formats.h" 41 42 43/** 44 * This macro defines the (many) parameters to the texstore functions. 45 * \param dims either 1 or 2 or 3 46 * \param baseInternalFormat user-specified base internal format 47 * \param dstFormat destination Mesa texture format 48 * \param dstX/Y/Zoffset destination x/y/z offset (ala TexSubImage), in texels 49 * \param dstRowStride destination image row stride, in bytes 50 * \param dstSlices array of addresses of image slices (for 3D, array texture) 51 * \param srcWidth/Height/Depth source image size, in pixels 52 * \param srcFormat incoming image format 53 * \param srcType incoming image data type 54 * \param srcAddr source image address 55 * \param srcPacking source image packing parameters 56 */ 57#define TEXSTORE_PARAMS \ 58 struct gl_context *ctx, GLuint dims, \ 59 GLenum baseInternalFormat, \ 60 gl_format dstFormat, \ 61 GLint dstXoffset, GLint dstYoffset, GLint dstZoffset, \ 62 GLint dstRowStride, \ 63 GLubyte **dstSlices, \ 64 GLint srcWidth, GLint srcHeight, GLint srcDepth, \ 65 GLenum srcFormat, GLenum srcType, \ 66 const GLvoid *srcAddr, \ 67 const struct gl_pixelstore_attrib *srcPacking 68 69 70extern GLboolean 71_mesa_texstore(TEXSTORE_PARAMS); 72 73 74extern GLubyte * 75_mesa_make_temp_ubyte_image(struct gl_context *ctx, GLuint dims, 76 GLenum logicalBaseFormat, 77 GLenum textureBaseFormat, 78 GLint srcWidth, GLint srcHeight, GLint srcDepth, 79 GLenum srcFormat, GLenum srcType, 80 const GLvoid *srcAddr, 81 const struct gl_pixelstore_attrib *srcPacking); 82 83GLfloat * 84_mesa_make_temp_float_image(struct gl_context *ctx, GLuint dims, 85 GLenum logicalBaseFormat, 86 GLenum textureBaseFormat, 87 GLint srcWidth, GLint srcHeight, GLint srcDepth, 88 GLenum srcFormat, GLenum srcType, 89 const GLvoid *srcAddr, 90 const struct gl_pixelstore_attrib *srcPacking, 91 GLbitfield transferOps); 92 93extern void 94_mesa_store_teximage1d(struct gl_context *ctx, GLenum target, GLint level, 95 GLint internalFormat, 96 GLint width, GLint border, 97 GLenum format, GLenum type, const GLvoid *pixels, 98 const struct gl_pixelstore_attrib *packing, 99 struct gl_texture_object *texObj, 100 struct gl_texture_image *texImage); 101 102 103extern void 104_mesa_store_teximage2d(struct gl_context *ctx, GLenum target, GLint level, 105 GLint internalFormat, 106 GLint width, GLint height, GLint border, 107 GLenum format, GLenum type, const GLvoid *pixels, 108 const struct gl_pixelstore_attrib *packing, 109 struct gl_texture_object *texObj, 110 struct gl_texture_image *texImage); 111 112 113extern void 114_mesa_store_teximage3d(struct gl_context *ctx, GLenum target, GLint level, 115 GLint internalFormat, 116 GLint width, GLint height, GLint depth, GLint border, 117 GLenum format, GLenum type, const GLvoid *pixels, 118 const struct gl_pixelstore_attrib *packing, 119 struct gl_texture_object *texObj, 120 struct gl_texture_image *texImage); 121 122 123extern void 124_mesa_store_texsubimage1d(struct gl_context *ctx, GLenum target, GLint level, 125 GLint xoffset, GLint width, 126 GLenum format, GLenum type, const GLvoid *pixels, 127 const struct gl_pixelstore_attrib *packing, 128 struct gl_texture_object *texObj, 129 struct gl_texture_image *texImage); 130 131 132extern void 133_mesa_store_texsubimage2d(struct gl_context *ctx, GLenum target, GLint level, 134 GLint xoffset, GLint yoffset, 135 GLint width, GLint height, 136 GLenum format, GLenum type, const GLvoid *pixels, 137 const struct gl_pixelstore_attrib *packing, 138 struct gl_texture_object *texObj, 139 struct gl_texture_image *texImage); 140 141 142extern void 143_mesa_store_texsubimage3d(struct gl_context *ctx, GLenum target, GLint level, 144 GLint xoffset, GLint yoffset, GLint zoffset, 145 GLint width, GLint height, GLint depth, 146 GLenum format, GLenum type, const GLvoid *pixels, 147 const struct gl_pixelstore_attrib *packing, 148 struct gl_texture_object *texObj, 149 struct gl_texture_image *texImage); 150 151 152extern void 153_mesa_store_compressed_teximage1d(struct gl_context *ctx, GLenum target, GLint level, 154 GLint internalFormat, 155 GLint width, GLint border, 156 GLsizei imageSize, const GLvoid *data, 157 struct gl_texture_object *texObj, 158 struct gl_texture_image *texImage); 159 160extern void 161_mesa_store_compressed_teximage2d(struct gl_context *ctx, GLenum target, GLint level, 162 GLint internalFormat, 163 GLint width, GLint height, GLint border, 164 GLsizei imageSize, const GLvoid *data, 165 struct gl_texture_object *texObj, 166 struct gl_texture_image *texImage); 167 168extern void 169_mesa_store_compressed_teximage3d(struct gl_context *ctx, GLenum target, GLint level, 170 GLint internalFormat, 171 GLint width, GLint height, GLint depth, 172 GLint border, 173 GLsizei imageSize, const GLvoid *data, 174 struct gl_texture_object *texObj, 175 struct gl_texture_image *texImage); 176 177 178extern void 179_mesa_store_compressed_texsubimage1d(struct gl_context *ctx, GLenum target, 180 GLint level, 181 GLint xoffset, GLsizei width, 182 GLenum format, 183 GLsizei imageSize, const GLvoid *data, 184 struct gl_texture_object *texObj, 185 struct gl_texture_image *texImage); 186 187extern void 188_mesa_store_compressed_texsubimage2d(struct gl_context *ctx, GLenum target, 189 GLint level, 190 GLint xoffset, GLint yoffset, 191 GLsizei width, GLsizei height, 192 GLenum format, 193 GLsizei imageSize, const GLvoid *data, 194 struct gl_texture_object *texObj, 195 struct gl_texture_image *texImage); 196 197extern void 198_mesa_store_compressed_texsubimage3d(struct gl_context *ctx, GLenum target, 199 GLint level, 200 GLint xoffset, GLint yoffset, GLint zoffset, 201 GLsizei width, GLsizei height, GLsizei depth, 202 GLenum format, 203 GLsizei imageSize, const GLvoid *data, 204 struct gl_texture_object *texObj, 205 struct gl_texture_image *texImage); 206 207 208#endif 209