32#define EXP5TO8R(packedcol) \
33 ((((packedcol) >> 8) & 0xf8) | (((packedcol) >> 13) & 0x7))
35#define EXP6TO8G(packedcol) \
36 ((((packedcol) >> 3) & 0xfc) | (((packedcol) >> 9) & 0x3))
38#define EXP5TO8B(packedcol) \
39 ((((packedcol) << 3) & 0xf8) | (((packedcol) >> 2) & 0x7))
42 ((col) | ((col) << 4))
49 const GLushort color0 = img_block_src[0] | (img_block_src[1] << 8);
50 const GLushort color1 = img_block_src[2] | (img_block_src[3] << 8);
51 const GLuint bits = img_block_src[4] | (img_block_src[5] << 8) |
52 (img_block_src[6] << 16) | (img_block_src[7] << 24);
70 if ((dxt_type > 1) || (color0 > color1)) {
82 if ((dxt_type > 1) || (color0 > color1)) {
108 const GLubyte *blksrc = (
pixdata + ((srcRowStride + 3) / 4 * (
j / 4) + (
i / 4)) * 8);
120 const GLubyte *blksrc = (
pixdata + ((srcRowStride + 3) / 4 * (
j / 4) + (
i / 4)) * 8);
132 const GLubyte *blksrc = (
pixdata + ((srcRowStride + 3) / 4 * (
j / 4) + (
i / 4)) * 16);
136 const GLubyte bit_pos = 4 * ((
j&3) * 4 + (
i&3));
137 const GLuint alpha_low = blksrc[0] | (blksrc[1] << 8) | (blksrc[2] << 16) | (blksrc[3] << 24);
138 const GLuint alpha_high = blksrc[4] | (blksrc[5] << 8) | (blksrc[6] << 16) | (blksrc[7] << 24);
148 const GLubyte anibble = (blksrc[((
j&3) * 4 + (
i&3)) / 2] >> (4 * (
i&1))) & 0xf;
163 const GLubyte *blksrc = (
pixdata + ((srcRowStride + 3) / 4 * (
j / 4) + (
i / 4)) * 16);
164 const GLubyte alpha0 = blksrc[0];
165 const GLubyte alpha1 = blksrc[1];
167 const GLubyte bit_pos = 3 * ((
j&3) * 4 + (
i&3));
169 const GLuint bits_low = blksrc[2] | (blksrc[3] << 8) | (blksrc[4] << 16) | (blksrc[5] << 24);
170 const GLuint bits_high = blksrc[6] | (blksrc[7] << 8);
175 else if (bit_pos == 30)
176 code = (
GLubyte) ((bits_low >> 30) & 3) | ((bits_high << 2) & 4);
178 code = (
GLubyte) ((bits_high >> (bit_pos - 32)) & 7);
182 const GLubyte bit_pos = ((
j&3) * 4 + (
i&3)) * 3;
183 const GLubyte acodelow = blksrc[2 + bit_pos / 8];
184 const GLubyte acodehigh = blksrc[3 + bit_pos / 8];
185 const GLubyte code = (acodelow >> (bit_pos & 0x7) |
186 (acodehigh << (8 - (bit_pos & 0x7)))) & 0x7;
190 if (alpha0 > alpha1) {
238 else if (alpha0 > alpha1)
void fetch_2d_texel_rgba_dxt3(GLint srcRowStride, const GLubyte *pixdata, GLint i, GLint j, GLvoid *texel)
#define EXP5TO8R(packedcol)
void fetch_2d_texel_rgb_dxt1(GLint srcRowStride, const GLubyte *pixdata, GLint i, GLint j, GLvoid *texel)
void fetch_2d_texel_rgba_dxt1(GLint srcRowStride, const GLubyte *pixdata, GLint i, GLint j, GLvoid *texel)
#define EXP6TO8G(packedcol)
void fetch_2d_texel_rgba_dxt5(GLint srcRowStride, const GLubyte *pixdata, GLint i, GLint j, GLvoid *texel)
static void dxt135_decode_imageblock(const GLubyte *img_block_src, GLint i, GLint j, GLuint dxt_type, GLvoid *texel)
#define EXP5TO8B(packedcol)
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
static const unsigned char pixdata[]