diff options
author | Brian Paul <[email protected]> | 2004-05-12 14:00:36 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2004-05-12 14:00:36 +0000 |
commit | 8813cb56b0e5c61cfcf1a33ed887f46d4f5dbf09 (patch) | |
tree | e28cdb25889fa1f16dd30259cc41348841fc77c2 | |
parent | e61d60eb813ae1891e5c9f65c16f23cc45a48841 (diff) |
yank bgr233 texformat. minor comment updates.
-rw-r--r-- | src/mesa/main/texformat.c | 22 | ||||
-rw-r--r-- | src/mesa/main/texformat.h | 7 | ||||
-rw-r--r-- | src/mesa/main/texformat_tmp.h | 25 | ||||
-rw-r--r-- | src/mesa/main/texstore.c | 53 | ||||
-rw-r--r-- | src/mesa/main/texstore.h | 1 |
5 files changed, 2 insertions, 106 deletions
diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c index 00e15b906ef..01aec5a5bb6 100644 --- a/src/mesa/main/texformat.c +++ b/src/mesa/main/texformat.c @@ -863,28 +863,6 @@ const struct gl_texture_format _mesa_texformat_rgb332 = { fetch_texel_3d_f_rgb332, /* FetchTexel3Df */ }; -const struct gl_texture_format _mesa_texformat_bgr233 = { - MESA_FORMAT_BGR233, /* MesaFormat */ - GL_RGB, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 3, /* RedBits */ - 3, /* GreenBits */ - 2, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 1, /* TexelBytes */ - _mesa_texstore_bgr233, /* StoreTexImageFunc */ - fetch_texel_1d_bgr233, /* FetchTexel1D */ - fetch_texel_2d_bgr233, /* FetchTexel2D */ - fetch_texel_3d_bgr233, /* FetchTexel3D */ - fetch_texel_1d_f_bgr233, /* FetchTexel1Df */ - fetch_texel_2d_f_bgr233, /* FetchTexel2Df */ - fetch_texel_3d_f_bgr233, /* FetchTexel3Df */ -}; - const struct gl_texture_format _mesa_texformat_a8 = { MESA_FORMAT_A8, /* MesaFormat */ GL_ALPHA, /* BaseFormat */ diff --git a/src/mesa/main/texformat.h b/src/mesa/main/texformat.h index c785d107e6c..e67e13b7383 100644 --- a/src/mesa/main/texformat.h +++ b/src/mesa/main/texformat.h @@ -54,8 +54,7 @@ enum _format { * Drivers can override the default formats and convert texture images to * one of these as required. The driver's * dd_function_table::ChooseTextureFormat function will choose one of these - * formats. These formats are all little endian, as shown below. They will - * be most useful for x86-based PC graphics card drivers. + * formats. * * \note In the default case, some of these formats will be duplicates of * the generic formats listed below. However, these formats guarantee their @@ -80,7 +79,6 @@ enum _format { MESA_FORMAT_AL88, /* AAAA AAAA LLLL LLLL */ MESA_FORMAT_LA88, /* LLLL LLLL AAAA AAAA */ MESA_FORMAT_RGB332, /* RRRG GGBB */ - MESA_FORMAT_BGR233, /* BBGG GRRR */ MESA_FORMAT_A8, /* AAAA AAAA */ MESA_FORMAT_L8, /* LLLL LLLL */ MESA_FORMAT_I8, /* IIII IIII */ @@ -105,7 +103,7 @@ enum _format { * \name Generic GLchan-based formats. * * Software-oriented texture formats. Texels are arrays of GLchan - * values so there will be no big/little endian issues. + * values so there are no byte order issues. * * \note Because these are based on the GLchan data type, one cannot assume * 8 bits per channel with these formats. If you require GLubyte channels, @@ -197,7 +195,6 @@ extern const struct gl_texture_format _mesa_texformat_bgra5551; extern const struct gl_texture_format _mesa_texformat_al88; extern const struct gl_texture_format _mesa_texformat_la88; extern const struct gl_texture_format _mesa_texformat_rgb332; -extern const struct gl_texture_format _mesa_texformat_bgr233; extern const struct gl_texture_format _mesa_texformat_a8; extern const struct gl_texture_format _mesa_texformat_l8; extern const struct gl_texture_format _mesa_texformat_i8; diff --git a/src/mesa/main/texformat_tmp.h b/src/mesa/main/texformat_tmp.h index 3f499748d92..972dab6eae1 100644 --- a/src/mesa/main/texformat_tmp.h +++ b/src/mesa/main/texformat_tmp.h @@ -929,31 +929,6 @@ static void FETCH(f_rgb332)( const struct gl_texture_image *texImage, } -/* Fetch color texel from 1D, 2D or 3D bgr233 texture, return 4 GLchans */ -static void FETCH(bgr233)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLubyte *src = UBYTE_SRC( texImage, i, j, k, 1 ); - const GLubyte s = *src; - texel[RCOMP] = UBYTE_TO_CHAN( ((s & 0x07) * 255 / 0x07) ); - texel[GCOMP] = UBYTE_TO_CHAN( ((s & 0x38) * 255 / 0x38) ); - texel[BCOMP] = UBYTE_TO_CHAN( ((s & 0xc0) * 255 / 0xc0) ); - texel[ACOMP] = CHAN_MAX; -} - -/* Fetch color texel from 1D, 2D or 3D bgr233 texture, return 4 GLfloats */ -static void FETCH(f_bgr233)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLubyte *src = UBYTE_SRC( texImage, i, j, k, 1 ); - const GLubyte s = *src; - texel[RCOMP] = (s & 0x07) * (1.0F / 7.0F); - texel[GCOMP] = (s & 0x38) * (1.0F / 56.0F); - texel[BCOMP] = (s & 0xc0) * (1.0F / 192.0F); - texel[ACOMP] = CHAN_MAXF; -} - - /* Fetch color texel from 1D, 2D or 3D a8 texture, return 4 GLchans */ static void FETCH(a8)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index f5d58f2d5e5..4e603c45f6d 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -1759,59 +1759,6 @@ _mesa_texstore_rgb332(STORE_PARAMS) } -GLboolean -_mesa_texstore_bgr233(STORE_PARAMS) -{ - ASSERT(dstFormat == &_mesa_texformat_bgr233); - ASSERT(dstFormat->TexelBytes == 1); - - if (!ctx->_ImageTransferState && - !srcPacking->SwapBytes && - baseInternalFormat == GL_RGB && - srcFormat == GL_BGR && srcType == GL_UNSIGNED_BYTE_3_3_2) { - /* simple memcpy path */ - memcpy_texture(dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset, - dstRowStride, dstImageStride, - srcWidth, srcHeight, srcDepth, srcFormat, srcType, - srcAddr, srcPacking); - } - else { - /* general path */ - const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, - baseInternalFormat, - dstFormat->BaseFormat, - srcWidth, srcHeight, srcDepth, - srcFormat, srcType, srcAddr, - srcPacking); - const GLchan *src = tempImage; - GLubyte *dstImage = (GLubyte *) dstAddr - + dstZoffset * dstImageStride - + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; - GLint img, row, col; - if (!tempImage) - return GL_FALSE; - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); - for (img = 0; img < srcDepth; img++) { - GLubyte *dstRow = dstImage; - for (row = 0; row < srcHeight; row++) { - for (col = 0; col < srcWidth; col++) { - dstRow[col] = PACK_COLOR_233( CHAN_TO_UBYTE(src[BCOMP]), - CHAN_TO_UBYTE(src[GCOMP]), - CHAN_TO_UBYTE(src[RCOMP]) ); - src += 3; - } - dstRow += dstRowStride; - } - dstImage += dstImageStride; - } - _mesa_free((void *) tempImage); - } - return GL_TRUE; -} - - - /** * Texstore for _mesa_texformat_a8, _mesa_texformat_l8, _mesa_texformat_i8. */ diff --git a/src/mesa/main/texstore.h b/src/mesa/main/texstore.h index 22f0c7e9c52..05270ca16c9 100644 --- a/src/mesa/main/texstore.h +++ b/src/mesa/main/texstore.h @@ -72,7 +72,6 @@ extern GLboolean _mesa_texstore_bgra5551(STORE_PARAMS); extern GLboolean _mesa_texstore_al88(STORE_PARAMS); extern GLboolean _mesa_texstore_la88(STORE_PARAMS); extern GLboolean _mesa_texstore_rgb332(STORE_PARAMS); -extern GLboolean _mesa_texstore_bgr233(STORE_PARAMS); extern GLboolean _mesa_texstore_a8(STORE_PARAMS); extern GLboolean _mesa_texstore_ci8(STORE_PARAMS); extern GLboolean _mesa_texstore_ycbcr(STORE_PARAMS); |