xref: /aosp_15_r20/external/mesa3d/src/mesa/main/pack.h (revision 6104692788411f58d303aa86923a9ff6ecaded22)
1*61046927SAndroid Build Coastguard Worker /*
2*61046927SAndroid Build Coastguard Worker  * Mesa 3-D graphics library
3*61046927SAndroid Build Coastguard Worker  *
4*61046927SAndroid Build Coastguard Worker  * Copyright (C) 1999-2008  Brian Paul   All Rights Reserved.
5*61046927SAndroid Build Coastguard Worker  * Copyright (C) 1999-2010  VMware, Inc.  All Rights Reserved.
6*61046927SAndroid Build Coastguard Worker  *
7*61046927SAndroid Build Coastguard Worker  * Permission is hereby granted, free of charge, to any person obtaining a
8*61046927SAndroid Build Coastguard Worker  * copy of this software and associated documentation files (the "Software"),
9*61046927SAndroid Build Coastguard Worker  * to deal in the Software without restriction, including without limitation
10*61046927SAndroid Build Coastguard Worker  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11*61046927SAndroid Build Coastguard Worker  * and/or sell copies of the Software, and to permit persons to whom the
12*61046927SAndroid Build Coastguard Worker  * Software is furnished to do so, subject to the following conditions:
13*61046927SAndroid Build Coastguard Worker  *
14*61046927SAndroid Build Coastguard Worker  * The above copyright notice and this permission notice shall be included
15*61046927SAndroid Build Coastguard Worker  * in all copies or substantial portions of the Software.
16*61046927SAndroid Build Coastguard Worker  *
17*61046927SAndroid Build Coastguard Worker  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18*61046927SAndroid Build Coastguard Worker  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19*61046927SAndroid Build Coastguard Worker  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
20*61046927SAndroid Build Coastguard Worker  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21*61046927SAndroid Build Coastguard Worker  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22*61046927SAndroid Build Coastguard Worker  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23*61046927SAndroid Build Coastguard Worker  * OTHER DEALINGS IN THE SOFTWARE.
24*61046927SAndroid Build Coastguard Worker  */
25*61046927SAndroid Build Coastguard Worker 
26*61046927SAndroid Build Coastguard Worker 
27*61046927SAndroid Build Coastguard Worker #ifndef PACK_H
28*61046927SAndroid Build Coastguard Worker #define PACK_H
29*61046927SAndroid Build Coastguard Worker 
30*61046927SAndroid Build Coastguard Worker 
31*61046927SAndroid Build Coastguard Worker #include "util/glheader.h"
32*61046927SAndroid Build Coastguard Worker 
33*61046927SAndroid Build Coastguard Worker struct gl_context;
34*61046927SAndroid Build Coastguard Worker struct gl_pixelstore_attrib;
35*61046927SAndroid Build Coastguard Worker 
36*61046927SAndroid Build Coastguard Worker extern void
37*61046927SAndroid Build Coastguard Worker _mesa_unpack_polygon_stipple(const GLubyte *pattern, GLuint dest[32],
38*61046927SAndroid Build Coastguard Worker                              const struct gl_pixelstore_attrib *unpacking);
39*61046927SAndroid Build Coastguard Worker 
40*61046927SAndroid Build Coastguard Worker 
41*61046927SAndroid Build Coastguard Worker extern void
42*61046927SAndroid Build Coastguard Worker _mesa_pack_polygon_stipple(const GLuint pattern[32], GLubyte *dest,
43*61046927SAndroid Build Coastguard Worker                            const struct gl_pixelstore_attrib *packing);
44*61046927SAndroid Build Coastguard Worker 
45*61046927SAndroid Build Coastguard Worker 
46*61046927SAndroid Build Coastguard Worker extern void
47*61046927SAndroid Build Coastguard Worker _mesa_pack_bitmap(GLint width, GLint height, const GLubyte *source,
48*61046927SAndroid Build Coastguard Worker                   GLubyte *dest, const struct gl_pixelstore_attrib *packing);
49*61046927SAndroid Build Coastguard Worker 
50*61046927SAndroid Build Coastguard Worker 
51*61046927SAndroid Build Coastguard Worker extern void
52*61046927SAndroid Build Coastguard Worker _mesa_unpack_stencil_span(struct gl_context *ctx, GLuint n,
53*61046927SAndroid Build Coastguard Worker                           GLenum dstType, GLvoid *dest,
54*61046927SAndroid Build Coastguard Worker                           GLenum srcType, const GLvoid *source,
55*61046927SAndroid Build Coastguard Worker                           const struct gl_pixelstore_attrib *srcPacking,
56*61046927SAndroid Build Coastguard Worker                           GLbitfield transferOps);
57*61046927SAndroid Build Coastguard Worker 
58*61046927SAndroid Build Coastguard Worker extern void
59*61046927SAndroid Build Coastguard Worker _mesa_pack_stencil_span(struct gl_context *ctx, GLuint n,
60*61046927SAndroid Build Coastguard Worker                         GLenum dstType, GLvoid *dest, const GLubyte *source,
61*61046927SAndroid Build Coastguard Worker                         const struct gl_pixelstore_attrib *dstPacking);
62*61046927SAndroid Build Coastguard Worker 
63*61046927SAndroid Build Coastguard Worker 
64*61046927SAndroid Build Coastguard Worker extern void
65*61046927SAndroid Build Coastguard Worker _mesa_unpack_depth_span(struct gl_context *ctx, GLuint n,
66*61046927SAndroid Build Coastguard Worker                         GLenum dstType, GLvoid *dest, GLuint depthMax,
67*61046927SAndroid Build Coastguard Worker                         GLenum srcType, const GLvoid *source,
68*61046927SAndroid Build Coastguard Worker                         const struct gl_pixelstore_attrib *srcPacking);
69*61046927SAndroid Build Coastguard Worker 
70*61046927SAndroid Build Coastguard Worker extern void
71*61046927SAndroid Build Coastguard Worker _mesa_pack_depth_span(struct gl_context *ctx, GLuint n, GLvoid *dest,
72*61046927SAndroid Build Coastguard Worker                       GLenum dstType, const GLfloat *depthSpan,
73*61046927SAndroid Build Coastguard Worker                       const struct gl_pixelstore_attrib *dstPacking);
74*61046927SAndroid Build Coastguard Worker 
75*61046927SAndroid Build Coastguard Worker 
76*61046927SAndroid Build Coastguard Worker extern void
77*61046927SAndroid Build Coastguard Worker _mesa_pack_depth_stencil_span(struct gl_context *ctx,GLuint n,
78*61046927SAndroid Build Coastguard Worker                               GLenum dstType, GLuint *dest,
79*61046927SAndroid Build Coastguard Worker                               const GLfloat *depthVals,
80*61046927SAndroid Build Coastguard Worker                               const GLubyte *stencilVals,
81*61046927SAndroid Build Coastguard Worker                               const struct gl_pixelstore_attrib *dstPacking);
82*61046927SAndroid Build Coastguard Worker 
83*61046927SAndroid Build Coastguard Worker 
84*61046927SAndroid Build Coastguard Worker extern void *
85*61046927SAndroid Build Coastguard Worker _mesa_unpack_image(GLuint dimensions,
86*61046927SAndroid Build Coastguard Worker                    GLsizei width, GLsizei height, GLsizei depth,
87*61046927SAndroid Build Coastguard Worker                    GLenum format, GLenum type, const GLvoid *pixels,
88*61046927SAndroid Build Coastguard Worker                    const struct gl_pixelstore_attrib *unpack);
89*61046927SAndroid Build Coastguard Worker 
90*61046927SAndroid Build Coastguard Worker extern void
91*61046927SAndroid Build Coastguard Worker _mesa_pack_luminance_from_rgba_float(GLuint n, GLfloat rgba[][4],
92*61046927SAndroid Build Coastguard Worker                                      GLvoid *dstAddr, GLenum dst_format,
93*61046927SAndroid Build Coastguard Worker                                      GLbitfield transferOps);
94*61046927SAndroid Build Coastguard Worker 
95*61046927SAndroid Build Coastguard Worker extern void
96*61046927SAndroid Build Coastguard Worker _mesa_pack_luminance_from_rgba_integer(GLuint n, GLuint rgba[][4], bool rgba_is_signed,
97*61046927SAndroid Build Coastguard Worker                                        GLvoid *dstAddr, GLenum dst_format,
98*61046927SAndroid Build Coastguard Worker                                        GLenum dst_type);
99*61046927SAndroid Build Coastguard Worker 
100*61046927SAndroid Build Coastguard Worker extern GLfloat *
101*61046927SAndroid Build Coastguard Worker _mesa_unpack_color_index_to_rgba_float(struct gl_context *ctx, GLuint dims,
102*61046927SAndroid Build Coastguard Worker                                        const void *src, GLenum srcFormat, GLenum srcType,
103*61046927SAndroid Build Coastguard Worker                                        int srcWidth, int srcHeight, int srcDepth,
104*61046927SAndroid Build Coastguard Worker                                        const struct gl_pixelstore_attrib *srcPacking,
105*61046927SAndroid Build Coastguard Worker                                        GLbitfield transferOps);
106*61046927SAndroid Build Coastguard Worker 
107*61046927SAndroid Build Coastguard Worker extern GLubyte *
108*61046927SAndroid Build Coastguard Worker _mesa_unpack_color_index_to_rgba_ubyte(struct gl_context *ctx, GLuint dims,
109*61046927SAndroid Build Coastguard Worker                                        const void *src, GLenum srcFormat, GLenum srcType,
110*61046927SAndroid Build Coastguard Worker                                        int srcWidth, int srcHeight, int srcDepth,
111*61046927SAndroid Build Coastguard Worker                                        const struct gl_pixelstore_attrib *srcPacking,
112*61046927SAndroid Build Coastguard Worker                                        GLbitfield transferOps);
113*61046927SAndroid Build Coastguard Worker 
114*61046927SAndroid Build Coastguard Worker #endif
115