histogram.c revision 3464ebd5
17117f1b4Smrg/*
27117f1b4Smrg * Mesa 3-D graphics library
37117f1b4Smrg * Version:  6.3
47117f1b4Smrg *
57117f1b4Smrg * Copyright (C) 1999-2004  Brian Paul   All Rights Reserved.
67117f1b4Smrg *
77117f1b4Smrg * Permission is hereby granted, free of charge, to any person obtaining a
87117f1b4Smrg * copy of this software and associated documentation files (the "Software"),
97117f1b4Smrg * to deal in the Software without restriction, including without limitation
107117f1b4Smrg * the rights to use, copy, modify, merge, publish, distribute, sublicense,
117117f1b4Smrg * and/or sell copies of the Software, and to permit persons to whom the
127117f1b4Smrg * Software is furnished to do so, subject to the following conditions:
137117f1b4Smrg *
147117f1b4Smrg * The above copyright notice and this permission notice shall be included
157117f1b4Smrg * in all copies or substantial portions of the Software.
167117f1b4Smrg *
177117f1b4Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
187117f1b4Smrg * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
197117f1b4Smrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
207117f1b4Smrg * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
217117f1b4Smrg * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
227117f1b4Smrg * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
237117f1b4Smrg */
247117f1b4Smrg
257117f1b4Smrg
267117f1b4Smrg#include "glheader.h"
277117f1b4Smrg#include "bufferobj.h"
287117f1b4Smrg#include "colormac.h"
297117f1b4Smrg#include "histogram.h"
303464ebd5Sriastradh#include "macros.h"
313464ebd5Sriastradh#include "mfeatures.h"
32cdc920a0Smrg#include "main/dispatch.h"
337117f1b4Smrg
347117f1b4Smrg
354a49301eSmrg#if FEATURE_histogram
364a49301eSmrg
377117f1b4Smrg/**********************************************************************
387117f1b4Smrg * API functions
397117f1b4Smrg */
407117f1b4Smrg
417117f1b4Smrg
424a49301eSmrg/* this is defined below */
434a49301eSmrgstatic void GLAPIENTRY _mesa_ResetMinmax(GLenum target);
444a49301eSmrg
454a49301eSmrg
464a49301eSmrgstatic void GLAPIENTRY
473464ebd5Sriastradh_mesa_GetnMinmaxARB(GLenum target, GLboolean reset, GLenum format,
483464ebd5Sriastradh                    GLenum type, GLsizei bufSize, GLvoid *values)
497117f1b4Smrg{
507117f1b4Smrg   GET_CURRENT_CONTEXT(ctx);
517117f1b4Smrg
523464ebd5Sriastradh   _mesa_error(ctx, GL_INVALID_OPERATION, "glGetMinmax");
533464ebd5Sriastradh}
547117f1b4Smrg
557117f1b4Smrg
563464ebd5Sriastradhstatic void GLAPIENTRY
573464ebd5Sriastradh_mesa_GetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum type,
583464ebd5Sriastradh                GLvoid *values)
593464ebd5Sriastradh{
603464ebd5Sriastradh   _mesa_GetnMinmaxARB(target, reset, format, type, INT_MAX, values);
617117f1b4Smrg}
627117f1b4Smrg
637117f1b4Smrg
644a49301eSmrgstatic void GLAPIENTRY
653464ebd5Sriastradh_mesa_GetnHistogramARB(GLenum target, GLboolean reset, GLenum format,
663464ebd5Sriastradh                       GLenum type, GLsizei bufSize, GLvoid *values)
677117f1b4Smrg{
687117f1b4Smrg   GET_CURRENT_CONTEXT(ctx);
697117f1b4Smrg
703464ebd5Sriastradh   _mesa_error(ctx, GL_INVALID_OPERATION, "glGetHistogram");
713464ebd5Sriastradh}
727117f1b4Smrg
737117f1b4Smrg
743464ebd5Sriastradhstatic void GLAPIENTRY
753464ebd5Sriastradh_mesa_GetHistogram(GLenum target, GLboolean reset, GLenum format, GLenum type,
763464ebd5Sriastradh                   GLvoid *values)
773464ebd5Sriastradh{
783464ebd5Sriastradh   _mesa_GetnHistogramARB(target, reset, format, type, INT_MAX, values);
797117f1b4Smrg}
807117f1b4Smrg
817117f1b4Smrg
824a49301eSmrgstatic void GLAPIENTRY
837117f1b4Smrg_mesa_GetHistogramParameterfv(GLenum target, GLenum pname, GLfloat *params)
847117f1b4Smrg{
857117f1b4Smrg   GET_CURRENT_CONTEXT(ctx);
867117f1b4Smrg
873464ebd5Sriastradh   _mesa_error(ctx, GL_INVALID_OPERATION, "glGetHistogramParameterfv");
887117f1b4Smrg}
897117f1b4Smrg
907117f1b4Smrg
914a49301eSmrgstatic void GLAPIENTRY
927117f1b4Smrg_mesa_GetHistogramParameteriv(GLenum target, GLenum pname, GLint *params)
937117f1b4Smrg{
947117f1b4Smrg   GET_CURRENT_CONTEXT(ctx);
957117f1b4Smrg
963464ebd5Sriastradh   _mesa_error(ctx, GL_INVALID_OPERATION, "glGetHistogramParameteriv");
977117f1b4Smrg}
987117f1b4Smrg
997117f1b4Smrg
1004a49301eSmrgstatic void GLAPIENTRY
1017117f1b4Smrg_mesa_GetMinmaxParameterfv(GLenum target, GLenum pname, GLfloat *params)
1027117f1b4Smrg{
1037117f1b4Smrg   GET_CURRENT_CONTEXT(ctx);
1047117f1b4Smrg
1057117f1b4Smrg      _mesa_error(ctx, GL_INVALID_OPERATION, "glGetMinmaxParameterfv");
1067117f1b4Smrg}
1077117f1b4Smrg
1087117f1b4Smrg
1094a49301eSmrgstatic void GLAPIENTRY
1107117f1b4Smrg_mesa_GetMinmaxParameteriv(GLenum target, GLenum pname, GLint *params)
1117117f1b4Smrg{
1127117f1b4Smrg   GET_CURRENT_CONTEXT(ctx);
1137117f1b4Smrg
1143464ebd5Sriastradh   _mesa_error(ctx, GL_INVALID_OPERATION, "glGetMinmaxParameteriv");
1157117f1b4Smrg}
1167117f1b4Smrg
1177117f1b4Smrg
1184a49301eSmrgstatic void GLAPIENTRY
1197117f1b4Smrg_mesa_Histogram(GLenum target, GLsizei width, GLenum internalFormat, GLboolean sink)
1207117f1b4Smrg{
1217117f1b4Smrg   GET_CURRENT_CONTEXT(ctx);
1227117f1b4Smrg
1233464ebd5Sriastradh   _mesa_error(ctx, GL_INVALID_OPERATION, "glHistogram");
1247117f1b4Smrg}
1257117f1b4Smrg
1267117f1b4Smrg
1274a49301eSmrgstatic void GLAPIENTRY
1287117f1b4Smrg_mesa_Minmax(GLenum target, GLenum internalFormat, GLboolean sink)
1297117f1b4Smrg{
1307117f1b4Smrg   GET_CURRENT_CONTEXT(ctx);
1317117f1b4Smrg
1323464ebd5Sriastradh   _mesa_error(ctx, GL_INVALID_OPERATION, "glMinmax");
1337117f1b4Smrg}
1347117f1b4Smrg
1357117f1b4Smrg
1364a49301eSmrgstatic void GLAPIENTRY
1377117f1b4Smrg_mesa_ResetHistogram(GLenum target)
1387117f1b4Smrg{
1397117f1b4Smrg   GET_CURRENT_CONTEXT(ctx);
1407117f1b4Smrg
1413464ebd5Sriastradh   _mesa_error(ctx, GL_INVALID_OPERATION, "glResetHistogram");
1427117f1b4Smrg}
1437117f1b4Smrg
1447117f1b4Smrg
1454a49301eSmrgstatic void GLAPIENTRY
1467117f1b4Smrg_mesa_ResetMinmax(GLenum target)
1477117f1b4Smrg{
1487117f1b4Smrg   GET_CURRENT_CONTEXT(ctx);
1497117f1b4Smrg
1503464ebd5Sriastradh   _mesa_error(ctx, GL_INVALID_OPERATION, "glResetMinmax");
1517117f1b4Smrg}
1527117f1b4Smrg
1537117f1b4Smrg
1544a49301eSmrgvoid
1554a49301eSmrg_mesa_init_histogram_dispatch(struct _glapi_table *disp)
1564a49301eSmrg{
1574a49301eSmrg   SET_GetHistogram(disp, _mesa_GetHistogram);
1584a49301eSmrg   SET_GetHistogramParameterfv(disp, _mesa_GetHistogramParameterfv);
1594a49301eSmrg   SET_GetHistogramParameteriv(disp, _mesa_GetHistogramParameteriv);
1604a49301eSmrg   SET_GetMinmax(disp, _mesa_GetMinmax);
1614a49301eSmrg   SET_GetMinmaxParameterfv(disp, _mesa_GetMinmaxParameterfv);
1624a49301eSmrg   SET_GetMinmaxParameteriv(disp, _mesa_GetMinmaxParameteriv);
1634a49301eSmrg   SET_Histogram(disp, _mesa_Histogram);
1644a49301eSmrg   SET_Minmax(disp, _mesa_Minmax);
1654a49301eSmrg   SET_ResetHistogram(disp, _mesa_ResetHistogram);
1664a49301eSmrg   SET_ResetMinmax(disp, _mesa_ResetMinmax);
1674a49301eSmrg
1683464ebd5Sriastradh   /* GL_ARB_robustness */
1693464ebd5Sriastradh   SET_GetnHistogramARB(disp, _mesa_GetnHistogramARB);
1703464ebd5Sriastradh   SET_GetnMinmaxARB(disp, _mesa_GetnMinmaxARB);
1713464ebd5Sriastradh}
1724a49301eSmrg
1734a49301eSmrg#endif /* FEATURE_histogram */
174