From 96385fa15569e25cd0977e678c0ff3bdab6ef316 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 14 Jul 2001 17:53:04 +0000 Subject: more work on float colors (still not finished) --- src/mesa/main/Makefile.OSMesa16 | 3 +-- src/mesa/main/colortab.c | 3 +-- src/mesa/main/image.c | 15 ++++++++++++++- 3 files changed, 16 insertions(+), 5 deletions(-) (limited to 'src/mesa/main') diff --git a/src/mesa/main/Makefile.OSMesa16 b/src/mesa/main/Makefile.OSMesa16 index 43193aa36b..d6da7db06c 100644 --- a/src/mesa/main/Makefile.OSMesa16 +++ b/src/mesa/main/Makefile.OSMesa16 @@ -1,4 +1,4 @@ -# $Id: Makefile.OSMesa16,v 1.4 2001/07/13 20:07:37 brianp Exp $ +# $Id: Makefile.OSMesa16,v 1.5 2001/07/14 17:53:04 brianp Exp $ # Mesa 3-D graphics library # Version: 3.5 @@ -121,7 +121,6 @@ CORE_SOURCES = \ swrast_setup/ss_context.c \ swrast_setup/ss_triangle.c \ swrast_setup/ss_vb.c \ - swrast_setup/ss_interp.c \ tnl/t_array_api.c \ tnl/t_array_import.c \ tnl/t_context.c \ diff --git a/src/mesa/main/colortab.c b/src/mesa/main/colortab.c index 0b0f50c074..bb45738270 100644 --- a/src/mesa/main/colortab.c +++ b/src/mesa/main/colortab.c @@ -1,4 +1,4 @@ -/* $Id: colortab.c,v 1.40 2001/04/20 19:21:41 brianp Exp $ */ +/* $Id: colortab.c,v 1.41 2001/07/14 17:53:04 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -127,7 +127,6 @@ _mesa_free_colortable_data( struct gl_color_table *p ) static void set_component_sizes( struct gl_color_table *table ) { - /* XXX what about GLfloat tables? */ switch (table->Format) { case GL_ALPHA: table->RedSize = 0; diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c index 376234285b..d99d908509 100644 --- a/src/mesa/main/image.c +++ b/src/mesa/main/image.c @@ -1,4 +1,4 @@ -/* $Id: image.c,v 1.62 2001/06/13 14:55:25 brianp Exp $ */ +/* $Id: image.c,v 1.63 2001/07/14 17:53:04 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -790,6 +790,11 @@ _mesa_pack_bitmap( GLint width, GLint height, const GLubyte *source, +/* + * Used to pack an array [][4] of RGBA GLchan colors as specified + * by the dstFormat, dstType and dstPacking. Used by glReadPixels, + * glGetConvolutionFilter(), etc. + */ void _mesa_pack_float_rgba_span( GLcontext *ctx, GLuint n, CONST GLfloat rgbaIn[][4], @@ -886,7 +891,11 @@ _mesa_pack_float_rgba_span( GLcontext *ctx, if (dstFormat == GL_LUMINANCE || dstFormat == GL_LUMINANCE_ALPHA) { for (i = 0; i < n; i++) { GLfloat sum = rgba[i][RCOMP] + rgba[i][GCOMP] + rgba[i][BCOMP]; +#if CHAN_TYPE == GL_FLOAT + luminance[i] = sum; +#else luminance[i] = CLAMP(sum, 0.0F, 1.0F); +#endif } } @@ -2666,6 +2675,7 @@ _mesa_unpack_chan_color_span( GLcontext *ctx, } /* clamp to [0,1] */ +#if CHAN_TYPE != GL_FLOAT { GLuint i; for (i = 0; i < n; i++) { @@ -2675,6 +2685,7 @@ _mesa_unpack_chan_color_span( GLcontext *ctx, rgba[i][ACOMP] = CLAMP(rgba[i][ACOMP], 0.0F, 1.0F); } } +#endif /* Now determine which color channels we need to produce. * And determine the dest index (offset) within each color tuple. @@ -2941,6 +2952,7 @@ _mesa_unpack_float_color_span( GLcontext *ctx, } /* clamp to [0,1] */ +#if CHAN_TYPE != GL_FLOAT if (clamp) { GLuint i; for (i = 0; i < n; i++) { @@ -2950,6 +2962,7 @@ _mesa_unpack_float_color_span( GLcontext *ctx, rgba[i][ACOMP] = CLAMP(rgba[i][ACOMP], 0.0F, 1.0F); } } +#endif /* Now determine which color channels we need to produce. * And determine the dest index (offset) within each color tuple. -- cgit v1.2.3