1/* 2 * Mesa 3-D graphics library 3 * Version: 6.3 4 * 5 * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. 6 * 7 * Permission is hereby granted, free of charge, to any person obtaining a 8 * copy of this software and associated documentation files (the "Software"), 9 * to deal in the Software without restriction, including without limitation 10 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 11 * and/or sell copies of the Software, and to permit persons to whom the 12 * Software is furnished to do so, subject to the following conditions: 13 * 14 * The above copyright notice and this permission notice shall be included 15 * in all copies or substantial portions of the Software. 16 * 17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 20 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 21 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 */ 24 25 26#include "glheader.h" 27#include "bufferobj.h" 28#include "colormac.h" 29#include "histogram.h" 30#include "macros.h" 31#include "mfeatures.h" 32#include "main/dispatch.h" 33 34 35#if FEATURE_histogram 36 37/********************************************************************** 38 * API functions 39 */ 40 41 42/* this is defined below */ 43static void GLAPIENTRY _mesa_ResetMinmax(GLenum target); 44 45 46static void GLAPIENTRY 47_mesa_GetnMinmaxARB(GLenum target, GLboolean reset, GLenum format, 48 GLenum type, GLsizei bufSize, GLvoid *values) 49{ 50 GET_CURRENT_CONTEXT(ctx); 51 52 _mesa_error(ctx, GL_INVALID_OPERATION, "glGetMinmax"); 53} 54 55 56static void GLAPIENTRY 57_mesa_GetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum type, 58 GLvoid *values) 59{ 60 _mesa_GetnMinmaxARB(target, reset, format, type, INT_MAX, values); 61} 62 63 64static void GLAPIENTRY 65_mesa_GetnHistogramARB(GLenum target, GLboolean reset, GLenum format, 66 GLenum type, GLsizei bufSize, GLvoid *values) 67{ 68 GET_CURRENT_CONTEXT(ctx); 69 70 _mesa_error(ctx, GL_INVALID_OPERATION, "glGetHistogram"); 71} 72 73 74static void GLAPIENTRY 75_mesa_GetHistogram(GLenum target, GLboolean reset, GLenum format, GLenum type, 76 GLvoid *values) 77{ 78 _mesa_GetnHistogramARB(target, reset, format, type, INT_MAX, values); 79} 80 81 82static void GLAPIENTRY 83_mesa_GetHistogramParameterfv(GLenum target, GLenum pname, GLfloat *params) 84{ 85 GET_CURRENT_CONTEXT(ctx); 86 87 _mesa_error(ctx, GL_INVALID_OPERATION, "glGetHistogramParameterfv"); 88} 89 90 91static void GLAPIENTRY 92_mesa_GetHistogramParameteriv(GLenum target, GLenum pname, GLint *params) 93{ 94 GET_CURRENT_CONTEXT(ctx); 95 96 _mesa_error(ctx, GL_INVALID_OPERATION, "glGetHistogramParameteriv"); 97} 98 99 100static void GLAPIENTRY 101_mesa_GetMinmaxParameterfv(GLenum target, GLenum pname, GLfloat *params) 102{ 103 GET_CURRENT_CONTEXT(ctx); 104 105 _mesa_error(ctx, GL_INVALID_OPERATION, "glGetMinmaxParameterfv"); 106} 107 108 109static void GLAPIENTRY 110_mesa_GetMinmaxParameteriv(GLenum target, GLenum pname, GLint *params) 111{ 112 GET_CURRENT_CONTEXT(ctx); 113 114 _mesa_error(ctx, GL_INVALID_OPERATION, "glGetMinmaxParameteriv"); 115} 116 117 118static void GLAPIENTRY 119_mesa_Histogram(GLenum target, GLsizei width, GLenum internalFormat, GLboolean sink) 120{ 121 GET_CURRENT_CONTEXT(ctx); 122 123 _mesa_error(ctx, GL_INVALID_OPERATION, "glHistogram"); 124} 125 126 127static void GLAPIENTRY 128_mesa_Minmax(GLenum target, GLenum internalFormat, GLboolean sink) 129{ 130 GET_CURRENT_CONTEXT(ctx); 131 132 _mesa_error(ctx, GL_INVALID_OPERATION, "glMinmax"); 133} 134 135 136static void GLAPIENTRY 137_mesa_ResetHistogram(GLenum target) 138{ 139 GET_CURRENT_CONTEXT(ctx); 140 141 _mesa_error(ctx, GL_INVALID_OPERATION, "glResetHistogram"); 142} 143 144 145static void GLAPIENTRY 146_mesa_ResetMinmax(GLenum target) 147{ 148 GET_CURRENT_CONTEXT(ctx); 149 150 _mesa_error(ctx, GL_INVALID_OPERATION, "glResetMinmax"); 151} 152 153 154void 155_mesa_init_histogram_dispatch(struct _glapi_table *disp) 156{ 157 SET_GetHistogram(disp, _mesa_GetHistogram); 158 SET_GetHistogramParameterfv(disp, _mesa_GetHistogramParameterfv); 159 SET_GetHistogramParameteriv(disp, _mesa_GetHistogramParameteriv); 160 SET_GetMinmax(disp, _mesa_GetMinmax); 161 SET_GetMinmaxParameterfv(disp, _mesa_GetMinmaxParameterfv); 162 SET_GetMinmaxParameteriv(disp, _mesa_GetMinmaxParameteriv); 163 SET_Histogram(disp, _mesa_Histogram); 164 SET_Minmax(disp, _mesa_Minmax); 165 SET_ResetHistogram(disp, _mesa_ResetHistogram); 166 SET_ResetMinmax(disp, _mesa_ResetMinmax); 167 168 /* GL_ARB_robustness */ 169 SET_GetnHistogramARB(disp, _mesa_GetnHistogramARB); 170 SET_GetnMinmaxARB(disp, _mesa_GetnMinmaxARB); 171} 172 173#endif /* FEATURE_histogram */ 174