2
2
* Mesa 3-D graphics library
5
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
5
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
7
7
* Permission is hereby granted, free of charge, to any person obtaining a
8
8
* copy of this software and associated documentation files (the "Software"),
563
_mesa_GetConvolutionFilter(GLenum target, GLenum format, GLenum type, GLvoid *image)
563
_mesa_GetConvolutionFilter(GLenum target, GLenum format, GLenum type,
565
const struct gl_convolution_attrib *filter;
566
struct gl_convolution_attrib *filter;
567
568
GET_CURRENT_CONTEXT(ctx);
568
569
ASSERT_OUTSIDE_BEGIN_END(ctx);
623
624
GLvoid *dst = _mesa_image_address2d(&ctx->Pack, image, filter->Width,
624
625
filter->Height, format, type,
626
const GLfloat *src = filter->Filter + row * filter->Width * 4;
627
_mesa_pack_rgba_span_float(ctx, filter->Width,
628
(const GLfloat (*)[4]) src,
629
format, type, dst, &ctx->Pack, 0);
627
GLfloat (*src)[4] = (GLfloat (*)[4]) (filter->Filter + row * filter->Width * 4);
628
_mesa_pack_rgba_span_float(ctx, filter->Width, src,
629
format, type, dst, &ctx->Pack, 0x0);
632
632
if (ctx->Pack.BufferObj->Name) {
771
_mesa_GetSeparableFilter(GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span)
771
_mesa_GetSeparableFilter(GLenum target, GLenum format, GLenum type,
772
GLvoid *row, GLvoid *column, GLvoid *span)
773
774
const GLint colStart = MAX_CONVOLUTION_WIDTH * 4;
774
const struct gl_convolution_attrib *filter;
775
struct gl_convolution_attrib *filter;
775
776
GET_CURRENT_CONTEXT(ctx);
776
777
ASSERT_OUTSIDE_BEGIN_END(ctx);
787
788
if (!_mesa_is_legal_format_and_type(ctx, format, type)) {
788
_mesa_error(ctx, GL_INVALID_OPERATION, "glGetConvolutionFilter(format or type)");
789
_mesa_error(ctx, GL_INVALID_OPERATION,
790
"glGetConvolutionFilter(format or type)");
833
835
GLvoid *dst = _mesa_image_address1d(&ctx->Pack, row, filter->Width,
834
836
format, type, 0);
835
837
_mesa_pack_rgba_span_float(ctx, filter->Width,
836
(const GLfloat (*)[4]) filter->Filter,
837
format, type, dst, &ctx->Pack, 0);
838
(GLfloat (*)[4]) filter->Filter,
839
format, type, dst, &ctx->Pack, 0x0);
840
842
/* Column filter */
842
844
GLvoid *dst = _mesa_image_address1d(&ctx->Pack, column, filter->Height,
843
845
format, type, 0);
844
const GLfloat *src = filter->Filter + colStart;
845
_mesa_pack_rgba_span_float(ctx, filter->Height,
846
(const GLfloat (*)[4]) src,
847
format, type, dst, &ctx->Pack, 0);
846
GLfloat (*src)[4] = (GLfloat (*)[4]) (filter->Filter + colStart);
847
_mesa_pack_rgba_span_float(ctx, filter->Height, src,
848
format, type, dst, &ctx->Pack, 0x0);
850
851
(void) span; /* unused at this time */