39#include <exiv2/exiv2.hpp>
41#include <wx/msw/registry.h>
131 args.Append(
"-overwrite_original -tagsfromfile ");
133 args.Append(
" -all:all ");
142 int pos =
s.Find(
"multipliers");
159 args.Append(
" -v -4 -T ");
168 args.Append(
"-overwrite_original -tagsfromfile ");
170 args.Append(
" -all:all ");
228 args.Append(
" -b16 -tz -Y -c ");
239 config.Write(
"/White Balance/Setting",
"Custom");
250 args.Append(
" -b16 -tz -Y -c ");
262 wxRegKey regkey(wxRegKey::HKLM,
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\rawtherapee-cli.exe");
266 if (wxFileName::FileExists(prog))
274 wxRegKey regkeyUser(wxRegKey::HKCU,
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\rawtherapee-cli.exe");
278 if (wxFileName::FileExists(prog))
285 return "rawtherapee-cli.exe";
286#elif defined __WXMAC__
287 return "/Applications/RawTherapee.app/Contents/MacOS/rawtherapee-cli";
289 return "rawtherapee-cli";
321 file.Replace(
"\\",
"/",
true);
327 args.Append(
" --core --conf plugins/imageio/format/tiff/bpp=16");
335#if defined EXIV2_VERSION && EXIV2_TEST_VERSION(0,27,99)
336 Exiv2::Image::UniquePtr image;
338 Exiv2::Image::AutoPtr image;
344 catch (
const Exiv2::Error& e)
346 std::cerr <<
"Exiv2: Error reading metadata (" << e.what() <<
")" << std::endl;
351 image->readMetadata();
353 catch (
const Exiv2::Error& e)
355 std::cerr <<
"Caught Exiv2 exception " << e.what() << std::endl;
359#if defined EXIV2_VERSION && EXIV2_TEST_VERSION(0,27,99)
360 Exiv2::Image::UniquePtr image2;
362 Exiv2::Image::AutoPtr image2;
368 catch (
const Exiv2::Error& e)
370 std::cerr <<
"Exiv2: Error creating temp xmp file (" << e.what() <<
")" << std::endl;
373 image2->setXmpData(image->xmpData());
374 image2->writeMetadata();
391 file.Replace(
"\\",
"/",
true);
397 args.Append(
" --core --conf plugins/imageio/format/tiff/bpp=16");
407 wxRegKey regkey(wxRegKey::HKLM,
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\darktable-cli.exe");
411 if (wxFileName::FileExists(prog))
419 wxRegKey regkeyUser(wxRegKey::HKCU,
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\darktable-cli.exe");
423 if (wxFileName::FileExists(prog))
430 return "darktable-cli.exe";
431#elif defined __WXMAC__
432 return "/Applications/darktable.app/Contents/MacOS/darktable-cli";
434 return "darktable-cli";
485 if (e.GetExitCode() == 0)
489 hugin_utils::HuginMessageBox(
_(
"Could not process the output of reference image.\nFurther processed images will not have a consistent white balance."),
500 if (wxConfigBase::Get()->Read(
"CopyLogToClipboard", 0l) == 1l)
522 if (e.GetExitCode() == 0)
525 if (wxConfigBase::Get()->Read(
"CopyLogToClipboard", 0l) == 1l)
539 if (
event.GetInt() >= 0)
577 wxXmlResource::Get()->LoadDialog(
this,
parent,
"import_raw_dialog");
583 XRCCTRL(*
this,
"raw_dcraw_parameter", wxTextCtrl)->SetValue(
s);
586 s =
config->Read(
"/RawImportDialog/RTProcessingProfile",
"");
587 wxTextCtrl*
ctrl =
XRCCTRL(*
this,
"raw_rt_processing_profile", wxTextCtrl);
589 ctrl->AutoCompleteFileNames();
605 wxCommandEvent
dummy;
638#if defined EXIV2_VERSION && EXIV2_TEST_VERSION(0,27,99)
639#if defined EXV_ENABLE_BMFF && !EXIV2_TEST_VERSION(0,28,3)
645 Exiv2::Image::UniquePtr image;
647 Exiv2::Image::AutoPtr image;
653 catch (
const Exiv2::Error& e)
655 std::cerr <<
"Exiv2: Error reading metadata (" << e.what() <<
")" << std::endl;
662 image->readMetadata();
664 catch (
const Exiv2::Error& e)
666 std::cerr <<
"Caught Exiv2 exception '" << e.what() <<
"' for file " << file << std::endl;
669 Exiv2::ExifData &
exifData = image->exifData();
702 wxXmlResource::Get()->LoadDialog(&
dlg,
this,
"dlg_warning_filename");
703 dlg.SetLabel(
_(
"Warning: Read error"));
704 XRCCTRL(
dlg,
"dlg_warning_text",
wxStaticText)->SetLabel(
_(
"The following files will be skipped because the metadata of these files could not read."));
707 dlg.CenterOnScreen();
726 wxXmlResource::Get()->LoadDialog(&
dlg,
this,
"dlg_warning_filename");
727 dlg.SetLabel(
_(
"Warning: raw images from different cameras"));
728 XRCCTRL(
dlg,
"dlg_warning_text",
wxStaticText)->SetLabel(
_(
"The following images were shot with different camera than the other one.\nThe raw import works only for images from the same cam."));
731 dlg.CenterOnScreen();
786 wxXmlResource::Get()->LoadDialog(&
dlg,
this,
"dlg_warning_overwrite");
789 dlg.CenterOnScreen();
811 config->Write(
"/RawImportDialog/dcrawParameter",
XRCCTRL(*
this,
"raw_dcraw_parameter", wxTextCtrl)->
GetValue().Trim(
true).Trim(
false));
812 config->Write(
"/RawImportDialog/RTProcessingProfile",
XRCCTRL(*
this,
"raw_rt_processing_profile", wxTextCtrl)->
GetValue());
815 std::vector<std::string> files;
819 if (wxFileName::FileExists(img))
838 std::vector<PanoCommand::PanoCommand*>
cmds;
852 wxTextCtrl*
input =
XRCCTRL(*
this,
"raw_rt_processing_profile", wxTextCtrl);
883 XRCCTRL(*
this,
"raw_dcraw_parameter", wxTextCtrl)->Enable(
rawConverter == Converter::DCRAW);
885 XRCCTRL(*
this,
"raw_rt_processing_profile", wxTextCtrl)->Enable(
rawConverter == Converter::RAWTHERAPEE);
895 choice->Append(file.GetFullName());
Definition of dialog and functions to import RAW images to project file.
special class for raw import with dcraw
HuginQueue::CommandQueue * GetCmdQueueForImport(const wxArrayString &rawFilenames, const wxArrayString &imageFilenames) override
return commands for processing of all other images with white balance read by RawImport::ProcessRefer...
void AddAdditionalPanoramaCommand(std::vector< PanoCommand::PanoCommand * > &cmds, HuginBase::Panorama *pano, const int oldImageCount, const int addedImageCount) override
add additional PanoCommand::PanoCommand to vector if needed hint: we need to pass old and new image n...
wxString GetImageExtension() override
image extension of converted files
HuginQueue::CommandQueue * GetCmdQueueForReference(const wxString &rawFilename, const wxString &imageFilename) override
return command for processing of reference image
wxString m_additionalParameters
bool ProcessReferenceOutput(const wxArrayString &output) override
read output of processing of reference image to read in white balance of reference image
bool ProcessAdditionalParameters(wxDialog *dlg) override
reads additional parameters from dialog into class
wxString GetDefaultExe() override
returns the default name of the executable
special class for Darktable raw import
HuginQueue::CommandQueue * GetCmdQueueForImport(const wxArrayString &rawFilenames, const wxArrayString &imageFilenames) override
return commands for processing of all other images with white balance read by RawImport::ProcessRefer...
HuginQueue::CommandQueue * GetCmdQueueForReference(const wxString &rawFilename, const wxString &imageFilename) override
return command for processing of reference image
bool ProcessReferenceOutput(const wxArrayString &output) override
read output of processing of reference image to read in white balance of reference image
wxString GetDefaultExe() override
returns the default name of the executable
bool SupportsOverwrite() override
return true if program supports overwritting output, otherwise false
@ RESPONSE_LINEAR
linear response
std::size_t getNrOfImages() const
number of images.
normal command for queue, processing is stopped if an error occurred in program
optional command for queue, processing of queue is always continued, also if an error occurred
void CopyLogToClipboard()
copy the content of the log window into the clipboard
int ExecQueue(HuginQueue::CommandQueue *queue)
wxArrayString GetLogAsArrayString()
returns the output
PanoCommand to combine other PanoCommands.
Base class for all panorama commands.
virtual void setName(const std::string &newName)
sets the name for the command
add image(s) to a panorama
class for RawTherapee raw import
bool ProcessAdditionalParameters(wxDialog *dlg) override
reads additional parameters from dialog into class
wxString GetDefaultExe() override
returns the default name of the executable
wxString m_processingProfile
bool ProcessReferenceOutput(const wxArrayString &output) override
read output of processing of reference image to read in white balance of reference image
HuginQueue::CommandQueue * GetCmdQueueForReference(const wxString &rawFilename, const wxString &imageFilename) override
return command for processing of reference image
wxString m_usedProcessingProfile
HuginQueue::CommandQueue * GetCmdQueueForImport(const wxArrayString &rawFilenames, const wxArrayString &imageFilenames) override
return commands for processing of all other images with white balance read by RawImport::ProcessRefer...
bool CheckRawFiles()
return true, if all raw files are from the same camera
void OnSelectRTProcessingProfile(wxCommandEvent &e)
PanoCommand::PanoCommand * m_cmd
PanoCommand::PanoCommand * GetPanoCommand()
return PanoCommand for adding converted raw files to Panorama
void OnRawConverterSelected(wxCommandEvent &e)
void OnOk(wxCommandEvent &e)
called when dialog is finished and does the conversion
RawImportDialog(wxWindow *parent, HuginBase::Panorama *pano, std::vector< std::string > &rawFiles)
Constructor, read from xrc ressource; restore last uses settings and position.
~RawImportDialog()
destructor, saves position
void FillImageChoice()
fill list with image names
HuginBase::Panorama * m_pano
wxArrayString m_rawImages
dialog class for showing progress of raw import
void OnProcessTerminate(wxProcessEvent &e)
wxButton * m_cancelButton
virtual ~RawImportProgress()
MyExecPanel * m_progressPanel
RawImportProgress(wxWindow *parent, std::shared_ptr< RawImport > &converter, const wxArrayString &rawImages, const wxArrayString &images, const int refImg)
wxArrayString m_rawImages
std::shared_ptr< RawImport > m_converter
void OnInitDialog(wxInitDialogEvent &e)
void OnCancel(wxCommandEvent &event)
void OnProcessReferenceTerminate(wxProcessEvent &e)
void OnProgress(wxCommandEvent &event)
base class for implementation of Raw import functions
RawImport(wxString ConfigExePath)
bool CheckExe(wxDialog *dlg)
checks if valid executable was given in dialog either absolute path or when relative path is given ch...
virtual bool ProcessAdditionalParameters(wxDialog *dlg)
reads additional parameters from dialog into class
virtual void AddAdditionalPanoramaCommand(std::vector< PanoCommand::PanoCommand * > &cmds, HuginBase::Panorama *pano, const int oldImageCount, const int addedImageCount)
add additional PanoCommand::PanoCommand to vector if needed hint: we need to pass old and new image n...
virtual HuginQueue::CommandQueue * GetCmdQueueForImport(const wxArrayString &rawFilenames, const wxArrayString &imageFilenames)=0
return commands for processing of all other images with white balance read by RawImport::ProcessRefer...
virtual bool ProcessReferenceOutput(const wxArrayString &output)=0
read output of processing of reference image to read in white balance of reference image
virtual wxString GetImageExtension()
image extension of converted files
virtual wxString GetDefaultExe()
returns the default name of the executable
virtual HuginQueue::CommandQueue * GetCmdQueueForReference(const wxString &rawFilename, const wxString &imageFilename)=0
return command for processing of reference image
virtual bool SupportsOverwrite()
return true if program supports overwritting output, otherwise false
const wxString & GetUtilsBinDir()
static huginApp * Get()
hack.. kind of a pseudo singleton...
#define DEBUG_ASSERT(cond)
std::set< unsigned int > UIntSet
str wxEscapeFilename(const str &arg)
special escaping routine for CommandQueues
wxString GetExternalProgram(wxConfigBase *config, const wxString &bindir, const wxString &name)
return path and name of external program, which can be overwritten by the user
std::vector< NormalCommand * > CommandQueue
int HuginMessageBox(const wxString &message, const wxString &caption, int style, wxWindow *parent)
std::string GetDataDir()
returns the full path to the data directory
void StoreFramePosition(wxTopLevelWindow *frame, const wxString &basename, const bool ignoreMaximize)
void RestoreFramePosition(wxTopLevelWindow *frame, const wxString &basename, const bool ignoreMaximize)
include file for the hugin project
void fill_set(_Container &c, typename _Container::key_type begin, typename _Container::key_type end)
std::vector< deghosting::BImagePtr > threshold(const std::vector< deghosting::FImagePtr > &inputImages, const double threshold, const uint16_t flags)
Threshold function used for creating alpha masks for images.
wxwindows specific panorama commands