当前位置: 首页>>代码示例>>C++>>正文


C++ QScopedPointer::getExifComment方法代码示例

本文整理汇总了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";
                }
            }
开发者ID:DINKIN,项目名称:LuminanceHDR,代码行数:54,代码来源:IOWorker.cpp


注:本文中的QScopedPointer::getExifComment方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。