summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/image.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2000-05-04 13:48:49 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2000-05-04 13:48:49 +0000
commit1a1cf7ed75d799bbda34399ddab7949b8c06686e (patch)
treebc750639db55bb2da0db4d81b13ab03c97653974 /src/mesa/main/image.c
parentf8825778121b2fe8c012b0ecb2c098865cbe84cb (diff)
downloadexternal_mesa3d-1a1cf7ed75d799bbda34399ddab7949b8c06686e.zip
external_mesa3d-1a1cf7ed75d799bbda34399ddab7949b8c06686e.tar.gz
external_mesa3d-1a1cf7ed75d799bbda34399ddab7949b8c06686e.tar.bz2
implemented GL_EXT_histogram extension
Diffstat (limited to 'src/mesa/main/image.c')
-rw-r--r--src/mesa/main/image.c32
1 files changed, 22 insertions, 10 deletions
diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c
index b16f030..23c5b77 100644
--- a/src/mesa/main/image.c
+++ b/src/mesa/main/image.c
@@ -1,4 +1,4 @@
-/* $Id: image.c,v 1.29 2000/04/18 14:32:10 brianp Exp $ */
+/* $Id: image.c,v 1.30 2000/05/04 13:48:49 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -615,7 +615,8 @@ _mesa_pack_rgba_span( GLcontext *ctx,
ctx->Pixel.ScaleOrBiasRGBApcm ||
ctx->Pixel.ColorTableEnabled ||
ctx->Pixel.PostColorMatrixColorTableEnabled ||
- ctx->Pixel.MinMaxEnabled);
+ ctx->Pixel.MinMaxEnabled ||
+ ctx->Pixel.HistogramEnabled);
/* Test for optimized case first */
if (!applyTransferOps && format == GL_RGBA && type == GL_UNSIGNED_BYTE) {
@@ -680,10 +681,13 @@ _mesa_pack_rgba_span( GLcontext *ctx,
if (ctx->Pixel.PostColorMatrixColorTableEnabled) {
_mesa_lookup_rgba(&ctx->PostColorMatrixColorTable, n, rgba);
}
- /* XXX histogram here */
+ /* update histogram count */
+ if (ctx->Pixel.HistogramEnabled) {
+ _mesa_update_histogram(ctx, n, (CONST GLfloat (*)[4]) rgba);
+ }
/* XXX min/max here */
if (ctx->Pixel.MinMaxEnabled) {
- _mesa_update_minmax(ctx, n, (const GLfloat (*)[4]) rgba);
+ _mesa_update_minmax(ctx, n, (CONST GLfloat (*)[4]) rgba);
if (ctx->MinMax.Sink)
return;
}
@@ -2194,7 +2198,8 @@ _mesa_unpack_ubyte_color_span( GLcontext *ctx,
ctx->Pixel.ScaleOrBiasRGBApcm ||
ctx->Pixel.ColorTableEnabled ||
ctx->Pixel.PostColorMatrixColorTableEnabled ||
- ctx->Pixel.MinMaxEnabled);
+ ctx->Pixel.MinMaxEnabled ||
+ ctx->Pixel.HistogramEnabled);
/* Try simple cases first */
if (!applyTransferOps && srcType == GL_UNSIGNED_BYTE) {
@@ -2320,10 +2325,13 @@ _mesa_unpack_ubyte_color_span( GLcontext *ctx,
if (ctx->Pixel.PostColorMatrixColorTableEnabled) {
_mesa_lookup_rgba(&ctx->PostColorMatrixColorTable, n, rgba);
}
- /* XXX histogram here */
+ /* update histogram count */
+ if (ctx->Pixel.HistogramEnabled) {
+ _mesa_update_histogram(ctx, n, (CONST GLfloat (*)[4]) rgba);
+ }
/* XXX min/max here */
if (ctx->Pixel.MinMaxEnabled) {
- _mesa_update_minmax(ctx, n, (const GLfloat (*)[4]) rgba);
+ _mesa_update_minmax(ctx, n, (CONST GLfloat (*)[4]) rgba);
}
}
@@ -2505,7 +2513,8 @@ _mesa_unpack_float_color_span( GLcontext *ctx,
ctx->Pixel.ScaleOrBiasRGBApcm ||
ctx->Pixel.ColorTableEnabled ||
ctx->Pixel.PostColorMatrixColorTableEnabled ||
- ctx->Pixel.MinMaxEnabled);
+ ctx->Pixel.MinMaxEnabled ||
+ ctx->Pixel.HistogramEnabled);
/* general solution, no special cases, yet */
{
@@ -2581,10 +2590,13 @@ _mesa_unpack_float_color_span( GLcontext *ctx,
if (ctx->Pixel.PostColorMatrixColorTableEnabled) {
_mesa_lookup_rgba(&ctx->PostColorMatrixColorTable, n, rgba);
}
- /* XXX histogram here */
+ /* update histogram count */
+ if (ctx->Pixel.HistogramEnabled) {
+ _mesa_update_histogram(ctx, n, (CONST GLfloat (*)[4]) rgba);
+ }
/* XXX min/max here */
if (ctx->Pixel.MinMaxEnabled) {
- _mesa_update_minmax(ctx, n, (const GLfloat (*)[4]) rgba);
+ _mesa_update_minmax(ctx, n, (CONST GLfloat (*)[4]) rgba);
}
}