Merge branch 'dev' into relax-procparam-dependency
This commit is contained in:
commit
9fe6bcaab1
BIN
rtdata/dcpprofiles/FUJIFILM GFX 50R.dcp
Normal file
BIN
rtdata/dcpprofiles/FUJIFILM GFX 50R.dcp
Normal file
Binary file not shown.
BIN
rtdata/dcpprofiles/NIKON D70s.dcp
Normal file
BIN
rtdata/dcpprofiles/NIKON D70s.dcp
Normal file
Binary file not shown.
27
rtdata/profiles/Unclipped.pp3
Normal file
27
rtdata/profiles/Unclipped.pp3
Normal file
@ -0,0 +1,27 @@
|
||||
[Exposure]
|
||||
ClampOOG=false
|
||||
Curve=0;
|
||||
Curve2=0;
|
||||
|
||||
[Black & White]
|
||||
BeforeCurve=0;
|
||||
AfterCurve=0;
|
||||
|
||||
[Vibrance]
|
||||
Enabled=false
|
||||
|
||||
[Color appearance]
|
||||
Enabled=false
|
||||
|
||||
[Film Simulation]
|
||||
Enabled=false
|
||||
|
||||
[RGB Curves]
|
||||
LumaMode=false
|
||||
|
||||
[Color Management]
|
||||
ApplyLookTable=false
|
||||
|
||||
[RAW]
|
||||
CA=true
|
||||
CAAutoIterations=2
|
@ -1265,7 +1265,7 @@ void DCPProfile::step2ApplyTile(float* rc, float* gc, float* bc, int width, int
|
||||
float cnewb = FCLIP(newb);
|
||||
|
||||
float h, s, v;
|
||||
Color::rgb2hsvdcp(cnewr, cnewg, cnewb, h, s, v);
|
||||
Color::rgb2hsvtc(cnewr, cnewg, cnewb, h, s, v);
|
||||
|
||||
hsdApply(look_info, look_table, h, s, v);
|
||||
s = CLIP01(s);
|
||||
@ -1648,7 +1648,7 @@ std::vector<DCPProfile::HsbModify> DCPProfile::makeHueSatMap(const ColorTemp& wh
|
||||
return res;
|
||||
}
|
||||
|
||||
void DCPProfile::hsdApply(const HsdTableInfo& table_info, const std::vector<HsbModify>& table_base, float& h, float& s, float& v) const
|
||||
inline void DCPProfile::hsdApply(const HsdTableInfo& table_info, const std::vector<HsbModify>& table_base, float& h, float& s, float& v) const
|
||||
{
|
||||
// Apply the HueSatMap. Ported from Adobes reference implementation.
|
||||
float hue_shift;
|
||||
|
@ -300,6 +300,38 @@ FrameData::FrameData (rtexif::TagDirectory* frameRootDir_, rtexif::TagDirectory*
|
||||
}
|
||||
|
||||
if (lens == "Unknown") {
|
||||
const auto lens_from_make_and_model =
|
||||
[this, exif]() -> bool
|
||||
{
|
||||
if (!exif) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const rtexif::Tag* const lens_model = exif->getTag(0xA434);
|
||||
|
||||
if (lens_model) {
|
||||
const rtexif::Tag* const lens_make = exif->getTag(0xA433);
|
||||
const std::string make =
|
||||
lens_make
|
||||
? lens_make->valueToString()
|
||||
: std::string();
|
||||
const std::string model = lens_model->valueToString();
|
||||
|
||||
if (!model.empty()) {
|
||||
lens = make;
|
||||
|
||||
if (!lens.empty()) {
|
||||
lens += ' ';
|
||||
}
|
||||
|
||||
lens += model;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
if (mnote) {
|
||||
|
||||
@ -341,6 +373,11 @@ FrameData::FrameData (rtexif::TagDirectory* frameRootDir_, rtexif::TagDirectory*
|
||||
}
|
||||
}
|
||||
}
|
||||
// If MakeNotes are vague, fall back to Exif LensMake and LensModel if set
|
||||
// https://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Nikon.html#LensType
|
||||
if (lens == "Manual Lens No CPU") {
|
||||
lens_from_make_and_model();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -406,11 +443,15 @@ FrameData::FrameData (rtexif::TagDirectory* frameRootDir_, rtexif::TagDirectory*
|
||||
rtexif::Tag *lt = mnote->getTag("LensType");
|
||||
|
||||
if ( lt ) {
|
||||
std::string ldata = lt->valueToString ();
|
||||
if (lt->toInt()) {
|
||||
std::string ldata = lt->valueToString ();
|
||||
|
||||
if (ldata.size() > 1) {
|
||||
found = true;
|
||||
lens = "Canon " + ldata;
|
||||
if (ldata.size() > 1) {
|
||||
found = true;
|
||||
lens = "Canon " + ldata;
|
||||
}
|
||||
} else {
|
||||
found = lens_from_make_and_model();
|
||||
}
|
||||
}
|
||||
|
||||
@ -437,7 +478,14 @@ FrameData::FrameData (rtexif::TagDirectory* frameRootDir_, rtexif::TagDirectory*
|
||||
}
|
||||
}
|
||||
if (mnote->getTag ("LensType")) {
|
||||
lens = mnote->getTag ("LensType")->valueToString ();
|
||||
lens = mnote->getTag ("LensType")->valueToString();
|
||||
// If MakeNotes are vague, fall back to Exif LensMake and LensModel if set
|
||||
// https://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Pentax.html#LensType
|
||||
if (lens == "M-42 or No Lens" || lens == "K or M Lens" || lens == "A Series Lens" || lens == "Sigma") {
|
||||
lens_from_make_and_model();
|
||||
}
|
||||
} else {
|
||||
lens_from_make_and_model();
|
||||
}
|
||||
|
||||
// Try to get the FocalLength from the LensInfo structure, where length below 10mm will be correctly set
|
||||
@ -459,6 +507,9 @@ FrameData::FrameData (rtexif::TagDirectory* frameRootDir_, rtexif::TagDirectory*
|
||||
} else if (mnote && (!make.compare (0, 4, "SONY") || !make.compare (0, 6, "KONICA"))) {
|
||||
if (mnote->getTag ("LensID")) {
|
||||
lens = mnote->getTag ("LensID")->valueToString ();
|
||||
if (lens == "Unknown") {
|
||||
lens_from_make_and_model();
|
||||
}
|
||||
}
|
||||
} else if (!make.compare (0, 7, "OLYMPUS")) {
|
||||
if (mnote->getTag ("Equipment")) {
|
||||
@ -468,6 +519,9 @@ FrameData::FrameData (rtexif::TagDirectory* frameRootDir_, rtexif::TagDirectory*
|
||||
lens = eq->getTag ("LensType")->valueToString ();
|
||||
}
|
||||
}
|
||||
if (lens == "Unknown") {
|
||||
lens_from_make_and_model();
|
||||
}
|
||||
} else if (mnote && !make.compare (0, 9, "Panasonic")) {
|
||||
if (mnote->getTag ("LensType")) {
|
||||
std::string panalens = mnote->getTag("LensType")->valueToString();
|
||||
@ -482,9 +536,7 @@ FrameData::FrameData (rtexif::TagDirectory* frameRootDir_, rtexif::TagDirectory*
|
||||
}
|
||||
} else if (exif->getTag ("DNGLensInfo")) {
|
||||
lens = exif->getTag ("DNGLensInfo")->valueToString ();
|
||||
} else if (exif->getTag ("LensModel")) {
|
||||
lens = exif->getTag ("LensModel")->valueToString ();
|
||||
} else if (exif->getTag ("LensInfo")) {
|
||||
} else if (!lens_from_make_and_model() && exif->getTag ("LensInfo")) {
|
||||
lens = exif->getTag ("LensInfo")->valueToString ();
|
||||
}
|
||||
}
|
||||
@ -1243,35 +1295,31 @@ FramesData::FramesData (const Glib::ustring& fname, std::unique_ptr<RawMetaDataL
|
||||
FILE* f = g_fopen (fname.c_str (), "rb");
|
||||
|
||||
if (f) {
|
||||
const bool has_rml_exif_base = rml->exifBase >= 0;
|
||||
rtexif::ExifManager exifManager (f, std::move(rml), firstFrameOnly);
|
||||
|
||||
if (has_rml_exif_base) {
|
||||
if (exifManager.f && exifManager.rml) {
|
||||
if (exifManager.rml->exifBase >= 0) {
|
||||
exifManager.parseRaw ();
|
||||
|
||||
} else if (exifManager.rml->ciffBase >= 0) {
|
||||
exifManager.parseCIFF ();
|
||||
}
|
||||
}
|
||||
|
||||
// copying roots
|
||||
roots = exifManager.roots;
|
||||
|
||||
// creating FrameData
|
||||
for (auto currFrame : exifManager.frames) {
|
||||
frames.push_back(std::unique_ptr<FrameData>(new FrameData(currFrame, currFrame->getRoot(), roots.at(0))));
|
||||
}
|
||||
for (auto currRoot : roots) {
|
||||
rtexif::Tag* t = currRoot->getTag(0x83BB);
|
||||
|
||||
if (t && !iptc) {
|
||||
iptc = iptc_data_new_from_data ((unsigned char*)t->getValue (), (unsigned)t->getValueSize ());
|
||||
break;
|
||||
}
|
||||
if (exifManager.f && exifManager.rml) {
|
||||
if (exifManager.rml->exifBase >= 0) {
|
||||
exifManager.parseRaw ();
|
||||
} else if (exifManager.rml->ciffBase >= 0) {
|
||||
exifManager.parseCIFF ();
|
||||
}
|
||||
}
|
||||
|
||||
// copying roots
|
||||
roots = exifManager.roots;
|
||||
|
||||
// creating FrameData
|
||||
for (auto currFrame : exifManager.frames) {
|
||||
frames.push_back(std::unique_ptr<FrameData>(new FrameData(currFrame, currFrame->getRoot(), roots.at(0))));
|
||||
}
|
||||
for (auto currRoot : roots) {
|
||||
rtexif::Tag* t = currRoot->getTag(0x83BB);
|
||||
|
||||
if (t && !iptc) {
|
||||
iptc = iptc_data_new_from_data ((unsigned char*)t->getValue (), (unsigned)t->getValueSize ());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
fclose (f);
|
||||
}
|
||||
} else if (hasJpegExtension(fname)) {
|
||||
|
@ -313,6 +313,8 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
|
||||
} else {
|
||||
imgsrc->setBorder(std::max(params->raw.bayersensor.border, 2));
|
||||
}
|
||||
} else if (imgsrc->getSensorType() == ST_FUJI_XTRANS) {
|
||||
imgsrc->setBorder(params.raw.xtranssensor.border);
|
||||
}
|
||||
bool autoContrast = imgsrc->getSensorType() == ST_BAYER ? params->raw.bayersensor.dualDemosaicAutoContrast : params->raw.xtranssensor.dualDemosaicAutoContrast;
|
||||
double contrastThreshold = imgsrc->getSensorType() == ST_BAYER ? params->raw.bayersensor.dualDemosaicContrast : params->raw.xtranssensor.dualDemosaicContrast;
|
||||
|
@ -2609,6 +2609,7 @@ RAWParams::XTransSensor::XTransSensor() :
|
||||
method(getMethodString(Method::THREE_PASS)),
|
||||
dualDemosaicAutoContrast(true),
|
||||
dualDemosaicContrast(20),
|
||||
border(7),
|
||||
ccSteps(0),
|
||||
blackred(0.0),
|
||||
blackgreen(0.0),
|
||||
@ -2622,6 +2623,7 @@ bool RAWParams::XTransSensor::operator ==(const XTransSensor& other) const
|
||||
method == other.method
|
||||
&& dualDemosaicAutoContrast == other.dualDemosaicAutoContrast
|
||||
&& dualDemosaicContrast == other.dualDemosaicContrast
|
||||
&& border == other.border
|
||||
&& ccSteps == other.ccSteps
|
||||
&& blackred == other.blackred
|
||||
&& blackgreen == other.blackgreen
|
||||
@ -3552,6 +3554,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo
|
||||
saveToKeyfile(!pedited || pedited->raw.xtranssensor.method, "RAW X-Trans", "Method", raw.xtranssensor.method, keyFile);
|
||||
saveToKeyfile(!pedited || pedited->raw.xtranssensor.dualDemosaicAutoContrast, "RAW X-Trans", "DualDemosaicAutoContrast", raw.xtranssensor.dualDemosaicAutoContrast, keyFile);
|
||||
saveToKeyfile(!pedited || pedited->raw.xtranssensor.dualDemosaicContrast, "RAW X-Trans", "DualDemosaicContrast", raw.xtranssensor.dualDemosaicContrast, keyFile);
|
||||
saveToKeyfile(!pedited || pedited->raw.xtranssensor.border, "RAW X-Trans", "Border", raw.xtranssensor.border, keyFile);
|
||||
saveToKeyfile(!pedited || pedited->raw.xtranssensor.ccSteps, "RAW X-Trans", "CcSteps", raw.xtranssensor.ccSteps, keyFile);
|
||||
saveToKeyfile(!pedited || pedited->raw.xtranssensor.exBlackRed, "RAW X-Trans", "PreBlackRed", raw.xtranssensor.blackred, keyFile);
|
||||
saveToKeyfile(!pedited || pedited->raw.xtranssensor.exBlackGreen, "RAW X-Trans", "PreBlackGreen", raw.xtranssensor.blackgreen, keyFile);
|
||||
@ -5099,6 +5102,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
|
||||
}
|
||||
}
|
||||
assignFromKeyfile(keyFile, "RAW X-Trans", "DualDemosaicContrast", pedited, raw.xtranssensor.dualDemosaicContrast, pedited->raw.xtranssensor.dualDemosaicContrast);
|
||||
assignFromKeyfile(keyFile, "RAW X-Trans", "Border", pedited, raw.xtranssensor.border, pedited->raw.xtranssensor.border);
|
||||
assignFromKeyfile(keyFile, "RAW X-Trans", "CcSteps", pedited, raw.xtranssensor.ccSteps, pedited->raw.xtranssensor.ccSteps);
|
||||
assignFromKeyfile(keyFile, "RAW X-Trans", "PreBlackRed", pedited, raw.xtranssensor.blackred, pedited->raw.xtranssensor.exBlackRed);
|
||||
assignFromKeyfile(keyFile, "RAW X-Trans", "PreBlackGreen", pedited, raw.xtranssensor.blackgreen, pedited->raw.xtranssensor.exBlackGreen);
|
||||
|
@ -1444,6 +1444,7 @@ struct RAWParams {
|
||||
Glib::ustring method;
|
||||
bool dualDemosaicAutoContrast;
|
||||
double dualDemosaicContrast;
|
||||
int border;
|
||||
int ccSteps;
|
||||
double blackred;
|
||||
double blackgreen;
|
||||
|
@ -166,6 +166,8 @@ private:
|
||||
} else {
|
||||
imgsrc->setBorder(std::max(params.raw.bayersensor.border, 2));
|
||||
}
|
||||
} else if (imgsrc->getSensorType() == ST_FUJI_XTRANS) {
|
||||
imgsrc->setBorder(params.raw.xtranssensor.border);
|
||||
}
|
||||
imgsrc->getFullSize (fw, fh, tr);
|
||||
|
||||
|
@ -120,6 +120,11 @@ void RawImageSource::xtransborder_interpolate (int border, array2D<float> &red,
|
||||
|
||||
int xtrans[6][6];
|
||||
ri->getXtransMatrix(xtrans);
|
||||
const float weight[3][3] = {
|
||||
{0.25f, 0.5f, 0.25f},
|
||||
{0.5f, 0.f, 0.5f},
|
||||
{0.25f, 0.5f, 0.25f}
|
||||
};
|
||||
|
||||
for (int row = 0; row < height; row++)
|
||||
for (int col = 0; col < width; col++) {
|
||||
@ -129,11 +134,11 @@ void RawImageSource::xtransborder_interpolate (int border, array2D<float> &red,
|
||||
|
||||
float sum[6] = {0.f};
|
||||
|
||||
for (int y = MAX(0, row - 1); y <= MIN(row + 1, height - 1); y++)
|
||||
for (int x = MAX(0, col - 1); x <= MIN(col + 1, width - 1); x++) {
|
||||
for (int y = MAX(0, row - 1), v = row == 0 ? 0 : -1; y <= MIN(row + 1, height - 1); y++, v++)
|
||||
for (int x = MAX(0, col - 1), h = col == 0 ? 0 : -1; x <= MIN(col + 1, width - 1); x++, h++) {
|
||||
int f = fcol(y, x);
|
||||
sum[f] += rawData[y][x];
|
||||
sum[f + 3]++;
|
||||
sum[f] += rawData[y][x] * weight[v + 1][h + 1];
|
||||
sum[f + 3] += weight[v + 1][h + 1];
|
||||
}
|
||||
|
||||
switch(fcol(row, col)) {
|
||||
@ -197,12 +202,6 @@ void RawImageSource::xtrans_interpolate (const int passes, const bool useCieLab)
|
||||
|
||||
const int height = H, width = W;
|
||||
|
||||
// if (settings->verbose) {
|
||||
// printf("%d-pass X-Trans interpolation using %s conversion...\n", passes, useCieLab ? "lab" : "yuv");
|
||||
// }
|
||||
|
||||
xtransborder_interpolate(6, red, green, blue);
|
||||
|
||||
float xyz_cam[3][3];
|
||||
{
|
||||
float rgb_cam[3][4];
|
||||
@ -956,6 +955,7 @@ void RawImageSource::xtrans_interpolate (const int passes, const bool useCieLab)
|
||||
free(buffer);
|
||||
}
|
||||
|
||||
xtransborder_interpolate(8, red, green, blue);
|
||||
}
|
||||
#undef CLIP
|
||||
void RawImageSource::fast_xtrans_interpolate (const array2D<float> &rawData, array2D<float> &red, array2D<float> &green, array2D<float> &blue)
|
||||
|
@ -32,7 +32,7 @@ namespace rtexif
|
||||
class CAOnOffInterpreter : public Interpreter
|
||||
{
|
||||
public:
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
int n = t->toInt();
|
||||
|
||||
@ -51,7 +51,7 @@ class CAIntSerNumInterpreter : public Interpreter
|
||||
{
|
||||
public:
|
||||
CAIntSerNumInterpreter () {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
return "";
|
||||
}
|
||||
@ -63,7 +63,7 @@ class CAApertureInterpreter : public Interpreter
|
||||
{
|
||||
public:
|
||||
CAApertureInterpreter () {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
char buffer[32];
|
||||
double v = pow (2.0, t->toDouble() / 64.0);
|
||||
@ -92,7 +92,7 @@ CAMacroModeInterpreter caMacroModeInterpreter;
|
||||
class CASelfTimerInterpreter : public Interpreter
|
||||
{
|
||||
public:
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
int sec = t->toInt (0, SHORT);
|
||||
|
||||
@ -385,7 +385,7 @@ CAExposureModeInterpreter caExposureModeInterpreter;
|
||||
class CAFlashBitsInterpreter : public Interpreter
|
||||
{
|
||||
public:
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
std::ostringstream s;
|
||||
unsigned bits = t->toInt (0, SHORT);
|
||||
@ -533,7 +533,7 @@ CARAWQualityInterpreter caRAWQualityInterpreter;
|
||||
class CAFocalInterpreter : public Interpreter
|
||||
{
|
||||
public:
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
Tag *unitTag = t->getParent()->getRoot()->findTag ("FocalUnits");
|
||||
double v = unitTag ? unitTag->toDouble() : 1.;
|
||||
@ -957,7 +957,7 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
int lensID = t->toInt();
|
||||
|
||||
@ -1109,7 +1109,7 @@ CAFocalTypeInterpreter caFocalTypeInterpreter;
|
||||
class CAFocalPlaneInterpreter : public Interpreter
|
||||
{
|
||||
public:
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
int val = t->toInt();
|
||||
|
||||
@ -1127,7 +1127,7 @@ CAFocalPlaneInterpreter caFocalPlaneInterpreter;
|
||||
class CAExposureTimeInterpreter : public Interpreter
|
||||
{
|
||||
public:
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
char buffer[32];
|
||||
double d = pow (2, - t->toInt() / 32.0);
|
||||
@ -1139,7 +1139,7 @@ CAExposureTimeInterpreter caExposureTimeInterpreter;
|
||||
|
||||
class CAEVInterpreter : public Interpreter
|
||||
{
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
char buffer[32];
|
||||
sprintf (buffer, "%.1f", t->toDouble() / 32.0 );
|
||||
@ -1151,7 +1151,7 @@ CAEVInterpreter caEVInterpreter;
|
||||
class CABaseISOInterpreter : public Interpreter
|
||||
{
|
||||
public:
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
char buffer[32];
|
||||
int a = t->toInt();
|
||||
@ -1288,7 +1288,7 @@ CASlowShutterInterpreter caSlowShutterInterpreter;
|
||||
class CAFlashGuideNumberInterpreter : public Interpreter
|
||||
{
|
||||
public:
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
int n = t->toInt();
|
||||
|
||||
@ -1349,7 +1349,7 @@ CAControModeInterpreter caControModeInterpreter;
|
||||
class CAFocusDistanceInterpreter : public Interpreter
|
||||
{
|
||||
public:
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
char buffer[32];
|
||||
sprintf (buffer, "%.2f", t->toDouble() / 100 );
|
||||
@ -1361,7 +1361,7 @@ CAFocusDistanceInterpreter caFocusDistanceInterpreter;
|
||||
class CAMeasuredEVInterpreter : public Interpreter
|
||||
{
|
||||
public:
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
char buffer[32];
|
||||
sprintf (buffer, "%.1f", t->toDouble() / 8 - 6 );
|
||||
@ -1496,7 +1496,7 @@ CAToningEffectInterpreter caToningEffectInterpreter;
|
||||
class CAFileNumberInterpreter : public Interpreter
|
||||
{
|
||||
public:
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
unsigned long val = t->toInt (0, LONG);
|
||||
char buffer[32];
|
||||
|
@ -34,7 +34,7 @@ class NAISOInterpreter : public Interpreter
|
||||
{
|
||||
public:
|
||||
NAISOInterpreter () {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
char buffer[32];
|
||||
sprintf (buffer, "%d", t->toInt (2));
|
||||
@ -47,7 +47,7 @@ class NAISOInfoISOInterpreter : public Interpreter
|
||||
{
|
||||
public:
|
||||
NAISOInfoISOInterpreter () {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
char buffer[32];
|
||||
int a = t->toInt();
|
||||
@ -83,7 +83,7 @@ class NAISOExpansionInterpreter : public Interpreter
|
||||
{
|
||||
public:
|
||||
NAISOExpansionInterpreter () {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
int a = t->toInt();
|
||||
|
||||
@ -142,7 +142,7 @@ class NALensTypeInterpreter : public Interpreter
|
||||
{
|
||||
public:
|
||||
NALensTypeInterpreter () {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
int a = t->toInt();
|
||||
std::ostringstream str;
|
||||
@ -191,7 +191,7 @@ class NAShootingModeInterpreter : public Interpreter
|
||||
{
|
||||
public:
|
||||
NAShootingModeInterpreter () {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
int a = t->toInt();
|
||||
std::ostringstream str;
|
||||
@ -234,14 +234,26 @@ public:
|
||||
afpchoices[0x9] = "Far Left";
|
||||
afpchoices[0xa] = "Far Right";
|
||||
}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
const auto get_from_choices =
|
||||
[](const std::map<int, std::string>& choices, int index) -> std::string
|
||||
{
|
||||
const std::map<int, std::string>::const_iterator choice = choices.find(index);
|
||||
|
||||
if (choice != choices.end()) {
|
||||
return choice->second;
|
||||
}
|
||||
|
||||
return {};
|
||||
};
|
||||
|
||||
int am = t->toInt (0, BYTE);
|
||||
int afp = t->toInt (1, BYTE);
|
||||
int aff = t->toInt (2, SHORT);
|
||||
std::ostringstream str;
|
||||
str << "AFAreaMode = " << amchoices[am] << std::endl;
|
||||
str << "AFAreaMode = " << afpchoices[afp] << std::endl;
|
||||
str << "AFAreaMode = " << get_from_choices(amchoices, am) << std::endl;
|
||||
str << "AFAreaMode = " << get_from_choices(afpchoices, afp) << std::endl;
|
||||
|
||||
std::ostringstream af;
|
||||
|
||||
@ -314,7 +326,7 @@ class NALensDataInterpreter : public Interpreter
|
||||
static const std::map<std::string, std::string> lenses;
|
||||
|
||||
public:
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
|
||||
static const unsigned char xlat[2][256] = {
|
||||
|
@ -33,7 +33,7 @@ class OLOnOffInterpreter : public Interpreter
|
||||
{
|
||||
public:
|
||||
OLOnOffInterpreter () {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
if (t->toInt() == 0) {
|
||||
return "Off";
|
||||
@ -48,7 +48,7 @@ class OLYesNoInterpreter : public Interpreter
|
||||
{
|
||||
public:
|
||||
OLYesNoInterpreter () {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
if (t->toInt() == 0) {
|
||||
return "No";
|
||||
@ -63,7 +63,7 @@ class OLApertureInterpreter : public Interpreter
|
||||
{
|
||||
public:
|
||||
OLApertureInterpreter () {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
std::ostringstream str;
|
||||
str.precision (2);
|
||||
@ -194,7 +194,7 @@ public:
|
||||
lenses["03 02 00"] = "Leica D Summilux 25mm f/1.4 Asph.";
|
||||
lenses["05 01 10"] = "Tamron 14-150mm f/3.5-5.8 Di III";
|
||||
}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
std::ostringstream lid;
|
||||
lid.setf (std::ios_base::hex, std::ios_base::basefield);
|
||||
@ -203,7 +203,7 @@ public:
|
||||
lid << std::setw (2) << std::setfill ('0') << t->toInt (2) << ' '; //model
|
||||
lid << std::setw (2) << std::setfill ('0') << t->toInt (3); // submodel
|
||||
|
||||
std::map<std::string, std::string>::iterator r = lenses.find (lid.str());
|
||||
std::map<std::string, std::string>::const_iterator r = lenses.find (lid.str());
|
||||
|
||||
if (r != lenses.end()) {
|
||||
return r->second;
|
||||
@ -465,7 +465,7 @@ class OLNoiseFilterInterpreter : public Interpreter
|
||||
{
|
||||
public:
|
||||
OLNoiseFilterInterpreter () {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
int a = t->toInt (0);
|
||||
int b = t->toInt (2);
|
||||
@ -490,7 +490,7 @@ class OLFlashModeInterpreter : public Interpreter
|
||||
{
|
||||
public:
|
||||
OLFlashModeInterpreter () {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
std::ostringstream str;
|
||||
int a = t->toInt ();
|
||||
@ -509,7 +509,7 @@ class OLNoiseReductionInterpreter : public Interpreter
|
||||
{
|
||||
public:
|
||||
OLNoiseReductionInterpreter () {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
std::ostringstream str;
|
||||
int a = t->toInt ();
|
||||
|
@ -415,7 +415,7 @@ class PAFNumberInterpreter: public Interpreter
|
||||
{
|
||||
public:
|
||||
PAFNumberInterpreter () {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
char buffer[32];
|
||||
double v = t->toDouble() / 10;
|
||||
@ -610,7 +610,7 @@ public:
|
||||
choices[256 * 255 + 0] = "Video (Auto Aperture)";
|
||||
choices[256 * 255 + 4] = "Video (4)";
|
||||
}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
int c = 256 * t->toInt (0, BYTE) + t->toInt (1, BYTE);
|
||||
const ChoicesIterator r = choices.find (c);
|
||||
@ -669,12 +669,12 @@ public:
|
||||
choices3[224] = "HDR Auto";
|
||||
choices3[255] = "Video";
|
||||
}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
const ChoicesIterator r = choices.find (t->toInt (0, BYTE));
|
||||
std::map<int, std::string>::iterator r1 = choices1.find (t->toInt (1, BYTE));
|
||||
std::map<int, std::string>::iterator r2 = choices2.find (t->toInt (2, BYTE));
|
||||
std::map<int, std::string>::iterator r3 = choices3.find (t->toInt (3, BYTE));
|
||||
std::map<int, std::string>::const_iterator r1 = choices1.find (t->toInt (1, BYTE));
|
||||
std::map<int, std::string>::const_iterator r2 = choices2.find (t->toInt (2, BYTE));
|
||||
std::map<int, std::string>::const_iterator r3 = choices3.find (t->toInt (3, BYTE));
|
||||
std::ostringstream s;
|
||||
s << ((r != choices.end()) ? r->second : "");
|
||||
s << ((r1 != choices1.end()) ? r1->second : "") << " ";
|
||||
@ -993,7 +993,7 @@ public:
|
||||
choices.insert (p_t (256 * 22 + 4, "04 Toy Lens Wide 6.3mm f/7.1"));
|
||||
choices.insert (p_t (256 * 22 + 5, "05 Toy Lens Telephoto 18mm f/8"));
|
||||
}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
double *liArray = nullptr;
|
||||
double maxApertureAtFocal = 0.;
|
||||
@ -1061,7 +1061,7 @@ class PASRResultInterpreter: public Interpreter
|
||||
{
|
||||
public:
|
||||
PASRResultInterpreter() { }
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
std::ostringstream str;
|
||||
int b = t->toInt (0, BYTE);
|
||||
@ -1146,7 +1146,7 @@ public:
|
||||
choices[ 2 << 8 | 4 ] = "Auto";
|
||||
}
|
||||
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
int idx = 0;
|
||||
|
||||
@ -1173,7 +1173,7 @@ public:
|
||||
choices[2] = "Standard";
|
||||
choices[3] = "Fast";
|
||||
}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
const ChoicesIterator r = choices.find (t->toInt (0, BYTE));
|
||||
std::ostringstream s;
|
||||
@ -1211,7 +1211,7 @@ public:
|
||||
choices[2] = "Medium";
|
||||
choices[3] = "High";
|
||||
}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
const ChoicesIterator r = choices.find (t->toInt (0, BYTE));
|
||||
std::ostringstream s;
|
||||
@ -1243,11 +1243,11 @@ public:
|
||||
choices2[8] = "2 EV";
|
||||
choices2[12] = "3 EV";
|
||||
}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
const ChoicesIterator r = choices.find (t->toInt (0, BYTE));
|
||||
std::map<int, std::string>::iterator r1 = choices1.find (t->toInt (1, BYTE));
|
||||
std::map<int, std::string>::iterator r2 = choices2.find (t->toInt (2, BYTE));
|
||||
std::map<int, std::string>::const_iterator r1 = choices1.find (t->toInt (1, BYTE));
|
||||
std::map<int, std::string>::const_iterator r2 = choices2.find (t->toInt (2, BYTE));
|
||||
std::ostringstream s;
|
||||
s << ((r != choices.end() ) ? r->second : "") << std::endl;
|
||||
s << ((r1 != choices1.end()) ? r1->second : "") << std::endl;
|
||||
@ -1290,7 +1290,7 @@ class PALensModelQInterpreter: public Interpreter
|
||||
{
|
||||
public:
|
||||
PALensModelQInterpreter() {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
char buffer[31];
|
||||
buffer[0] = 0; //
|
||||
@ -1308,7 +1308,7 @@ class PALensInfoQInterpreter: public Interpreter
|
||||
{
|
||||
public:
|
||||
PALensInfoQInterpreter() {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
char buffer[21];
|
||||
buffer[0] = 0;
|
||||
@ -1326,7 +1326,7 @@ class PAFlashExposureCompInterpreter: public Interpreter
|
||||
{
|
||||
public:
|
||||
PAFlashExposureCompInterpreter() {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
int a;
|
||||
|
||||
@ -1359,7 +1359,7 @@ class PAFocalLengthInterpreter: public Interpreter
|
||||
{
|
||||
public:
|
||||
PAFocalLengthInterpreter() {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
double a = double (t->toInt (0, LONG));
|
||||
|
||||
@ -1388,7 +1388,7 @@ class PALensDataFocalLengthInterpreter: public Interpreter
|
||||
{
|
||||
public:
|
||||
PALensDataFocalLengthInterpreter() {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
int a = t->toInt (0, BYTE);
|
||||
float b = float (10 * int (a >> 2)) * pow (4.f, float (int (a & 0x03) - 2));
|
||||
@ -1419,7 +1419,7 @@ class PAISOfInterpreter: public Interpreter
|
||||
{
|
||||
public:
|
||||
PAISOfInterpreter() {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
int a = t->toInt (0, BYTE);
|
||||
char buffer[32];
|
||||
@ -1439,7 +1439,7 @@ class PAMaxApertureInterpreter: public Interpreter
|
||||
{
|
||||
public:
|
||||
PAMaxApertureInterpreter() {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
int a = t->toInt (0, BYTE);
|
||||
a &= 0x7F;
|
||||
@ -1476,7 +1476,7 @@ class PAAEXvInterpreter: public Interpreter
|
||||
{
|
||||
public:
|
||||
PAAEXvInterpreter() {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
int a = t->toInt (0, BYTE);
|
||||
char buffer[32];
|
||||
@ -1496,7 +1496,7 @@ class PAAEBXvInterpreter: public Interpreter
|
||||
{
|
||||
public:
|
||||
PAAEBXvInterpreter() {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
int a = t->toInt (0, SBYTE);
|
||||
char buffer[32];
|
||||
@ -1516,7 +1516,7 @@ class PAApertureInterpreter: public Interpreter
|
||||
{
|
||||
public:
|
||||
PAApertureInterpreter() {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
int a = t->toInt (0, BYTE);
|
||||
char buffer[32];
|
||||
@ -1536,7 +1536,7 @@ class PAExposureTimeInterpreter: public Interpreter
|
||||
{
|
||||
public:
|
||||
PAExposureTimeInterpreter() {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
int a = t->toInt (0, BYTE);
|
||||
char buffer[32];
|
||||
@ -1556,7 +1556,7 @@ class PANominalMinApertureInterpreter: public Interpreter
|
||||
{
|
||||
public:
|
||||
PANominalMinApertureInterpreter() {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
char buffer[32];
|
||||
int a = t->toInt (0, BYTE);
|
||||
@ -1576,7 +1576,7 @@ class PANominalMaxApertureInterpreter: public Interpreter
|
||||
{
|
||||
public:
|
||||
PANominalMaxApertureInterpreter() {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
char buffer[32];
|
||||
int a = t->toInt (0, BYTE);
|
||||
@ -1694,7 +1694,7 @@ class PAExternalFlashGNInterpreter: public Interpreter
|
||||
{
|
||||
public:
|
||||
PAExternalFlashGNInterpreter() {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
char buffer[32];
|
||||
int b = t->toInt (0, BYTE) & 0x1F;
|
||||
@ -1708,7 +1708,7 @@ class PAEVStepsInterpreter: public Interpreter
|
||||
{
|
||||
public:
|
||||
PAEVStepsInterpreter() {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
std::ostringstream str;
|
||||
|
||||
@ -1727,7 +1727,7 @@ class PAEDialinInterpreter: public Interpreter
|
||||
{
|
||||
public:
|
||||
PAEDialinInterpreter() {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
std::ostringstream str;
|
||||
|
||||
@ -1746,7 +1746,7 @@ class PAApertureRingUseInterpreter: public Interpreter
|
||||
{
|
||||
public:
|
||||
PAApertureRingUseInterpreter() {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
std::ostringstream str;
|
||||
|
||||
@ -1776,7 +1776,7 @@ public:
|
||||
choices[9] = "Slow-sync, Red-eye reduction";
|
||||
choices[10] = "Trailing-curtain Sync";
|
||||
}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
const ChoicesIterator r = choices.find (t->toInt (0, BYTE) >> 4);
|
||||
|
||||
@ -1795,7 +1795,7 @@ class PAMeteringMode2Interpreter: public Interpreter
|
||||
{
|
||||
public:
|
||||
PAMeteringMode2Interpreter() {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
std::ostringstream str;
|
||||
int v = (t->toInt (0, BYTE) & 0xF);
|
||||
@ -1859,7 +1859,7 @@ class PAProgramLineInterpreter: public Interpreter
|
||||
{
|
||||
public:
|
||||
PAProgramLineInterpreter() {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
std::ostringstream str;
|
||||
int c = t->toInt (0, BYTE);
|
||||
@ -1899,7 +1899,7 @@ class PAAFModeInterpreter: public Interpreter
|
||||
{
|
||||
public:
|
||||
PAAFModeInterpreter() {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
switch (t->toInt (0, BYTE) & 0x3) {
|
||||
case 0:
|
||||
@ -1925,7 +1925,7 @@ class PAAFPointSelectedInterpreter: public Interpreter
|
||||
{
|
||||
public:
|
||||
PAAFPointSelectedInterpreter() {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
int c = t->toInt (0, SHORT);
|
||||
|
||||
@ -1949,7 +1949,7 @@ class PADriveMode2Interpreter: public Interpreter
|
||||
{
|
||||
public:
|
||||
PADriveMode2Interpreter() {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
int c = t->toInt (0, BYTE);
|
||||
|
||||
|
@ -1769,7 +1769,7 @@ std::string Tag::nameToString (int i)
|
||||
return buffer;
|
||||
}
|
||||
|
||||
std::string Tag::valueToString ()
|
||||
std::string Tag::valueToString () const
|
||||
{
|
||||
|
||||
if (attrib && attrib->interpreter) {
|
||||
@ -2118,6 +2118,7 @@ void ExifManager::parseCIFF ()
|
||||
}
|
||||
parseCIFF (rml->ciffLength, root);
|
||||
root->sort ();
|
||||
parse(true);
|
||||
}
|
||||
|
||||
Tag* ExifManager::saveCIFFMNTag (TagDirectory* root, int len, const char* name)
|
||||
@ -3441,7 +3442,7 @@ short int int2_to_signed (short unsigned int i)
|
||||
* <focal>-<focal>mm f/<aperture>-<aperture>
|
||||
* NB: no space between separator '-'; no space between focal length and 'mm'
|
||||
*/
|
||||
bool extractLensInfo (std::string &fullname, double &minFocal, double &maxFocal, double &maxApertureAtMinFocal, double &maxApertureAtMaxFocal)
|
||||
bool extractLensInfo (const std::string &fullname, double &minFocal, double &maxFocal, double &maxApertureAtMinFocal, double &maxApertureAtMaxFocal)
|
||||
{
|
||||
minFocal = 0.0;
|
||||
maxFocal = 0.0;
|
||||
|
@ -67,7 +67,7 @@ const enum ByteOrder HOSTORDER = MOTOROLA;
|
||||
#endif
|
||||
enum MNKind {NOMK, IFD, HEADERIFD, NIKON3, OLYMPUS2, FUJI, TABLESUBDIR};
|
||||
|
||||
bool extractLensInfo (std::string &fullname, double &minFocal, double &maxFocal, double &maxApertureAtMinFocal, double &maxApertureAtMaxFocal);
|
||||
bool extractLensInfo (const std::string &fullname, double &minFocal, double &maxFocal, double &maxApertureAtMinFocal, double &maxApertureAtMaxFocal);
|
||||
|
||||
unsigned short sget2 (unsigned char *s, ByteOrder order);
|
||||
int sget4 (unsigned char *s, ByteOrder order);
|
||||
@ -302,7 +302,7 @@ public:
|
||||
int getDistanceFrom (const TagDirectory *root);
|
||||
|
||||
// additional getter/setter for more comfortable use
|
||||
std::string valueToString ();
|
||||
std::string valueToString () const;
|
||||
std::string nameToString (int i = 0);
|
||||
void valueFromString (const std::string& value);
|
||||
void userCommentFromString (const Glib::ustring& text);
|
||||
@ -381,7 +381,7 @@ class Interpreter
|
||||
public:
|
||||
Interpreter () {}
|
||||
virtual ~Interpreter() {};
|
||||
virtual std::string toString (Tag* t)
|
||||
virtual std::string toString (const Tag* t) const
|
||||
{
|
||||
char buffer[1024];
|
||||
t->toString (buffer);
|
||||
@ -502,7 +502,7 @@ protected:
|
||||
Choices choices;
|
||||
public:
|
||||
ChoiceInterpreter () {};
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
const typename std::map<T, std::string>::const_iterator r = choices.find(t->toInt());
|
||||
|
||||
@ -521,11 +521,11 @@ class IntLensInterpreter : public Interpreter
|
||||
{
|
||||
protected:
|
||||
typedef std::multimap< T, std::string> container_t;
|
||||
typedef typename std::multimap< T, std::string>::iterator it_t;
|
||||
typedef typename std::multimap< T, std::string>::const_iterator it_t;
|
||||
typedef std::pair< T, std::string> p_t;
|
||||
container_t choices;
|
||||
|
||||
virtual std::string guess (const T lensID, double focalLength, double maxApertureAtFocal, double *lensInfoArray)
|
||||
virtual std::string guess (const T lensID, double focalLength, double maxApertureAtFocal, double *lensInfoArray) const
|
||||
{
|
||||
it_t r;
|
||||
size_t nFound = choices.count ( lensID );
|
||||
|
@ -1158,7 +1158,7 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
int lensID = t->toInt();
|
||||
Tag *lensInfoTag = t->getParent()->getRoot()->findTag ("LensInfo");
|
||||
@ -1309,7 +1309,7 @@ public:
|
||||
choices.insert (p_t (51507, "Samyang AF 35mm f/1.4"));
|
||||
}
|
||||
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
int lensID = t->toInt();
|
||||
Tag *lensInfoTag = t->getParent()->getRoot()->findTag ("LensInfo");
|
||||
@ -2103,7 +2103,7 @@ class SAExposureTimeInterpreter : public Interpreter
|
||||
{
|
||||
public:
|
||||
SAExposureTimeInterpreter () {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
double a = t->toDouble();
|
||||
|
||||
@ -2163,7 +2163,7 @@ class SAFNumberInterpreter : public Interpreter
|
||||
{
|
||||
public:
|
||||
SAFNumberInterpreter () {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
double a = double (t->toDouble());
|
||||
|
||||
@ -2223,7 +2223,7 @@ class SAISOSettingInterpreter : public Interpreter
|
||||
{
|
||||
public:
|
||||
SAISOSettingInterpreter () {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
int a = t->toInt();
|
||||
|
||||
@ -2264,7 +2264,7 @@ class SAExposureCompSetInterpreter : public Interpreter
|
||||
{
|
||||
public:
|
||||
SAExposureCompSetInterpreter () {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
double a = t->toDouble();
|
||||
char buffer[32];
|
||||
@ -2285,7 +2285,7 @@ class SAAFMicroAdjValueInterpreter : public Interpreter
|
||||
{
|
||||
public:
|
||||
SAAFMicroAdjValueInterpreter() {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
char buffer[32];
|
||||
sprintf (buffer, "%d", t->getValue()[0] - 20);
|
||||
@ -2302,7 +2302,7 @@ class SAAFMicroAdjModeInterpreter : public Interpreter
|
||||
{
|
||||
public:
|
||||
SAAFMicroAdjModeInterpreter() {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
int a = t->getValue()[0] & 0x80;
|
||||
|
||||
@ -2324,7 +2324,7 @@ class SAAFMicroAdjRegisteredLensesInterpreter : public Interpreter
|
||||
{
|
||||
public:
|
||||
SAAFMicroAdjRegisteredLensesInterpreter() {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
char buffer[32];
|
||||
sprintf (buffer, "%d", t->getValue()[0] & 0x7f);
|
||||
@ -2341,7 +2341,7 @@ class SAFocusStatusInterpreter : public Interpreter
|
||||
{
|
||||
public:
|
||||
SAFocusStatusInterpreter () {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
std::string retval;
|
||||
int a = t->toInt();
|
||||
@ -2380,7 +2380,7 @@ class SAColorTemperatureSettingInterpreter : public Interpreter
|
||||
{
|
||||
public:
|
||||
SAColorTemperatureSettingInterpreter () {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
char buffer[32];
|
||||
sprintf (buffer, "%d", t->toInt());
|
||||
|
@ -327,7 +327,7 @@ class FNumberInterpreter : public Interpreter
|
||||
{
|
||||
public:
|
||||
FNumberInterpreter () {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
char buffer[32];
|
||||
double v = t->toDouble();
|
||||
@ -346,7 +346,7 @@ class ApertureInterpreter : public Interpreter
|
||||
{
|
||||
public:
|
||||
ApertureInterpreter () {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
char buffer[32];
|
||||
double v = pow (2.0, t->toDouble() / 2.0);
|
||||
@ -365,7 +365,7 @@ class ExposureBiasInterpreter : public Interpreter
|
||||
{
|
||||
public:
|
||||
ExposureBiasInterpreter () {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
char buffer[32];
|
||||
double v = t->toDouble();
|
||||
@ -384,7 +384,7 @@ class ShutterSpeedInterpreter : public Interpreter
|
||||
{
|
||||
public:
|
||||
ShutterSpeedInterpreter () {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
char buffer[32];
|
||||
double d = pow (2.0, -t->toDouble());
|
||||
@ -404,7 +404,7 @@ class ExposureTimeInterpreter : public Interpreter
|
||||
{
|
||||
public:
|
||||
ExposureTimeInterpreter () {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
char buffer[32];
|
||||
double d = t->toDouble();
|
||||
@ -424,7 +424,7 @@ class FocalLengthInterpreter : public Interpreter
|
||||
{
|
||||
public:
|
||||
FocalLengthInterpreter () {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
char buffer[32];
|
||||
double v = t->toDouble();
|
||||
@ -443,7 +443,7 @@ class UserCommentInterpreter : public Interpreter
|
||||
{
|
||||
public:
|
||||
UserCommentInterpreter () {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
int count = t->getCount();
|
||||
|
||||
@ -575,7 +575,7 @@ class CFAInterpreter : public Interpreter
|
||||
{
|
||||
public:
|
||||
CFAInterpreter() {}
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
char colors[] = "RGB";
|
||||
char buffer[1024];
|
||||
@ -632,7 +632,7 @@ UTF8BinInterpreter utf8BinInterpreter;
|
||||
class RawImageSegmentationInterpreter : public Interpreter
|
||||
{
|
||||
public:
|
||||
std::string toString (Tag* t) override
|
||||
std::string toString (const Tag* t) const override
|
||||
{
|
||||
int segmentNumber = t->toInt(0, SHORT);
|
||||
int segmentWidth = t->toInt(2, SHORT);
|
||||
|
@ -564,7 +564,7 @@ void Options::setDefaults()
|
||||
rtSettings.adobe = "RTv2_Medium"; // put the name of yours profiles (here windows)
|
||||
rtSettings.prophoto = "RTv2_Large"; // these names appear in the menu "output profile"
|
||||
rtSettings.widegamut = "RTv2_Wide";
|
||||
rtSettings.srgb = "RTv2_sRGB";
|
||||
rtSettings.srgb = "RTv4_sRGB";
|
||||
rtSettings.bruce = "RTv2_Bruce";
|
||||
rtSettings.beta = "RTv2_Beta";
|
||||
rtSettings.best = "RTv2_Best";
|
||||
@ -1485,8 +1485,8 @@ void Options::readFromFile(Glib::ustring fname)
|
||||
|
||||
if (keyFile.has_key("Color Management", "sRGB")) {
|
||||
rtSettings.srgb = keyFile.get_string("Color Management", "sRGB");
|
||||
if (rtSettings.srgb == "RT_sRGB" || rtSettings.srgb == "RTv4_sRGB") {
|
||||
rtSettings.srgb = "RTv2_sRGB";
|
||||
if (rtSettings.srgb == "RT_sRGB" || rtSettings.srgb == "RTv2_sRGB") {
|
||||
rtSettings.srgb = "RTv4_sRGB";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -436,6 +436,7 @@ void ParamsEdited::set(bool v)
|
||||
raw.xtranssensor.method = v;
|
||||
raw.xtranssensor.dualDemosaicAutoContrast = v;
|
||||
raw.xtranssensor.dualDemosaicContrast = v;
|
||||
raw.xtranssensor.border = v;
|
||||
raw.xtranssensor.ccSteps = v;
|
||||
raw.xtranssensor.exBlackRed = v;
|
||||
raw.xtranssensor.exBlackGreen = v;
|
||||
@ -1002,6 +1003,7 @@ void ParamsEdited::initFrom(const std::vector<rtengine::procparams::ProcParams>&
|
||||
raw.xtranssensor.method = raw.xtranssensor.method && p.raw.xtranssensor.method == other.raw.xtranssensor.method;
|
||||
raw.xtranssensor.dualDemosaicAutoContrast = raw.xtranssensor.dualDemosaicAutoContrast && p.raw.xtranssensor.dualDemosaicAutoContrast == other.raw.xtranssensor.dualDemosaicAutoContrast;
|
||||
raw.xtranssensor.dualDemosaicContrast = raw.xtranssensor.dualDemosaicContrast && p.raw.xtranssensor.dualDemosaicContrast == other.raw.xtranssensor.dualDemosaicContrast;
|
||||
raw.xtranssensor.border = raw.xtranssensor.border && p.raw.xtranssensor.border == other.raw.xtranssensor.border;
|
||||
raw.xtranssensor.ccSteps = raw.xtranssensor.ccSteps && p.raw.xtranssensor.ccSteps == other.raw.xtranssensor.ccSteps;
|
||||
raw.xtranssensor.exBlackRed = raw.xtranssensor.exBlackRed && p.raw.xtranssensor.blackred == other.raw.xtranssensor.blackred;
|
||||
raw.xtranssensor.exBlackGreen = raw.xtranssensor.exBlackGreen && p.raw.xtranssensor.blackgreen == other.raw.xtranssensor.blackgreen;
|
||||
@ -2660,6 +2662,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng
|
||||
toEdit.raw.xtranssensor.ccSteps = mods.raw.xtranssensor.ccSteps;
|
||||
}
|
||||
|
||||
if (raw.xtranssensor.border) {
|
||||
toEdit.raw.xtranssensor.border = mods.raw.xtranssensor.border;
|
||||
}
|
||||
|
||||
if (raw.xtranssensor.exBlackRed) {
|
||||
toEdit.raw.xtranssensor.blackred = dontforceSet && options.baBehav[ADDSET_RAWEXPOS_BLACKS] ? toEdit.raw.xtranssensor.blackred + mods.raw.xtranssensor.blackred : mods.raw.xtranssensor.blackred;
|
||||
}
|
||||
@ -3192,7 +3198,7 @@ bool RAWParamsEdited::BayerSensor::isUnchanged() const
|
||||
|
||||
bool RAWParamsEdited::XTransSensor::isUnchanged() const
|
||||
{
|
||||
return method && exBlackRed && exBlackGreen && exBlackBlue && dualDemosaicAutoContrast && dualDemosaicContrast;
|
||||
return method && border && exBlackRed && exBlackGreen && exBlackBlue && dualDemosaicAutoContrast && dualDemosaicContrast;
|
||||
}
|
||||
|
||||
bool RAWParamsEdited::isUnchanged() const
|
||||
|
@ -628,6 +628,7 @@ struct RAWParamsEdited {
|
||||
bool method;
|
||||
bool dualDemosaicAutoContrast;
|
||||
bool dualDemosaicContrast;
|
||||
bool border;
|
||||
bool ccSteps;
|
||||
bool exBlackRed;
|
||||
bool exBlackGreen;
|
||||
|
@ -841,6 +841,7 @@ void PartialPasteDlg::applyPaste (rtengine::procparams::ProcParams* dstPP, Param
|
||||
|
||||
if (!raw_border->get_active ()) {
|
||||
filterPE.raw.bayersensor.border = falsePE.raw.bayersensor.border;
|
||||
filterPE.raw.xtranssensor.border = falsePE.raw.xtranssensor.border;
|
||||
}
|
||||
|
||||
if (!raw_imagenum->get_active ()) {
|
||||
|
@ -30,6 +30,7 @@ using namespace rtengine::procparams;
|
||||
XTransProcess::XTransProcess () : FoldableToolPanel(this, "xtransprocess", M("TP_RAW_LABEL"), true)
|
||||
{
|
||||
auto m = ProcEventMapper::getInstance();
|
||||
EvDemosaicBorder = m->newEvent(DEMOSAIC, "HISTORY_MSG_RAW_BORDER");
|
||||
EvDemosaicContrast = m->newEvent(DEMOSAIC, "HISTORY_MSG_DUALDEMOSAIC_CONTRAST");
|
||||
EvDemosaicAutoContrast = m->newEvent(DEMOSAIC, "HISTORY_MSG_DUALDEMOSAIC_AUTO_CONTRAST");
|
||||
|
||||
@ -86,6 +87,18 @@ XTransProcess::XTransProcess () : FoldableToolPanel(this, "xtransprocess", M("TP
|
||||
dualDemosaicOptions->pack_start(*dualDemosaicContrast);
|
||||
pack_start( *dualDemosaicOptions, Gtk::PACK_SHRINK, 4);
|
||||
|
||||
borderbox = Gtk::manage(new Gtk::HBox());
|
||||
border = Gtk::manage(new Adjuster(M("TP_RAW_BORDER"), 0, 16, 1, 7));
|
||||
border->setAdjusterListener (this);
|
||||
|
||||
if (border->delay < options.adjusterMaxDelay) {
|
||||
border->delay = options.adjusterMaxDelay;
|
||||
}
|
||||
|
||||
border->show();
|
||||
borderbox->pack_start(*border);
|
||||
pack_start(*borderbox, Gtk::PACK_SHRINK, 4);
|
||||
|
||||
pack_start( *Gtk::manage( new Gtk::HSeparator()), Gtk::PACK_SHRINK, 0 );
|
||||
ccSteps = Gtk::manage (new Adjuster (M("TP_RAW_FALSECOLOR"), 0, 5, 1, 0 ));
|
||||
ccSteps->setAdjusterListener (this);
|
||||
@ -109,6 +122,7 @@ void XTransProcess::read(const rtengine::procparams::ProcParams* pp, const Param
|
||||
disableListener ();
|
||||
methodconn.block (true);
|
||||
|
||||
border->setValue(pp->raw.xtranssensor.border);
|
||||
for (size_t i = 0; i < RAWParams::XTransSensor::getMethodStrings().size(); ++i)
|
||||
if( pp->raw.xtranssensor.method == RAWParams::XTransSensor::getMethodStrings()[i]) {
|
||||
method->set_active(i);
|
||||
@ -117,6 +131,7 @@ void XTransProcess::read(const rtengine::procparams::ProcParams* pp, const Param
|
||||
}
|
||||
|
||||
if(pedited ) {
|
||||
border->setEditedState (pedited->raw.xtranssensor.border ? Edited : UnEdited);
|
||||
dualDemosaicContrast->setAutoInconsistent (multiImage && !pedited->raw.xtranssensor.dualDemosaicAutoContrast);
|
||||
dualDemosaicContrast->setEditedState ( pedited->raw.xtranssensor.dualDemosaicContrast ? Edited : UnEdited);
|
||||
ccSteps->setEditedState (pedited->raw.xtranssensor.ccSteps ? Edited : UnEdited);
|
||||
@ -129,7 +144,7 @@ void XTransProcess::read(const rtengine::procparams::ProcParams* pp, const Param
|
||||
dualDemosaicContrast->setValue (pp->raw.xtranssensor.dualDemosaicContrast);
|
||||
ccSteps->setValue (pp->raw.xtranssensor.ccSteps);
|
||||
|
||||
lastAutoContrast = pp->raw.bayersensor.dualDemosaicAutoContrast;
|
||||
lastAutoContrast = pp->raw.xtranssensor.dualDemosaicAutoContrast;
|
||||
|
||||
if (!batchMode) {
|
||||
dualDemosaicOptions->set_visible(pp->raw.xtranssensor.method == procparams::RAWParams::XTransSensor::getMethodString(procparams::RAWParams::XTransSensor::Method::FOUR_PASS)
|
||||
@ -145,6 +160,7 @@ void XTransProcess::write( rtengine::procparams::ProcParams* pp, ParamsEdited* p
|
||||
{
|
||||
pp->raw.xtranssensor.dualDemosaicAutoContrast = dualDemosaicContrast->getAutoValue();
|
||||
pp->raw.xtranssensor.dualDemosaicContrast = dualDemosaicContrast->getValue();
|
||||
pp->raw.xtranssensor.border = border->getIntValue();
|
||||
pp->raw.xtranssensor.ccSteps = ccSteps->getIntValue();
|
||||
|
||||
int currentRow = method->get_active_row_number();
|
||||
@ -154,6 +170,7 @@ void XTransProcess::write( rtengine::procparams::ProcParams* pp, ParamsEdited* p
|
||||
}
|
||||
|
||||
if (pedited) {
|
||||
pedited->raw.xtranssensor.border = border->getEditedState ();
|
||||
pedited->raw.xtranssensor.method = method->get_active_text() != M("GENERAL_UNCHANGED");
|
||||
pedited->raw.xtranssensor.dualDemosaicAutoContrast = !dualDemosaicContrast->getAutoInconsistent ();
|
||||
pedited->raw.xtranssensor.dualDemosaicContrast = dualDemosaicContrast->getEditedState ();
|
||||
@ -163,6 +180,7 @@ void XTransProcess::write( rtengine::procparams::ProcParams* pp, ParamsEdited* p
|
||||
|
||||
void XTransProcess::setAdjusterBehavior (bool falsecoloradd, bool dualDemosaicContrastAdd)
|
||||
{
|
||||
border->setAddMode(false);
|
||||
dualDemosaicContrast->setAddMode(dualDemosaicContrastAdd);
|
||||
ccSteps->setAddMode(falsecoloradd);
|
||||
}
|
||||
@ -173,19 +191,23 @@ void XTransProcess::setBatchMode(bool batchMode)
|
||||
method->set_active_text(M("GENERAL_UNCHANGED"));
|
||||
ToolPanel::setBatchMode (batchMode);
|
||||
dualDemosaicContrast->showEditedCB ();
|
||||
border->showEditedCB ();
|
||||
ccSteps->showEditedCB ();
|
||||
}
|
||||
|
||||
void XTransProcess::setDefaults(const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited)
|
||||
{
|
||||
dualDemosaicContrast->setDefault( defParams->raw.xtranssensor.dualDemosaicContrast);
|
||||
border->setDefault (defParams->raw.xtranssensor.border);
|
||||
ccSteps->setDefault (defParams->raw.xtranssensor.ccSteps);
|
||||
|
||||
if (pedited) {
|
||||
dualDemosaicContrast->setDefaultEditedState( pedited->raw.xtranssensor.dualDemosaicContrast ? Edited : UnEdited);
|
||||
border->setDefaultEditedState(pedited->raw.xtranssensor.border ? Edited : UnEdited);
|
||||
ccSteps->setDefaultEditedState(pedited->raw.xtranssensor.ccSteps ? Edited : UnEdited);
|
||||
} else {
|
||||
dualDemosaicContrast->setDefaultEditedState(Irrelevant );
|
||||
border->setDefaultEditedState(Irrelevant);
|
||||
ccSteps->setDefaultEditedState(Irrelevant );
|
||||
}
|
||||
}
|
||||
@ -197,6 +219,8 @@ void XTransProcess::adjusterChanged(Adjuster* a, double newval)
|
||||
listener->panelChanged (EvDemosaicFalseColorIter, a->getTextValue() );
|
||||
} else if (a == dualDemosaicContrast) {
|
||||
listener->panelChanged (EvDemosaicContrast, a->getTextValue() );
|
||||
} else if (a == border) {
|
||||
listener->panelChanged (EvDemosaicBorder, a->getTextValue() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -32,6 +32,8 @@ class XTransProcess : public ToolParamBlock, public AdjusterListener, public Che
|
||||
protected:
|
||||
|
||||
MyComboBoxText* method;
|
||||
Gtk::HBox* borderbox;
|
||||
Adjuster* border;
|
||||
Adjuster* ccSteps;
|
||||
Gtk::VBox *dualDemosaicOptions;
|
||||
Adjuster* dualDemosaicContrast;
|
||||
@ -40,6 +42,8 @@ protected:
|
||||
int oldSelection;
|
||||
sigc::connection methodconn;
|
||||
IdleRegister idle_register;
|
||||
|
||||
rtengine::ProcEvent EvDemosaicBorder;
|
||||
rtengine::ProcEvent EvDemosaicAutoContrast;
|
||||
rtengine::ProcEvent EvDemosaicContrast;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user