Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
4358 Serge 1
/*
2
 * Mesa 3-D graphics library
3
 *
4
 * Copyright (C) 1999-2006  Brian Paul   All Rights Reserved.
5
 * Copyright (c) 2008 VMware, Inc.
6
 *
7
 * Permission is hereby granted, free of charge, to any person obtaining a
8
 * copy of this software and associated documentation files (the "Software"),
9
 * to deal in the Software without restriction, including without limitation
10
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11
 * and/or sell copies of the Software, and to permit persons to whom the
12
 * Software is furnished to do so, subject to the following conditions:
13
 *
14
 * The above copyright notice and this permission notice shall be included
15
 * in all copies or substantial portions of the Software.
16
 *
17
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18
 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
20
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21
 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22
 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23
 * 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 dstRowStride, \
62
        GLubyte **dstSlices, \
63
	GLint srcWidth, GLint srcHeight, GLint srcDepth, \
64
	GLenum srcFormat, GLenum srcType, \
65
	const GLvoid *srcAddr, \
66
	const struct gl_pixelstore_attrib *srcPacking
67
 
68
 
69
extern GLboolean
70
_mesa_texstore(TEXSTORE_PARAMS);
71
 
72
extern GLboolean
73
_mesa_texstore_needs_transfer_ops(struct gl_context *ctx,
74
                                  GLenum baseInternalFormat,
75
                                  gl_format dstFormat);
76
 
77
extern GLboolean
78
_mesa_texstore_can_use_memcpy(struct gl_context *ctx,
79
                              GLenum baseInternalFormat, gl_format dstFormat,
80
                              GLenum srcFormat, GLenum srcType,
81
                              const struct gl_pixelstore_attrib *srcPacking);
82
 
83
 
84
extern GLubyte *
85
_mesa_make_temp_ubyte_image(struct gl_context *ctx, GLuint dims,
86
                           GLenum logicalBaseFormat,
87
                           GLenum textureBaseFormat,
88
                           GLint srcWidth, GLint srcHeight, GLint srcDepth,
89
                           GLenum srcFormat, GLenum srcType,
90
                           const GLvoid *srcAddr,
91
                           const struct gl_pixelstore_attrib *srcPacking);
92
 
93
GLfloat *
94
_mesa_make_temp_float_image(struct gl_context *ctx, GLuint dims,
95
			    GLenum logicalBaseFormat,
96
			    GLenum textureBaseFormat,
97
			    GLint srcWidth, GLint srcHeight, GLint srcDepth,
98
			    GLenum srcFormat, GLenum srcType,
99
			    const GLvoid *srcAddr,
100
			    const struct gl_pixelstore_attrib *srcPacking,
101
			    GLbitfield transferOps);
102
 
103
extern void
104
_mesa_store_teximage(struct gl_context *ctx,
105
                     GLuint dims,
106
                     struct gl_texture_image *texImage,
107
                     GLenum format, GLenum type, const GLvoid *pixels,
108
                     const struct gl_pixelstore_attrib *packing);
109
 
110
 
111
extern void
112
_mesa_store_texsubimage(struct gl_context *ctx, GLuint dims,
113
                        struct gl_texture_image *texImage,
114
                        GLint xoffset, GLint yoffset, GLint zoffset,
115
                        GLint width, GLint height, GLint depth,
116
                        GLenum format, GLenum type, const GLvoid *pixels,
117
                        const struct gl_pixelstore_attrib *packing);
118
 
119
 
120
extern void
121
_mesa_store_compressed_teximage(struct gl_context *ctx, GLuint dims,
122
                                struct gl_texture_image *texImage,
123
                                GLsizei imageSize, const GLvoid *data);
124
 
125
 
126
extern void
127
_mesa_store_compressed_texsubimage(struct gl_context *ctx, GLuint dims,
128
                                   struct gl_texture_image *texImage,
129
                                   GLint xoffset, GLint yoffset, GLint zoffset,
130
                                   GLsizei width, GLsizei height, GLsizei depth,
131
                                   GLenum format,
132
                                   GLsizei imageSize, const GLvoid *data);
133
 
134
 
135
#endif