From 8d770524e1b3d2dae6d814978d70229abc8cc195 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 31 May 2022 10:44:36 +0200 Subject: [PATCH] imageconverter: show total data size in --info. Counterpart to d07b6a2bb464cc99f8bc166248fa582678b7bc95, which did this for sceneconverter (I should really do changes in both at the same time). Additionally, it's not saying "uncompressed" for images anymore, since it's more confusing than just saying nothing, especially when block-compressed formats are involved. --- src/Magnum/SceneTools/sceneconverter.cpp | 2 +- src/Magnum/Trade/imageconverter.cpp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Magnum/SceneTools/sceneconverter.cpp b/src/Magnum/SceneTools/sceneconverter.cpp index 4971792e9..0ee1b6234 100644 --- a/src/Magnum/SceneTools/sceneconverter.cpp +++ b/src/Magnum/SceneTools/sceneconverter.cpp @@ -1278,7 +1278,7 @@ is specified as well, the IDs reference attributes of the first mesh.)") totalImageDataSize += info.dataSize; } if(!imageInfos.isEmpty()) - Debug{} << "Total (uncompressed) image data size:" << Utility::format("{:.1f}", totalImageDataSize/1024.0f) << "kB"; + Debug{} << "Total image data size:" << Utility::format("{:.1f}", totalImageDataSize/1024.0f) << "kB"; if(args.isSet("profile")) { Debug{} << "Import took" << UnsignedInt(std::chrono::duration_cast(importTime).count())/1.0e3f << "seconds"; diff --git a/src/Magnum/Trade/imageconverter.cpp b/src/Magnum/Trade/imageconverter.cpp index d2688f196..5eb01f6af 100644 --- a/src/Magnum/Trade/imageconverter.cpp +++ b/src/Magnum/Trade/imageconverter.cpp @@ -514,6 +514,7 @@ key=true; configuration subgroups are delimited with /.)") else useColor = Debug::isTty() ? Debug::Flags{} : Debug::Flag::DisableColors; + std::size_t totalImageDataSize = 0; for(const Trade::Implementation::ImageInfo& info: infos) { Debug d{useColor}; if(info.level == 0) { @@ -542,7 +543,11 @@ key=true; configuration subgroups are delimited with /.)") << Debug::color(Debug::Color::Green) << info.dataFlags << Debug::resetColor; d << Debug::nospace << ")"; + + totalImageDataSize += info.dataSize; } + if(!infos.isEmpty()) + Debug{} << "Total image data size:" << Utility::format("{:.1f}", totalImageDataSize/1024.0f) << "kB"; if(args.isSet("profile")) { Debug{} << "Import took" << UnsignedInt(std::chrono::duration_cast(importTime).count())/1.0e3f << "seconds";