pack.h revision 3464ebd5
13464ebd5Sriastradh/*
23464ebd5Sriastradh * Mesa 3-D graphics library
33464ebd5Sriastradh *
43464ebd5Sriastradh * Copyright (C) 1999-2008  Brian Paul   All Rights Reserved.
53464ebd5Sriastradh * Copyright (C) 1999-2010  VMware, Inc.  All Rights Reserved.
63464ebd5Sriastradh *
73464ebd5Sriastradh * Permission is hereby granted, free of charge, to any person obtaining a
83464ebd5Sriastradh * copy of this software and associated documentation files (the "Software"),
93464ebd5Sriastradh * to deal in the Software without restriction, including without limitation
103464ebd5Sriastradh * the rights to use, copy, modify, merge, publish, distribute, sublicense,
113464ebd5Sriastradh * and/or sell copies of the Software, and to permit persons to whom the
123464ebd5Sriastradh * Software is furnished to do so, subject to the following conditions:
133464ebd5Sriastradh *
143464ebd5Sriastradh * The above copyright notice and this permission notice shall be included
153464ebd5Sriastradh * in all copies or substantial portions of the Software.
163464ebd5Sriastradh *
173464ebd5Sriastradh * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
183464ebd5Sriastradh * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
193464ebd5Sriastradh * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
203464ebd5Sriastradh * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
213464ebd5Sriastradh * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
223464ebd5Sriastradh * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
233464ebd5Sriastradh */
243464ebd5Sriastradh
253464ebd5Sriastradh
263464ebd5Sriastradh#ifndef PACK_H
273464ebd5Sriastradh#define PACK_H
283464ebd5Sriastradh
293464ebd5Sriastradh
303464ebd5Sriastradh#include "mtypes.h"
313464ebd5Sriastradh
323464ebd5Sriastradh
333464ebd5Sriastradhextern void
343464ebd5Sriastradh_mesa_unpack_polygon_stipple(const GLubyte *pattern, GLuint dest[32],
353464ebd5Sriastradh                             const struct gl_pixelstore_attrib *unpacking);
363464ebd5Sriastradh
373464ebd5Sriastradh
383464ebd5Sriastradhextern void
393464ebd5Sriastradh_mesa_pack_polygon_stipple(const GLuint pattern[32], GLubyte *dest,
403464ebd5Sriastradh                           const struct gl_pixelstore_attrib *packing);
413464ebd5Sriastradh
423464ebd5Sriastradh
433464ebd5Sriastradhextern GLvoid *
443464ebd5Sriastradh_mesa_unpack_bitmap(GLint width, GLint height, const GLubyte *pixels,
453464ebd5Sriastradh                    const struct gl_pixelstore_attrib *packing);
463464ebd5Sriastradh
473464ebd5Sriastradhextern void
483464ebd5Sriastradh_mesa_pack_bitmap(GLint width, GLint height, const GLubyte *source,
493464ebd5Sriastradh                  GLubyte *dest, const struct gl_pixelstore_attrib *packing);
503464ebd5Sriastradh
513464ebd5Sriastradh
523464ebd5Sriastradhextern void
533464ebd5Sriastradh_mesa_pack_rgba_span_float(struct gl_context *ctx, GLuint n,
543464ebd5Sriastradh                           GLfloat rgba[][4],
553464ebd5Sriastradh                           GLenum dstFormat, GLenum dstType, GLvoid *dstAddr,
563464ebd5Sriastradh                           const struct gl_pixelstore_attrib *dstPacking,
573464ebd5Sriastradh                           GLbitfield transferOps);
583464ebd5Sriastradh
593464ebd5Sriastradh
603464ebd5Sriastradhextern void
613464ebd5Sriastradh_mesa_unpack_color_span_chan(struct gl_context *ctx,
623464ebd5Sriastradh                             GLuint n, GLenum dstFormat, GLchan dest[],
633464ebd5Sriastradh                             GLenum srcFormat, GLenum srcType,
643464ebd5Sriastradh                             const GLvoid *source,
653464ebd5Sriastradh                             const struct gl_pixelstore_attrib *srcPacking,
663464ebd5Sriastradh                             GLbitfield transferOps);
673464ebd5Sriastradh
683464ebd5Sriastradh
693464ebd5Sriastradhextern void
703464ebd5Sriastradh_mesa_unpack_color_span_float(struct gl_context *ctx,
713464ebd5Sriastradh                              GLuint n, GLenum dstFormat, GLfloat dest[],
723464ebd5Sriastradh                              GLenum srcFormat, GLenum srcType,
733464ebd5Sriastradh                              const GLvoid *source,
743464ebd5Sriastradh                              const struct gl_pixelstore_attrib *srcPacking,
753464ebd5Sriastradh                              GLbitfield transferOps);
763464ebd5Sriastradh
773464ebd5Sriastradhextern void
783464ebd5Sriastradh_mesa_unpack_color_span_uint(struct gl_context *ctx,
793464ebd5Sriastradh                             GLuint n, GLenum dstFormat, GLuint *dest,
803464ebd5Sriastradh                             GLenum srcFormat, GLenum srcType,
813464ebd5Sriastradh                             const GLvoid *source,
823464ebd5Sriastradh                             const struct gl_pixelstore_attrib *srcPacking);
833464ebd5Sriastradh
843464ebd5Sriastradhextern void
853464ebd5Sriastradh_mesa_unpack_dudv_span_byte(struct gl_context *ctx,
863464ebd5Sriastradh                            GLuint n, GLenum dstFormat, GLbyte dest[],
873464ebd5Sriastradh                            GLenum srcFormat, GLenum srcType,
883464ebd5Sriastradh                            const GLvoid *source,
893464ebd5Sriastradh                            const struct gl_pixelstore_attrib *srcPacking,
903464ebd5Sriastradh                            GLbitfield transferOps);
913464ebd5Sriastradh
923464ebd5Sriastradhextern void
933464ebd5Sriastradh_mesa_unpack_index_span(struct gl_context *ctx, GLuint n,
943464ebd5Sriastradh                        GLenum dstType, GLvoid *dest,
953464ebd5Sriastradh                        GLenum srcType, const GLvoid *source,
963464ebd5Sriastradh                        const struct gl_pixelstore_attrib *srcPacking,
973464ebd5Sriastradh                        GLbitfield transferOps);
983464ebd5Sriastradh
993464ebd5Sriastradh
1003464ebd5Sriastradhextern void
1013464ebd5Sriastradh_mesa_pack_index_span(struct gl_context *ctx, GLuint n,
1023464ebd5Sriastradh                      GLenum dstType, GLvoid *dest, const GLuint *source,
1033464ebd5Sriastradh                      const struct gl_pixelstore_attrib *dstPacking,
1043464ebd5Sriastradh                      GLbitfield transferOps);
1053464ebd5Sriastradh
1063464ebd5Sriastradh
1073464ebd5Sriastradhextern void
1083464ebd5Sriastradh_mesa_unpack_stencil_span(struct gl_context *ctx, GLuint n,
1093464ebd5Sriastradh                          GLenum dstType, GLvoid *dest,
1103464ebd5Sriastradh                          GLenum srcType, const GLvoid *source,
1113464ebd5Sriastradh                          const struct gl_pixelstore_attrib *srcPacking,
1123464ebd5Sriastradh                          GLbitfield transferOps);
1133464ebd5Sriastradh
1143464ebd5Sriastradhextern void
1153464ebd5Sriastradh_mesa_pack_stencil_span(struct gl_context *ctx, GLuint n,
1163464ebd5Sriastradh                        GLenum dstType, GLvoid *dest, const GLstencil *source,
1173464ebd5Sriastradh                        const struct gl_pixelstore_attrib *dstPacking);
1183464ebd5Sriastradh
1193464ebd5Sriastradh
1203464ebd5Sriastradhextern void
1213464ebd5Sriastradh_mesa_unpack_depth_span(struct gl_context *ctx, GLuint n,
1223464ebd5Sriastradh                        GLenum dstType, GLvoid *dest, GLuint depthMax,
1233464ebd5Sriastradh                        GLenum srcType, const GLvoid *source,
1243464ebd5Sriastradh                        const struct gl_pixelstore_attrib *srcPacking);
1253464ebd5Sriastradh
1263464ebd5Sriastradhextern void
1273464ebd5Sriastradh_mesa_pack_depth_span(struct gl_context *ctx, GLuint n, GLvoid *dest,
1283464ebd5Sriastradh                      GLenum dstType, const GLfloat *depthSpan,
1293464ebd5Sriastradh                      const struct gl_pixelstore_attrib *dstPacking);
1303464ebd5Sriastradh
1313464ebd5Sriastradh
1323464ebd5Sriastradhextern void
1333464ebd5Sriastradh_mesa_pack_depth_stencil_span(struct gl_context *ctx,
1343464ebd5Sriastradh                              GLuint n, GLuint *dest,
1353464ebd5Sriastradh                              const GLfloat *depthVals,
1363464ebd5Sriastradh                              const GLstencil *stencilVals,
1373464ebd5Sriastradh                              const struct gl_pixelstore_attrib *dstPacking);
1383464ebd5Sriastradh
1393464ebd5Sriastradh
1403464ebd5Sriastradhextern void *
1413464ebd5Sriastradh_mesa_unpack_image(GLuint dimensions,
1423464ebd5Sriastradh                   GLsizei width, GLsizei height, GLsizei depth,
1433464ebd5Sriastradh                   GLenum format, GLenum type, const GLvoid *pixels,
1443464ebd5Sriastradh                   const struct gl_pixelstore_attrib *unpack);
1453464ebd5Sriastradh
1463464ebd5Sriastradh
1473464ebd5Sriastradh#endif
148