/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5.2
*
- * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
if (ctx->Unpack.BufferObj->Name) {
/* unpack filter from PBO */
GLubyte *buf;
- if (!_mesa_validate_pbo_access(&ctx->Unpack, width, 1, 1,
+ if (!_mesa_validate_pbo_access(1, &ctx->Unpack, width, 1, 1,
format, type, image)) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glConvolutionFilter1D(invalid PBO access)");
if (ctx->Unpack.BufferObj->Name) {
/* unpack filter from PBO */
GLubyte *buf;
- if (!_mesa_validate_pbo_access(&ctx->Unpack, width, height, 1,
+ if (!_mesa_validate_pbo_access(2, &ctx->Unpack, width, height, 1,
format, type, image)) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glConvolutionFilter2D(invalid PBO access)");
/* Unpack filter image. We always store filters in RGBA format. */
for (i = 0; i < height; i++) {
- const GLvoid *src = _mesa_image_address(&ctx->Unpack, image, width,
- height, format, type, 0, i, 0);
+ const GLvoid *src = _mesa_image_address2d(&ctx->Unpack, image, width,
+ height, format, type, i, 0);
GLfloat *dst = ctx->Convolution2D.Filter + i * width * 4;
_mesa_unpack_color_span_float(ctx, width, GL_RGBA, dst,
format, type, src, &ctx->Unpack,
void GLAPIENTRY
-_mesa_GetConvolutionFilter(GLenum target, GLenum format, GLenum type, GLvoid *image)
+_mesa_GetConvolutionFilter(GLenum target, GLenum format, GLenum type,
+ GLvoid *image)
{
- const struct gl_convolution_attrib *filter;
+ struct gl_convolution_attrib *filter;
GLuint row;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (ctx->Pack.BufferObj->Name) {
/* Pack the filter into a PBO */
GLubyte *buf;
- if (!_mesa_validate_pbo_access(&ctx->Pack, filter->Width, filter->Height,
+ if (!_mesa_validate_pbo_access(2, &ctx->Pack,
+ filter->Width, filter->Height,
1, format, type, image)) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glGetConvolutionFilter(invalid PBO access)");
}
for (row = 0; row < filter->Height; row++) {
- GLvoid *dst = _mesa_image_address( &ctx->Pack, image, filter->Width,
- filter->Height, format, type,
- 0, row, 0);
- const GLfloat *src = filter->Filter + row * filter->Width * 4;
- _mesa_pack_rgba_span_float(ctx, filter->Width,
- (const GLfloat (*)[4]) src,
- format, type, dst, &ctx->Pack, 0);
+ GLvoid *dst = _mesa_image_address2d(&ctx->Pack, image, filter->Width,
+ filter->Height, format, type,
+ row, 0);
+ GLfloat (*src)[4] = (GLfloat (*)[4]) (filter->Filter + row * filter->Width * 4);
+ _mesa_pack_rgba_span_float(ctx, filter->Width, src,
+ format, type, dst, &ctx->Pack, 0x0);
}
if (ctx->Pack.BufferObj->Name) {
void GLAPIENTRY
-_mesa_GetSeparableFilter(GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span)
+_mesa_GetSeparableFilter(GLenum target, GLenum format, GLenum type,
+ GLvoid *row, GLvoid *column, GLvoid *span)
{
const GLint colStart = MAX_CONVOLUTION_WIDTH * 4;
- const struct gl_convolution_attrib *filter;
+ struct gl_convolution_attrib *filter;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
}
if (!_mesa_is_legal_format_and_type(ctx, format, type)) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glGetConvolutionFilter(format or type)");
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glGetConvolutionFilter(format or type)");
return;
}
if (ctx->Pack.BufferObj->Name) {
/* Pack filter into PBO */
GLubyte *buf;
- if (!_mesa_validate_pbo_access(&ctx->Pack, filter->Width, 1, 1,
+ if (!_mesa_validate_pbo_access(1, &ctx->Pack, filter->Width, 1, 1,
format, type, row)) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glGetSeparableFilter(invalid PBO access, width)");
return;
}
- if (!_mesa_validate_pbo_access(&ctx->Pack, filter->Height, 1, 1,
+ if (!_mesa_validate_pbo_access(1, &ctx->Pack, filter->Height, 1, 1,
format, type, column)) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glGetSeparableFilter(invalid PBO access, height)");
/* Row filter */
if (row) {
- GLvoid *dst = _mesa_image_address( &ctx->Pack, row, filter->Width,
- filter->Height, format, type,
- 0, 0, 0);
+ GLvoid *dst = _mesa_image_address1d(&ctx->Pack, row, filter->Width,
+ format, type, 0);
_mesa_pack_rgba_span_float(ctx, filter->Width,
- (const GLfloat (*)[4]) filter->Filter,
- format, type, dst, &ctx->Pack, 0);
+ (GLfloat (*)[4]) filter->Filter,
+ format, type, dst, &ctx->Pack, 0x0);
}
/* Column filter */
if (column) {
- GLvoid *dst = _mesa_image_address( &ctx->Pack, column, filter->Width,
- 1, format, type,
- 0, 0, 0);
- const GLfloat *src = filter->Filter + colStart;
- _mesa_pack_rgba_span_float(ctx, filter->Height,
- (const GLfloat (*)[4]) src,
- format, type, dst, &ctx->Pack, 0);
+ GLvoid *dst = _mesa_image_address1d(&ctx->Pack, column, filter->Height,
+ format, type, 0);
+ GLfloat (*src)[4] = (GLfloat (*)[4]) (filter->Filter + colStart);
+ _mesa_pack_rgba_span_float(ctx, filter->Height, src,
+ format, type, dst, &ctx->Pack, 0x0);
}
(void) span; /* unused at this time */
if (ctx->Unpack.BufferObj->Name) {
/* unpack filter from PBO */
GLubyte *buf;
- if (!_mesa_validate_pbo_access(&ctx->Unpack, width, 1, 1,
+ if (!_mesa_validate_pbo_access(1, &ctx->Unpack, width, 1, 1,
format, type, row)) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glSeparableFilter2D(invalid PBO access, width)");
return;
}
- if (!_mesa_validate_pbo_access(&ctx->Unpack, height, 1, 1,
+ if (!_mesa_validate_pbo_access(1, &ctx->Unpack, height, 1, 1,
format, type, column)) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glSeparableFilter2D(invalid PBO access, height)");
/* unpack column filter */
if (column) {
- _mesa_unpack_color_span_float(ctx, height, GL_RGBA,
- &ctx->Separable2D.Filter[colStart],
- format, type, column, &ctx->Unpack,
- 0); /* transferOps */
+ _mesa_unpack_color_span_float(ctx, height, GL_RGBA,
+ &ctx->Separable2D.Filter[colStart],
+ format, type, column, &ctx->Unpack,
+ 0); /* transferOps */
_mesa_scale_and_bias_rgba(height,
(GLfloat (*)[4]) (ctx->Separable2D.Filter + colStart),