ExpoBlendingIntroPage::ExpoBlendingIntroPage(ExpoBlendingManager* const mngr, QWizard* const dlg) : DWizardPage(dlg, i18nc("@title:window", "Welcome to Stacked Images Tool")), d(new Private(mngr)) { DVBox* const vbox = new DVBox(this); QLabel* const title = new QLabel(vbox); title->setWordWrap(true); title->setOpenExternalLinks(true); title->setText(i18n("<qt>" "<p><h1><b>Welcome to Stacked Images Tool</b></h1></p>" "<p>This tool fuses bracketed images with different exposure to make pseudo " "<a href='http://en.wikipedia.org/wiki/High_dynamic_range_imaging'>HDR image</a>.</p>" "<p>It can also be used to <a href='https://en.wikipedia.org/wiki/Focus_stacking'>merge focus bracketed stack</a> " "to get a single image with increased depth of field.</p>" "<p>This assistant will help you to configure how to import images before " "merging them to a single one.</p>" "<p>Bracketed images must be taken with the same camera, " "in the same conditions, and if possible using a tripod.</p>" "<p>For more information, please take a look at " "<a href='http://en.wikipedia.org/wiki/Bracketing'>this page</a></p>" "</qt>")); QGroupBox* const binaryBox = new QGroupBox(vbox); QGridLayout* const binaryLayout = new QGridLayout; binaryBox->setLayout(binaryLayout); binaryBox->setTitle(i18nc("@title:group", "Exposure Blending Binaries")); d->binariesWidget = new DBinarySearch(binaryBox); d->binariesWidget->addBinary(d->mngr->alignBinary()); d->binariesWidget->addBinary(d->mngr->enfuseBinary()); #ifdef Q_OS_OSX // Hugin bundle PKG install d->binariesWidget->addDirectory(QLatin1String("/Applications/Hugin/HuginTools")); d->binariesWidget->addDirectory(QLatin1String("/Applications/Hugin/Hugin.app/Contents/MacOS")); d->binariesWidget->addDirectory(QLatin1String("/Applications/Hugin/tools_mac")); // Std Macports install d->binariesWidget->addDirectory(QLatin1String("/opt/local/bin")); // digiKam Bundle PKG install d->binariesWidget->addDirectory(QLatin1String("/opt/digikam/bin")); #endif #ifdef Q_OS_WIN d->binariesWidget->addDirectory(QLatin1String("C:/Program Files/Hugin/bin")); d->binariesWidget->addDirectory(QLatin1String("C:/Program Files (x86)/Hugin/bin")); d->binariesWidget->addDirectory(QLatin1String("C:/Program Files/GnuWin32/bin")); d->binariesWidget->addDirectory(QLatin1String("C:/Program Files (x86)/GnuWin32/bin")); #endif connect(d->binariesWidget, SIGNAL(signalBinariesFound(bool)), this, SIGNAL(signalExpoBlendingIntroPageIsValid(bool))); emit signalExpoBlendingIntroPageIsValid(d->binariesWidget->allBinariesFound()); setPageWidget(vbox); QPixmap leftPix(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1String("digikam/data/assistant-stack.png"))); setLeftBottomPix(leftPix.scaledToWidth(128, Qt::SmoothTransformation)); }
ItemsPage::ItemsPage(Manager* const mngr, KPWizardDialog* const dlg) : KPWizardPage(dlg, i18nc("@title:window", "<b>Set Panorama Images</b>")), d(new Private) { d->mngr = mngr; KPVBox* const vbox = new KPVBox(this); QLabel* const label1 = new QLabel(vbox); label1->setWordWrap(true); label1->setText(i18n("<qt>" "<p>Set here the list of your images to blend into a panorama. " "Please follow these conditions:</p>" "<ul><li>Images are taken from the same point of view.</li>" "<li>Images are taken with the same camera (and lens).</li>" "<li>Do not mix images with different color depth.</li></ul>" "<p>Note that, in the case of a 360° panorama, the first image " "in the list will be the image that will be in the center of " "the panorama.</p>" "</qt>")); d->list = new KPImagesList(vbox); d->list->slotAddImages(d->mngr->itemsList()); setPageWidget(vbox); QPixmap leftPix(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("kipiplugin_panorama/pics/assistant-stack.png"))); setLeftBottomPix(leftPix.scaledToWidth(128, Qt::SmoothTransformation)); connect(d->list, SIGNAL(signalImageListChanged()), this, SLOT(slotImageListChanged())); QTimer::singleShot(0, this, SLOT(slotSetupList())); }
ExpoBlendingLastPage::ExpoBlendingLastPage(ExpoBlendingManager* const mngr, QWizard* const dlg) : DWizardPage(dlg, i18nc("@title:window", "Pre-Processing is Complete")), d(new Private) { d->mngr = mngr; DVBox* const vbox = new DVBox(this); QLabel* const title = new QLabel(vbox); title->setOpenExternalLinks(true); title->setWordWrap(true); title->setText(i18n("<qt>" "<p><h1><b>Bracketed Images Pre-Processing is Done</b></h1></p>" "<p>Congratulations. Your images are ready to be fused. </p>" "<p>To perform this operation, <b>%1</b> program from " "<a href='%2'>Enblend</a> " "project will be used.</p>" "<p>Press \"Finish\" button to fuse your items and make a pseudo HDR image.</p>" "</qt>", QDir::toNativeSeparators(d->mngr->enfuseBinary().path()), d->mngr->enfuseBinary().url().url())); vbox->setStretchFactor(new QWidget(vbox), 10); setPageWidget(vbox); QPixmap leftPix(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1String("digikam/data/assistant-enfuse.png"))); setLeftBottomPix(leftPix.scaledToWidth(128, Qt::SmoothTransformation)); }
PanoPreviewPage::PanoPreviewPage(PanoManager* const mngr, QWizard* const dlg) : DWizardPage(dlg, i18nc("@title:window", "<b>Preview and Post-Processing</b>")), d(new Private(mngr)) { d->dlg = dlg; DVBox* const vbox = new DVBox(this); d->title = new QLabel(vbox); d->title->setOpenExternalLinks(true); d->title->setWordWrap(true); d->previewWidget = new DPreviewManager(vbox); d->previewWidget->setButtonText(i18nc("@action:button", "Details...")); d->postProcessing = new DHistoryView(vbox); d->progressBar = new DProgressWdg(vbox); setPageWidget(vbox); QPixmap leftPix(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1String("digikam/data/assistant-hugin.png"))); setLeftBottomPix(leftPix.scaledToWidth(128, Qt::SmoothTransformation)); connect(d->progressBar, SIGNAL(signalProgressCanceled()), this, SLOT(slotCancel())); }
PanoIntroPage::PanoIntroPage(PanoManager* const mngr, QWizard* const dlg) : DWizardPage(dlg, i18nc("@title:window", "<b>Welcome to Panorama Tool</b>")), d(new Private(mngr)) { DVBox* const vbox = new DVBox(this); QLabel* const title = new QLabel(vbox); title->setWordWrap(true); title->setOpenExternalLinks(true); title->setText(i18n("<qt>" "<p><h1><b>Welcome to Panorama Tool</b></h1></p>" "<p>This tool stitches several images together to create a panorama, making the " "seam between images not visible.</p>" "<p>This assistant will help you to configure how to import images before " "stitching them into a panorama.</p>" "<p>Images must be taken from the same point of view.</p>" "<p>For more information, please take a look at " "<a href='http://hugin.sourceforge.net/tutorials/overview/en.shtml'>this page</a></p>" "</qt>")); QGroupBox* const binaryBox = new QGroupBox(vbox); QGridLayout* const binaryLayout = new QGridLayout; binaryBox->setLayout(binaryLayout); binaryBox->setTitle(i18nc("@title:group", "Panorama Binaries")); d->binariesWidget = new DBinarySearch(binaryBox); d->binariesWidget->addBinary(d->mngr->autoOptimiserBinary()); d->binariesWidget->addBinary(d->mngr->cpCleanBinary()); d->binariesWidget->addBinary(d->mngr->cpFindBinary()); d->binariesWidget->addBinary(d->mngr->enblendBinary()); d->binariesWidget->addBinary(d->mngr->makeBinary()); d->binariesWidget->addBinary(d->mngr->nonaBinary()); d->binariesWidget->addBinary(d->mngr->panoModifyBinary()); d->mngr->checkForHugin2015(); if (d->mngr->hugin2015()) { d->binariesWidget->addBinary(d->mngr->huginExecutorBinary()); } else { d->binariesWidget->addBinary(d->mngr->pto2MkBinary()); } d->mngr->checkBinaries(); #ifdef Q_OS_OSX // Hugin bundle PKG install d->binariesWidget->addDirectory(QLatin1String("/Applications/Hugin/HuginTools")); d->binariesWidget->addDirectory(QLatin1String("/Applications/Hugin/Hugin.app/Contents/MacOS")); d->binariesWidget->addDirectory(QLatin1String("/Applications/Hugin/tools_mac")); // Std Macports install d->binariesWidget->addDirectory(QLatin1String("/opt/local/bin")); // digiKam Bundle PKG install d->binariesWidget->addDirectory(QLatin1String("/opt/digikam/bin")); #endif #ifdef Q_OS_WIN d->binariesWidget->addDirectory(QLatin1String("C:/Program Files/Hugin/bin")); d->binariesWidget->addDirectory(QLatin1String("C:/Program Files (x86)/Hugin/bin")); d->binariesWidget->addDirectory(QLatin1String("C:/Program Files/GnuWin32/bin")); d->binariesWidget->addDirectory(QLatin1String("C:/Program Files (x86)/GnuWin32/bin")); #endif /* QVBoxLayout* const settingsVBox = new QVBoxLayout(); d->settingsGroupBox = new QGroupBox(i18nc("@title:group", "Panorama Settings"), this); d->settingsGroupBox->setLayout(settingsVBox); d->addGPlusMetadataCheckBox = new QCheckBox(i18nc("@option:check", "Add Photosphere Metadata"), d->settingsGroupBox); d->addGPlusMetadataCheckBox->setToolTip(i18nc("@info:tooltip", "Add Exif metadata to the output panorama image for Google+ 3D viewer")); d->addGPlusMetadataCheckBox->setWhatsThis(i18nc("@info:whatsthis", "<b>Add Photosphere Metadata</b>: Enabling this allows the program to add " "metadata to the output image such that when uploaded to Google+, the " "Google+ 3D viewer is activated and the panorama can be seen in 3D. Note " "that this feature is most interesting for large panoramas.")); settingsVBox->addWidget(d->addGPlusMetadataCheckBox); vbox->addWidget(d->settingsGroupBox); */ QVBoxLayout* const formatVBox = new QVBoxLayout(); d->formatGroupBox = new QGroupBox(i18nc("@title:group", "File Format"), vbox); d->formatGroupBox->setLayout(formatVBox); QButtonGroup* const group = new QButtonGroup(); d->jpegRadioButton = new QRadioButton(i18nc("@option:radio", "JPEG output"), d->formatGroupBox); // The following comment is to get the next string extracted for translation // xgettext: no-c-format d->jpegRadioButton->setToolTip(i18nc("@info:tooltip", "Selects a JPEG output with 90% compression rate " "(lossy compression, smaller size).")); d->jpegRadioButton->setWhatsThis(i18nc("@info:whatsthis", "<b>JPEG output</b>: Using JPEG output, the panorama file will be smaller " "at the cost of information loss during compression. This is the easiest " "way to share the result, or print it online or in a shop.")); formatVBox->addWidget(d->jpegRadioButton); group->addButton(d->jpegRadioButton); d->tiffRadioButton = new QRadioButton(i18nc("@option:radio", "TIFF output"), d->formatGroupBox); d->tiffRadioButton->setToolTip(i18nc("@info:tooltip", "Selects a TIFF output compressed using the LZW algorithm " "(lossless compression, bigger size).")); d->tiffRadioButton->setWhatsThis(i18nc("@info:whatsthis", "<b>TIFF output</b>: Using TIFF output, you get the same color depth than " "your original photos using RAW images at the cost of a bigger panorama file.")); formatVBox->addWidget(d->tiffRadioButton); group->addButton(d->tiffRadioButton); // TODO HDR /* d->hdrRadioButton = new QRadioButton(i18nc("@option:radio", "HDR output"), d->formatGroupBox); d->hdrRadioButton->setToolTip(i18nc("@info:tooltip", "Selects an High Dynamic Range (HDR) image, that can be processed further " "with a dedicated software.")); d->hdrRadioButton->setWhatsThis(i18nc("@info:whatsthis", "<b>HDR output</b>: Output in High Dynamic Range, meaning that every piece of " "information contained in the original photos are preserved. Note that you " "need another software to process the resulting panorama, like " "<a href=\"http://qtpfsgui.sourceforge.net/\">Luminance HDR</a>")); formatVBox->addWidget(d->hdrRadioButton); group->addButton(d->hdrRadioButton); */ switch (d->mngr->format()) { case JPEG: d->jpegRadioButton->setChecked(true); break; case TIFF: d->tiffRadioButton->setChecked(true); break; case HDR: // TODO HDR // d->hdrRadioButton->setChecked(true); break; } setPageWidget(vbox); QPixmap leftPix(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1String("digikam/data/assistant-tripod.png"))); setLeftBottomPix(leftPix.scaledToWidth(128, Qt::SmoothTransformation)); /* connect(d->addGPlusMetadataCheckBox, SIGNAL(stateChanged(int)), this, SLOT(slotToggleGPano(int))); d->addGPlusMetadataCheckBox->setChecked(d->mngr->gPano()); */ slotToggleGPano(0); // Disabled for the moment connect(group, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(slotChangeFileFormat(QAbstractButton*))); connect(d->binariesWidget, SIGNAL(signalBinariesFound(bool)), this, SLOT(slotBinariesChanged(bool))); // TODO HDR // d->hdrCheckBox->setChecked(d->mngr->hdr()); }
PanoLastPage::PanoLastPage(PanoManager* const mngr, QWizard* const dlg) : DWizardPage(dlg, i18nc("@title:window", "<b>Panorama Stitched</b>")), d(new Private) { KConfig config; KConfigGroup group = config.group("Panorama Settings"); d->mngr = mngr; DVBox* const vbox = new DVBox(this); d->title = new QLabel(vbox); d->title->setOpenExternalLinks(true); d->title->setWordWrap(true); QVBoxLayout* const formatVBox = new QVBoxLayout(); d->saveSettingsGroupBox = new QGroupBox(i18nc("@title:group", "Save Settings"), vbox); d->saveSettingsGroupBox->setLayout(formatVBox); formatVBox->addStretch(1); QLabel* const fileTemplateLabel = new QLabel(i18nc("@label:textbox", "File name template:"), d->saveSettingsGroupBox); formatVBox->addWidget(fileTemplateLabel); d->fileTemplateQLineEdit = new QLineEdit(QLatin1String("panorama"), d->saveSettingsGroupBox); d->fileTemplateQLineEdit->setToolTip(i18nc("@info:tooltip", "Name of the panorama file (without its extension).")); d->fileTemplateQLineEdit->setWhatsThis(i18nc("@info:whatsthis", "<b>File name template</b>: Set here the base name of the files that " "will be saved. For example, if your template is <i>panorama</i> and if " "you chose a JPEG output, then your panorama will be saved with the " "name <i>panorama.jpg</i>. If you choose to save also the project file, " "it will have the name <i>panorama.pto</i>.")); formatVBox->addWidget(d->fileTemplateQLineEdit); d->savePtoCheckBox = new QCheckBox(i18nc("@option:check", "Save project file"), d->saveSettingsGroupBox); d->savePtoCheckBox->setChecked(group.readEntry("Save PTO", false)); d->savePtoCheckBox->setToolTip(i18nc("@info:tooltip", "Save the project file for further processing within Hugin GUI.")); d->savePtoCheckBox->setWhatsThis(i18nc("@info:whatsthis", "<b>Save project file</b>: You can keep the project file generated to stitch " "your panorama for further tweaking within " "<a href=\"http://hugin.sourceforge.net/\">Hugin</a> by checking this. " "This is useful if you want a different projection, modify the horizon or " "the center of the panorama, or modify the control points to get better results.")); formatVBox->addWidget(d->savePtoCheckBox); d->warningLabel = new QLabel(d->saveSettingsGroupBox); d->warningLabel->hide(); formatVBox->addWidget(d->warningLabel); d->errorLabel = new QLabel(d->saveSettingsGroupBox); d->errorLabel->hide(); formatVBox->addWidget(d->errorLabel); vbox->setStretchFactor(new QWidget(vbox), 2); setPageWidget(vbox); QPixmap leftPix(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1String("digikam/data/assistant-hugin.png"))); setLeftBottomPix(leftPix.scaledToWidth(128, Qt::SmoothTransformation)); connect(d->fileTemplateQLineEdit, SIGNAL(textChanged(QString)), this, SLOT(slotTemplateChanged(QString))); connect(d->savePtoCheckBox, SIGNAL(stateChanged(int)), this, SLOT(slotPtoCheckBoxChanged(int))); }
PanoOptimizePage::PanoOptimizePage(PanoManager* const mngr, QWizard* const dlg) : DWizardPage(dlg, i18nc("@title:window", "<b>Optimization</b>")), d(new Private) { d->mngr = mngr; d->progressTimer = new QTimer(this); DVBox* const vbox = new DVBox(this); d->title = new QLabel(vbox); d->title->setOpenExternalLinks(true); d->title->setWordWrap(true); KConfig config; KConfigGroup group = config.group("Panorama Settings"); d->horizonCheckbox = new QCheckBox(i18nc("@option:check", "Level horizon"), vbox); d->horizonCheckbox->setChecked(group.readEntry("Horizon", true)); d->horizonCheckbox->setToolTip(i18nc("@info:tooltip", "Detect the horizon and adapt the project to make it horizontal.")); d->horizonCheckbox->setWhatsThis(i18nc("@info:whatsthis", "<b>Level horizon</b>: Detect the horizon and adapt the projection so that " "the detected horizon is an horizontal line in the final panorama")); /* if (!d->mngr->gPano()) { d->projectionAndSizeCheckbox = new QCheckBox(i18nc("@option:check", "Automatic projection and output aspect"), vbox); d->projectionAndSizeCheckbox->setChecked(group.readEntry("Output Projection And Size", true)); d->projectionAndSizeCheckbox->setToolTip(i18nc("@info:tooltip", "Adapt the projection of the panorama and the area rendered on the " "resulting projection so that every photo fits in the resulting " "panorama.")); d->projectionAndSizeCheckbox->setWhatsThis(i18nc("@info:whatsthis", "<b>Automatic projection and output aspect</b>: Automatically " "adapt the projection and the area rendered of the panorama to " "get every photos into the panorama.")); } else { d->projectionAndSizeCheckbox = new QCheckBox(i18nc("@option:check", "Automatic output aspect"), vbox); d->projectionAndSizeCheckbox->setChecked(group.readEntry("Output Projection And Size", true)); d->projectionAndSizeCheckbox->setToolTip(i18nc("@info:tooltip", "Adapt the area rendered on the resulting projection so that " "every photo fits in the resulting panorama.")); d->projectionAndSizeCheckbox->setWhatsThis(i18nc("@info:whatsthis", "<b>Automatic output aspect</b>: Automatically adapt the area " "rendered of the panorama to get every photos into the panorama.")); } */ // d->preprocessResults = new QLabel(vbox); vbox->setStretchFactor(new QWidget(vbox), 2); d->detailsText = new QTextBrowser(vbox); d->detailsText->hide(); vbox->setStretchFactor(new QWidget(vbox), 2); d->progressLabel = new QLabel(vbox); d->progressLabel->setAlignment(Qt::AlignCenter); vbox->setStretchFactor(new QWidget(vbox), 10); setPageWidget(vbox); QPixmap leftPix(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1String("digikam/data/assistant-hugin.png"))); setLeftBottomPix(leftPix.scaledToWidth(128, Qt::SmoothTransformation)); connect(d->progressTimer, SIGNAL(timeout()), this, SLOT(slotProgressTimerDone())); }