histogram code move, remove s_histogram.[ch] from Makefiles
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
# $Id: Makefile.X11,v 1.74 2003/03/01 01:50:20 brianp Exp $
|
# $Id: Makefile.X11,v 1.75 2003/03/25 02:26:29 brianp Exp $
|
||||||
|
|
||||||
# Mesa 3-D graphics library
|
# Mesa 3-D graphics library
|
||||||
# Version: 5.0
|
# Version: 5.0
|
||||||
@@ -102,7 +102,6 @@ CORE_SOURCES = \
|
|||||||
swrast/s_drawpix.c \
|
swrast/s_drawpix.c \
|
||||||
swrast/s_feedback.c \
|
swrast/s_feedback.c \
|
||||||
swrast/s_fog.c \
|
swrast/s_fog.c \
|
||||||
swrast/s_histogram.c \
|
|
||||||
swrast/s_imaging.c \
|
swrast/s_imaging.c \
|
||||||
swrast/s_lines.c \
|
swrast/s_lines.c \
|
||||||
swrast/s_logic.c \
|
swrast/s_logic.c \
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
/* $Id: xm_dd.c,v 1.42 2003/01/16 19:10:46 alanh Exp $ */
|
/* $Id: xm_dd.c,v 1.43 2003/03/25 02:26:30 brianp Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mesa 3-D graphics library
|
* Mesa 3-D graphics library
|
||||||
@@ -35,6 +35,7 @@
|
|||||||
#include "imports.h"
|
#include "imports.h"
|
||||||
#include "mtypes.h"
|
#include "mtypes.h"
|
||||||
#include "state.h"
|
#include "state.h"
|
||||||
|
#include "texobj.h"
|
||||||
#include "texstore.h"
|
#include "texstore.h"
|
||||||
#include "texformat.h"
|
#include "texformat.h"
|
||||||
#include "xmesaP.h"
|
#include "xmesaP.h"
|
||||||
@@ -705,7 +706,7 @@ clear_buffers( GLcontext *ctx, GLbitfield mask,
|
|||||||
if ((mask & (DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT)) &&
|
if ((mask & (DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT)) &&
|
||||||
xmesa->xm_draw_buffer->mesa_buffer.UseSoftwareAlphaBuffers &&
|
xmesa->xm_draw_buffer->mesa_buffer.UseSoftwareAlphaBuffers &&
|
||||||
ctx->Color.ColorMask[ACOMP]) {
|
ctx->Color.ColorMask[ACOMP]) {
|
||||||
_mesa_clear_alpha_buffers(ctx);
|
_swrast_clear_alpha_buffers(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* we can't handle color or index masking */
|
/* we can't handle color or index masking */
|
||||||
@@ -963,6 +964,9 @@ void xmesa_init_pointers( GLcontext *ctx )
|
|||||||
ctx->Driver.CopyTexSubImage2D = _swrast_copy_texsubimage2d;
|
ctx->Driver.CopyTexSubImage2D = _swrast_copy_texsubimage2d;
|
||||||
ctx->Driver.CopyTexSubImage3D = _swrast_copy_texsubimage3d;
|
ctx->Driver.CopyTexSubImage3D = _swrast_copy_texsubimage3d;
|
||||||
|
|
||||||
|
ctx->Driver.NewTextureObject = _mesa_alloc_texture_object;
|
||||||
|
ctx->Driver.DeleteTexture = _mesa_free_texture_object;
|
||||||
|
|
||||||
ctx->Driver.CompressedTexImage1D = _mesa_store_compressed_teximage1d;
|
ctx->Driver.CompressedTexImage1D = _mesa_store_compressed_teximage1d;
|
||||||
ctx->Driver.CompressedTexImage2D = _mesa_store_compressed_teximage2d;
|
ctx->Driver.CompressedTexImage2D = _mesa_store_compressed_teximage2d;
|
||||||
ctx->Driver.CompressedTexImage3D = _mesa_store_compressed_teximage3d;
|
ctx->Driver.CompressedTexImage3D = _mesa_store_compressed_teximage3d;
|
||||||
|
@@ -132,7 +132,6 @@ MESA_CORE_SRCS = \
|
|||||||
swrast/s_drawpix.c \
|
swrast/s_drawpix.c \
|
||||||
swrast/s_feedback.c \
|
swrast/s_feedback.c \
|
||||||
swrast/s_fog.c \
|
swrast/s_fog.c \
|
||||||
swrast/s_histogram.c \
|
|
||||||
swrast/s_imaging.c \
|
swrast/s_imaging.c \
|
||||||
swrast/s_lines.c \
|
swrast/s_lines.c \
|
||||||
swrast/s_logic.c \
|
swrast/s_logic.c \
|
||||||
|
@@ -173,7 +173,6 @@ CORE_SOURCES = \
|
|||||||
swrast/s_drawpix.c \
|
swrast/s_drawpix.c \
|
||||||
swrast/s_feedback.c \
|
swrast/s_feedback.c \
|
||||||
swrast/s_fog.c \
|
swrast/s_fog.c \
|
||||||
swrast/s_histogram.c \
|
|
||||||
swrast/s_imaging.c \
|
swrast/s_imaging.c \
|
||||||
swrast/s_lines.c \
|
swrast/s_lines.c \
|
||||||
swrast/s_logic.c \
|
swrast/s_logic.c \
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
# $Id: Makefile.OSMesa16,v 1.12 2003/03/01 01:50:20 brianp Exp $
|
# $Id: Makefile.OSMesa16,v 1.13 2003/03/25 02:26:29 brianp Exp $
|
||||||
|
|
||||||
# Mesa 3-D graphics library
|
# Mesa 3-D graphics library
|
||||||
# Version: 5.0
|
# Version: 5.0
|
||||||
@@ -103,7 +103,6 @@ CORE_SOURCES = \
|
|||||||
swrast/s_drawpix.c \
|
swrast/s_drawpix.c \
|
||||||
swrast/s_feedback.c \
|
swrast/s_feedback.c \
|
||||||
swrast/s_fog.c \
|
swrast/s_fog.c \
|
||||||
swrast/s_histogram.c \
|
|
||||||
swrast/s_imaging.c \
|
swrast/s_imaging.c \
|
||||||
swrast/s_lines.c \
|
swrast/s_lines.c \
|
||||||
swrast/s_logic.c \
|
swrast/s_logic.c \
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
# $Id: Makefile.X11,v 1.74 2003/03/01 01:50:20 brianp Exp $
|
# $Id: Makefile.X11,v 1.75 2003/03/25 02:26:29 brianp Exp $
|
||||||
|
|
||||||
# Mesa 3-D graphics library
|
# Mesa 3-D graphics library
|
||||||
# Version: 5.0
|
# Version: 5.0
|
||||||
@@ -102,7 +102,6 @@ CORE_SOURCES = \
|
|||||||
swrast/s_drawpix.c \
|
swrast/s_drawpix.c \
|
||||||
swrast/s_feedback.c \
|
swrast/s_feedback.c \
|
||||||
swrast/s_fog.c \
|
swrast/s_fog.c \
|
||||||
swrast/s_histogram.c \
|
|
||||||
swrast/s_imaging.c \
|
swrast/s_imaging.c \
|
||||||
swrast/s_lines.c \
|
swrast/s_lines.c \
|
||||||
swrast/s_logic.c \
|
swrast/s_logic.c \
|
||||||
|
@@ -130,7 +130,6 @@ GL_SOURCES = \
|
|||||||
swrast/s_drawpix.c \
|
swrast/s_drawpix.c \
|
||||||
swrast/s_feedback.c \
|
swrast/s_feedback.c \
|
||||||
swrast/s_fog.c \
|
swrast/s_fog.c \
|
||||||
swrast/s_histogram.c \
|
|
||||||
swrast/s_imaging.c \
|
swrast/s_imaging.c \
|
||||||
swrast/s_lines.c \
|
swrast/s_lines.c \
|
||||||
swrast/s_logic.c \
|
swrast/s_logic.c \
|
||||||
|
@@ -91,7 +91,6 @@ CORE_SRCS = \
|
|||||||
swrast\s_drawpix.c \
|
swrast\s_drawpix.c \
|
||||||
swrast\s_feedback.c \
|
swrast\s_feedback.c \
|
||||||
swrast\s_fog.c \
|
swrast\s_fog.c \
|
||||||
swrast\s_histogram.c \
|
|
||||||
swrast\s_imaging.c \
|
swrast\s_imaging.c \
|
||||||
swrast\s_lines.c \
|
swrast\s_lines.c \
|
||||||
swrast\s_logic.c \
|
swrast\s_logic.c \
|
||||||
|
@@ -97,7 +97,6 @@ RASTER_SOURCES = [.swrast]s_aatriangle.c \
|
|||||||
[.swrast]s_drawpix.c \
|
[.swrast]s_drawpix.c \
|
||||||
[.swrast]s_fog.c \
|
[.swrast]s_fog.c \
|
||||||
[.swrast]s_feedback.c \
|
[.swrast]s_feedback.c \
|
||||||
[.swrast]s_histogram.c \
|
|
||||||
[.swrast]s_imaging.c \
|
[.swrast]s_imaging.c \
|
||||||
[.swrast]s_lines.c \
|
[.swrast]s_lines.c \
|
||||||
[.swrast]s_logic.c \
|
[.swrast]s_logic.c \
|
||||||
@@ -239,7 +238,6 @@ OBJECTS8=[.swrast]s_aatriangle.obj,\
|
|||||||
|
|
||||||
OBJECTS9=[.swrast]s_drawpix.obj,\
|
OBJECTS9=[.swrast]s_drawpix.obj,\
|
||||||
[.swrast]s_fog.obj,\
|
[.swrast]s_fog.obj,\
|
||||||
[.swrast]s_histogram.obj,\
|
|
||||||
[.swrast]s_imaging.obj,\
|
[.swrast]s_imaging.obj,\
|
||||||
[.swrast]s_lines.obj,\
|
[.swrast]s_lines.obj,\
|
||||||
[.swrast]s_logic.obj,\
|
[.swrast]s_logic.obj,\
|
||||||
@@ -435,8 +433,6 @@ imports.obj : imports.c
|
|||||||
$(CC) $(CFLAGS) /obj=[.swrast]s_feedback.obj [.swrast]s_feedback.c
|
$(CC) $(CFLAGS) /obj=[.swrast]s_feedback.obj [.swrast]s_feedback.c
|
||||||
[.swrast]s_fog.obj : [.swrast]s_fog.c
|
[.swrast]s_fog.obj : [.swrast]s_fog.c
|
||||||
$(CC) $(CFLAGS) /obj=[.swrast]s_fog.obj [.swrast]s_fog.c
|
$(CC) $(CFLAGS) /obj=[.swrast]s_fog.obj [.swrast]s_fog.c
|
||||||
[.swrast]s_histogram.obj : [.swrast]s_histogram.c
|
|
||||||
$(CC) $(CFLAGS) /obj=[.swrast]s_histogram.obj [.swrast]s_histogram.c
|
|
||||||
[.swrast]s_imaging.obj : [.swrast]s_imaging.c
|
[.swrast]s_imaging.obj : [.swrast]s_imaging.c
|
||||||
$(CC) $(CFLAGS) /obj=[.swrast]s_imaging.obj [.swrast]s_imaging.c
|
$(CC) $(CFLAGS) /obj=[.swrast]s_imaging.obj [.swrast]s_imaging.c
|
||||||
[.swrast]s_lines.obj : [.swrast]s_lines.c
|
[.swrast]s_lines.obj : [.swrast]s_lines.c
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
/* $Id: histogram.c,v 1.12 2003/03/01 01:50:21 brianp Exp $ */
|
/* $Id: histogram.c,v 1.13 2003/03/25 02:26:29 brianp Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mesa 3-D graphics library
|
* Mesa 3-D graphics library
|
||||||
@@ -32,6 +32,72 @@
|
|||||||
#include "histogram.h"
|
#include "histogram.h"
|
||||||
|
|
||||||
|
|
||||||
|
/**********************************************************************
|
||||||
|
* Internal functions
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Update the min/max values from an array of fragment colors.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
_mesa_update_minmax(GLcontext *ctx, GLuint n, const GLfloat rgba[][4])
|
||||||
|
{
|
||||||
|
GLuint i;
|
||||||
|
for (i = 0; i < n; i++) {
|
||||||
|
/* update mins */
|
||||||
|
if (rgba[i][RCOMP] < ctx->MinMax.Min[RCOMP])
|
||||||
|
ctx->MinMax.Min[RCOMP] = rgba[i][RCOMP];
|
||||||
|
if (rgba[i][GCOMP] < ctx->MinMax.Min[GCOMP])
|
||||||
|
ctx->MinMax.Min[GCOMP] = rgba[i][GCOMP];
|
||||||
|
if (rgba[i][BCOMP] < ctx->MinMax.Min[BCOMP])
|
||||||
|
ctx->MinMax.Min[BCOMP] = rgba[i][BCOMP];
|
||||||
|
if (rgba[i][ACOMP] < ctx->MinMax.Min[ACOMP])
|
||||||
|
ctx->MinMax.Min[ACOMP] = rgba[i][ACOMP];
|
||||||
|
|
||||||
|
/* update maxs */
|
||||||
|
if (rgba[i][RCOMP] > ctx->MinMax.Max[RCOMP])
|
||||||
|
ctx->MinMax.Max[RCOMP] = rgba[i][RCOMP];
|
||||||
|
if (rgba[i][GCOMP] > ctx->MinMax.Max[GCOMP])
|
||||||
|
ctx->MinMax.Max[GCOMP] = rgba[i][GCOMP];
|
||||||
|
if (rgba[i][BCOMP] > ctx->MinMax.Max[BCOMP])
|
||||||
|
ctx->MinMax.Max[BCOMP] = rgba[i][BCOMP];
|
||||||
|
if (rgba[i][ACOMP] > ctx->MinMax.Max[ACOMP])
|
||||||
|
ctx->MinMax.Max[ACOMP] = rgba[i][ACOMP];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Update the histogram values from an array of fragment colors.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
_mesa_update_histogram(GLcontext *ctx, GLuint n, const GLfloat rgba[][4])
|
||||||
|
{
|
||||||
|
const GLint max = ctx->Histogram.Width - 1;
|
||||||
|
GLfloat w = (GLfloat) max;
|
||||||
|
GLuint i;
|
||||||
|
|
||||||
|
if (ctx->Histogram.Width == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (i = 0; i < n; i++) {
|
||||||
|
GLint ri = IROUND(rgba[i][RCOMP] * w);
|
||||||
|
GLint gi = IROUND(rgba[i][GCOMP] * w);
|
||||||
|
GLint bi = IROUND(rgba[i][BCOMP] * w);
|
||||||
|
GLint ai = IROUND(rgba[i][ACOMP] * w);
|
||||||
|
ri = CLAMP(ri, 0, max);
|
||||||
|
gi = CLAMP(gi, 0, max);
|
||||||
|
bi = CLAMP(bi, 0, max);
|
||||||
|
ai = CLAMP(ai, 0, max);
|
||||||
|
ctx->Histogram.Count[ri][RCOMP]++;
|
||||||
|
ctx->Histogram.Count[gi][GCOMP]++;
|
||||||
|
ctx->Histogram.Count[bi][BCOMP]++;
|
||||||
|
ctx->Histogram.Count[ai][ACOMP]++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* XXX the packed pixel formats haven't been tested.
|
* XXX the packed pixel formats haven't been tested.
|
||||||
*/
|
*/
|
||||||
@@ -591,6 +657,12 @@ base_histogram_format( GLenum format )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**********************************************************************
|
||||||
|
* API functions
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
_mesa_GetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values)
|
_mesa_GetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values)
|
||||||
{
|
{
|
||||||
|
@@ -1,10 +1,10 @@
|
|||||||
/* $Id: histogram.h,v 1.4 2002/10/24 23:57:21 brianp Exp $ */
|
/* $Id: histogram.h,v 1.5 2003/03/25 02:26:29 brianp Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mesa 3-D graphics library
|
* Mesa 3-D graphics library
|
||||||
* Version: 4.1
|
* Version: 5.1
|
||||||
*
|
*
|
||||||
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
|
* Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
* copy of this software and associated documentation files (the "Software"),
|
* copy of this software and associated documentation files (the "Software"),
|
||||||
@@ -32,6 +32,13 @@
|
|||||||
#include "mtypes.h"
|
#include "mtypes.h"
|
||||||
|
|
||||||
|
|
||||||
|
extern void
|
||||||
|
_mesa_update_minmax(GLcontext *ctx, GLuint n, const GLfloat rgba[][4]);
|
||||||
|
|
||||||
|
extern void
|
||||||
|
_mesa_update_histogram(GLcontext *ctx, GLuint n, const GLfloat rgba[][4]);
|
||||||
|
|
||||||
|
|
||||||
extern void _mesa_GetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum types, GLvoid *values);
|
extern void _mesa_GetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum types, GLvoid *values);
|
||||||
|
|
||||||
extern void _mesa_GetHistogram(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
|
extern void _mesa_GetHistogram(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
|
||||||
@@ -52,11 +59,4 @@ extern void _mesa_ResetHistogram(GLenum target);
|
|||||||
|
|
||||||
extern void _mesa_ResetMinmax(GLenum target);
|
extern void _mesa_ResetMinmax(GLenum target);
|
||||||
|
|
||||||
extern void
|
|
||||||
_mesa_update_minmax(GLcontext *ctx, GLuint n, const GLfloat rgba[][4]);
|
|
||||||
|
|
||||||
extern void
|
|
||||||
_mesa_update_histogram(GLcontext *ctx, GLuint n, const GLfloat rgba[][4]);
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user