1c1f859d4Smrg/*
2c1f859d4Smrg * Mesa 3-D graphics library
3c1f859d4Smrg *
4c1f859d4Smrg * Copyright (C) 1999-2008  Brian Paul   All Rights Reserved.
5c1f859d4Smrg *
6c1f859d4Smrg * Permission is hereby granted, free of charge, to any person obtaining a
7c1f859d4Smrg * copy of this software and associated documentation files (the "Software"),
8c1f859d4Smrg * to deal in the Software without restriction, including without limitation
9c1f859d4Smrg * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10c1f859d4Smrg * and/or sell copies of the Software, and to permit persons to whom the
11c1f859d4Smrg * Software is furnished to do so, subject to the following conditions:
12c1f859d4Smrg *
13c1f859d4Smrg * The above copyright notice and this permission notice shall be included
14c1f859d4Smrg * in all copies or substantial portions of the Software.
15c1f859d4Smrg *
16c1f859d4Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17c1f859d4Smrg * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18c1f859d4Smrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
19af69d88dSmrg * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20af69d88dSmrg * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21af69d88dSmrg * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22af69d88dSmrg * OTHER DEALINGS IN THE SOFTWARE.
23c1f859d4Smrg */
24c1f859d4Smrg
25c1f859d4Smrg
26c1f859d4Smrg#ifndef READPIXELS_H
27c1f859d4Smrg#define READPIXELS_H
28c1f859d4Smrg
29c1f859d4Smrg
303464ebd5Sriastradh#include "glheader.h"
31c1f859d4Smrg
323464ebd5Sriastradhstruct gl_context;
33af69d88dSmrgstruct gl_pixelstore_attrib;
34af69d88dSmrg
35c1f859d4Smrg
36c1f859d4Smrgextern GLboolean
37af69d88dSmrg_mesa_readpixels_needs_slow_path(const struct gl_context *ctx, GLenum format,
38af69d88dSmrg                                 GLenum type, GLboolean uses_blit);
39af69d88dSmrg
4001e04c3fSmrgextern GLboolean
4101e04c3fSmrg_mesa_need_rgb_to_luminance_conversion(GLenum srcBaseFormat,
4201e04c3fSmrg                                       GLenum dstBaseFormat);
4301e04c3fSmrg
4401e04c3fSmrgextern GLboolean
4501e04c3fSmrg_mesa_need_luminance_to_rgb_conversion(GLenum srcBaseFormat,
4601e04c3fSmrg                                       GLenum dstBaseFormat);
4701e04c3fSmrg
4801e04c3fSmrgextern GLbitfield
4901e04c3fSmrg_mesa_get_readpixels_transfer_ops(const struct gl_context *ctx,
5001e04c3fSmrg                                  mesa_format texFormat,
5101e04c3fSmrg                                  GLenum format, GLenum type,
5201e04c3fSmrg                                  GLboolean uses_blit);
5301e04c3fSmrg
54af69d88dSmrgextern void
55af69d88dSmrg_mesa_readpixels(struct gl_context *ctx,
56af69d88dSmrg                 GLint x, GLint y, GLsizei width, GLsizei height,
57af69d88dSmrg                 GLenum format, GLenum type,
58af69d88dSmrg                 const struct gl_pixelstore_attrib *packing,
59af69d88dSmrg                 GLvoid *pixels);
60c1f859d4Smrg
6101e04c3fSmrgvoid GLAPIENTRY
6201e04c3fSmrg_mesa_ReadPixels_no_error(GLint x, GLint y, GLsizei width, GLsizei height,
6301e04c3fSmrg                          GLenum format, GLenum type, GLvoid *pixels);
6401e04c3fSmrg
65c1f859d4Smrgextern void GLAPIENTRY
66c1f859d4Smrg_mesa_ReadPixels( GLint x, GLint y, GLsizei width, GLsizei height,
67c1f859d4Smrg                  GLenum format, GLenum type, GLvoid *pixels );
68c1f859d4Smrg
6901e04c3fSmrgvoid GLAPIENTRY
7001e04c3fSmrg_mesa_ReadnPixelsARB_no_error(GLint x, GLint y, GLsizei width, GLsizei height,
7101e04c3fSmrg		                        GLenum format, GLenum type, GLsizei bufSize,
7201e04c3fSmrg                              GLvoid *pixels);
7301e04c3fSmrg
743464ebd5Sriastradhextern void GLAPIENTRY
753464ebd5Sriastradh_mesa_ReadnPixelsARB( GLint x, GLint y, GLsizei width, GLsizei height,
763464ebd5Sriastradh		      GLenum format, GLenum type, GLsizei bufSize,
773464ebd5Sriastradh                      GLvoid *pixels );
78c1f859d4Smrg
79c1f859d4Smrg#endif
80