2 #include <gli/texture2d.hpp>
3 #include <gli/convert.hpp>
4 #include <gli/generate_mipmaps.hpp>
6 bool convert_rgb32f_rgb9e5(const char* FilenameSrc, const char* FilenameDst)
8 if(FilenameDst == NULL)
10 if(std::strstr(FilenameDst, ".dds") > 0 || std::strstr(FilenameDst, ".ktx") > 0)
13 gli::texture2d TextureSource(gli::load(FilenameSrc));
14 if(TextureSource.empty())
16 if(TextureSource.format() != gli::FORMAT_RGB16_SFLOAT_PACK16 && TextureSource.format() != gli::FORMAT_RGB32_SFLOAT_PACK32)
19 gli::texture2d TextureMipmaped = gli::generate_mipmaps(TextureSource, gli::FILTER_LINEAR);
21 gli::texture2d TextureConverted = gli::convert(TextureMipmaped, gli::FORMAT_RGB9E5_UFLOAT_PACK32);
23 gli::save(TextureConverted, FilenameDst);