11c131752c3e07ef91f49d4970dafca6d26585334Brian Paul/*
21c131752c3e07ef91f49d4970dafca6d26585334Brian Paul * Mesa 3-D graphics library
31c131752c3e07ef91f49d4970dafca6d26585334Brian Paul *
41c131752c3e07ef91f49d4970dafca6d26585334Brian Paul * Copyright (C) 1999-2008  Brian Paul   All Rights Reserved.
51c131752c3e07ef91f49d4970dafca6d26585334Brian Paul * Copyright (C) 1999-2010  VMware, Inc.  All Rights Reserved.
61c131752c3e07ef91f49d4970dafca6d26585334Brian Paul *
71c131752c3e07ef91f49d4970dafca6d26585334Brian Paul * Permission is hereby granted, free of charge, to any person obtaining a
81c131752c3e07ef91f49d4970dafca6d26585334Brian Paul * copy of this software and associated documentation files (the "Software"),
91c131752c3e07ef91f49d4970dafca6d26585334Brian Paul * to deal in the Software without restriction, including without limitation
101c131752c3e07ef91f49d4970dafca6d26585334Brian Paul * the rights to use, copy, modify, merge, publish, distribute, sublicense,
111c131752c3e07ef91f49d4970dafca6d26585334Brian Paul * and/or sell copies of the Software, and to permit persons to whom the
121c131752c3e07ef91f49d4970dafca6d26585334Brian Paul * Software is furnished to do so, subject to the following conditions:
131c131752c3e07ef91f49d4970dafca6d26585334Brian Paul *
141c131752c3e07ef91f49d4970dafca6d26585334Brian Paul * The above copyright notice and this permission notice shall be included
151c131752c3e07ef91f49d4970dafca6d26585334Brian Paul * in all copies or substantial portions of the Software.
161c131752c3e07ef91f49d4970dafca6d26585334Brian Paul *
171c131752c3e07ef91f49d4970dafca6d26585334Brian Paul * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
181c131752c3e07ef91f49d4970dafca6d26585334Brian Paul * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
191c131752c3e07ef91f49d4970dafca6d26585334Brian Paul * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
201c131752c3e07ef91f49d4970dafca6d26585334Brian Paul * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
211c131752c3e07ef91f49d4970dafca6d26585334Brian Paul * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
221c131752c3e07ef91f49d4970dafca6d26585334Brian Paul * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
231c131752c3e07ef91f49d4970dafca6d26585334Brian Paul */
241c131752c3e07ef91f49d4970dafca6d26585334Brian Paul
251c131752c3e07ef91f49d4970dafca6d26585334Brian Paul
261c131752c3e07ef91f49d4970dafca6d26585334Brian Paul#ifndef PACK_H
271c131752c3e07ef91f49d4970dafca6d26585334Brian Paul#define PACK_H
281c131752c3e07ef91f49d4970dafca6d26585334Brian Paul
291c131752c3e07ef91f49d4970dafca6d26585334Brian Paul
301c131752c3e07ef91f49d4970dafca6d26585334Brian Paul#include "mtypes.h"
311c131752c3e07ef91f49d4970dafca6d26585334Brian Paul
321c131752c3e07ef91f49d4970dafca6d26585334Brian Paul
331c131752c3e07ef91f49d4970dafca6d26585334Brian Paulextern void
341c131752c3e07ef91f49d4970dafca6d26585334Brian Paul_mesa_unpack_polygon_stipple(const GLubyte *pattern, GLuint dest[32],
351c131752c3e07ef91f49d4970dafca6d26585334Brian Paul                             const struct gl_pixelstore_attrib *unpacking);
361c131752c3e07ef91f49d4970dafca6d26585334Brian Paul
371c131752c3e07ef91f49d4970dafca6d26585334Brian Paul
381c131752c3e07ef91f49d4970dafca6d26585334Brian Paulextern void
391c131752c3e07ef91f49d4970dafca6d26585334Brian Paul_mesa_pack_polygon_stipple(const GLuint pattern[32], GLubyte *dest,
401c131752c3e07ef91f49d4970dafca6d26585334Brian Paul                           const struct gl_pixelstore_attrib *packing);
411c131752c3e07ef91f49d4970dafca6d26585334Brian Paul
421c131752c3e07ef91f49d4970dafca6d26585334Brian Paul
431c131752c3e07ef91f49d4970dafca6d26585334Brian Paulextern GLvoid *
441c131752c3e07ef91f49d4970dafca6d26585334Brian Paul_mesa_unpack_bitmap(GLint width, GLint height, const GLubyte *pixels,
451c131752c3e07ef91f49d4970dafca6d26585334Brian Paul                    const struct gl_pixelstore_attrib *packing);
461c131752c3e07ef91f49d4970dafca6d26585334Brian Paul
471c131752c3e07ef91f49d4970dafca6d26585334Brian Paulextern void
481c131752c3e07ef91f49d4970dafca6d26585334Brian Paul_mesa_pack_bitmap(GLint width, GLint height, const GLubyte *source,
491c131752c3e07ef91f49d4970dafca6d26585334Brian Paul                  GLubyte *dest, const struct gl_pixelstore_attrib *packing);
501c131752c3e07ef91f49d4970dafca6d26585334Brian Paul
511c131752c3e07ef91f49d4970dafca6d26585334Brian Paul
521c131752c3e07ef91f49d4970dafca6d26585334Brian Paulextern void
531c131752c3e07ef91f49d4970dafca6d26585334Brian Paul_mesa_pack_rgba_span_float(struct gl_context *ctx, GLuint n,
541c131752c3e07ef91f49d4970dafca6d26585334Brian Paul                           GLfloat rgba[][4],
551c131752c3e07ef91f49d4970dafca6d26585334Brian Paul                           GLenum dstFormat, GLenum dstType, GLvoid *dstAddr,
561c131752c3e07ef91f49d4970dafca6d26585334Brian Paul                           const struct gl_pixelstore_attrib *dstPacking,
571c131752c3e07ef91f49d4970dafca6d26585334Brian Paul                           GLbitfield transferOps);
581c131752c3e07ef91f49d4970dafca6d26585334Brian Paul
591c131752c3e07ef91f49d4970dafca6d26585334Brian Paul
601c131752c3e07ef91f49d4970dafca6d26585334Brian Paulextern void
61e1d703bec58be011636f73470e2b8a41b1363dc7Brian Paul_mesa_unpack_color_span_ubyte(struct gl_context *ctx,
62e1d703bec58be011636f73470e2b8a41b1363dc7Brian Paul                             GLuint n, GLenum dstFormat, GLubyte dest[],
631c131752c3e07ef91f49d4970dafca6d26585334Brian Paul                             GLenum srcFormat, GLenum srcType,
641c131752c3e07ef91f49d4970dafca6d26585334Brian Paul                             const GLvoid *source,
651c131752c3e07ef91f49d4970dafca6d26585334Brian Paul                             const struct gl_pixelstore_attrib *srcPacking,
661c131752c3e07ef91f49d4970dafca6d26585334Brian Paul                             GLbitfield transferOps);
671c131752c3e07ef91f49d4970dafca6d26585334Brian Paul
681c131752c3e07ef91f49d4970dafca6d26585334Brian Paul
691c131752c3e07ef91f49d4970dafca6d26585334Brian Paulextern void
701c131752c3e07ef91f49d4970dafca6d26585334Brian Paul_mesa_unpack_color_span_float(struct gl_context *ctx,
711c131752c3e07ef91f49d4970dafca6d26585334Brian Paul                              GLuint n, GLenum dstFormat, GLfloat dest[],
721c131752c3e07ef91f49d4970dafca6d26585334Brian Paul                              GLenum srcFormat, GLenum srcType,
731c131752c3e07ef91f49d4970dafca6d26585334Brian Paul                              const GLvoid *source,
741c131752c3e07ef91f49d4970dafca6d26585334Brian Paul                              const struct gl_pixelstore_attrib *srcPacking,
751c131752c3e07ef91f49d4970dafca6d26585334Brian Paul                              GLbitfield transferOps);
761c131752c3e07ef91f49d4970dafca6d26585334Brian Paul
771c131752c3e07ef91f49d4970dafca6d26585334Brian Paulextern void
78b29ca2a561621425991727f8dc2145ae21f0f3b2Brian Paul_mesa_unpack_color_span_uint(struct gl_context *ctx,
79b29ca2a561621425991727f8dc2145ae21f0f3b2Brian Paul                             GLuint n, GLenum dstFormat, GLuint *dest,
80b29ca2a561621425991727f8dc2145ae21f0f3b2Brian Paul                             GLenum srcFormat, GLenum srcType,
81b29ca2a561621425991727f8dc2145ae21f0f3b2Brian Paul                             const GLvoid *source,
82b29ca2a561621425991727f8dc2145ae21f0f3b2Brian Paul                             const struct gl_pixelstore_attrib *srcPacking);
83b29ca2a561621425991727f8dc2145ae21f0f3b2Brian Paul
84b29ca2a561621425991727f8dc2145ae21f0f3b2Brian Paulextern void
851c131752c3e07ef91f49d4970dafca6d26585334Brian Paul_mesa_unpack_dudv_span_byte(struct gl_context *ctx,
861c131752c3e07ef91f49d4970dafca6d26585334Brian Paul                            GLuint n, GLenum dstFormat, GLbyte dest[],
871c131752c3e07ef91f49d4970dafca6d26585334Brian Paul                            GLenum srcFormat, GLenum srcType,
881c131752c3e07ef91f49d4970dafca6d26585334Brian Paul                            const GLvoid *source,
891c131752c3e07ef91f49d4970dafca6d26585334Brian Paul                            const struct gl_pixelstore_attrib *srcPacking,
901c131752c3e07ef91f49d4970dafca6d26585334Brian Paul                            GLbitfield transferOps);
911c131752c3e07ef91f49d4970dafca6d26585334Brian Paul
921c131752c3e07ef91f49d4970dafca6d26585334Brian Paulextern void
9336b09b5ded84a03622a746bd6e963cec5d70c5c3Brian Paul_mesa_unpack_index_span(struct gl_context *ctx, GLuint n,
941c131752c3e07ef91f49d4970dafca6d26585334Brian Paul                        GLenum dstType, GLvoid *dest,
951c131752c3e07ef91f49d4970dafca6d26585334Brian Paul                        GLenum srcType, const GLvoid *source,
961c131752c3e07ef91f49d4970dafca6d26585334Brian Paul                        const struct gl_pixelstore_attrib *srcPacking,
971c131752c3e07ef91f49d4970dafca6d26585334Brian Paul                        GLbitfield transferOps);
981c131752c3e07ef91f49d4970dafca6d26585334Brian Paul
991c131752c3e07ef91f49d4970dafca6d26585334Brian Paul
1001c131752c3e07ef91f49d4970dafca6d26585334Brian Paulextern void
10136b09b5ded84a03622a746bd6e963cec5d70c5c3Brian Paul_mesa_pack_index_span(struct gl_context *ctx, GLuint n,
1021c131752c3e07ef91f49d4970dafca6d26585334Brian Paul                      GLenum dstType, GLvoid *dest, const GLuint *source,
1031c131752c3e07ef91f49d4970dafca6d26585334Brian Paul                      const struct gl_pixelstore_attrib *dstPacking,
1041c131752c3e07ef91f49d4970dafca6d26585334Brian Paul                      GLbitfield transferOps);
1051c131752c3e07ef91f49d4970dafca6d26585334Brian Paul
1061c131752c3e07ef91f49d4970dafca6d26585334Brian Paul
1071c131752c3e07ef91f49d4970dafca6d26585334Brian Paulextern void
10836b09b5ded84a03622a746bd6e963cec5d70c5c3Brian Paul_mesa_unpack_stencil_span(struct gl_context *ctx, GLuint n,
1091c131752c3e07ef91f49d4970dafca6d26585334Brian Paul                          GLenum dstType, GLvoid *dest,
1101c131752c3e07ef91f49d4970dafca6d26585334Brian Paul                          GLenum srcType, const GLvoid *source,
1111c131752c3e07ef91f49d4970dafca6d26585334Brian Paul                          const struct gl_pixelstore_attrib *srcPacking,
1121c131752c3e07ef91f49d4970dafca6d26585334Brian Paul                          GLbitfield transferOps);
1131c131752c3e07ef91f49d4970dafca6d26585334Brian Paul
1141c131752c3e07ef91f49d4970dafca6d26585334Brian Paulextern void
11536b09b5ded84a03622a746bd6e963cec5d70c5c3Brian Paul_mesa_pack_stencil_span(struct gl_context *ctx, GLuint n,
1166d68855df133bdd4891e8aa428787b520739e0feBrian Paul                        GLenum dstType, GLvoid *dest, const GLubyte *source,
1171c131752c3e07ef91f49d4970dafca6d26585334Brian Paul                        const struct gl_pixelstore_attrib *dstPacking);
1181c131752c3e07ef91f49d4970dafca6d26585334Brian Paul
1191c131752c3e07ef91f49d4970dafca6d26585334Brian Paul
1201c131752c3e07ef91f49d4970dafca6d26585334Brian Paulextern void
12136b09b5ded84a03622a746bd6e963cec5d70c5c3Brian Paul_mesa_unpack_depth_span(struct gl_context *ctx, GLuint n,
1221c131752c3e07ef91f49d4970dafca6d26585334Brian Paul                        GLenum dstType, GLvoid *dest, GLuint depthMax,
1231c131752c3e07ef91f49d4970dafca6d26585334Brian Paul                        GLenum srcType, const GLvoid *source,
1241c131752c3e07ef91f49d4970dafca6d26585334Brian Paul                        const struct gl_pixelstore_attrib *srcPacking);
1251c131752c3e07ef91f49d4970dafca6d26585334Brian Paul
1261c131752c3e07ef91f49d4970dafca6d26585334Brian Paulextern void
12736b09b5ded84a03622a746bd6e963cec5d70c5c3Brian Paul_mesa_pack_depth_span(struct gl_context *ctx, GLuint n, GLvoid *dest,
1281c131752c3e07ef91f49d4970dafca6d26585334Brian Paul                      GLenum dstType, const GLfloat *depthSpan,
1291c131752c3e07ef91f49d4970dafca6d26585334Brian Paul                      const struct gl_pixelstore_attrib *dstPacking);
1301c131752c3e07ef91f49d4970dafca6d26585334Brian Paul
1311c131752c3e07ef91f49d4970dafca6d26585334Brian Paul
1321c131752c3e07ef91f49d4970dafca6d26585334Brian Paulextern void
13301f48a979d85525acd060c8055ec835a1b56ea87Marek Olšák_mesa_pack_depth_stencil_span(struct gl_context *ctx,GLuint n,
13401f48a979d85525acd060c8055ec835a1b56ea87Marek Olšák                              GLenum dstType, GLuint *dest,
1351c131752c3e07ef91f49d4970dafca6d26585334Brian Paul                              const GLfloat *depthVals,
1366d68855df133bdd4891e8aa428787b520739e0feBrian Paul                              const GLubyte *stencilVals,
1371c131752c3e07ef91f49d4970dafca6d26585334Brian Paul                              const struct gl_pixelstore_attrib *dstPacking);
1381c131752c3e07ef91f49d4970dafca6d26585334Brian Paul
1391c131752c3e07ef91f49d4970dafca6d26585334Brian Paul
1401c131752c3e07ef91f49d4970dafca6d26585334Brian Paulextern void *
1411c131752c3e07ef91f49d4970dafca6d26585334Brian Paul_mesa_unpack_image(GLuint dimensions,
1421c131752c3e07ef91f49d4970dafca6d26585334Brian Paul                   GLsizei width, GLsizei height, GLsizei depth,
1431c131752c3e07ef91f49d4970dafca6d26585334Brian Paul                   GLenum format, GLenum type, const GLvoid *pixels,
1441c131752c3e07ef91f49d4970dafca6d26585334Brian Paul                   const struct gl_pixelstore_attrib *unpack);
1451c131752c3e07ef91f49d4970dafca6d26585334Brian Paul
1461c131752c3e07ef91f49d4970dafca6d26585334Brian Paul
1478f9edbad6f972792a51234715aad83c406e1845dDave Airlievoid
1487ef270867cb1f3e19067c93449e48987a32730d3Jordan Justen_mesa_pack_rgba_span_from_uints(struct gl_context *ctx, GLuint n, GLuint rgba[][4],
1497ef270867cb1f3e19067c93449e48987a32730d3Jordan Justen                                GLenum dstFormat, GLenum dstType,
1507ef270867cb1f3e19067c93449e48987a32730d3Jordan Justen                                GLvoid *dstAddr);
1517ef270867cb1f3e19067c93449e48987a32730d3Jordan Justen
1527ef270867cb1f3e19067c93449e48987a32730d3Jordan Justen
1537ef270867cb1f3e19067c93449e48987a32730d3Jordan Justenvoid
1547ef270867cb1f3e19067c93449e48987a32730d3Jordan Justen_mesa_pack_rgba_span_from_ints(struct gl_context *ctx, GLuint n, GLint rgba[][4],
1557ef270867cb1f3e19067c93449e48987a32730d3Jordan Justen                               GLenum dstFormat, GLenum dstType,
1567ef270867cb1f3e19067c93449e48987a32730d3Jordan Justen                               GLvoid *dstAddr);
1578f9edbad6f972792a51234715aad83c406e1845dDave Airlie
158774c4027651436451b3486f62b9a8903f29a715bBrian Paul
159774c4027651436451b3486f62b9a8903f29a715bBrian Paulextern void
160774c4027651436451b3486f62b9a8903f29a715bBrian Paul_mesa_rebase_rgba_float(GLuint n, GLfloat rgba[][4], GLenum baseFormat);
161774c4027651436451b3486f62b9a8903f29a715bBrian Paul
162774c4027651436451b3486f62b9a8903f29a715bBrian Paulextern void
163774c4027651436451b3486f62b9a8903f29a715bBrian Paul_mesa_rebase_rgba_uint(GLuint n, GLuint rgba[][4], GLenum baseFormat);
164774c4027651436451b3486f62b9a8903f29a715bBrian Paul
1651c131752c3e07ef91f49d4970dafca6d26585334Brian Paul#endif
166