pack.h revision af69d88d
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
20af69d88dSmrg * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21af69d88dSmrg * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22af69d88dSmrg * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23af69d88dSmrg * OTHER DEALINGS IN THE SOFTWARE.
243464ebd5Sriastradh */
253464ebd5Sriastradh
263464ebd5Sriastradh
273464ebd5Sriastradh#ifndef PACK_H
283464ebd5Sriastradh#define PACK_H
293464ebd5Sriastradh
303464ebd5Sriastradh
313464ebd5Sriastradh#include "mtypes.h"
323464ebd5Sriastradh
333464ebd5Sriastradh
343464ebd5Sriastradhextern void
353464ebd5Sriastradh_mesa_unpack_polygon_stipple(const GLubyte *pattern, GLuint dest[32],
363464ebd5Sriastradh                             const struct gl_pixelstore_attrib *unpacking);
373464ebd5Sriastradh
383464ebd5Sriastradh
393464ebd5Sriastradhextern void
403464ebd5Sriastradh_mesa_pack_polygon_stipple(const GLuint pattern[32], GLubyte *dest,
413464ebd5Sriastradh                           const struct gl_pixelstore_attrib *packing);
423464ebd5Sriastradh
433464ebd5Sriastradh
443464ebd5Sriastradhextern GLvoid *
453464ebd5Sriastradh_mesa_unpack_bitmap(GLint width, GLint height, const GLubyte *pixels,
463464ebd5Sriastradh                    const struct gl_pixelstore_attrib *packing);
473464ebd5Sriastradh
483464ebd5Sriastradhextern void
493464ebd5Sriastradh_mesa_pack_bitmap(GLint width, GLint height, const GLubyte *source,
503464ebd5Sriastradh                  GLubyte *dest, const struct gl_pixelstore_attrib *packing);
513464ebd5Sriastradh
523464ebd5Sriastradh
533464ebd5Sriastradhextern void
543464ebd5Sriastradh_mesa_pack_rgba_span_float(struct gl_context *ctx, GLuint n,
553464ebd5Sriastradh                           GLfloat rgba[][4],
563464ebd5Sriastradh                           GLenum dstFormat, GLenum dstType, GLvoid *dstAddr,
573464ebd5Sriastradh                           const struct gl_pixelstore_attrib *dstPacking,
583464ebd5Sriastradh                           GLbitfield transferOps);
593464ebd5Sriastradh
603464ebd5Sriastradh
613464ebd5Sriastradhextern void
62af69d88dSmrg_mesa_unpack_color_span_ubyte(struct gl_context *ctx,
63af69d88dSmrg                             GLuint n, GLenum dstFormat, GLubyte dest[],
643464ebd5Sriastradh                             GLenum srcFormat, GLenum srcType,
653464ebd5Sriastradh                             const GLvoid *source,
663464ebd5Sriastradh                             const struct gl_pixelstore_attrib *srcPacking,
673464ebd5Sriastradh                             GLbitfield transferOps);
683464ebd5Sriastradh
693464ebd5Sriastradh
703464ebd5Sriastradhextern void
713464ebd5Sriastradh_mesa_unpack_color_span_float(struct gl_context *ctx,
723464ebd5Sriastradh                              GLuint n, GLenum dstFormat, GLfloat dest[],
733464ebd5Sriastradh                              GLenum srcFormat, GLenum srcType,
743464ebd5Sriastradh                              const GLvoid *source,
753464ebd5Sriastradh                              const struct gl_pixelstore_attrib *srcPacking,
763464ebd5Sriastradh                              GLbitfield transferOps);
773464ebd5Sriastradh
783464ebd5Sriastradhextern void
793464ebd5Sriastradh_mesa_unpack_color_span_uint(struct gl_context *ctx,
803464ebd5Sriastradh                             GLuint n, GLenum dstFormat, GLuint *dest,
813464ebd5Sriastradh                             GLenum srcFormat, GLenum srcType,
823464ebd5Sriastradh                             const GLvoid *source,
833464ebd5Sriastradh                             const struct gl_pixelstore_attrib *srcPacking);
843464ebd5Sriastradh
853464ebd5Sriastradhextern void
863464ebd5Sriastradh_mesa_unpack_index_span(struct gl_context *ctx, GLuint n,
873464ebd5Sriastradh                        GLenum dstType, GLvoid *dest,
883464ebd5Sriastradh                        GLenum srcType, const GLvoid *source,
893464ebd5Sriastradh                        const struct gl_pixelstore_attrib *srcPacking,
903464ebd5Sriastradh                        GLbitfield transferOps);
913464ebd5Sriastradh
923464ebd5Sriastradh
933464ebd5Sriastradhextern void
943464ebd5Sriastradh_mesa_pack_index_span(struct gl_context *ctx, GLuint n,
953464ebd5Sriastradh                      GLenum dstType, GLvoid *dest, const GLuint *source,
963464ebd5Sriastradh                      const struct gl_pixelstore_attrib *dstPacking,
973464ebd5Sriastradh                      GLbitfield transferOps);
983464ebd5Sriastradh
993464ebd5Sriastradh
1003464ebd5Sriastradhextern void
1013464ebd5Sriastradh_mesa_unpack_stencil_span(struct gl_context *ctx, GLuint n,
1023464ebd5Sriastradh                          GLenum dstType, GLvoid *dest,
1033464ebd5Sriastradh                          GLenum srcType, const GLvoid *source,
1043464ebd5Sriastradh                          const struct gl_pixelstore_attrib *srcPacking,
1053464ebd5Sriastradh                          GLbitfield transferOps);
1063464ebd5Sriastradh
1073464ebd5Sriastradhextern void
1083464ebd5Sriastradh_mesa_pack_stencil_span(struct gl_context *ctx, GLuint n,
109af69d88dSmrg                        GLenum dstType, GLvoid *dest, const GLubyte *source,
1103464ebd5Sriastradh                        const struct gl_pixelstore_attrib *dstPacking);
1113464ebd5Sriastradh
1123464ebd5Sriastradh
1133464ebd5Sriastradhextern void
1143464ebd5Sriastradh_mesa_unpack_depth_span(struct gl_context *ctx, GLuint n,
1153464ebd5Sriastradh                        GLenum dstType, GLvoid *dest, GLuint depthMax,
1163464ebd5Sriastradh                        GLenum srcType, const GLvoid *source,
1173464ebd5Sriastradh                        const struct gl_pixelstore_attrib *srcPacking);
1183464ebd5Sriastradh
1193464ebd5Sriastradhextern void
1203464ebd5Sriastradh_mesa_pack_depth_span(struct gl_context *ctx, GLuint n, GLvoid *dest,
1213464ebd5Sriastradh                      GLenum dstType, const GLfloat *depthSpan,
1223464ebd5Sriastradh                      const struct gl_pixelstore_attrib *dstPacking);
1233464ebd5Sriastradh
1243464ebd5Sriastradh
1253464ebd5Sriastradhextern void
126af69d88dSmrg_mesa_pack_depth_stencil_span(struct gl_context *ctx,GLuint n,
127af69d88dSmrg                              GLenum dstType, GLuint *dest,
1283464ebd5Sriastradh                              const GLfloat *depthVals,
129af69d88dSmrg                              const GLubyte *stencilVals,
1303464ebd5Sriastradh                              const struct gl_pixelstore_attrib *dstPacking);
1313464ebd5Sriastradh
1323464ebd5Sriastradh
1333464ebd5Sriastradhextern void *
1343464ebd5Sriastradh_mesa_unpack_image(GLuint dimensions,
1353464ebd5Sriastradh                   GLsizei width, GLsizei height, GLsizei depth,
1363464ebd5Sriastradh                   GLenum format, GLenum type, const GLvoid *pixels,
1373464ebd5Sriastradh                   const struct gl_pixelstore_attrib *unpack);
1383464ebd5Sriastradh
1393464ebd5Sriastradh
140af69d88dSmrgvoid
141af69d88dSmrg_mesa_pack_rgba_span_from_uints(struct gl_context *ctx, GLuint n, GLuint rgba[][4],
142af69d88dSmrg                                GLenum dstFormat, GLenum dstType,
143af69d88dSmrg                                GLvoid *dstAddr);
144af69d88dSmrg
145af69d88dSmrg
146af69d88dSmrgvoid
147af69d88dSmrg_mesa_pack_rgba_span_from_ints(struct gl_context *ctx, GLuint n, GLint rgba[][4],
148af69d88dSmrg                               GLenum dstFormat, GLenum dstType,
149af69d88dSmrg                               GLvoid *dstAddr);
150af69d88dSmrg
151af69d88dSmrg
152af69d88dSmrgextern void
153af69d88dSmrg_mesa_rebase_rgba_float(GLuint n, GLfloat rgba[][4], GLenum baseFormat);
154af69d88dSmrg
155af69d88dSmrgextern void
156af69d88dSmrg_mesa_rebase_rgba_uint(GLuint n, GLuint rgba[][4], GLenum baseFormat);
157af69d88dSmrg
1583464ebd5Sriastradh#endif
159