Apply code-cleanup patch from @Floessie
See https://github.com/Beep6581/RawTherapee/pull/5325
This commit is contained in:
@@ -69,37 +69,40 @@ FramesMetaData* FramesMetaData::fromFile (const Glib::ustring& fname, std::uniqu
|
|||||||
return new FramesData (fname, std::move(rml), firstFrameOnly);
|
return new FramesData (fname, std::move(rml), firstFrameOnly);
|
||||||
}
|
}
|
||||||
|
|
||||||
FrameData::FrameData (rtexif::TagDirectory* frameRootDir_, rtexif::TagDirectory* rootDir, rtexif::TagDirectory* firstRootDir)
|
FrameData::FrameData(rtexif::TagDirectory* frameRootDir_, rtexif::TagDirectory* rootDir, rtexif::TagDirectory* firstRootDir) :
|
||||||
: frameRootDir(frameRootDir_), iptc(nullptr), time(), timeStamp(), iso_speed(0), aperture(0.), focal_len(0.), focal_len35mm(0.), focus_dist(0.f),
|
frameRootDir(frameRootDir_),
|
||||||
shutter(0.), expcomp(0.), make("Unknown"), model("Unknown"), orientation("Unknown"), rating(0), lens("Unknown"),
|
iptc(nullptr),
|
||||||
sampleFormat(IIOSF_UNKNOWN), isPixelShift(false), isHDR(false)
|
time{},
|
||||||
|
timeStamp{},
|
||||||
|
iso_speed(0),
|
||||||
|
aperture(0.),
|
||||||
|
focal_len(0.),
|
||||||
|
focal_len35mm(0.),
|
||||||
|
focus_dist(0.f),
|
||||||
|
shutter(0.),
|
||||||
|
expcomp(0.),
|
||||||
|
make("Unknown"),
|
||||||
|
model("Unknown"),
|
||||||
|
orientation("Unknown"),
|
||||||
|
rating(0),
|
||||||
|
lens("Unknown"),
|
||||||
|
sampleFormat(IIOSF_UNKNOWN),
|
||||||
|
isPixelShift(false),
|
||||||
|
isHDR(false)
|
||||||
{
|
{
|
||||||
memset (&time, 0, sizeof(time));
|
|
||||||
|
|
||||||
if (!frameRootDir) {
|
if (!frameRootDir) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
rtexif::Tag* tag;
|
|
||||||
rtexif::TagDirectory* newFrameRootDir = frameRootDir;
|
|
||||||
|
|
||||||
memset(&time, 0, sizeof(time));
|
|
||||||
timeStamp = 0;
|
|
||||||
iso_speed = 0;
|
|
||||||
aperture = 0.0;
|
|
||||||
focal_len = 0.0;
|
|
||||||
focal_len35mm = 0.0;
|
|
||||||
focus_dist = 0.0f;
|
|
||||||
shutter = 0.0;
|
|
||||||
expcomp = 0.0;
|
|
||||||
make.clear();
|
make.clear();
|
||||||
model.clear();
|
model.clear();
|
||||||
serial.clear();
|
serial.clear();
|
||||||
orientation.clear();
|
orientation.clear();
|
||||||
lens.clear();
|
lens.clear();
|
||||||
rating = 0;
|
|
||||||
|
|
||||||
tag = newFrameRootDir->findTag("Make");
|
rtexif::TagDirectory* newFrameRootDir = frameRootDir;
|
||||||
|
|
||||||
|
rtexif::Tag* tag = newFrameRootDir->findTag("Make");
|
||||||
if (!tag) {
|
if (!tag) {
|
||||||
newFrameRootDir = rootDir;
|
newFrameRootDir = rootDir;
|
||||||
tag = newFrameRootDir->findTag("Make");
|
tag = newFrameRootDir->findTag("Make");
|
||||||
@@ -198,17 +201,11 @@ FrameData::FrameData (rtexif::TagDirectory* frameRootDir_, rtexif::TagDirectory*
|
|||||||
}
|
}
|
||||||
char sXMPRating[64];
|
char sXMPRating[64];
|
||||||
if (newFrameRootDir->getXMPTagValue("xmp:Rating", sXMPRating)) {
|
if (newFrameRootDir->getXMPTagValue("xmp:Rating", sXMPRating)) {
|
||||||
rating = atoi(sXMPRating);
|
// Guard against out-of-range values (<0, >5)
|
||||||
}
|
rating = rtengine::max(0, rtengine::min(5, atoi(sXMPRating)));
|
||||||
// guard against out-of-range values
|
|
||||||
if (rating > 5) {
|
|
||||||
rating = 5;
|
|
||||||
}
|
|
||||||
// Currently, Rating=-1 is not supported. A value of -1 should mean
|
// Currently, Rating=-1 is not supported. A value of -1 should mean
|
||||||
// "Rejected" according to the specification. Maybe in the future, Rating=-1
|
// "Rejected" according to the specification. Maybe in the future, Rating=-1
|
||||||
// sets InTrash=true?
|
// sets InTrash=true?
|
||||||
if (rating < 0) {
|
|
||||||
rating = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tag = newFrameRootDir->findTagUpward("MakerNote");
|
tag = newFrameRootDir->findTagUpward("MakerNote");
|
||||||
@@ -1197,15 +1194,21 @@ std::string FramesData::getOrientation(unsigned int frame) const
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
int FramesData::getRating (unsigned int frame) const
|
|
||||||
|
int FramesData::getRating(unsigned int frame) const
|
||||||
{
|
{
|
||||||
return frames.empty() || frame >= frames.size() ? 0 : frames.at(frame)->getRating ();
|
return getFromFrame<int>(
|
||||||
|
frames,
|
||||||
|
frame,
|
||||||
|
[](const FrameData& frame_data)
|
||||||
|
{
|
||||||
|
return frame_data.getRating();
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//------inherited functions--------------//
|
//------inherited functions--------------//
|
||||||
|
|
||||||
|
|
||||||
std::string FramesMetaData::apertureToString (double aperture)
|
std::string FramesMetaData::apertureToString (double aperture)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@@ -127,7 +127,7 @@ public:
|
|||||||
std::string getModel (unsigned int frame = 0) const override;
|
std::string getModel (unsigned int frame = 0) const override;
|
||||||
std::string getLens (unsigned int frame = 0) const override;
|
std::string getLens (unsigned int frame = 0) const override;
|
||||||
std::string getSerialNumber (unsigned int frame = 0) const;
|
std::string getSerialNumber (unsigned int frame = 0) const;
|
||||||
std::string getOrientation (unsigned int frame = 0) const;
|
std::string getOrientation (unsigned int frame = 0) const override;
|
||||||
int getRating (unsigned int frame = 0) const override;
|
int getRating (unsigned int frame = 0) const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -24,12 +24,37 @@
|
|||||||
|
|
||||||
#include "../rtengine/procparams.h"
|
#include "../rtengine/procparams.h"
|
||||||
|
|
||||||
CacheImageData::CacheImageData ()
|
CacheImageData::CacheImageData() :
|
||||||
: md5(""), supported(false), format(FT_Invalid), rankOld(-1), inTrashOld(false), recentlySaved(false),
|
supported(false),
|
||||||
timeValid(false), year(0), month(0), day(0), hour(0), min(0), sec(0), exifValid(false), frameCount(1),
|
format(FT_Invalid),
|
||||||
fnumber(0.0), shutter(0.0), focalLen(0.0), focalLen35mm(0.0), focusDist(0.f), iso(0), rating(0), isHDR (false),
|
rankOld(-1),
|
||||||
isPixelShift (false), sensortype(rtengine::ST_NONE), sampleFormat(rtengine::IIOSF_UNKNOWN),
|
inTrashOld(false),
|
||||||
redAWBMul(-1.0), greenAWBMul(-1.0), blueAWBMul(-1.0), rotate(0), thumbImgType(0)
|
recentlySaved(false),
|
||||||
|
timeValid(false),
|
||||||
|
year(0),
|
||||||
|
month(0),
|
||||||
|
day(0),
|
||||||
|
hour(0),
|
||||||
|
min(0),
|
||||||
|
sec(0),
|
||||||
|
exifValid(false),
|
||||||
|
frameCount(1),
|
||||||
|
fnumber(0.0),
|
||||||
|
shutter(0.0),
|
||||||
|
focalLen(0.0),
|
||||||
|
focalLen35mm(0.0),
|
||||||
|
focusDist(0.f),
|
||||||
|
iso(0),
|
||||||
|
rating(0),
|
||||||
|
isHDR (false),
|
||||||
|
isPixelShift (false),
|
||||||
|
sensortype(rtengine::ST_NONE),
|
||||||
|
sampleFormat(rtengine::IIOSF_UNKNOWN),
|
||||||
|
redAWBMul(-1.0),
|
||||||
|
greenAWBMul(-1.0),
|
||||||
|
blueAWBMul(-1.0),
|
||||||
|
rotate(0),
|
||||||
|
thumbImgType(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user