get the mipmap level from the texture image

Hello folks,

It may be is a bit off-topic here. I want to access the information about the mipmap level count from the image header. There are many OpenGL image loading libraries for texturing, but i could find out which one provides with the support that i am looking for.

Any idea ?


By image header, do you mean the header of the file containing the image?

That depends on the image format. Common formats like png, jpg, tga, gif, bmp, etc… don’t have mipmaps. They don’t even have the concept of mipmaps
since it is not needed for what they were desinged for. If you load one of those image formats, mipmaps have to be generated on the fly. They also don’t
have cubemaps or 3D texture data.

Image file formats that can store mipmaps are typically customly designed for a specific software. I only know two commonly used, well documented
formats that support mipmaps, cubemap images and everything else that 3D rendering APIs typically have:
[li]DirectDraw Surface (DDS) [/li][li]Valve Texture Format (VTF) [/li][/ul]

There’s also khronos’ KTX, not sure if that sees a lot of use though. It does seem like it could be quite convenient as a format for an on-disk cache or so, since it closely mirrors the GL texture functionality.