Merge branch 'master' into gtk3

This commit is contained in:
Hombre 2016-11-11 23:05:29 +01:00
commit 024905a8ca
15 changed files with 1903 additions and 46 deletions

BIN
rtdata/rt_splash_5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

1772
rtdata/rt_splash_5.svg Normal file

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 67 KiB

View File

@ -1003,8 +1003,8 @@ Camera constants:
"ranges": { "white": 16300 } "ranges": { "white": 16300 }
}, },
{ // Quality B { // Quality B,
"make_model": [ "Canon PowerShot G7 X", "Canon PowerShot G7 X Mark II" ], "make_model": "Canon PowerShot G7 X",
"dcraw_matrix": [ 9602,-3823,-937,-2984,11495,1675,-407,1415,5049 ], // DNG_V8.7 D65 "dcraw_matrix": [ 9602,-3823,-937,-2984,11495,1675,-407,1415,5049 ], // DNG_V8.7 D65
//"raw_crop": [ 116, 24, 5504, 3680 ], // Sensor size 5632x3710. Largest useful frame 120-5616X28-3702 = 5504x3682, 4pix RTborders, Left Border 120-4, Top border 28-4 //"raw_crop": [ 116, 24, 5504, 3680 ], // Sensor size 5632x3710. Largest useful frame 120-5616X28-3702 = 5504x3682, 4pix RTborders, Left Border 120-4, Top border 28-4
"raw_crop": [ 128, 36, 5480, 3656 ], // Default official 3/2 frame 5472X3648, 4pix borders, Left Border 132-4, Top border 40-4 "raw_crop": [ 128, 36, 5480, 3656 ], // Default official 3/2 frame 5472X3648, 4pix borders, Left Border 132-4, Top border 40-4
@ -1012,8 +1012,8 @@ Camera constants:
"ranges": { "white": 4080 } "ranges": { "white": 4080 }
}, },
{ // Quality B { // Quality B,
"make_model": [ "Canon PowerShot G5 X", "Canon PowerShot G9 X" ], "make_model": [ "Canon PowerShot G5 X", "Canon PowerShot G9 X", "Canon PowerShot G7 X Mark II" ],
"dcraw_matrix": [ 9602,-3823,-937,-2984,11495,1675,-407,1415,5049 ], // DNG_V8.7 D65 "dcraw_matrix": [ 9602,-3823,-937,-2984,11495,1675,-407,1415,5049 ], // DNG_V8.7 D65
//"raw_crop": [ 116, 24, 5504, 3680 ], // Sensor size 5632x3710. Largest useful frame 120-5616X28-3702 = 5504x3682, 4pix RTborders, Left Border 120-4, Top border 28-4 //"raw_crop": [ 116, 24, 5504, 3680 ], // Sensor size 5632x3710. Largest useful frame 120-5616X28-3702 = 5504x3682, 4pix RTborders, Left Border 120-4, Top border 28-4
"raw_crop": [ 128, 36, 5480, 3656 ], // Default official 3/2 frame 5472X3648, 4pix borders, Left Border 132-4, Top border 40-4 "raw_crop": [ 128, 36, 5480, 3656 ], // Default official 3/2 frame 5472X3648, 4pix borders, Left Border 132-4, Top border 40-4
@ -1332,6 +1332,20 @@ Camera constants:
} }
}, },
{ // Quality C, 20Mp and 80Mp raw frames, Color matrix copied from EM5MKII which looks to be close.
"make_model": "OLYMPUS E-M1MarkII",
"dcraw_matrix": [ 9422,-3258,-711,-2655,10898,2015,-512,1354,5512 ], // E-M5II dng_v9.5 D65
"raw_crop": [ 8, 8, -16, -8 ], // full raw 5240X3912, jpeg top12,left12,5184x3888, full hires 10400X7792, jpeg crop 8,8,10368x7776
"ranges": {
"white": [
{ "iso": [ 64, 100, 125, 160, 200, 250, 320, 400 ], "levels": 4090 }, // normal 4095
{ "iso": [ 500, 640, 800, 1000, 1600 ], "levels": 4080 }, // 4085-4095
{ "iso": [ 2000, 2500, 3200, 4000, 5000, 6400 ], "levels": 4060 }, // 4085-4095
{ "iso": [ 12800, 25600, 51200 ], "levels": 4060 } // guess
]
}
},
{ // Quality B, missing per ISO samples { // Quality B, missing per ISO samples
"make_model": "OLYMPUS E-M1", "make_model": "OLYMPUS E-M1",
"dcraw_matrix": [ 7687,-1984,-606,-4327,11928,2721,-1381,2339,6452 ], // dng d65 "dcraw_matrix": [ 7687,-1984,-606,-4327,11928,2721,-1381,2339,6452 ], // dng d65
@ -1702,6 +1716,22 @@ Camera constants:
} }
}, },
{ // Quality B, Intemediate ISO samples missing, Pentax_DNG WLtags are after BL sutraction and not valid
"make_model": [ "RICOH PENTAX K-1", "PENTAX K-1" ],
"dcraw_matrix": [ 8596,-2981,-639,-4202,12046,2431,-685,1424,6122 ], // adobe DNG v9.7 D65
//"dcraw_matrix": [ 8566,-2746,-1201,-3612,12204,1550,-893,1680,6264 ], // PENTAX DNG
"raw_crop": [ 6, 18, 7376, 4932 ], // full frame 7392x4950, cropped to official DNG raw_crop 6,18,7382,4950, official jpeg crop 8,10,7360x4912
"ranges": {
"white": [
{ "iso": [ 100, 200, 400, 800 ], "levels": 16300 }, // 16380
{ "iso": [ 1600, 3200 ], "levels": 16250 }, // 16360
{ "iso": [ 6400, 12800 ], "levels": 16200 }, // 16330
{ "iso": [ 25600, 51200 ], "levels": 16100 }, // 16300
{ "iso": 102400, "levels": 16000 } // 16200
]
}
},
{ // Quality B, intermediate ISOs info missing { // Quality B, intermediate ISOs info missing
"make_model": [ "RICOH PENTAX K-3", "PENTAX K-3" ], "make_model": [ "RICOH PENTAX K-3", "PENTAX K-3" ],
"dcraw_matrix": [ 7415,-2052,-721,-5186,12788,2682,-1446,2157,6773 ], // adobe dcp d65 "dcraw_matrix": [ 7415,-2052,-721,-5186,12788,2682,-1446,2157,6773 ], // adobe dcp d65

View File

@ -17,14 +17,16 @@
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>. * along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef _COLOR_H_ #pragma once
#define _COLOR_H_
#include <array>
#include "rt_math.h" #include "rt_math.h"
#include "LUT.h" #include "LUT.h"
#include "labimage.h" #include "labimage.h"
#include "iccmatrices.h" #include "iccmatrices.h"
#include "sleef.c" #include "sleef.c"
#define SAT(a,b,c) ((float)max(a,b,c)-(float)min(a,b,c))/(float)max(a,b,c) #define SAT(a,b,c) ((float)max(a,b,c)-(float)min(a,b,c))/(float)max(a,b,c)
namespace rtengine namespace rtengine
@ -1680,5 +1682,3 @@ public:
}; };
} }
#endif

View File

@ -142,7 +142,9 @@ marker_is_icc (jpeg_saved_marker_ptr marker)
GETJOCTET(marker->data[8]) == 0x49 && GETJOCTET(marker->data[8]) == 0x49 &&
GETJOCTET(marker->data[9]) == 0x4C && GETJOCTET(marker->data[9]) == 0x4C &&
GETJOCTET(marker->data[10]) == 0x45 && GETJOCTET(marker->data[10]) == 0x45 &&
GETJOCTET(marker->data[11]) == 0x0; GETJOCTET(marker->data[11]) == 0x0
? TRUE
: FALSE;
} }

View File

@ -440,6 +440,16 @@ void ImageData::extractInfo ()
} }
} }
} else if (mnote && (!make.compare (0, 6, "PENTAX") || (!make.compare (0, 5, "RICOH") && !model.compare (0, 6, "PENTAX")))) { } else if (mnote && (!make.compare (0, 6, "PENTAX") || (!make.compare (0, 5, "RICOH") && !model.compare (0, 6, "PENTAX")))) {
// ISO at max value supported, check manufacturer specific
if (iso_speed == 65535 || iso_speed == 0) {
rtexif::Tag* baseIsoTag = mnote->getTag("ISO");
if (baseIsoTag) {
std::string isoData = baseIsoTag->valueToString();
if (isoData.size() > 1) {
iso_speed = stoi(isoData);
}
}
}
if (mnote->getTag ("LensType")) { if (mnote->getTag ("LensType")) {
lens = mnote->getTag ("LensType")->valueToString (); lens = mnote->getTag ("LensType")->valueToString ();
} }

View File

@ -794,12 +794,13 @@ void ImProcFunctions::transformHighQuality (Imagefloat* original, Imagefloat* tr
// multiplier for vignetting correction // multiplier for vignetting correction
double vignmul = 1.0; double vignmul = 1.0;
if (needsVignetting()) if (needsVignetting()) {
if(darkening) { if(darkening) {
vignmul /= std::max(v + mul * tanh (b * (maxRadius - s * r2) / maxRadius), 0.001); vignmul /= std::max(v + mul * tanh (b * (maxRadius - s * r2) / maxRadius), 0.001);
} else { } else {
vignmul *= (v + mul * tanh (b * (maxRadius - s * r2) / maxRadius)); vignmul *= (v + mul * tanh (b * (maxRadius - s * r2) / maxRadius));
} }
}
if (needsGradient()) { if (needsGradient()) {
vignmul *= calcGradientFactor(gp, cx + x, cy + y); vignmul *= calcGradientFactor(gp, cx + x, cy + y);
@ -963,12 +964,13 @@ void ImProcFunctions::transformPreview (Imagefloat* original, Imagefloat* transf
// multiplier for vignetting correction // multiplier for vignetting correction
double vignmul = 1.0; double vignmul = 1.0;
if (needsVignetting()) if (needsVignetting()) {
if(darkening) { if(darkening) {
vignmul /= std::max(v + mul * tanh (b * (maxRadius - s * r2) / maxRadius), 0.001); vignmul /= std::max(v + mul * tanh (b * (maxRadius - s * r2) / maxRadius), 0.001);
} else { } else {
vignmul = v + mul * tanh (b * (maxRadius - s * r2) / maxRadius); vignmul = v + mul * tanh (b * (maxRadius - s * r2) / maxRadius);
} }
}
if (needsGradient()) { if (needsGradient()) {
vignmul *= calcGradientFactor(gp, cx + x, cy + y); vignmul *= calcGradientFactor(gp, cx + x, cy + y);

View File

@ -1476,6 +1476,10 @@ int ProcParams::save (const Glib::ustring &fname, const Glib::ustring &fname2, b
//save retinex //save retinex
if (!pedited || pedited->retinex.enabled) {
keyFile.set_boolean ("Retinex", "Enabled", retinex.enabled);
}
if (!pedited || pedited->retinex.str) { if (!pedited || pedited->retinex.str) {
keyFile.set_integer ("Retinex", "Str", retinex.str); keyFile.set_integer ("Retinex", "Str", retinex.str);
} }
@ -1504,10 +1508,6 @@ int ProcParams::save (const Glib::ustring &fname, const Glib::ustring &fname2, b
keyFile.set_double ("Retinex", "Slope", retinex.slope); keyFile.set_double ("Retinex", "Slope", retinex.slope);
} }
if (!pedited || pedited->retinex.enabled) {
keyFile.set_boolean ("Retinex", "Enabled", retinex.enabled);
}
if (!pedited || pedited->retinex.medianmap) { if (!pedited || pedited->retinex.medianmap) {
keyFile.set_boolean ("Retinex", "Median", retinex.medianmap); keyFile.set_boolean ("Retinex", "Median", retinex.medianmap);
} }

View File

@ -22,6 +22,7 @@
#include <vector> #include <vector>
#include <cstdio> #include <cstdio>
#include <cmath> #include <cmath>
#include <type_traits>
#include <glibmm.h> #include <glibmm.h>
#include <lcms2.h> #include <lcms2.h>
@ -206,7 +207,7 @@ public:
} }
}*/ }*/
Threshold<T> & operator= (const Threshold<T> &rhs) Threshold<T>& operator =(const Threshold<T> &rhs)
{ {
value[0] = rhs.value[0]; value[0] = rhs.value[0];
value[1] = rhs.value[1]; value[1] = rhs.value[1];
@ -217,16 +218,34 @@ public:
return *this; return *this;
} }
bool operator== (const Threshold<T> &rhs) const template<typename U = T>
typename std::enable_if<std::is_floating_point<U>::value, bool>::type operator ==(const Threshold<U> &rhs) const
{ {
if (_isDouble) if (_isDouble) {
return fabs(value[0] - rhs.value[0]) < 1e-10 return std::fabs(value[0] - rhs.value[0]) < 1e-10
&& fabs(value[1] - rhs.value[1]) < 1e-10 && std::fabs(value[1] - rhs.value[1]) < 1e-10
&& fabs(value[2] - rhs.value[2]) < 1e-10 && std::fabs(value[2] - rhs.value[2]) < 1e-10
&& fabs(value[3] - rhs.value[3]) < 1e-10; && std::fabs(value[3] - rhs.value[3]) < 1e-10;
else } else {
return fabs(value[0] - rhs.value[0]) < 1e-10 return std::fabs(value[0] - rhs.value[0]) < 1e-10
&& fabs(value[1] - rhs.value[1]) < 1e-10; && std::fabs(value[1] - rhs.value[1]) < 1e-10;
}
}
template<typename U = T>
typename std::enable_if<std::is_integral<U>::value, bool>::type operator ==(const Threshold<U> &rhs) const
{
if (_isDouble) {
return
value[0] == rhs.value[0]
&& value[1] == rhs.value[1]
&& value[2] == rhs.value[2]
&& value[3] == rhs.value[3];
} else {
return
value[0] == rhs.value[0]
&& value[1] == rhs.value[1];
}
} }
}; };

View File

@ -1851,7 +1851,7 @@ void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &le
} }
if( totBP ) if( totBP ) {
if ( ri->getSensorType() == ST_BAYER ) { if ( ri->getSensorType() == ST_BAYER ) {
interpolateBadPixelsBayer( *bitmapBads ); interpolateBadPixelsBayer( *bitmapBads );
} else if ( ri->getSensorType() == ST_FUJI_XTRANS ) { } else if ( ri->getSensorType() == ST_FUJI_XTRANS ) {
@ -1859,6 +1859,7 @@ void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &le
} else { } else {
interpolateBadPixelsNColours( *bitmapBads, ri->get_colors() ); interpolateBadPixelsNColours( *bitmapBads, ri->get_colors() );
} }
}
if ( ri->getSensorType() == ST_BAYER && raw.bayersensor.linenoise > 0 ) { if ( ri->getSensorType() == ST_BAYER && raw.bayersensor.linenoise > 0 ) {
if (plistener) { if (plistener) {

View File

@ -449,7 +449,7 @@ void ExifPanel::addPressed ()
} else { } else {
tcombo->set_active_text (sel); tcombo->set_active_text (sel);
if (tcombo->get_active () < 0) { if (!tcombo->get_active ()) {
tcombo->append (sel); tcombo->append (sel);
tcombo->set_active_text (sel); tcombo->set_active_text (sel);
} }

View File

@ -149,16 +149,43 @@ void ImageArea::setInfoText (Glib::ustring text)
infotext = text; infotext = text;
Glib::RefPtr<Pango::Context> context = get_pango_context () ; Glib::RefPtr<Pango::Context> context = get_pango_context () ;
Pango::FontDescription fontd = context->get_font_description (); Pango::FontDescription fontd(get_style_context()->get_font());
// update font
fontd.set_weight (Pango::WEIGHT_BOLD); fontd.set_weight (Pango::WEIGHT_BOLD);
fontd.set_size (10 * Pango::SCALE); fontd.set_size (10 * Pango::SCALE);
context->set_font_description (fontd); context->set_font_description (fontd);
ilayout = create_pango_layout("");
// create text layout
Glib::RefPtr<Pango::Layout> ilayout = create_pango_layout("");
ilayout->set_markup(text); ilayout->set_markup(text);
// get size of the text block
int iw, ih; int iw, ih;
ilayout->get_pixel_size (iw, ih); ilayout->get_pixel_size (iw, ih);
ipixbuf = Gdk::Pixbuf::create (Gdk::COLORSPACE_RGB, true, 8, iw + 8, ih + 8);
ipixbuf->fill (128); // create BackBuffer
iBackBuffer.setDrawRectangle(Cairo::FORMAT_ARGB32, 0, 0, iw + 16, ih + 16, true);
iBackBuffer.setDestPosition(8, 8);
Cairo::RefPtr<Cairo::Context> cr = iBackBuffer.getContext();
// cleaning the back buffer (make it full transparent)
cr->set_source_rgba (0., 0., 0., 0.);
cr->set_operator (Cairo::OPERATOR_CLEAR);
cr->paint ();
cr->set_operator (Cairo::OPERATOR_OVER);
// paint transparent black background
cr->set_source_rgba (0., 0., 0., 0.5);
cr->paint ();
// paint text
cr->set_source_rgb (1.0, 1.0, 1.0);
cr->move_to (8, 8);
ilayout->add_to_cairo_context (cr);
cr->fill ();
} }
void ImageArea::infoEnabled (bool e) void ImageArea::infoEnabled (bool e)
@ -215,15 +242,7 @@ bool ImageArea::on_draw(const ::Cairo::RefPtr< Cairo::Context> &cr)
} }
if (options.showInfo && infotext != "") { if (options.showInfo && infotext != "") {
int fnw, fnh; iBackBuffer.copySurface(cr);
ilayout->get_pixel_size (fnw, fnh);
Gdk::Cairo::set_source_pixbuf(cr, ipixbuf, 4, 4);
cr->rectangle(4, 4, fnw + 8, fnh + 8);
cr->fill();
cr->set_source_rgb (1.0, 1.0, 1.0);
cr->move_to (8, 8);
ilayout->add_to_cairo_context (cr);
cr->fill ();
} }
for (std::list<CropWindow*>::reverse_iterator i = cropWins.rbegin(); i != cropWins.rend(); ++i) { for (std::list<CropWindow*>::reverse_iterator i = cropWins.rbegin(); i != cropWins.rend(); ++i) {

View File

@ -41,9 +41,8 @@ class ImageArea : public Gtk::DrawingArea, public CropWindowListener, public Edi
protected: protected:
Glib::ustring infotext; Glib::ustring infotext;
Glib::RefPtr<Pango::Layout> ilayout;
Glib::RefPtr<Pango::Layout> deglayout; Glib::RefPtr<Pango::Layout> deglayout;
Glib::RefPtr<Gdk::Pixbuf> ipixbuf; BackBuffer iBackBuffer;
bool showClippedH, showClippedS; bool showClippedH, showClippedS;
ImageAreaPanel* parent; ImageAreaPanel* parent;

View File

@ -17,9 +17,11 @@
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>. * along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <cassert>
#include <cmath>
#include "thresholdselector.h" #include "thresholdselector.h"
#include "multilangmgr.h" #include "multilangmgr.h"
#include <cassert>
#include "mycurve.h" #include "mycurve.h"
ThresholdSelector::ThresholdSelector(double minValueBottom, double maxValueBottom, double defBottom, Glib::ustring labelBottom, unsigned int precisionBottom, ThresholdSelector::ThresholdSelector(double minValueBottom, double maxValueBottom, double defBottom, Glib::ustring labelBottom, unsigned int precisionBottom,
@ -594,7 +596,7 @@ void ThresholdSelector::findLitCursor(int posX, int posY)
// we use minValTop since if this block is executed, it means that we are in a simple Threshold where both bottom and top range are the same // we use minValTop since if this block is executed, it means that we are in a simple Threshold where both bottom and top range are the same
double cursorX = (posX - hb) * (maxValTop - minValTop) / (w - 2 * hb) + minValTop; double cursorX = (posX - hb) * (maxValTop - minValTop) / (w - 2 * hb) + minValTop;
if (cursorX > positions[TS_TOPRIGHT] || abs(cursorX - positions[TS_TOPRIGHT]) < abs(cursorX - positions[TS_TOPLEFT])) { if (cursorX > positions[TS_TOPRIGHT] || std::fabs(cursorX - positions[TS_TOPRIGHT]) < std::fabs(cursorX - positions[TS_TOPLEFT])) {
litCursor = TS_TOPRIGHT; litCursor = TS_TOPRIGHT;
} }
} }
@ -607,7 +609,7 @@ void ThresholdSelector::findLitCursor(int posX, int posY)
// we use minValTop since if this block is executed, it means that we are in a simple Threshold where both bottom and top range are the same // we use minValTop since if this block is executed, it means that we are in a simple Threshold where both bottom and top range are the same
double cursorX = (posX - hb) * (maxValTop - minValTop) / (w - 2 * hb) + minValTop; double cursorX = (posX - hb) * (maxValTop - minValTop) / (w - 2 * hb) + minValTop;
if (cursorX > positions[TS_BOTTOMRIGHT] || abs(cursorX - positions[TS_BOTTOMRIGHT]) < abs(cursorX - positions[TS_BOTTOMLEFT])) { if (cursorX > positions[TS_BOTTOMRIGHT] || std::fabs(cursorX - positions[TS_BOTTOMRIGHT]) < std::fabs(cursorX - positions[TS_BOTTOMLEFT])) {
litCursor = TS_BOTTOMRIGHT; litCursor = TS_BOTTOMRIGHT;
} }
} }

View File

@ -24,8 +24,9 @@
class WinDirChangeListener class WinDirChangeListener
{ {
public: public:
virtual ~WinDirChangeListener() = default;
virtual void winDirChanged () {} virtual void winDirChanged () {}
}; };