1/*
2 * Mesa 3-D graphics library
3 *
4 * Copyright (c) 2011 VMware, Inc.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included
14 * in all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
19 * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
20 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 */
23
24
25#ifndef FORMAT_PACK_H
26#define FORMAT_PACK_H
27
28
29#include "formats.h"
30
31
32/** Pack a GLubyte rgba[4] color to dest address */
33typedef void (*gl_pack_ubyte_rgba_func)(const GLubyte src[4], void *dst);
34
35/** Pack a GLfloat rgba[4] color to dest address */
36typedef void (*gl_pack_float_rgba_func)(const GLfloat src[4], void *dst);
37
38/** Pack a GLfloat Z value to dest address */
39typedef void (*gl_pack_float_z_func)(const GLfloat *src, void *dst);
40
41/** Pack a GLuint Z value to dest address */
42typedef void (*gl_pack_uint_z_func)(const GLuint *src, void *dst);
43
44/** Pack a GLubyte stencil value to dest address */
45typedef void (*gl_pack_ubyte_stencil_func)(const GLubyte *src, void *dst);
46
47
48
49
50extern gl_pack_ubyte_rgba_func
51_mesa_get_pack_ubyte_rgba_function(gl_format format);
52
53
54extern gl_pack_float_rgba_func
55_mesa_get_pack_float_rgba_function(gl_format format);
56
57
58extern gl_pack_float_z_func
59_mesa_get_pack_float_z_func(gl_format format);
60
61
62extern gl_pack_uint_z_func
63_mesa_get_pack_uint_z_func(gl_format format);
64
65
66extern gl_pack_ubyte_stencil_func
67_mesa_get_pack_ubyte_stencil_func(gl_format format);
68
69
70
71extern void
72_mesa_pack_float_rgba_row(gl_format format, GLuint n,
73                          const GLfloat src[][4], void *dst);
74
75extern void
76_mesa_pack_ubyte_rgba_row(gl_format format, GLuint n,
77                          const GLubyte src[][4], void *dst);
78
79
80extern void
81_mesa_pack_ubyte_rgba_rect(gl_format format, GLuint width, GLuint height,
82                           const GLubyte *src, GLint srcRowStride,
83                           void *dst, GLint dstRowStride);
84
85extern void
86_mesa_pack_float_z_row(gl_format format, GLuint n,
87                       const GLfloat *src, void *dst);
88
89extern void
90_mesa_pack_uint_z_row(gl_format format, GLuint n,
91                      const GLuint *src, void *dst);
92
93extern void
94_mesa_pack_ubyte_stencil_row(gl_format format, GLuint n,
95                             const GLubyte *src, void *dst);
96
97extern void
98_mesa_pack_uint_24_8_depth_stencil_row(gl_format format, GLuint n,
99                                       const GLuint *src, void *dst);
100
101
102extern void
103_mesa_pack_colormask(gl_format format, const GLubyte colorMask[4], void *dst);
104
105#endif
106