28#define EXP5TO8R(packedcol) \
29 ((((packedcol) >> 8) & 0xf8) | (((packedcol) >> 13) & 0x7))
31#define EXP6TO8G(packedcol) \
32 ((((packedcol) >> 3) & 0xfc) | (((packedcol) >> 9) & 0x3))
34#define EXP5TO8B(packedcol) \
35 ((((packedcol) << 3) & 0xf8) | (((packedcol) >> 2) & 0x7))
38 ((col) | ((col) << 4))
45 const GLushort color0 = img_block_src[0] | (img_block_src[1] << 8);
46 const GLushort color1 = img_block_src[2] | (img_block_src[3] << 8);
47 const GLuint bits = img_block_src[4] | (img_block_src[5] << 8) |
48 (img_block_src[6] << 16) | (img_block_src[7] << 24);
66 if ((dxt_type > 1) || (color0 > color1)) {
78 if ((dxt_type > 1) || (color0 > color1)) {
104 const GLubyte *blksrc = (
pixdata + ((srcRowStride + 3) / 4 * (
j / 4) + (
i / 4)) * 8);
116 const GLubyte *blksrc = (
pixdata + ((srcRowStride + 3) / 4 * (
j / 4) + (
i / 4)) * 8);
128 const GLubyte *blksrc = (
pixdata + ((srcRowStride + 3) / 4 * (
j / 4) + (
i / 4)) * 16);
132 const GLubyte bit_pos = 4 * ((
j&3) * 4 + (
i&3));
133 const GLuint alpha_low = blksrc[0] | (blksrc[1] << 8) | (blksrc[2] << 16) | (blksrc[3] << 24);
134 const GLuint alpha_high = blksrc[4] | (blksrc[5] << 8) | (blksrc[6] << 16) | (blksrc[7] << 24);
144 const GLubyte anibble = (blksrc[((
j&3) * 4 + (
i&3)) / 2] >> (4 * (
i&1))) & 0xf;
159 const GLubyte *blksrc = (
pixdata + ((srcRowStride + 3) / 4 * (
j / 4) + (
i / 4)) * 16);
160 const GLubyte alpha0 = blksrc[0];
161 const GLubyte alpha1 = blksrc[1];
163 const GLubyte bit_pos = 3 * ((
j&3) * 4 + (
i&3));
165 const GLuint bits_low = blksrc[2] | (blksrc[3] << 8) | (blksrc[4] << 16) | (blksrc[5] << 24);
166 const GLuint bits_high = blksrc[6] | (blksrc[7] << 8);
171 else if (bit_pos == 30)
172 code = (
GLubyte) ((bits_low >> 30) & 3) | ((bits_high << 2) & 4);
174 code = (
GLubyte) ((bits_high >> (bit_pos - 32)) & 7);
178 const GLubyte bit_pos = ((
j&3) * 4 + (
i&3)) * 3;
179 const GLubyte acodelow = blksrc[2 + bit_pos / 8];
180 const GLubyte acodehigh = blksrc[3 + bit_pos / 8];
181 const GLubyte code = (acodelow >> (bit_pos & 0x7) |
182 (acodehigh << (8 - (bit_pos & 0x7)))) & 0x7;
186 if (alpha0 > alpha1) {
234 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[]