~ubuntu-branches/ubuntu/quantal/mesa/quantal

« back to all changes in this revision

Viewing changes to src/mesa/main/convolve.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2007-02-21 12:44:07 UTC
  • mfrom: (1.2.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 22.
  • Revision ID: james.westby@ubuntu.com-20070221124407-rgcacs32mycrtadl
ImportĀ upstreamĀ versionĀ 6.5.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * Mesa 3-D graphics library
3
 
 * Version:  6.3
 
3
 * Version:  6.5.2
4
4
 *
5
 
 * Copyright (C) 1999-2004  Brian Paul   All Rights Reserved.
 
5
 * Copyright (C) 1999-2006  Brian Paul   All Rights Reserved.
6
6
 *
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"),
560
560
 
561
561
 
562
562
void GLAPIENTRY
563
 
_mesa_GetConvolutionFilter(GLenum target, GLenum format, GLenum type, GLvoid *image)
 
563
_mesa_GetConvolutionFilter(GLenum target, GLenum format, GLenum type,
 
564
                           GLvoid *image)
564
565
{
565
 
   const struct gl_convolution_attrib *filter;
 
566
   struct gl_convolution_attrib *filter;
566
567
   GLuint row;
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,
625
626
                                          row, 0);
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);
630
630
   }
631
631
 
632
632
   if (ctx->Pack.BufferObj->Name) {
768
768
 
769
769
 
770
770
void GLAPIENTRY
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)
772
773
{
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);
777
778
 
785
786
   }
786
787
 
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)");
789
791
      return;
790
792
   }
791
793
 
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);
838
840
   }
839
841
 
840
842
   /* Column filter */
841
843
   if (column) {
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);
848
849
   }
849
850
 
850
851
   (void) span;  /* unused at this time */