|
|
|
@ -925,19 +925,11 @@ key=true; configuration subgroups are delimited with /.)") |
|
|
|
data = outputImages3D.front().data(); |
|
|
|
data = outputImages3D.front().data(); |
|
|
|
} else CORRADE_INTERNAL_ASSERT_UNREACHABLE(); |
|
|
|
} else CORRADE_INTERNAL_ASSERT_UNREACHABLE(); |
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
Trade::Implementation::Duration d{conversionTime}; |
|
|
|
Trade::Implementation::Duration d{conversionTime}; |
|
|
|
if(!Utility::Path::write(output, data)) return 1; |
|
|
|
if(!Utility::Path::write(output, data)) return 1; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(args.isSet("profile")) { |
|
|
|
|
|
|
|
Debug{} << "Import took" << UnsignedInt(std::chrono::duration_cast<std::chrono::milliseconds>(importTime).count())/1.0e3f << "seconds, conversion" |
|
|
|
|
|
|
|
<< UnsignedInt(std::chrono::duration_cast<std::chrono::milliseconds>(conversionTime).count())/1.0e3f << "seconds"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Otherwise convert to a file */ |
|
|
|
|
|
|
|
} else { |
|
|
|
/* Load converter plugin */ |
|
|
|
/* Load converter plugin */ |
|
|
|
PluginManager::Manager<Trade::AbstractImageConverter> converterManager{ |
|
|
|
PluginManager::Manager<Trade::AbstractImageConverter> converterManager{ |
|
|
|
args.value("plugin-dir").empty() ? Containers::String{} : |
|
|
|
args.value("plugin-dir").empty() ? Containers::String{} : |
|
|
|
@ -983,9 +975,7 @@ key=true; configuration subgroups are delimited with /.)") |
|
|
|
if(args.isSet("verbose")) converter->addFlags(Trade::ImageConverterFlag::Verbose); |
|
|
|
if(args.isSet("verbose")) converter->addFlags(Trade::ImageConverterFlag::Verbose); |
|
|
|
Implementation::setOptions(*converter, "AnyImageConverter", args.value("converter-options")); |
|
|
|
Implementation::setOptions(*converter, "AnyImageConverter", args.value("converter-options")); |
|
|
|
|
|
|
|
|
|
|
|
/* Save output file */ |
|
|
|
|
|
|
|
bool converted; |
|
|
|
bool converted; |
|
|
|
{ |
|
|
|
|
|
|
|
Trade::Implementation::Duration d{conversionTime}; |
|
|
|
Trade::Implementation::Duration d{conversionTime}; |
|
|
|
if(outputDimensions == 1) |
|
|
|
if(outputDimensions == 1) |
|
|
|
converted = convertOneOrMoreImagesToFile(*converter, outputImages1D, output); |
|
|
|
converted = convertOneOrMoreImagesToFile(*converter, outputImages1D, output); |
|
|
|
@ -994,11 +984,11 @@ key=true; configuration subgroups are delimited with /.)") |
|
|
|
else if(outputDimensions == 3) |
|
|
|
else if(outputDimensions == 3) |
|
|
|
converted = convertOneOrMoreImagesToFile(*converter, outputImages3D, output); |
|
|
|
converted = convertOneOrMoreImagesToFile(*converter, outputImages3D, output); |
|
|
|
else CORRADE_INTERNAL_ASSERT_UNREACHABLE(); |
|
|
|
else CORRADE_INTERNAL_ASSERT_UNREACHABLE(); |
|
|
|
} |
|
|
|
|
|
|
|
if(!converted) { |
|
|
|
if(!converted) { |
|
|
|
Error{} << "Cannot save file" << output; |
|
|
|
Error{} << "Cannot save file" << output; |
|
|
|
return 5; |
|
|
|
return 5; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(args.isSet("profile")) { |
|
|
|
if(args.isSet("profile")) { |
|
|
|
Debug{} << "Import took" << UnsignedInt(std::chrono::duration_cast<std::chrono::milliseconds>(importTime).count())/1.0e3f << "seconds, conversion" |
|
|
|
Debug{} << "Import took" << UnsignedInt(std::chrono::duration_cast<std::chrono::milliseconds>(importTime).count())/1.0e3f << "seconds, conversion" |
|
|
|
|