summaryrefslogtreecommitdiff
path: root/src/mesa/main
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2001-07-14 17:53:04 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2001-07-14 17:53:04 +0000
commit96385fa15569e25cd0977e678c0ff3bdab6ef316 (patch)
tree64906f361d7fca6abb6cdd96b50439ccbce945d6 /src/mesa/main
parent274fc30d31803a1c73d7d05e041e71e6b683229e (diff)
more work on float colors (still not finished)
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/Makefile.OSMesa163
-rw-r--r--src/mesa/main/colortab.c3
-rw-r--r--src/mesa/main/image.c15
3 files changed, 16 insertions, 5 deletions
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.