First steps to extend dynamic profiles for Pixel Shift and HDR images

This commit is contained in:
heckflosse 2018-04-05 14:41:02 +02:00
parent 69d362e3ba
commit 15794cc1ba
9 changed files with 31 additions and 1 deletions

View File

@ -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

View File

@ -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);
}

View File

@ -59,6 +59,7 @@ public:
Range<double> expcomp;
Optional camera;
Optional lens;
Optional rawType;
Glib::ustring profilepath;
};

View File

@ -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 ();

View File

@ -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;

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -109,6 +109,9 @@ private:
Gtk::CheckButton *has_lens_;
Gtk::Entry *lens_;
Gtk::CheckButton *has_rawtype_;
Gtk::Entry *rawtype_;
ProfileStoreComboBox *profilepath_;
};