From 4d14d91d5d2fb9a5f90acb87b920671f73dbe7c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 3 Feb 2022 19:01:33 +0100 Subject: [PATCH] AnyImageConverter: Basis now supports also 3D (2D array) image export. --- doc/changelog.dox | 3 ++- src/MagnumPlugins/AnyImageConverter/AnyImageConverter.cpp | 8 ++++++-- src/MagnumPlugins/AnyImageConverter/AnyImageConverter.h | 4 ++-- .../AnyImageConverter/Test/AnyImageConverterTest.cpp | 2 ++ 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/doc/changelog.dox b/doc/changelog.dox index 50e37c7db..6d755430d 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -473,7 +473,8 @@ See also: plugins also warn if the user specifies and option that is not present in the target implementation. - @relativeref{Trade,AnyImageConverter} now implements also conversion of 3D - and multi-level 2D/3D images for formats that support it (such as OpenEXR) + and multi-level 2D/3D images for formats that support it (such as Basis + Universal or OpenEXR) - Added @ref Trade::PhongMaterialData::hasCommonTextureTransformation(), @ref Trade::PhongMaterialData::ambientTextureMatrix(), @ref Trade::PhongMaterialData::diffuseTextureMatrix(), diff --git a/src/MagnumPlugins/AnyImageConverter/AnyImageConverter.cpp b/src/MagnumPlugins/AnyImageConverter/AnyImageConverter.cpp index 8dfda9fa5..172ef27d8 100644 --- a/src/MagnumPlugins/AnyImageConverter/AnyImageConverter.cpp +++ b/src/MagnumPlugins/AnyImageConverter/AnyImageConverter.cpp @@ -176,7 +176,9 @@ bool AnyImageConverter::doConvertToFile(const ImageView3D& image, const Containe /* Detect the plugin from extension */ Containers::StringView plugin; - if(normalized.hasSuffix(".exr"_s)) + if(normalized.hasSuffix(".basis"_s)) + plugin = "BasisImageConverter"_s; + else if(normalized.hasSuffix(".exr"_s)) plugin = "OpenExrImageConverter"_s; else if(normalized.hasSuffix(".ktx2"_s)) plugin = "KtxImageConverter"_s; @@ -440,7 +442,9 @@ bool AnyImageConverter::doConvertToFile(const Containers::ArrayView