diff --git a/rtdata/languages/default b/rtdata/languages/default index 3621596f3..3c6313305 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -60,6 +60,7 @@ EXIFFILTER_ISO;ISO EXIFFILTER_LENS;Lens EXIFFILTER_METADATAFILTER;Enable metadata filters EXIFFILTER_SHUTTER;Shutter +EXIFFILTER_RAWTYPE;Raw type EXIFPANEL_ADDEDIT;Add/Edit EXIFPANEL_ADDEDITHINT;Add new tag or edit tag. EXIFPANEL_ADDTAGDLG_ENTERVALUE;Enter value diff --git a/rtengine/dynamicprofile.cc b/rtengine/dynamicprofile.cc index 1afc04446..fc8b952e4 100644 --- a/rtengine/dynamicprofile.cc +++ b/rtengine/dynamicprofile.cc @@ -80,7 +80,8 @@ bool DynamicProfileRule::matches (const rtengine::FramesMetaData *im) const && shutterspeed (im->getShutterSpeed()) && expcomp (im->getExpComp()) && camera (im->getCamera()) - && lens (im->getLens())); + && lens (im->getLens()) + && rawType(im->getRawType(0))); } namespace @@ -208,6 +209,7 @@ bool DynamicProfileRules::loadRules() get_double_range (rule.expcomp, kf, group, "expcomp"); get_optional (rule.camera, kf, group, "camera"); get_optional (rule.lens, kf, group, "lens"); + get_optional (rule.rawType, kf, group, "rawtype"); try { rule.profilepath = kf.get_string (group, "profilepath"); @@ -240,6 +242,7 @@ bool DynamicProfileRules::storeRules() set_double_range (kf, group, "expcomp", rule.expcomp); set_optional (kf, group, "camera", rule.camera); set_optional (kf, group, "lens", rule.lens); + set_optional (kf, group, "rawtype", rule.rawType); kf.set_string (group, "profilepath", rule.profilepath); } diff --git a/rtengine/dynamicprofile.h b/rtengine/dynamicprofile.h index 4e6bbbba9..2de3f422f 100644 --- a/rtengine/dynamicprofile.h +++ b/rtengine/dynamicprofile.h @@ -59,6 +59,7 @@ public: Range expcomp; Optional camera; Optional lens; + Optional rawType; Glib::ustring profilepath; }; diff --git a/rtengine/imagedata.cc b/rtengine/imagedata.cc index eb213a8ea..78a762f2b 100644 --- a/rtengine/imagedata.cc +++ b/rtengine/imagedata.cc @@ -692,6 +692,10 @@ bool FrameData::getHDR () const { return isHDR; } +std::string FrameData::getRawType () const +{ + return isPixelShift ? "PS" : isHDR ? "HDR" : "STD"; +} IIOSampleFormat FrameData::getSampleFormat () const { return sampleFormat; @@ -808,6 +812,11 @@ bool FramesData::getHDR (unsigned int frame) const return frames.empty() || frame >= frames.size() ? false : frames.at(0)->getHDR (); } +std::string FramesData::getRawType (unsigned int frame) const +{ + return frames.empty() || frame >= frames.size() ? "STD" : frames.at(0)->getRawType(); +} + IIOSampleFormat FramesData::getSampleFormat (unsigned int frame) const { return frames.empty() || frame >= frames.size() ? IIOSF_UNKNOWN : frames.at(frame)->getSampleFormat (); diff --git a/rtengine/imagedata.h b/rtengine/imagedata.h index b9f955611..3c8d3b657 100644 --- a/rtengine/imagedata.h +++ b/rtengine/imagedata.h @@ -63,6 +63,7 @@ public: bool getPixelShift () const; bool getHDR () const; + std::string getRawType () const; IIOSampleFormat getSampleFormat () const; rtexif::TagDirectory* getExifData () const; procparams::IPTCPairs getIPTCData () const; @@ -104,6 +105,7 @@ public: FrameData *getFrameData (unsigned int frame) const; bool getPixelShift (unsigned int frame = 0) const; bool getHDR (unsigned int frame = 0) const; + std::string getRawType (unsigned int frame) const; IIOSampleFormat getSampleFormat (unsigned int frame = 0) const; rtexif::TagDirectory* getFrameExifData (unsigned int frame = 0) const; rtexif::TagDirectory* getRootExifData (unsigned int root = 0) const; diff --git a/rtengine/rtengine.h b/rtengine/rtengine.h index 687836c49..b86a2f98a 100644 --- a/rtengine/rtengine.h +++ b/rtengine/rtengine.h @@ -123,6 +123,9 @@ public: virtual bool getPixelShift (unsigned int frame = 0) const = 0; /** @return false: not an HDR file ; true: single or multi-frame HDR file (e.g. Pentax HDR raw file or 32 bit float DNG file or Log compressed) */ virtual bool getHDR (unsigned int frame = 0) const = 0; + + /** @return false: not an HDR file ; true: single or multi-frame HDR file (e.g. Pentax HDR raw file or 32 bit float DNG file or Log compressed) */ + virtual std::string getRawType (unsigned int frame) const = 0; /** @return the sample format based on MetaData */ virtual IIOSampleFormat getSampleFormat (unsigned int frame = 0) const = 0; diff --git a/rtgui/cacheimagedata.h b/rtgui/cacheimagedata.h index 71541cdb8..9d177a05e 100644 --- a/rtgui/cacheimagedata.h +++ b/rtgui/cacheimagedata.h @@ -110,6 +110,7 @@ public: std::string getOrientation (unsigned int frame = 0) const { return ""; } // TODO bool getPixelShift (unsigned int frame = 0) const { return isPixelShift; } bool getHDR (unsigned int frame = 0) const { return isHDR; } + std::string getRawType (unsigned int frame) const { return isPixelShift ? "PS" : isHDR ? "HDR" : "STD"; } rtengine::IIOSampleFormat getSampleFormat (unsigned int frame = 0) const { return sampleFormat; } }; #endif diff --git a/rtgui/dynamicprofilepanel.cc b/rtgui/dynamicprofilepanel.cc index c8a8a1644..7f0ed5db7 100644 --- a/rtgui/dynamicprofilepanel.cc +++ b/rtgui/dynamicprofilepanel.cc @@ -41,6 +41,7 @@ DynamicProfilePanel::EditDialog::EditDialog (const Glib::ustring &title, Gtk::Wi add_optional (M ("EXIFFILTER_CAMERA"), has_camera_, camera_); add_optional (M ("EXIFFILTER_LENS"), has_lens_, lens_); + add_optional (M ("EXIFFILTER_RAWTYPE"), has_rawtype_, rawtype_); add_range (M ("EXIFFILTER_ISO"), iso_min_, iso_max_); add_range (M ("EXIFFILTER_APERTURE"), fnumber_min_, fnumber_max_); @@ -81,6 +82,9 @@ void DynamicProfilePanel::EditDialog::set_rule ( has_lens_->set_active (rule.lens.enabled); lens_->set_text (rule.lens.value); + has_rawtype_->set_active (rule.rawType.enabled); + rawtype_->set_text (rule.rawType.value); + profilepath_->updateProfileList(); if (!profilepath_->setActiveRowFromFullPath (rule.profilepath)) { @@ -112,6 +116,9 @@ DynamicProfileRule DynamicProfilePanel::EditDialog::get_rule() ret.lens.enabled = has_lens_->get_active(); ret.lens.value = lens_->get_text(); + ret.rawType.enabled = has_rawtype_->get_active(); + ret.rawType.value = rawtype_->get_text(); + ret.profilepath = profilepath_->getFullPathFromActiveRow(); return ret; diff --git a/rtgui/dynamicprofilepanel.h b/rtgui/dynamicprofilepanel.h index dca62f1e6..26e816cb0 100644 --- a/rtgui/dynamicprofilepanel.h +++ b/rtgui/dynamicprofilepanel.h @@ -109,6 +109,9 @@ private: Gtk::CheckButton *has_lens_; Gtk::Entry *lens_; + Gtk::CheckButton *has_rawtype_; + Gtk::Entry *rawtype_; + ProfileStoreComboBox *profilepath_; };