Browse Source

imageconverter: show total data size in --info.

Counterpart to d07b6a2bb4, 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.
ktx1-detection
Vladimír Vondruš 4 years ago
parent
commit
8d770524e1
  1. 2
      src/Magnum/SceneTools/sceneconverter.cpp
  2. 5
      src/Magnum/Trade/imageconverter.cpp

2
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<std::chrono::milliseconds>(importTime).count())/1.0e3f << "seconds";

5
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<std::chrono::milliseconds>(importTime).count())/1.0e3f << "seconds";

Loading…
Cancel
Save