convolve.c revision af69d88d
17117f1b4Smrg/*
27117f1b4Smrg * Mesa 3-D graphics library
37117f1b4Smrg *
47117f1b4Smrg * Copyright (C) 1999-2006  Brian Paul   All Rights Reserved.
57117f1b4Smrg *
67117f1b4Smrg * Permission is hereby granted, free of charge, to any person obtaining a
77117f1b4Smrg * copy of this software and associated documentation files (the "Software"),
87117f1b4Smrg * to deal in the Software without restriction, including without limitation
97117f1b4Smrg * the rights to use, copy, modify, merge, publish, distribute, sublicense,
107117f1b4Smrg * and/or sell copies of the Software, and to permit persons to whom the
117117f1b4Smrg * Software is furnished to do so, subject to the following conditions:
127117f1b4Smrg *
137117f1b4Smrg * The above copyright notice and this permission notice shall be included
147117f1b4Smrg * in all copies or substantial portions of the Software.
157117f1b4Smrg *
167117f1b4Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
177117f1b4Smrg * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
187117f1b4Smrg * 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.
237117f1b4Smrg */
247117f1b4Smrg
257117f1b4Smrg
267117f1b4Smrg/*
277117f1b4Smrg * Image convolution functions.
287117f1b4Smrg *
297117f1b4Smrg * Notes: filter kernel elements are indexed by <n> and <m> as in
307117f1b4Smrg * the GL spec.
317117f1b4Smrg */
327117f1b4Smrg
337117f1b4Smrg
347117f1b4Smrg#include "glheader.h"
357117f1b4Smrg#include "bufferobj.h"
367117f1b4Smrg#include "colormac.h"
377117f1b4Smrg#include "convolve.h"
383464ebd5Sriastradh#include "macros.h"
397117f1b4Smrg#include "mtypes.h"
40cdc920a0Smrg#include "main/dispatch.h"
414a49301eSmrg
424a49301eSmrg
43af69d88dSmrgvoid GLAPIENTRY
447117f1b4Smrg_mesa_ConvolutionFilter1D(GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *image)
457117f1b4Smrg{
467117f1b4Smrg   GET_CURRENT_CONTEXT(ctx);
477117f1b4Smrg
48af69d88dSmrg   _mesa_error(ctx, GL_INVALID_OPERATION, "glConvolutionFilter1D");
497117f1b4Smrg}
507117f1b4Smrg
51af69d88dSmrgvoid GLAPIENTRY
527117f1b4Smrg_mesa_ConvolutionFilter2D(GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image)
537117f1b4Smrg{
547117f1b4Smrg   GET_CURRENT_CONTEXT(ctx);
557117f1b4Smrg
56af69d88dSmrg   _mesa_error(ctx, GL_INVALID_OPERATION, "glConvolutionFilter2D");
577117f1b4Smrg}
587117f1b4Smrg
597117f1b4Smrg
60af69d88dSmrgvoid GLAPIENTRY
617117f1b4Smrg_mesa_ConvolutionParameterf(GLenum target, GLenum pname, GLfloat param)
627117f1b4Smrg{
637117f1b4Smrg   GET_CURRENT_CONTEXT(ctx);
647117f1b4Smrg
65af69d88dSmrg   _mesa_error(ctx, GL_INVALID_OPERATION, "glConvolutionParameterf");
667117f1b4Smrg}
677117f1b4Smrg
687117f1b4Smrg
69af69d88dSmrgvoid GLAPIENTRY
707117f1b4Smrg_mesa_ConvolutionParameterfv(GLenum target, GLenum pname, const GLfloat *params)
717117f1b4Smrg{
727117f1b4Smrg   GET_CURRENT_CONTEXT(ctx);
737117f1b4Smrg
74af69d88dSmrg   _mesa_error(ctx, GL_INVALID_OPERATION, "glConvolutionParameterfv");
757117f1b4Smrg}
767117f1b4Smrg
777117f1b4Smrg
78af69d88dSmrgvoid GLAPIENTRY
797117f1b4Smrg_mesa_ConvolutionParameteri(GLenum target, GLenum pname, GLint param)
807117f1b4Smrg{
817117f1b4Smrg   GET_CURRENT_CONTEXT(ctx);
827117f1b4Smrg
83af69d88dSmrg   _mesa_error(ctx, GL_INVALID_OPERATION, "glConvolutionParameteri");
847117f1b4Smrg}
857117f1b4Smrg
867117f1b4Smrg
87af69d88dSmrgvoid GLAPIENTRY
887117f1b4Smrg_mesa_ConvolutionParameteriv(GLenum target, GLenum pname, const GLint *params)
897117f1b4Smrg{
907117f1b4Smrg   GET_CURRENT_CONTEXT(ctx);
917117f1b4Smrg
92af69d88dSmrg   _mesa_error(ctx, GL_INVALID_OPERATION, "glConvolutionParameteriv");
937117f1b4Smrg}
947117f1b4Smrg
957117f1b4Smrg
96af69d88dSmrgvoid GLAPIENTRY
977117f1b4Smrg_mesa_CopyConvolutionFilter1D(GLenum target, GLenum internalFormat, GLint x, GLint y, GLsizei width)
987117f1b4Smrg{
997117f1b4Smrg   GET_CURRENT_CONTEXT(ctx);
1007117f1b4Smrg
101af69d88dSmrg   _mesa_error(ctx, GL_INVALID_OPERATION, "glCopyConvolutionFilter1D");
1027117f1b4Smrg}
1037117f1b4Smrg
1047117f1b4Smrg
105af69d88dSmrgvoid GLAPIENTRY
1067117f1b4Smrg_mesa_CopyConvolutionFilter2D(GLenum target, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height)
1077117f1b4Smrg{
1087117f1b4Smrg   GET_CURRENT_CONTEXT(ctx);
1097117f1b4Smrg
110af69d88dSmrg   _mesa_error(ctx, GL_INVALID_OPERATION, "glCopyConvolutionFilter2D");
1113464ebd5Sriastradh}
1127117f1b4Smrg
1137117f1b4Smrg
114af69d88dSmrgvoid GLAPIENTRY
1153464ebd5Sriastradh_mesa_GetnConvolutionFilterARB(GLenum target, GLenum format, GLenum type,
1163464ebd5Sriastradh                               GLsizei bufSize, GLvoid *image)
1173464ebd5Sriastradh{
1183464ebd5Sriastradh   GET_CURRENT_CONTEXT(ctx);
1194a49301eSmrg
1203464ebd5Sriastradh   _mesa_error(ctx, GL_INVALID_OPERATION, "glGetConvolutionFilter");
1217117f1b4Smrg}
1227117f1b4Smrg
1237117f1b4Smrg
124af69d88dSmrgvoid GLAPIENTRY
1257117f1b4Smrg_mesa_GetConvolutionFilter(GLenum target, GLenum format, GLenum type,
1267117f1b4Smrg                           GLvoid *image)
1277117f1b4Smrg{
1283464ebd5Sriastradh   _mesa_GetnConvolutionFilterARB(target, format, type, INT_MAX, image);
1297117f1b4Smrg}
1307117f1b4Smrg
1317117f1b4Smrg
132af69d88dSmrgvoid GLAPIENTRY
1337117f1b4Smrg_mesa_GetConvolutionParameterfv(GLenum target, GLenum pname, GLfloat *params)
1347117f1b4Smrg{
1357117f1b4Smrg   GET_CURRENT_CONTEXT(ctx);
1367117f1b4Smrg
137af69d88dSmrg   _mesa_error(ctx, GL_INVALID_OPERATION, "glGetConvolutionParameterfv");
1387117f1b4Smrg}
1397117f1b4Smrg
1407117f1b4Smrg
141af69d88dSmrgvoid GLAPIENTRY
1427117f1b4Smrg_mesa_GetConvolutionParameteriv(GLenum target, GLenum pname, GLint *params)
1437117f1b4Smrg{
1447117f1b4Smrg   GET_CURRENT_CONTEXT(ctx);
1457117f1b4Smrg
146af69d88dSmrg   _mesa_error(ctx, GL_INVALID_OPERATION, "glGetConvolutionParameteriv");
1477117f1b4Smrg}
1487117f1b4Smrg
1497117f1b4Smrg
150af69d88dSmrgvoid GLAPIENTRY
1513464ebd5Sriastradh_mesa_GetnSeparableFilterARB(GLenum target, GLenum format, GLenum type,
1523464ebd5Sriastradh                             GLsizei rowBufSize, GLvoid *row,
1533464ebd5Sriastradh                             GLsizei columnBufSize,  GLvoid *column,
1543464ebd5Sriastradh                             GLvoid *span)
1557117f1b4Smrg{
1567117f1b4Smrg   GET_CURRENT_CONTEXT(ctx);
1577117f1b4Smrg
158af69d88dSmrg   _mesa_error(ctx, GL_INVALID_OPERATION, "glGetSeparableFilter");
1597117f1b4Smrg}
1607117f1b4Smrg
1617117f1b4Smrg
162af69d88dSmrgvoid GLAPIENTRY
1633464ebd5Sriastradh_mesa_GetSeparableFilter(GLenum target, GLenum format, GLenum type,
1643464ebd5Sriastradh                         GLvoid *row, GLvoid *column, GLvoid *span)
1657117f1b4Smrg{
1663464ebd5Sriastradh   _mesa_GetnSeparableFilterARB(target, format, type, INT_MAX, row,
1673464ebd5Sriastradh                                INT_MAX, column, span);
1687117f1b4Smrg}
1697117f1b4Smrg
1707117f1b4Smrg
171af69d88dSmrgvoid GLAPIENTRY
1723464ebd5Sriastradh_mesa_SeparableFilter2D(GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column)
1737117f1b4Smrg{
1743464ebd5Sriastradh   GET_CURRENT_CONTEXT(ctx);
1757117f1b4Smrg
176af69d88dSmrg   _mesa_error(ctx, GL_INVALID_OPERATION, "glSeparableFilter2D");
1774a49301eSmrg}
178