2 * Mesa 3-D graphics library
5 * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
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:
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
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.
27 * Image convolution functions.
29 * Notes: filter kernel elements are indexed by <n> and <m> as in
35 #include "bufferobj.h"
40 #include "main/dispatch.h"
45 static void GLAPIENTRY
46 _mesa_ConvolutionFilter1D(GLenum target
, GLenum internalFormat
, GLsizei width
, GLenum format
, GLenum type
, const GLvoid
*image
)
48 GET_CURRENT_CONTEXT(ctx
);
50 _mesa_error(ctx
, GL_INVALID_ENUM
, "glConvolutionFilter1D");
53 static void GLAPIENTRY
54 _mesa_ConvolutionFilter2D(GLenum target
, GLenum internalFormat
, GLsizei width
, GLsizei height
, GLenum format
, GLenum type
, const GLvoid
*image
)
56 GET_CURRENT_CONTEXT(ctx
);
58 _mesa_error(ctx
, GL_INVALID_ENUM
, "glConvolutionFilter2D");
62 static void GLAPIENTRY
63 _mesa_ConvolutionParameterf(GLenum target
, GLenum pname
, GLfloat param
)
65 GET_CURRENT_CONTEXT(ctx
);
67 _mesa_error(ctx
, GL_INVALID_ENUM
, "glConvolutionParameterf");
71 static void GLAPIENTRY
72 _mesa_ConvolutionParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
74 GET_CURRENT_CONTEXT(ctx
);
76 _mesa_error(ctx
, GL_INVALID_ENUM
, "glConvolutionParameterfv");
80 static void GLAPIENTRY
81 _mesa_ConvolutionParameteri(GLenum target
, GLenum pname
, GLint param
)
83 GET_CURRENT_CONTEXT(ctx
);
85 _mesa_error(ctx
, GL_INVALID_ENUM
, "glConvolutionParameteri");
89 static void GLAPIENTRY
90 _mesa_ConvolutionParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
92 GET_CURRENT_CONTEXT(ctx
);
94 _mesa_error(ctx
, GL_INVALID_ENUM
, "glConvolutionParameteriv");
98 static void GLAPIENTRY
99 _mesa_CopyConvolutionFilter1D(GLenum target
, GLenum internalFormat
, GLint x
, GLint y
, GLsizei width
)
101 GET_CURRENT_CONTEXT(ctx
);
103 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCopyConvolutionFilter1D");
107 static void GLAPIENTRY
108 _mesa_CopyConvolutionFilter2D(GLenum target
, GLenum internalFormat
, GLint x
, GLint y
, GLsizei width
, GLsizei height
)
110 GET_CURRENT_CONTEXT(ctx
);
112 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCopyConvolutionFilter2D");
116 static void GLAPIENTRY
117 _mesa_GetConvolutionFilter(GLenum target
, GLenum format
, GLenum type
,
120 GET_CURRENT_CONTEXT(ctx
);
122 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glGetConvolutionFilter");
126 static void GLAPIENTRY
127 _mesa_GetConvolutionParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
129 GET_CURRENT_CONTEXT(ctx
);
131 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetConvolutionParameterfv");
135 static void GLAPIENTRY
136 _mesa_GetConvolutionParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
138 GET_CURRENT_CONTEXT(ctx
);
140 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetConvolutionParameteriv");
144 static void GLAPIENTRY
145 _mesa_GetSeparableFilter(GLenum target
, GLenum format
, GLenum type
,
146 GLvoid
*row
, GLvoid
*column
, GLvoid
*span
)
148 GET_CURRENT_CONTEXT(ctx
);
150 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetSeparableFilter");
154 static void GLAPIENTRY
155 _mesa_SeparableFilter2D(GLenum target
, GLenum internalFormat
, GLsizei width
, GLsizei height
, GLenum format
, GLenum type
, const GLvoid
*row
, const GLvoid
*column
)
157 GET_CURRENT_CONTEXT(ctx
);
159 _mesa_error(ctx
, GL_INVALID_ENUM
, "glSeparableFilter2D");
163 _mesa_init_convolve_dispatch(struct _glapi_table
*disp
)
165 SET_ConvolutionFilter1D(disp
, _mesa_ConvolutionFilter1D
);
166 SET_ConvolutionFilter2D(disp
, _mesa_ConvolutionFilter2D
);
167 SET_ConvolutionParameterf(disp
, _mesa_ConvolutionParameterf
);
168 SET_ConvolutionParameterfv(disp
, _mesa_ConvolutionParameterfv
);
169 SET_ConvolutionParameteri(disp
, _mesa_ConvolutionParameteri
);
170 SET_ConvolutionParameteriv(disp
, _mesa_ConvolutionParameteriv
);
171 SET_CopyConvolutionFilter1D(disp
, _mesa_CopyConvolutionFilter1D
);
172 SET_CopyConvolutionFilter2D(disp
, _mesa_CopyConvolutionFilter2D
);
173 SET_GetConvolutionFilter(disp
, _mesa_GetConvolutionFilter
);
174 SET_GetConvolutionParameterfv(disp
, _mesa_GetConvolutionParameterfv
);
175 SET_GetConvolutionParameteriv(disp
, _mesa_GetConvolutionParameteriv
);
176 SET_SeparableFilter2D(disp
, _mesa_SeparableFilter2D
);
177 SET_GetSeparableFilter(disp
, _mesa_GetSeparableFilter
);
181 #endif /* FEATURE_convolve */