From 5bc33fe6f1c66ff6e3d41909847cb96ee45d78f3 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 12 Oct 2006 23:47:19 +0000 Subject: remove _mesa_chan_to_float_span(), rename _mesa_map_ci8_to_rgba() --- src/mesa/main/pixel.c | 72 +++------------------------------------------------ 1 file changed, 4 insertions(+), 68 deletions(-) (limited to 'src/mesa/main/pixel.c') diff --git a/src/mesa/main/pixel.c b/src/mesa/main/pixel.c index 95dc2bc0f3..10013bb50d 100644 --- a/src/mesa/main/pixel.c +++ b/src/mesa/main/pixel.c @@ -1714,14 +1714,13 @@ _mesa_map_ci_to_rgba( const GLcontext *ctx, GLuint n, } -/* - * Map 8-bit color indexes to rgb values. +/** + * Map ubyte color indexes to ubyte/RGBA values. */ void -_mesa_map_ci8_to_rgba( const GLcontext *ctx, GLuint n, const GLubyte index[], - GLchan rgba[][4] ) +_mesa_map_ci8_to_rgba8(const GLcontext *ctx, GLuint n, const GLubyte index[], + GLubyte rgba[][4]) { -#if CHAN_BITS == 8 GLuint rmask = ctx->Pixel.MapItoRsize - 1; GLuint gmask = ctx->Pixel.MapItoGsize - 1; GLuint bmask = ctx->Pixel.MapItoBsize - 1; @@ -1737,23 +1736,6 @@ _mesa_map_ci8_to_rgba( const GLcontext *ctx, GLuint n, const GLubyte index[], rgba[i][BCOMP] = bMap[index[i] & bmask]; rgba[i][ACOMP] = aMap[index[i] & amask]; } -#else - GLuint rmask = ctx->Pixel.MapItoRsize - 1; - GLuint gmask = ctx->Pixel.MapItoGsize - 1; - GLuint bmask = ctx->Pixel.MapItoBsize - 1; - GLuint amask = ctx->Pixel.MapItoAsize - 1; - const GLfloat *rMap = ctx->Pixel.MapItoR; - const GLfloat *gMap = ctx->Pixel.MapItoG; - const GLfloat *bMap = ctx->Pixel.MapItoB; - const GLfloat *aMap = ctx->Pixel.MapItoA; - GLuint i; - for (i=0;iDriver.ReadRGBASpan() functions. - * This fixes a number of OpenGL conformance failures when running on - * 16bpp displays, for example. - */ -void -_mesa_chan_to_float_span(const GLcontext *ctx, GLuint n, - CONST GLchan rgba[][4], GLfloat rgbaf[][4]) -{ -#if CHAN_TYPE == GL_FLOAT - MEMCPY(rgbaf, rgba, n * 4 * sizeof(GLfloat)); -#else - const GLuint rShift = CHAN_BITS - ctx->Visual.redBits; - const GLuint gShift = CHAN_BITS - ctx->Visual.greenBits; - const GLuint bShift = CHAN_BITS - ctx->Visual.blueBits; - GLuint aShift; - const GLfloat rScale = 1.0F / (GLfloat) ((1 << ctx->Visual.redBits ) - 1); - const GLfloat gScale = 1.0F / (GLfloat) ((1 << ctx->Visual.greenBits) - 1); - const GLfloat bScale = 1.0F / (GLfloat) ((1 << ctx->Visual.blueBits ) - 1); - GLfloat aScale; - GLuint i; - - if (ctx->Visual.alphaBits > 0) { - aShift = CHAN_BITS - ctx->Visual.alphaBits; - aScale = 1.0F / (GLfloat) ((1 << ctx->Visual.alphaBits) - 1); - } - else { - aShift = 0; - aScale = 1.0F / CHAN_MAXF; - } - - for (i = 0; i < n; i++) { - const GLint r = rgba[i][RCOMP] >> rShift; - const GLint g = rgba[i][GCOMP] >> gShift; - const GLint b = rgba[i][BCOMP] >> bShift; - const GLint a = rgba[i][ACOMP] >> aShift; - rgbaf[i][RCOMP] = (GLfloat) r * rScale; - rgbaf[i][GCOMP] = (GLfloat) g * gScale; - rgbaf[i][BCOMP] = (GLfloat) b * bScale; - rgbaf[i][ACOMP] = (GLfloat) a * aScale; - } -#endif -} /**********************************************************************/ /***** State Management *****/ -- cgit v1.2.3