本文整理汇总了C++中QScopedPointer::getExifComment方法的典型用法代码示例。如果您正苦于以下问题:C++ QScopedPointer::getExifComment方法的具体用法?C++ QScopedPointer::getExifComment怎么用?C++ QScopedPointer::getExifComment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QScopedPointer
的用法示例。
在下文中一共展示了QScopedPointer::getExifComment方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: write_ldr_frame
bool IOWorker::write_ldr_frame(pfs::Frame* ldr_input,
const QString& filename,
const QString& inputFileName,
const QVector<float>& expoTimes,
TonemappingOptions* tmopts,
const pfs::Params& params)
{
bool status = true;
emit IO_init();
QScopedPointer<TMOptionsOperations> operations;
if (tmopts != NULL) {
operations.reset(new TMOptionsOperations(tmopts));
}
QFileInfo qfi(filename);
QString absoluteFileName = qfi.absoluteFilePath();
QByteArray encodedName = QFile::encodeName(absoluteFileName);
try
{
FrameWriterPtr writer = FrameWriterFactory::open(encodedName.constData(), params);
writer->write(*ldr_input, params);
}
catch (pfs::io::UnsupportedFormat& exUnsupported) {
qDebug() << "Exception: " << exUnsupported.what();
QString format = qfi.suffix();
// QScopedPointer will call delete when this object goes out of scope
QScopedPointer<QImage> image(fromLDRPFStoQImage(ldr_input, 0.f, 1.f));
status = image->save(filename, format.toLocal8Bit(), -1);
}
catch (pfs::io::InvalidFile& /*exInvalid*/) {
status = false;
}
catch (pfs::io::WriteException& /*exWrite*/) {
status = false;
}
if ( status )
{
// copy EXIF tags from the 1st bracketed image
if ( !inputFileName.isEmpty() )
{
QFileInfo fileinfo(inputFileName);
QString absoluteInputFileName = fileinfo.absoluteFilePath();
QByteArray encodedInputFileName = QFile::encodeName(absoluteInputFileName);
QString comment = operations->getExifComment();
if ( !expoTimes.empty() ) {
comment += "\nBracketed images exposure times:\n";
foreach (float e, expoTimes) {
comment += QString("%1").arg(e) + "\n";
}
}