Added support for 4,7,12,16 bit luminance and intensity formats

This commit is contained in:
Robert Osfield 2007-03-06 11:20:39 +00:00
parent 62ac5301c9
commit 5423add9e2

View File

@ -195,9 +195,23 @@ unsigned int Image::computeNumComponents(GLenum pixelFormat)
case(GL_RGBA): return 4;
case(GL_BGRA): return 4;
case(GL_LUMINANCE): return 1;
case(GL_LUMINANCE4): return 1;
case(GL_LUMINANCE8): return 1;
case(GL_LUMINANCE12): return 1;
case(GL_LUMINANCE16): return 1;
case(GL_LUMINANCE16F_ARB): return 1;
case(GL_LUMINANCE32F_ARB): return 1;
case(GL_LUMINANCE4_ALPHA4): return 2;
case(GL_LUMINANCE6_ALPHA2): return 2;
case(GL_LUMINANCE8_ALPHA8): return 2;
case(GL_LUMINANCE12_ALPHA4): return 2;
case(GL_LUMINANCE12_ALPHA12): return 2;
case(GL_LUMINANCE16_ALPHA16): return 2;
case(GL_INTENSITY): return 1;
case(GL_INTENSITY4): return 1;
case(GL_INTENSITY8): return 1;
case(GL_INTENSITY12): return 1;
case(GL_INTENSITY16): return 1;
case(GL_INTENSITY16F_ARB): return 1;
case(GL_INTENSITY32F_ARB): return 1;
case(GL_LUMINANCE_ALPHA): return 2;
@ -251,6 +265,25 @@ unsigned int Image::computePixelSizeInBits(GLenum format,GLenum type)
default: break;
}
switch(format)
{
case(GL_LUMINANCE4): return 4;
case(GL_LUMINANCE8): return 8;
case(GL_LUMINANCE12): return 12;
case(GL_LUMINANCE16): return 16;
case(GL_LUMINANCE4_ALPHA4): return 8;
case(GL_LUMINANCE6_ALPHA2): return 8;
case(GL_LUMINANCE8_ALPHA8): return 16;
case(GL_LUMINANCE12_ALPHA4): return 16;
case(GL_LUMINANCE12_ALPHA12): return 24;
case(GL_LUMINANCE16_ALPHA16): return 32;
case(GL_INTENSITY4): return 4;
case(GL_INTENSITY8): return 8;
case(GL_INTENSITY12): return 12;
case(GL_INTENSITY16): return 16;
default: break;
}
switch(type)
{