private Image.Format getImageFormat(int glFormat, int glInternalFormat, int glType) {
        EnumSet<Caps> caps = EnumSet.allOf(Caps.class);
        GLImageFormat[][] formats = GLImageFormats.getFormatsForCaps(caps);
        for (GLImageFormat[] format : formats) {
            for (int j = 0; j < format.length; j++) {
                GLImageFormat glImgFormat = format[j];
                if (glImgFormat != null) {
                    if (glImgFormat.format == glFormat && glImgFormat.dataType == glType) {
                        if (glFormat == glInternalFormat || glImgFormat.internalFormat == glInternalFormat) {
                            return Image.Format.values()[j];
                        }
                    }
                }
            }
        }
        return null;
    }
returns the JME image format from gl formats and types.
@param glFormat
@param glInternalFormat
@param glType
@return
jme3-core/src/plugins/java/com/jme3/texture/plugins/ktx/KTXLoader.java