Beispiel #1
0
void
_mesa_fetch_texel_2d_f_srgba_dxt1(const struct gl_texture_image *texImage,
                                  GLint i, GLint j, GLint k, GLfloat *texel)
{
   /* just sample as GLchan and convert to float here */
   GLchan rgba[4];
   fetch_texel_2d_rgba_dxt1(texImage, i, j, k, rgba);
   texel[RCOMP] = nonlinear_to_linear(rgba[RCOMP]);
   texel[GCOMP] = nonlinear_to_linear(rgba[GCOMP]);
   texel[BCOMP] = nonlinear_to_linear(rgba[BCOMP]);
   texel[ACOMP] = CHAN_TO_FLOAT(rgba[ACOMP]);
}
Beispiel #2
0
void
_mesa_fetch_texel_rgba_dxt1(const struct swrast_texture_image *texImage,
                            GLint i, GLint j, GLint k, GLfloat *texel)
{
   /* just sample as GLubyte and convert to float here */
   GLubyte rgba[4];
   fetch_texel_2d_rgba_dxt1(texImage, i, j, k, rgba);
   texel[RCOMP] = UBYTE_TO_FLOAT(rgba[RCOMP]);
   texel[GCOMP] = UBYTE_TO_FLOAT(rgba[GCOMP]);
   texel[BCOMP] = UBYTE_TO_FLOAT(rgba[BCOMP]);
   texel[ACOMP] = UBYTE_TO_FLOAT(rgba[ACOMP]);
}