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 */
* 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
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 */
* \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,
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;
}
-/* 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 )
}
-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.
*/
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);