merge with dev

This commit is contained in:
Desmis 2019-12-01 06:53:23 +01:00
commit c0da01cf9a
116 changed files with 4040 additions and 562 deletions

View File

@ -12,8 +12,8 @@ MultiUser=true
[File Browser]
# Image filename extensions to be looked for, and their corresponding search state (0/1 -> skip/include)
ParseExtensions=3fr;arw;arq;cr2;crf;crw;dcr;dng;fff;iiq;jpg;jpeg;kdc;mef;mos;mrw;nef;nrw;orf;pef;png;raf;raw;rw2;rwl;rwz;sr2;srf;srw;tif;tiff;x3f;
ParseExtensionsEnabled=1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;0;1;1;1;1;1;1;1;1;1;1;1;
ParseExtensions=3fr;arw;arq;cr2;cr3;crf;crw;dcr;dng;fff;iiq;jpg;jpeg;kdc;mef;mos;mrw;nef;nrw;orf;pef;png;raf;raw;rw2;rwl;rwz;sr2;srf;srw;tif;tiff;x3f;
ParseExtensionsEnabled=1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;0;1;1;1;1;1;1;1;1;1;1;1;
[Output]
PathTemplate=%p1/converted/%f

View File

@ -12,8 +12,8 @@ MultiUser=true
[File Browser]
# Image filename extensions to be looked for, and their corresponding search state (0/1 -> skip/include)
ParseExtensions=3fr;arw;arq;cr2;crf;crw;dcr;dng;fff;iiq;jpg;jpeg;kdc;mef;mos;mrw;nef;nrw;orf;pef;png;raf;raw;rw2;rwl;rwz;sr2;srf;srw;tif;tiff;x3f;
ParseExtensionsEnabled=1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;0;1;1;1;1;1;1;1;1;1;1;1;
ParseExtensions=3fr;arw;arq;cr2;cr3;crf;crw;dcr;dng;fff;iiq;jpg;jpeg;kdc;mef;mos;mrw;nef;nrw;orf;pef;png;raf;raw;rw2;rwl;rwz;sr2;srf;srw;tif;tiff;x3f;
ParseExtensionsEnabled=1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;0;1;1;1;1;1;1;1;1;1;1;1;
[Output]
PathTemplate=%p1/converted/%f

View File

@ -14,8 +14,8 @@ UseSystemTheme=false
[File Browser]
# Image filename extensions to be looked for, and their corresponding search state (0/1 -> skip/include)
ParseExtensions=3fr;arw;arq;cr2;crf;crw;dcr;dng;fff;iiq;jpg;jpeg;kdc;mef;mos;mrw;nef;nrw;orf;pef;png;raf;raw;rw2;rwl;rwz;sr2;srf;srw;tif;tiff;x3f;
ParseExtensionsEnabled=1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;0;1;1;1;1;1;1;1;1;1;1;1;
ParseExtensions=3fr;arw;arq;cr2;cr3;crf;crw;dcr;dng;fff;iiq;jpg;jpeg;kdc;mef;mos;mrw;nef;nrw;orf;pef;png;raf;raw;rw2;rwl;rwz;sr2;srf;srw;tif;tiff;x3f;
ParseExtensionsEnabled=1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;0;1;1;1;1;1;1;1;1;1;1;1;
[Output]
PathTemplate=%p1/converted/%f

View File

@ -1,18 +1,8 @@
[Sharpening]
Enabled=true
Contrast=5
Method=rld
DeconvRadius=0.75
DeconvAmount=100
DeconvDamping=0
DeconvIterations=30
Enabled=false
[SharpenMicro]
Enabled=true
Contrast=15
Matrix=false
Strength=20
Uniformity=5
Enabled=false
[RAW]
CA=true
@ -38,3 +28,6 @@ pixelShiftBlur=true
pixelShiftSmoothFactor=0.69999999999999996
pixelShiftLmmse=false
pixelShiftNonGreenCross=true
[PostDemosaicSharpening]
Enabled=true

View File

@ -1,18 +1,8 @@
[Sharpening]
Enabled=true
Contrast=5
Method=rld
DeconvRadius=0.75
DeconvAmount=100
DeconvDamping=0
DeconvIterations=30
Enabled=false
[SharpenMicro]
Enabled=true
Contrast=15
Matrix=false
Strength=20
Uniformity=5
Enabled=false
[RAW]
CA=true
@ -22,3 +12,6 @@ Method=pixelshift
PixelShiftMotion=0
PixelShiftMotionCorrection=5
PixelShiftMotionCorrectionMethod=0
[PostDemosaicSharpening]
Enabled=true

View File

@ -34,6 +34,7 @@ set(RTENGINESOURCEFILES
amaze_demosaic_RT.cc
badpixels.cc
boxblur.cc
canon_cr3_decoder.cc
CA_correct_RT.cc
calc_distort.cc
camconst.cc

View File

@ -1599,9 +1599,9 @@ BENCHFUN
Color::Lab2RGBLimit(labdn->L[i1], labdn->a[i1], labdn->b[i1], labdn->L[i1], labdn->a[i1], labdn->b[i1], wip, 9000000.f, 1.f + qhighFactor * realred, 1.f + qhighFactor * realblue, width);
for (int j = tileleft; j < tileright; ++j) {
int j1 = j - tileleft;
float r_ = labdn->L[i1][j1];
float g_ = labdn->a[i1][j1];
float b_ = labdn->b[i1][j1];
float r_ = std::max(0.f, labdn->L[i1][j1]);
float g_ = std::max(0.f, labdn->a[i1][j1]);
float b_ = std::max(0.f, labdn->b[i1][j1]);
//inverse gamma standard (slider)
r_ = r_ < 32768.f ? igamcurve[r_] : (Color::gammanf(r_ / 32768.f, igam) * 65535.f);
g_ = g_ < 32768.f ? igamcurve[g_] : (Color::gammanf(g_ / 32768.f, igam) * 65535.f);

View File

@ -22,12 +22,39 @@
#include "pixelsmap.h"
#include "rawimage.h"
#include "rawimagesource.h"
//#define BENCHMARK
#include "StopWatch.h"
namespace
{
unsigned fc(const unsigned int cfa[2][2], int r, int c) {
return cfa[r & 1][c & 1];
}
inline void sum5x5(const array2D<float>& in, int col, float &sum) {
#ifdef __SSE2__
// sum up 5*4 = 20 values using SSE
// 10 fabs function calls and 10 float additions with SSE
const vfloat sumv = (vabsf(LVFU(in[0][col])) + vabsf(LVFU(in[1][col]))) +
(vabsf(LVFU(in[2][col])) + vabsf(LVFU(in[3][col]))) +
vabsf(LVFU(in[4][col]));
// horizontally add the values and add the result to hfnbrave
sum += vhadd(sumv);
// add remaining 5 values of last column
sum += (fabsf(in[0][col + 4]) + fabsf(in[1][col + 4])) +
(fabsf(in[2][col + 4]) + fabsf(in[3][col + 4])) +
fabsf(in[4][col + 4]);
#else
// 25 fabs function calls and 25 float additions without SSE
for (int nn = col; nn < col + 5; ++nn) {
sum += (fabsf(in[0][nn]) + fabsf(in[1][nn])) +
(fabsf(in[2][nn]) + fabsf(in[3][nn])) +
fabsf(in[4][nn]);
}
#endif
}
}
namespace rtengine
@ -445,126 +472,124 @@ int RawImageSource::interpolateBadPixelsXtrans(const PixelsMap &bitmapBads)
/* Search for hot or dead pixels in the image and update the map
* For each pixel compare its value to the average of similar color surrounding
* (Taken from Emil Martinec idea)
* (Optimized by Ingo Weyrich 2013 and 2015)
* (Optimized by Ingo Weyrich 2013, 2015, and 2019)
*/
int RawImageSource::findHotDeadPixels(PixelsMap &bpMap, const float thresh, const bool findHotPixels, const bool findDeadPixels) const
{
BENCHFUN
const float varthresh = (20.0 * (thresh / 100.0) + 1.0) / 24.f;
// allocate temporary buffer
float* cfablur = new float[H * W];
// counter for dead or hot pixels
int counter = 0;
#ifdef _OPENMP
#pragma omp parallel
#pragma omp parallel reduction(+:counter)
#endif
{
array2D<float> cfablur(W, 5, ARRAY2D_CLEAR_DATA);
int firstRow = -1;
int lastRow = -1;
#ifdef _OPENMP
#pragma omp for schedule(dynamic,16) nowait
// note, static scheduling is important in this implementation
#pragma omp for schedule(static) nowait
#endif
for (int i = 2; i < H - 2; i++) {
for (int j = 2; j < W - 2; j++) {
for (int i = 2; i < H - 2; ++i) {
if (firstRow == -1) {
firstRow = i;
if (firstRow > 2) {
for (int row = firstRow - 2; row < firstRow; ++row) {
const int destRow = row % 5;
for (int j = 2; j < W - 2; ++j) {
const float temp = median(rawData[row - 2][j - 2], rawData[row - 2][j], rawData[row - 2][j + 2],
rawData[row][j - 2], rawData[row][j], rawData[row][j + 2],
rawData[row + 2][j - 2], rawData[row + 2][j], rawData[row + 2][j + 2]);
cfablur[destRow][j] = rawData[row][j] - temp;
}
}
}
}
lastRow = i;
const int destRow = i % 5;
for (int j = 2; j < W - 2; ++j) {
const float temp = median(rawData[i - 2][j - 2], rawData[i - 2][j], rawData[i - 2][j + 2],
rawData[i][j - 2], rawData[i][j], rawData[i][j + 2],
rawData[i + 2][j - 2], rawData[i + 2][j], rawData[i + 2][j + 2]);
cfablur[i * W + j] = rawData[i][j] - temp;
}
cfablur[destRow][j] = rawData[i][j] - temp;
}
// process borders. Former version calculated the median using mirrored border which does not make sense because the original pixel loses weight
// Setting the difference between pixel and median for border pixels to zero should do the job not worse then former version
#ifdef _OPENMP
#pragma omp single
#endif
{
for (int i = 0; i < 2; ++i) {
for (int j = 0; j < W; ++j) {
cfablur[i * W + j] = 0.f;
}
}
for (int i = 2; i < H - 2; ++i) {
for (int j = 0; j < 2; ++j) {
cfablur[i * W + j] = 0.f;
}
for (int j = W - 2; j < W; ++j) {
cfablur[i * W + j] = 0.f;
}
}
for (int i = H - 2; i < H; ++i) {
for (int j = 0; j < W; ++j) {
cfablur[i * W + j] = 0.f;
}
}
}
#ifdef _OPENMP
#pragma omp barrier // barrier because of nowait clause above
#pragma omp for reduction(+:counter) schedule(dynamic,16)
#endif
//cfa pixel heat/death evaluation
for (int rr = 2; rr < H - 2; ++rr) {
for (int cc = 2, rrmWpcc = rr * W + 2; cc < W - 2; ++cc, ++rrmWpcc) {
if (i - 1 > firstRow) {
const int rr = i - 2;
const int rr0 = rr % 5;
for (int cc = 2; cc < W - 2; ++cc) {
//evaluate pixel for heat/death
float pixdev = cfablur[rrmWpcc];
float pixdev = cfablur[rr0][cc];
if (pixdev == 0.f) {
if (!findDeadPixels && pixdev <= 0.f) {
continue;
}
if ((!findDeadPixels) && pixdev < 0) {
continue;
}
if ((!findHotPixels) && pixdev > 0) {
if (!findHotPixels && pixdev >= 0.f) {
continue;
}
pixdev = fabsf(pixdev);
float hfnbrave = -pixdev;
#ifdef __SSE2__
// sum up 5*4 = 20 values using SSE
// 10 fabs function calls and 10 float additions with SSE
vfloat sum = vabsf(LVFU(cfablur[(rr - 2) * W + cc - 2])) + vabsf(LVFU(cfablur[(rr - 1) * W + cc - 2]));
sum += vabsf(LVFU(cfablur[(rr) * W + cc - 2]));
sum += vabsf(LVFU(cfablur[(rr + 1) * W + cc - 2]));
sum += vabsf(LVFU(cfablur[(rr + 2) * W + cc - 2]));
// horizontally add the values and add the result to hfnbrave
hfnbrave += vhadd(sum);
// add remaining 5 values of last column
for (int mm = rr - 2; mm <= rr + 2; ++mm) {
hfnbrave += fabsf(cfablur[mm * W + cc + 2]);
}
#else
// 25 fabs function calls and 25 float additions without SSE
for (int mm = rr - 2; mm <= rr + 2; ++mm) {
for (int nn = cc - 2; nn <= cc + 2; ++nn) {
hfnbrave += fabsf(cfablur[mm * W + nn]);
}
}
#endif
sum5x5(cfablur, cc - 2, hfnbrave);
if (pixdev > varthresh * hfnbrave) {
// mark the pixel as "bad"
bpMap.set(cc, rr);
counter++;
++counter;
}
} //end of pixel evaluation
}
}
if (lastRow > 0 && lastRow < H - 2) {
//cfa pixel heat/death evaluation
for (int rr = lastRow - 1; rr < lastRow + 1; ++rr) {
const int i = rr + 2;
const int destRow = i % 5;
if (i >= H - 2) {
for (int j = 2; j < W - 2; j++) {
cfablur[destRow][j] = 0.f;
}
} else {
for (int j = 2; j < W - 2; ++j) {
const float temp = median(rawData[i - 2][j - 2], rawData[i - 2][j], rawData[i - 2][j + 2],
rawData[i][j - 2], rawData[i][j], rawData[i][j + 2],
rawData[i + 2][j - 2], rawData[i + 2][j], rawData[i + 2][j + 2]);
cfablur[destRow][j] = rawData[i][j] - temp;
}
}
const int rr0 = rr % 5;
for (int cc = 2; cc < W - 2; ++cc) {
//evaluate pixel for heat/death
float pixdev = cfablur[rr0][cc];
if (!findDeadPixels && pixdev <= 0.f) {
continue;
}
if (!findHotPixels && pixdev >= 0.f) {
continue;
}
pixdev = fabsf(pixdev);
float hfnbrave = -pixdev;
sum5x5(cfablur, cc - 2, hfnbrave);
if (pixdev > varthresh * hfnbrave) {
// mark the pixel as "bad"
bpMap.set(cc, rr);
++counter;
}
}//end of pixel evaluation
}
}
}//end of parallel processing
delete [] cfablur;
return counter;
}

View File

@ -33,6 +33,7 @@ void boxblur(float** src, float** dst, int radius, int W, int H, bool multiThrea
{
//box blur using rowbuffers and linebuffers instead of a full size buffer
radius = rtengine::min(radius, W - 1, H - 1);
if (radius == 0) {
if (src != dst) {
#ifdef _OPENMP

View File

@ -445,9 +445,7 @@ static unsigned char* ensure(printbuffer * const p, size_t needed)
p->buffer = NULL;
return NULL;
}
if (newbuffer)
{
} else {
memcpy(newbuffer, p->buffer, p->offset + 1);
}
p->hooks.deallocate(p->buffer);
@ -1436,7 +1434,7 @@ fail:
static cJSON_bool print_array(const cJSON * const item, printbuffer * const output_buffer)
{
unsigned char *output_pointer = NULL;
size_t length = 0;
size_t length;
cJSON *current_element = item->child;
if (output_buffer == NULL)

View File

@ -1138,6 +1138,16 @@ Camera constants:
}
},
{ // Quality C, only raw crop
"make_model": [ "Canon EOS M6 Mark II", "Canon EOS 90D" ],
"raw_crop": [ 144, 72, 6984, 4660 ]
},
{ // Quality C, only raw crop
"make_model": [ "Canon EOS R" ],
"raw_crop": [ 144, 46, 6744, 4500 ]
},
// Canon Powershot
{ // Quality C, CHDK DNGs, raw frame correction
"make_model": "Canon PowerShot A3100 IS",
@ -2506,7 +2516,7 @@ Camera constants:
{ // Quality C,
"make_model": "Sony ILCE-7RM4",
"raw_crop": [ 0, 0, 9568, 0 ] // full raw frame 9600x6376 - 32 rightmost columns are garbage
"raw_crop": [ 0, 0, -32, 0 ] // full raw frame 9600x6376 - 32 rightmost columns are garbage. Using -32 instead of 9568 to support also 16-shot pixelshift files
},
{ // Quality B, color matrix copied from a7rm2

File diff suppressed because it is too large Load Diff

View File

@ -409,92 +409,88 @@ float calcRadiusXtrans(const float * const *rawData, int W, int H, float lowerLi
#ifdef _OPENMP
#pragma omp parallel for reduction(max:maxRatio) schedule(dynamic, 16)
#endif
for (int row = starty + 3; row < H - 4; row += 3) {
for (int col = startx + 3; col < W - 4; col += 3) {
const float valtl = rawData[row][col];
const float valtr = rawData[row][col + 1];
const float valbl = rawData[row + 1][col];
const float valbr = rawData[row + 1][col + 1];
if (valtl > 1.f) {
const float maxValtltr = std::max(valtl, valtr);
if (valtr > 1.f && maxValtltr > lowerLimit) {
const float minVal = std::min(valtl, valtr);
if (UNLIKELY(maxValtltr > maxRatio * minVal)) {
bool clipped = false;
if (maxValtltr == valtl) { // check for influence by clipped green in neighborhood
if (rtengine::max(rawData[row - 1][col - 1], valtr, valbl, valbr) >= upperLimit) {
clipped = true;
}
} else { // check for influence by clipped green in neighborhood
if (rtengine::max(rawData[row - 1][col + 2], valtl, valbl, valbr) >= upperLimit) {
clipped = true;
}
}
if (!clipped) {
maxRatio = maxValtltr / minVal;
for (int row = starty + 2; row < H - 4; row += 3) {
for (int col = startx + 2; col < W - 4; col += 3) {
const float valp1p1 = rawData[row + 1][col + 1];
const bool squareClipped = rtengine::max(valp1p1, rawData[row + 1][col + 2], rawData[row + 2][col + 1], rawData[row + 2][col + 2]) >= upperLimit;
const float greenSolitary = rawData[row][col];
if (greenSolitary > 1.f && std::max(rawData[row - 1][col - 1], rawData[row - 1][col + 1]) < upperLimit) {
if (greenSolitary < upperLimit) {
const float valp1m1 = rawData[row + 1][col - 1];
if (valp1m1 > 1.f && rtengine::max(rawData[row + 1][col - 2], valp1m1, rawData[row + 2][col - 2], rawData[row + 1][col - 1]) < upperLimit) {
const float maxVal = std::max(greenSolitary, valp1m1);
if (maxVal > lowerLimit) {
const float minVal = std::min(greenSolitary, valp1m1);
if (UNLIKELY(maxVal > maxRatio * minVal)) {
maxRatio = maxVal / minVal;
}
}
}
const float maxValtlbl = std::max(valtl, valbl);
if (valbl > 1.f && maxValtlbl > lowerLimit) {
const float minVal = std::min(valtl, valbl);
if (UNLIKELY(maxValtlbl > maxRatio * minVal)) {
bool clipped = false;
if (maxValtlbl == valtl) { // check for influence by clipped green in neighborhood
if (rtengine::max(rawData[row - 1][col - 1], valtr, valbl, valbr) >= upperLimit) {
clipped = true;
}
} else { // check for influence by clipped green in neighborhood
if (rtengine::max(valtl, valtr, rawData[row + 2][col - 1], valbr) >= upperLimit) {
clipped = true;
}
}
if (!clipped) {
maxRatio = maxValtlbl / minVal;
}
}
}
}
if (valbr > 1.f) {
const float maxValblbr = std::max(valbl, valbr);
if (valbl > 1.f && maxValblbr > lowerLimit) {
const float minVal = std::min(valbl, valbr);
if (UNLIKELY(maxValblbr > maxRatio * minVal)) {
bool clipped = false;
if (maxValblbr == valbr) { // check for influence by clipped green in neighborhood
if (rtengine::max(valtl, valtr, valbl, rawData[row + 2][col + 2]) >= upperLimit) {
clipped = true;
}
} else { // check for influence by clipped green in neighborhood
if (rtengine::max(valtl, valtr, rawData[row + 2][col - 1], valbr) >= upperLimit) {
clipped = true;
}
}
if (!clipped) {
maxRatio = maxValblbr / minVal;
}
}
}
const float maxValtrbr = std::max(valtr, valbr);
if (valtr > 1.f && maxValtrbr > lowerLimit) {
const float minVal = std::min(valtr, valbr);
if (UNLIKELY(maxValtrbr > maxRatio * minVal)) {
if (maxValtrbr == valbr) { // check for influence by clipped green in neighborhood
if (rtengine::max(valtl, valtr, valbl, rawData[row + 2][col + 2]) >= upperLimit) {
continue;
}
} else { // check for influence by clipped green in neighborhood
if (rtengine::max(rawData[row - 1][col + 2], valtl, valbl, valbr) >= upperLimit) {
continue;
}
}
maxRatio = maxValtrbr / minVal;
if (valp1p1 > 1.f && !squareClipped) {
const float maxVal = std::max(greenSolitary, valp1p1);
if (maxVal > lowerLimit) {
const float minVal = std::min(greenSolitary, valp1p1);
if (UNLIKELY(maxVal > maxRatio * minVal)) {
maxRatio = maxVal / minVal;
}
}
}
}
}
return std::sqrt((1.f / (std::log(1.f / maxRatio))) / -2.f);
if (!squareClipped) {
const float valp2p2 = rawData[row + 2][col + 2];
if (valp2p2 > 1.f) {
if (valp1p1 > 1.f) {
const float maxVal = std::max(valp1p1, valp2p2);
if (maxVal > lowerLimit) {
const float minVal = std::min(valp1p1, valp2p2);
if (UNLIKELY(maxVal > maxRatio * minVal)) {
maxRatio = maxVal / minVal;
}
}
}
const float greenSolitaryRight = rawData[row + 3][col + 3];
if (rtengine::max(greenSolitaryRight, rawData[row + 4][col + 2], rawData[row + 4][col + 4]) < upperLimit) {
if (greenSolitaryRight > 1.f) {
const float maxVal = std::max(greenSolitaryRight, valp2p2);
if (maxVal > lowerLimit) {
const float minVal = std::min(greenSolitaryRight, valp2p2);
if (UNLIKELY(maxVal > maxRatio * minVal)) {
maxRatio = maxVal / minVal;
}
}
}
}
}
const float valp1p2 = rawData[row + 1][col + 2];
const float valp2p1 = rawData[row + 2][col + 1];
if (valp2p1 > 1.f) {
if (valp1p2 > 1.f) {
const float maxVal = std::max(valp1p2, valp2p1);
if (maxVal > lowerLimit) {
const float minVal = std::min(valp1p2, valp2p1);
if (UNLIKELY(maxVal > maxRatio * minVal)) {
maxRatio = maxVal / minVal;
}
}
}
const float greenSolitaryLeft = rawData[row + 3][col];
if (rtengine::max(greenSolitaryLeft, rawData[row + 4][col - 1], rawData[row + 4][col + 1]) < upperLimit) {
if (greenSolitaryLeft > 1.f) {
const float maxVal = std::max(greenSolitaryLeft, valp2p1);
if (maxVal > lowerLimit) {
const float minVal = std::min(greenSolitaryLeft, valp2p1);
if (UNLIKELY(maxVal > maxRatio * minVal)) {
maxRatio = maxVal / minVal;
}
}
}
}
}
}
}
}
return std::sqrt((1.f / (std::log(1.f / maxRatio) / 2.f)) / -2.f);
}
bool checkForStop(float** tmpIThr, float** iterCheck, int fullTileSize, int border)
@ -537,8 +533,8 @@ BENCHFUN
}
constexpr int tileSize = 32;
constexpr int border = 5;
constexpr int fullTileSize = tileSize + 2 * border;
const int border = iterations <= 30 ? 5 : 7;
const int fullTileSize = tileSize + 2 * border;
const float cornerRadius = std::min<float>(1.15f, sigma + sigmaCornerOffset);
const float cornerDistance = sqrt(rtengine::SQR(W * 0.5f) + rtengine::SQR(H * 0.5f));
const float distanceFactor = (cornerRadius - sigma) / cornerDistance;
@ -573,10 +569,10 @@ BENCHFUN
}
}
}
for (int k = 0, ii = endOfCol ? H - fullTileSize : i; k < fullTileSize; ++k, ++ii) {
for (int l = 0, jj = endOfRow ? W - fullTileSize : j; l < fullTileSize; ++l, ++jj) {
tmpIThr[k][l] = oldLuminance[ii - border][jj - border];
lumThr[k][l] = oldLuminance[ii - border][jj - border];
for (int k = 0, ii = endOfCol ? H - fullTileSize : i - border; k < fullTileSize; ++k, ++ii) {
for (int l = 0, jj = endOfRow ? W - fullTileSize : j - border; l < fullTileSize; ++l, ++jj) {
tmpIThr[k][l] = oldLuminance[ii][jj];
lumThr[k][l] = oldLuminance[ii][jj];
}
}
} else {
@ -618,6 +614,7 @@ BENCHFUN
const float distance = sqrt(rtengine::SQR(i + tileSize / 2 - H / 2) + rtengine::SQR(j + tileSize / 2 - W / 2));
const float sigmaTile = static_cast<float>(sigma) + distanceFactor * distance;
if (sigmaTile >= 0.4f) {
if (sigmaTile > 0.84) { // have to use 7x7 kernel
float lkernel7[7][7];
compute7x7kernel(static_cast<float>(sigma) + distanceFactor * distance, lkernel7);
for (int k = 0; k < iterations && !stopped; ++k) {
@ -628,6 +625,18 @@ BENCHFUN
stopped = checkForStop(tmpIThr, iterCheck, fullTileSize, border);
}
}
} else { // can use 5x5 kernel
float lkernel7[5][5];
compute5x5kernel(static_cast<float>(sigma) + distanceFactor * distance, lkernel7);
for (int k = 0; k < iterations && !stopped; ++k) {
// apply 7x7 gaussian blur and divide luminance by result of gaussian blur
gauss5x5div(tmpIThr, tmpThr, lumThr, fullTileSize, lkernel7);
gauss5x5mult(tmpThr, tmpIThr, fullTileSize, lkernel7);
if (checkIterStop) {
stopped = checkForStop(tmpIThr, iterCheck, fullTileSize, border);
}
}
}
}
} else {
for (int k = 0; k < iterations && !stopped; ++k) {
@ -642,8 +651,8 @@ BENCHFUN
}
if (endOfRow || endOfCol) {
// special handling for small tiles at end of row or column
for (int k = border, ii = endOfCol ? H - fullTileSize - border : i - border; k < fullTileSize - border; ++k) {
for (int l = border, jj = endOfRow ? W - fullTileSize - border : j - border; l < fullTileSize - border; ++l) {
for (int k = border, ii = endOfCol ? H - fullTileSize : i - border; k < fullTileSize - border; ++k) {
for (int l = border, jj = endOfRow ? W - fullTileSize : j - border; l < fullTileSize - border; ++l) {
luminance[ii + k][jj + l] = rtengine::intp(blend[ii + k][jj + l], std::max(tmpIThr[k][l], 0.0f), luminance[ii + k][jj + l]);
}
}

View File

@ -404,7 +404,7 @@ void Ciecam02::calculate_abfloat ( vfloat &aa, vfloat &bb, vfloat h, vfloat e, v
#endif
void Ciecam02::initcam1float (float yb, float pilotd, float f, float la, float xw, float yw, float zw, float &n, float &d, float &nbb, float &ncb,
float &cz, float &aw, float &wh, float &pfl, float &fl, float &c)
float &cz, float &aw, float &wh, float &pfl, float &fl, float c)
{
n = yb / yw;

View File

@ -84,7 +84,7 @@ public:
* Forward transform from XYZ to CIECAM02 JCh.
*/
static void initcam1float (float yb, float pilotd, float f, float la, float xw, float yw, float zw, float &n, float &d, float &nbb, float &ncb,
float &cz, float &aw, float &wh, float &pfl, float &fl, float &c);
float &cz, float &aw, float &wh, float &pfl, float &fl, float c);
static void initcam2float (float yb, float pilotd, float f, float la, float xw, float yw, float zw, float &n, float &d, float &nbb, float &ncb,
float &cz, float &aw, float &fl);

View File

@ -272,7 +272,7 @@ template<typename T> void wavelet_level<T>::SynthesisFilterHaarVertical (const T
#pragma omp for nowait
#endif
for(int i = 0; i < skip; i++)
for(int i = 0; i < std::min(skip, height); i++)
{
for(int j = 0; j < width; j++) {
dst[width * i + j] = (srcLo[i * width + j] + srcHi[i * width + j]);

View File

@ -5595,13 +5595,26 @@ nf: order = 0x4949;
else if (!strcmp (buf,"AOC") ||
!strcmp (buf,"QVC"))
fseek (ifp, -4, SEEK_CUR);
// ALB -- taken from LibRaw ------------------------------------------------
else if (!strncmp(buf, "CMT3", 4))
{
order = sget2((uchar *)(buf + 4));
fseek(ifp, 2L, SEEK_CUR);
}
else if (RT_canon_CR3_data.CR3_CTMDtag)
{
order = sget2((uchar *)buf);
fseek(ifp, -2L, SEEK_CUR);
}
// -------------------------------------------------------------------------
else {
fseek (ifp, -10, SEEK_CUR);
if (!strncmp(make,"SAMSUNG",7))
base = ftell(ifp);
}
entries = get2();
if (entries > 1000) return;
if (entries > 2000) return;
morder = order;
while (entries--) {
order = morder;
@ -5806,16 +5819,335 @@ get2_256:
parse_thumb_note (base, 136, 137);
}
if (tag == 0x4001 && len > 500) {
i = len == 582 ? 50 : len == 653 ? 68 : len == 5120 ? 142 : 126;
fseek (ifp, i, SEEK_CUR);
FORC4 cam_mul[c ^ (c >> 1)] = get2();
for (i+=18; i <= len; i+=10) {
get2();
// i = len == 582 ? 50 : len == 653 ? 68 : len == 5120 ? 142 : 126;
// fseek (ifp, i, SEEK_CUR);
// FORC4 cam_mul[c ^ (c >> 1)] = get2();
// for (i+=18; i <= len; i+=10) {
// get2();
// FORC4 sraw_mul[c ^ (c >> 1)] = get2();
// if (sraw_mul[1] == 1170) break;
// }
// -- ALB -- adapted from LibRaw --------------------------------------
int bls = 0;
long int offsetChannelBlackLevel = 0L;
long int offsetChannelBlackLevel2 = 0L;
long int offsetWhiteLevels = 0L;
struct {
int AverageBlackLevel;
int ColorDataSubVer;
int NormalWhiteLevel;
int SpecularWhiteLevel;
} imCanon = { 0, 0, 0, 0 };
long int save1 = ftell(ifp);
switch (len)
{
case 582:
// imCanon.ColorDataVer = 1; // 20D / 350D
fseek(ifp, save1 + (0x0019 << 1), SEEK_SET);
FORC4 cam_mul[c ^ (c >> 1)] = (float)get2();
// fseek(ifp, save1 + (0x001e << 1), SEEK_SET);
// FORC4 imgdata.color.WB_Coeffs[LIBRAW_WBI_Auto][c ^ (c >> 1)] = get2();
// fseek(ifp, save1 + (0x0041 << 1), SEEK_SET);
// FORC4 imgdata.color.WB_Coeffs[LIBRAW_WBI_Custom1][c ^ (c >> 1)] = get2();
// fseek(ifp, save1 + (0x0046 << 1), SEEK_SET);
// FORC4 imgdata.color.WB_Coeffs[LIBRAW_WBI_Custom2][c ^ (c >> 1)] = get2();
// fseek(ifp, save1 + (0x0023 << 1), SEEK_SET);
// Canon_WBpresets(2, 2);
// fseek(ifp, save1 + (0x004b << 1), SEEK_SET);
// Canon_WBCTpresets(1); // ABCT
offsetChannelBlackLevel = save1 + (0x00a6 << 1);
break;
case 653:
// imCanon.ColorDataVer = 2; // 1Dmk2 / 1DsMK2
// fseek(ifp, save1 + (0x0018 << 1), SEEK_SET);
// FORC4 imgdata.color.WB_Coeffs[LIBRAW_WBI_Auto][c ^ (c >> 1)] = get2();
fseek(ifp, save1 + (0x0022 << 1), SEEK_SET);
FORC4 cam_mul[c ^ (c >> 1)] = (float)get2();
// fseek(ifp, save1 + (0x0090 << 1), SEEK_SET);
// FORC4 imgdata.color.WB_Coeffs[LIBRAW_WBI_Custom1][c ^ (c >> 1)] = get2();
// fseek(ifp, save1 + (0x0095 << 1), SEEK_SET);
// FORC4 imgdata.color.WB_Coeffs[LIBRAW_WBI_Custom2][c ^ (c >> 1)] = get2();
// fseek(ifp, save1 + (0x009a << 1), SEEK_SET);
// FORC4 imgdata.color.WB_Coeffs[LIBRAW_WBI_Custom3][c ^ (c >> 1)] = get2();
// fseek(ifp, save1 + (0x0027 << 1), SEEK_SET);
// Canon_WBpresets(2, 12);
// fseek(ifp, save1 + (0x00a4 << 1), SEEK_SET);
// Canon_WBCTpresets(1); // ABCT
offsetChannelBlackLevel = save1 + (0x011e << 1);
break;
case 796:
// imCanon.ColorDataVer = 3; // 1DmkIIN / 5D / 30D / 400D
// imCanon.ColorDataSubVer = get2();
fseek(ifp, save1 + (0x003f << 1), SEEK_SET);
FORC4 cam_mul[c ^ (c >> 1)] = (float)get2();
// fseek(ifp, save1 + (0x0044 << 1), SEEK_SET);
// FORC4 imgdata.color.WB_Coeffs[LIBRAW_WBI_Auto][c ^ (c >> 1)] = get2();
// fseek(ifp, save1 + (0x0049 << 1), SEEK_SET);
// FORC4 imgdata.color.WB_Coeffs[LIBRAW_WBI_Measured][c ^ (c >> 1)] = get2();
// fseek(ifp, save1 + (0x0071 << 1), SEEK_SET);
// FORC4 imgdata.color.WB_Coeffs[LIBRAW_WBI_Custom1][c ^ (c >> 1)] = get2();
// fseek(ifp, save1 + (0x0076 << 1), SEEK_SET);
// FORC4 imgdata.color.WB_Coeffs[LIBRAW_WBI_Custom2][c ^ (c >> 1)] = get2();
// fseek(ifp, save1 + (0x007b << 1), SEEK_SET);
// FORC4 imgdata.color.WB_Coeffs[LIBRAW_WBI_Custom3][c ^ (c >> 1)] = get2();
// fseek(ifp, save1 + (0x0080 << 1), SEEK_SET);
// FORC4 imgdata.color.WB_Coeffs[LIBRAW_WBI_Custom][c ^ (c >> 1)] = get2();
// fseek(ifp, save1 + (0x004e << 1), SEEK_SET);
// Canon_WBpresets(2, 12);
// fseek(ifp, save1 + (0x0085 << 1), SEEK_SET);
// Canon_WBCTpresets(0); // BCAT
offsetChannelBlackLevel = save1 + (0x00c4 << 1);
break;
// 1DmkIII / 1DSmkIII / 1DmkIV / 5DmkII
// 7D / 40D / 50D / 60D / 450D / 500D
// 550D / 1000D / 1100D
case 674:
case 692:
case 702:
case 1227:
case 1250:
case 1251:
case 1337:
case 1338:
case 1346:
// imCanon.ColorDataVer = 4;
imCanon.ColorDataSubVer = get2();
fseek(ifp, save1 + (0x003f << 1), SEEK_SET);
FORC4 cam_mul[c ^ (c >> 1)] = (float)get2();
// fseek(ifp, save1 + (0x0044 << 1), SEEK_SET);
// FORC4 imgdata.color.WB_Coeffs[LIBRAW_WBI_Auto][c ^ (c >> 1)] = get2();
// fseek(ifp, save1 + (0x0049 << 1), SEEK_SET);
// FORC4 imgdata.color.WB_Coeffs[LIBRAW_WBI_Measured][c ^ (c >> 1)] = get2();
fseek(ifp, save1 + (0x004e << 1), SEEK_SET);
FORC4 sraw_mul[c ^ (c >> 1)] = get2();
if (sraw_mul[1] == 1170) break;
// fseek(ifp, save1 + (0x0053 << 1), SEEK_SET);
// Canon_WBpresets(2, 12);
// fseek(ifp, save1 + (0x00a8 << 1), SEEK_SET);
// Canon_WBCTpresets(0); // BCAT
if ((imCanon.ColorDataSubVer == 4) ||
(imCanon.ColorDataSubVer == 5))
{
offsetChannelBlackLevel = save1 + (0x02b4 << 1);
offsetWhiteLevels = save1 + (0x02b8 << 1);
}
else if ((imCanon.ColorDataSubVer == 6) ||
(imCanon.ColorDataSubVer == 7))
{
offsetChannelBlackLevel = save1 + (0x02cb << 1);
offsetWhiteLevels = save1 + (0x02cf << 1);
}
if (tag == 0x4021 && get4() && get4())
else if (imCanon.ColorDataSubVer == 9)
{
offsetChannelBlackLevel = save1 + (0x02cf << 1);
offsetWhiteLevels = save1 + (0x02d3 << 1);
}
else
offsetChannelBlackLevel = save1 + (0x00e7 << 1);
break;
case 5120: // PowerShot G10, G12, G5 X, G7 X, G9 X, EOS M3, EOS M5, EOS M6
// imCanon.ColorDataVer = 5;
imCanon.ColorDataSubVer = get2();
fseek(ifp, save1 + (0x0047 << 1), SEEK_SET);
FORC4 cam_mul[c ^ (c >> 1)] = (float)get2();
if (imCanon.ColorDataSubVer == 0xfffc)
{ // -4: G7 X Mark II, G9 X Mark II, G1 X Mark III, M5, M100, M6
// fseek(ifp, save1 + (0x004f << 1), SEEK_SET);
// FORC4 imgdata.color.WB_Coeffs[LIBRAW_WBI_Auto][c ^ (c >> 1)] = get2();
// fseek(ifp, 8, SEEK_CUR);
// FORC4 imgdata.color.WB_Coeffs[LIBRAW_WBI_Measured][c ^ (c >> 1)] =
// get2();
// fseek(ifp, 8, SEEK_CUR);
// FORC4 imgdata.color.WB_Coeffs[LIBRAW_WBI_Other][c ^ (c >> 1)] = get2();
// fseek(ifp, 8, SEEK_CUR);
// Canon_WBpresets(8, 24);
// fseek(ifp, 168, SEEK_CUR);
// FORC4 imgdata.color.WB_Coeffs[LIBRAW_WBI_FL_WW][c ^ (c >> 1)] = get2();
// fseek(ifp, 24, SEEK_CUR);
// Canon_WBCTpresets(2); // BCADT
offsetChannelBlackLevel = save1 + (0x014d << 1);
offsetWhiteLevels = save1 + (0x0569 << 1);
}
else if (imCanon.ColorDataSubVer == 0xfffd)
{ // -3: M10/M3/G1 X/G1 X II/G10/G11/G12/G15/G16/G3 X/G5 X/G7 X/G9
// X/S100/S110/S120/S90/S95/SX1 IX/SX50 HS/SX60 HS
// fseek(ifp, save1 + (0x004c << 1), SEEK_SET);
// FORC4 imgdata.color.WB_Coeffs[LIBRAW_WBI_Auto][c ^ (c >> 1)] = get2();
// get2();
// FORC4 imgdata.color.WB_Coeffs[LIBRAW_WBI_Measured][c ^ (c >> 1)] =
// get2();
// get2();
// FORC4 imgdata.color.WB_Coeffs[LIBRAW_WBI_Other][c ^ (c >> 1)] = get2();
// get2();
// Canon_WBpresets(2, 12);
// fseek(ifp, save1 + (0x00ba << 1), SEEK_SET);
// Canon_WBCTpresets(2); // BCADT
offsetChannelBlackLevel = save1 + (0x0108 << 1);
}
break;
case 1273:
case 1275:
// imCanon.ColorDataVer = 6; // 600D / 1200D
imCanon.ColorDataSubVer = get2();
fseek(ifp, save1 + (0x003f << 1), SEEK_SET);
FORC4 cam_mul[c ^ (c >> 1)] = (float)get2();
// fseek(ifp, save1 + (0x0044 << 1), SEEK_SET);
// FORC4 imgdata.color.WB_Coeffs[LIBRAW_WBI_Auto][c ^ (c >> 1)] = get2();
// fseek(ifp, save1 + (0x0049 << 1), SEEK_SET);
// FORC4 imgdata.color.WB_Coeffs[LIBRAW_WBI_Measured][c ^ (c >> 1)] = get2();
fseek(ifp, save1 + (0x0062 << 1), SEEK_SET);
FORC4 sraw_mul[c ^ (c >> 1)] = get2();
// fseek(ifp, save1 + (0x0067 << 1), SEEK_SET);
// Canon_WBpresets(2, 12);
// fseek(ifp, save1 + (0x00bc << 1), SEEK_SET);
// Canon_WBCTpresets(0); // BCAT
offsetChannelBlackLevel = save1 + (0x01df << 1);
offsetWhiteLevels = save1 + (0x01e3 << 1);
break;
// 1DX / 5DmkIII / 6D / 100D / 650D / 700D / EOS M / 7DmkII / 750D / 760D
case 1312:
case 1313:
case 1316:
case 1506:
// imCanon.ColorDataVer = 7;
imCanon.ColorDataSubVer = get2();
fseek(ifp, save1 + (0x003f << 1), SEEK_SET);
FORC4 cam_mul[c ^ (c >> 1)] = (float)get2();
// fseek(ifp, save1 + (0x0044 << 1), SEEK_SET);
// FORC4 imgdata.color.WB_Coeffs[LIBRAW_WBI_Auto][c ^ (c >> 1)] = get2();
// fseek(ifp, save1 + (0x0049 << 1), SEEK_SET);
// FORC4 imgdata.color.WB_Coeffs[LIBRAW_WBI_Measured][c ^ (c >> 1)] = get2();
fseek(ifp, save1 + (0x007b << 1), SEEK_SET);
FORC4 sraw_mul[c ^ (c >> 1)] = get2();
// fseek(ifp, save1 + (0x0080 << 1), SEEK_SET);
// Canon_WBpresets(2, 12);
// fseek(ifp, save1 + (0x00d5 << 1), SEEK_SET);
// Canon_WBCTpresets(0); // BCAT
if (imCanon.ColorDataSubVer == 10)
{
offsetChannelBlackLevel = save1 + (0x01f8 << 1);
offsetWhiteLevels = save1 + (0x01fc << 1);
}
else if (imCanon.ColorDataSubVer == 11)
{
offsetChannelBlackLevel = save1 + (0x02d8 << 1);
offsetWhiteLevels = save1 + (0x02dc << 1);
}
break;
// 5DS / 5DS R / 80D / 1300D / 1500D / 3000D / 5D4 / 800D / 77D / 6D II /
// 200D
case 1560:
case 1592:
case 1353:
case 1602:
// imCanon.ColorDataVer = 8;
imCanon.ColorDataSubVer = get2();
fseek(ifp, save1 + (0x003f << 1), SEEK_SET);
FORC4 cam_mul[c ^ (c >> 1)] = (float)get2();
// fseek(ifp, save1 + (0x0044 << 1), SEEK_SET);
// FORC4 imgdata.color.WB_Coeffs[LIBRAW_WBI_Auto][c ^ (c >> 1)] = get2();
// fseek(ifp, save1 + (0x0049 << 1), SEEK_SET);
// FORC4 imgdata.color.WB_Coeffs[LIBRAW_WBI_Measured][c ^ (c >> 1)] = get2();
fseek(ifp, save1 + (0x0080 << 1), SEEK_SET);
FORC4 sraw_mul[c ^ (c >> 1)] = get2();
// fseek(ifp, save1 + (0x0085 << 1), SEEK_SET);
// Canon_WBpresets(2, 12);
// fseek(ifp, save1 + (0x0107 << 1), SEEK_SET);
// Canon_WBCTpresets(0); // BCAT
if (imCanon.ColorDataSubVer == 14)
{ // 1300D / 1500D / 3000D
offsetChannelBlackLevel = save1 + (0x022c << 1);
offsetWhiteLevels = save1 + (0x0230 << 1);
}
else
{
offsetChannelBlackLevel = save1 + (0x030a << 1);
offsetWhiteLevels = save1 + (0x030e << 1);
}
break;
case 1820: // M50, ColorDataSubVer 16
case 1824: // EOS R, SX740HS, ColorDataSubVer 17
case 1816: // EOS RP, SX70HS, ColorDataSubVer 18;
// EOS M6 Mark II, EOS 90D, G7XmkIII, ColorDataSubVer 19
// imCanon.ColorDataVer = 9;
imCanon.ColorDataSubVer = get2();
fseek(ifp, save1 + (0x0047 << 1), SEEK_SET);
FORC4 cam_mul[c ^ (c >> 1)] = (float)get2();
// get2();
// FORC4 imgdata.color.WB_Coeffs[LIBRAW_WBI_Auto][c ^ (c >> 1)] = get2();
// get2();
// FORC4 imgdata.color.WB_Coeffs[LIBRAW_WBI_Measured][c ^ (c >> 1)] = get2();
// fseek(ifp, save1 + (0x0088 << 1), SEEK_SET);
// Canon_WBpresets(2, 12);
// fseek(ifp, save1 + (0x010a << 1), SEEK_SET);
// Canon_WBCTpresets(0);
offsetChannelBlackLevel = save1 + (0x0318 << 1);
offsetChannelBlackLevel2 = save1 + (0x0149 << 1);
offsetWhiteLevels = save1 + (0x031c << 1);
break;
}
if (offsetChannelBlackLevel)
{
fseek(ifp, offsetChannelBlackLevel, SEEK_SET);
FORC4
bls += (cblack/*imCanon.ChannelBlackLevel*/[c ^ (c >> 1)] = get2());
imCanon.AverageBlackLevel = bls / 4;
// RT_blacklevel_from_constant = ThreeValBool::F;
}
if (offsetWhiteLevels)
{
if ((offsetWhiteLevels - offsetChannelBlackLevel) != 8L)
fseek(ifp, offsetWhiteLevels, SEEK_SET);
imCanon.NormalWhiteLevel = get2();
imCanon.SpecularWhiteLevel = get2();
// FORC4
// imgdata.color.linear_max[c] = imCanon.SpecularWhiteLevel;
maximum = imCanon.SpecularWhiteLevel;
// RT_whitelevel_from_constant = ThreeValBool::F;
}
if(!imCanon.AverageBlackLevel && offsetChannelBlackLevel2)
{
fseek(ifp, offsetChannelBlackLevel2, SEEK_SET);
FORC4
bls += (cblack/*imCanon.ChannelBlackLevel*/[c ^ (c >> 1)] = get2());
imCanon.AverageBlackLevel = bls / 4;
// RT_blacklevel_from_constant = ThreeValBool::F;
}
fseek(ifp, save1, SEEK_SET);
//---------------------------------------------------------------------
} if (tag == 0x4021 && get4() && get4())
FORC4 cam_mul[c] = 1024;
if (tag == 0xa021)
FORC4 cam_mul[c ^ (c >> 1)] = get4();
@ -6683,7 +7015,8 @@ int CLASS parse_tiff (int base)
void CLASS apply_tiff()
{
int max_samp=0, ties=0, os, ns, raw=-1, thm=-1, i;
int max_samp=0, ties=0, /*os, ns,*/ raw=-1, thm=-1, i;
uint64_t os, ns; // RT
struct jhead jh;
thumb_misc = 16;
@ -6713,6 +7046,7 @@ void CLASS apply_tiff()
}
if ((tiff_ifd[i].comp != 6 || tiff_ifd[i].samples != 3) &&
(tiff_ifd[i].width | tiff_ifd[i].height) < 0x10000 &&
(unsigned)tiff_ifd[i].bps < 33 && (unsigned)tiff_ifd[i].samples < 13 && // RT
ns && ((ns > os && (ties = 1)) ||
(ns == os && shot_select == ties++))) {
raw_width = tiff_ifd[i].width;
@ -6780,7 +7114,7 @@ void CLASS apply_tiff()
load_raw = &CLASS olympus_load_raw;
// ------- RT -------
if (!strncmp(make,"SONY",4) &&
!strncmp(model,"ILCE-7RM3",9) &&
(!strncmp(model,"ILCE-7RM3",9) || !strncmp(model,"ILCE-7RM4",9)) &&
tiff_samples == 4 &&
tiff_ifd[raw].bytes == raw_width*raw_height*tiff_samples*2) {
load_raw = &CLASS sony_arq_load_raw;
@ -9313,6 +9647,11 @@ void CLASS identify()
parse_foveon();
else if (!memcmp (head,"CI",2))
parse_cine();
//--- RT ----------------------------------------------------------------
else if (!memcmp(head + 4, "ftypcrx ", 8)) {
parse_canon_cr3();
}
//-------------------------------------------------------------------------
if (make[0] == 0)
for (zero_fsize=i=0; i < sizeof table / sizeof *table; i++)
if (fsize == table[i].fsize) {

View File

@ -68,6 +68,7 @@ public:
gamm[0]=0.45;gamm[1]=4.5;gamm[2]=gamm[3]=gamm[4]=gamm[5]=0;
user_mul[0]=user_mul[1]=user_mul[2]=user_mul[3]=0;
greybox[0]=greybox[1]=0; greybox[2]=greybox[3]= UINT_MAX;
RT_canon_CR3_data.CR3_CTMDtag = 0;
}
protected:
@ -164,6 +165,35 @@ protected:
PanasonicRW2Info(): bpp(0), encoding(0) {}
};
PanasonicRW2Info RT_pana_info;
public:
struct CanonCR3Data {
// contents of tag CMP1 for relevant track in CR3 file
struct crx_data_header_t {
int32_t version;
int32_t f_width;
int32_t f_height;
int32_t tileWidth;
int32_t tileHeight;
int32_t nBits;
int32_t nPlanes;
int32_t cfaLayout;
int32_t encType;
int32_t imageLevels;
int32_t hasTileCols;
int32_t hasTileRows;
int32_t mdatHdrSize;
// Not from header, but from datastream
uint32_t MediaSize;
INT64 MediaOffset;
uint32_t MediaType; /* 1 -> /C/RAW, 2-> JPEG */
};
static constexpr size_t CRXTRACKS_MAXCOUNT = 16;
crx_data_header_t crx_header[CRXTRACKS_MAXCOUNT];
int crx_track_selected;
short CR3_CTMDtag;
};
protected:
CanonCR3Data RT_canon_CR3_data;
float cam_mul[4], pre_mul[4], cmatrix[3][4], rgb_cam[3][4];
@ -529,4 +559,20 @@ void shiftXtransMatrix( const int offsy, const int offsx) {
void nikon_14bit_load_raw(); // ported from LibRaw
//-----------------------------------------------------------------------------
// Canon CR3 support ported from LibRaw
//-----------------------------------------------------------------------------
void parse_canon_cr3();
void selectCRXTrack(short maxTrack);
int parseCR3(unsigned long long oAtomList,
unsigned long long szAtomList, short &nesting,
char *AtomNameStack, short &nTrack, short &TrackType);
int crxDecodePlane(void *p, uint32_t planeNumber);
void crxLoadDecodeLoop(void *img, int nPlanes);
void crxConvertPlaneLineDf(void *p, int imageRow);
void crxLoadFinalizeLoopE3(void *p, int planeHeight);
void crxLoadRaw();
int crxParseImageHeader(uchar *cmp1TagData, int nTrack);
//-----------------------------------------------------------------------------
};

View File

@ -196,18 +196,8 @@ void Crop::update(int todo)
params.dirpyrDenoise.getCurves(noiseLCurve, noiseCCurve);
int tilesize;
int overlap;
if (settings->leveldnti == 0) {
tilesize = 1024;
overlap = 128;
}
if (settings->leveldnti == 1) {
tilesize = 768;
overlap = 96;
}
const int tilesize = settings->leveldnti == 0 ? 1024 : 768;
const int overlap = settings->leveldnti == 0 ? 128 : 96;
int numtiles_W, numtiles_H, tilewidth, tileheight, tileWskip, tileHskip;

View File

@ -66,14 +66,9 @@ void RawImageSource::dual_demosaic_RT(bool isBayer, const procparams::RAWParams
return;
}
array2D<float> redTmp(winw, winh);
array2D<float> greenTmp(winw, winh);
array2D<float> blueTmp(winw, winh);
array2D<float> L(winw, winh);
if (isBayer) {
vng4_demosaic(rawData, redTmp, greenTmp, blueTmp);
if (raw.bayersensor.method == procparams::RAWParams::BayerSensor::getMethodString(procparams::RAWParams::BayerSensor::Method::AMAZEVNG4) || raw.bayersensor.method == procparams::RAWParams::BayerSensor::getMethodString(procparams::RAWParams::BayerSensor::Method::PIXELSHIFT)) {
amaze_demosaic_RT(0, 0, winw, winh, rawData, red, green, blue, options.chunkSizeAMAZE, options.measure);
} else if (raw.bayersensor.method == procparams::RAWParams::BayerSensor::getMethodString(procparams::RAWParams::BayerSensor::Method::DCBVNG4) ) {
@ -87,7 +82,6 @@ void RawImageSource::dual_demosaic_RT(bool isBayer, const procparams::RAWParams
} else {
xtrans_interpolate (1, false, options.chunkSizeXT, options.measure);
}
fast_xtrans_interpolate(rawData, redTmp, greenTmp, blueTmp);
}
const float xyz_rgb[3][3] = { // XYZ from RGB
@ -114,6 +108,17 @@ void RawImageSource::dual_demosaic_RT(bool isBayer, const procparams::RAWParams
buildBlendMask(L, blend, winw, winh, contrastf, 1.f, autoContrast);
contrast = contrastf * 100.f;
array2D<float>& redTmp = L; // L is not needed anymore => reuse it
array2D<float> greenTmp(winw, winh);
array2D<float> blueTmp(winw, winh);
if (isBayer) {
vng4_demosaic(rawData, redTmp, greenTmp, blueTmp);
} else {
fast_xtrans_interpolate(rawData, redTmp, greenTmp, blueTmp);
}
// the following is split into 3 loops intentionally to avoid cache conflicts on CPUs with only 4-way cache
#ifdef _OPENMP
#pragma omp parallel for

View File

@ -20,11 +20,12 @@
#pragma once
#include "array2D.h"
template<typename T> class array2D;
namespace rtengine
{
void guidedFilter(const array2D<float> &guide, const array2D<float> &src, array2D<float> &dst, int r, float epsilon, bool multithread, int subsampling=0);
} // namespace rtengine

View File

@ -233,10 +233,10 @@ void Image8::getStdImage (const ColorTemp &ctemp, int tran, Imagefloat* image, P
lineB[dst_x] = CLIP(bm * btot);
} else {
// computing a special factor for this incomplete sub-region
float area = src_sub_width * src_sub_height;
lineR[dst_x] = CLIP(rm2 * rtot / area);
lineG[dst_x] = CLIP(gm2 * gtot / area);
lineB[dst_x] = CLIP(bm2 * btot / area);
float larea = src_sub_width * src_sub_height;
lineR[dst_x] = CLIP(rm2 * rtot / larea);
lineG[dst_x] = CLIP(gm2 * gtot / larea);
lineB[dst_x] = CLIP(bm2 * btot / larea);
}
}
}

View File

@ -231,9 +231,6 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
MyMutex::MyLock processingLock(mProcessing);
constexpr int numofphases = 14;
int readyphase = 0;
bool highDetailNeeded = options.prevdemo == PD_Sidecar ? true : (todo & M_HIGHQUAL);
// Check if any detail crops need high detail. If not, take a fast path short cut
@ -274,8 +271,6 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
//rp.deadPixelFilter = rp.hotPixelFilter = false;
}
progress("Applying white balance, color correction & sRGB conversion...", 100 * readyphase / numofphases);
if (frameCountListener) {
frameCountListener->FrameCountChanged(imgsrc->getFrameCount(), params->raw.bayersensor.imageNum);
}
@ -539,8 +534,6 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
ipf.firstAnalysis(orig_prev, *params, vhist16);
}
readyphase++;
if ((todo & M_HDR) && (params->fattal.enabled || params->dehaze.enabled)) {
if (fattal_11_dcrop_cache) {
delete fattal_11_dcrop_cache;
@ -557,7 +550,6 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
oprevi = orig_prev;
progress("Rotate / Distortion...", 100 * readyphase / numofphases);
// Remove transformation if unneeded
bool needstransform = ipf.needsTransform();
@ -583,11 +575,6 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
ipf.lab2rgb(labcbdl, *oprevi, params->icm.workingProfile);
}
readyphase++;
progress("Preparing shadow/highlight map...", 100 * readyphase / numofphases);
readyphase++;
if (todo & M_AUTOEXP) {
if (params->toneCurve.autoexp) {
LUTu aehist;
@ -624,8 +611,6 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
}
}
progress("Exposure curve & CIELAB conversion...", 100 * readyphase / numofphases);
if (todo & (M_AUTOEXP | M_RGBCURVE)) {
if (params->icm.workingTRC == "Custom") { //exec TRC IN free
if (oprevi == orig_prev) {
@ -777,8 +762,6 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
params->crop.mapToResized(pW, pH, scale, x1, x2, y1, y2);
}
readyphase++;
if (todo & (M_LUMACURVE | M_CROP)) {
LUTu lhist16(32768);
lhist16.clear();
@ -821,8 +804,6 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
if (todo & (M_LUMINANCE + M_COLOR)) {
nprevl->CopyFrom(oprevl);
progress("Applying Color Boost...", 100 * readyphase / numofphases);
histCCurve.clear();
histLCurve.clear();
ipf.chromiLuminanceCurve(nullptr, pW, nprevl, nprevl, chroma_acurve, chroma_bcurve, satcurve, lhskcurve, clcurve, lumacurve, utili, autili, butili, ccutili, cclutili, clcutili, histCCurve, histLCurve);
@ -833,68 +814,20 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
ipf.EPDToneMap(nprevl, 0, scale);
}
// for all treatments Defringe, Sharpening, Contrast detail , Microcontrast they are activated if "CIECAM" function are disabled
readyphase++;
/* Issue 2785, disabled some 1:1 tools
if (scale==1) {
if((params->colorappearance.enabled && !settings->autocielab) || (!params->colorappearance.enabled)){
progress ("Denoising luminance impulse...",100*readyphase/numofphases);
ipf.impulsedenoise (nprevl);
readyphase++;
}
if((params->colorappearance.enabled && !settings->autocielab) || (!params->colorappearance.enabled)){
progress ("Defringing...",100*readyphase/numofphases);
ipf.defringe (nprevl);
readyphase++;
}
if (params->sharpenEdge.enabled) {
progress ("Edge sharpening...",100*readyphase/numofphases);
ipf.MLsharpen (nprevl);
readyphase++;
}
if (params->sharpenMicro.enabled) {
if(( params->colorappearance.enabled && !settings->autocielab) || (!params->colorappearance.enabled)){
progress ("Microcontrast...",100*readyphase/numofphases);
ipf.MLmicrocontrast (nprevl);
readyphase++;
}
}
if(((params->colorappearance.enabled && !settings->autocielab) || (!params->colorappearance.enabled)) && params->sharpening.enabled) {
progress ("Sharpening...",100*readyphase/numofphases);
float **buffer = new float*[pH];
for (int i=0; i<pH; i++)
buffer[i] = new float[pW];
ipf.sharpening (nprevl, (float**)buffer);
for (int i=0; i<pH; i++)
delete [] buffer[i];
delete [] buffer;
readyphase++;
}
}
*/
if (params->dirpyrequalizer.cbdlMethod == "aft") {
if (((params->colorappearance.enabled && !settings->autocielab) || (!params->colorappearance.enabled))) {
progress("Pyramid wavelet...", 100 * readyphase / numofphases);
ipf.dirpyrequalizer(nprevl, scale);
//ipf.Lanczoslab (ip_wavelet(LabImage * lab, LabImage * dst, const procparams::EqualizerParams & eqparams), nprevl, 1.f/scale);
readyphase++;
}
}
wavcontlutili = false;
//CurveFactory::curveWavContL ( wavcontlutili,params->wavelet.lcurve, wavclCurve, LUTu & histogramwavcl, LUTu & outBeforeWavCLurveHistogram,int skip);
CurveFactory::curveWavContL(wavcontlutili, params->wavelet.wavclCurve, wavclCurve, scale == 1 ? 1 : 16);
if ((params->wavelet.enabled)) {
WaveletParams WaveParams = params->wavelet;
WaveParams.getCurves(wavCLVCurve, waOpacityCurveRG, waOpacityCurveBY, waOpacityCurveW, waOpacityCurveWL);
int kall = 0;
progress("Wavelet...", 100 * readyphase / numofphases);
LabImage *unshar = nullptr;
Glib::ustring provis;
LabImage *provradius = nullptr;
@ -1190,8 +1123,6 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
if (params->colorappearance.autoybscen && acListener && params->colorappearance.enabled) {
acListener->ybCamChanged((int) yb); //real value Yb scene
}
readyphase++;
} else {
// CIECAM is disabled, we free up its image buffer to save some space
if (ncie) {
@ -1226,8 +1157,6 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
}
if (panningRelatedChange || (todo & M_MONITOR)) {
progress("Conversion to RGB...", 100 * readyphase / numofphases);
if ((todo != CROP && todo != MINUPDATE) || (todo & M_MONITOR)) {
MyMutex::MyLock prevImgLock(previmg->getMutex());
@ -1239,7 +1168,6 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
delete workimg;
workimg = ipf.lab2rgb(nprevl, 0, 0, pW, pH, params->icm);
} catch (char * str) {
progress("Error converting file...", 0);
return;
}
}
@ -1258,8 +1186,6 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
imageListener->imageReady(params->crop);
}
readyphase++;
if (hListener) {
updateLRGBHistograms();
hListener->histogramChanged(histRed, histGreen, histBlue, histLuma, histToneCurve, histLCurve, histCCurve, /*histCLurve, histLLCurve,*/ histLCAM, histCCAM, histRedRaw, histGreenRaw, histBlueRaw, histChroma, histLRETI);
@ -1423,15 +1349,6 @@ void ImProcCoordinator::updateLRGBHistograms()
}
void ImProcCoordinator::progress(Glib::ustring str, int pr)
{
/* if (plistener) {
plistener->setProgressStr (str);
plistener->setProgress ((double)pr / 100.0);
}*/
}
bool ImProcCoordinator::getAutoWB(double& temp, double& green, double equal, double tempBias)
{

View File

@ -186,7 +186,6 @@ protected:
MyMutex minit; // to gain mutually exclusive access to ... to what exactly?
void progress (Glib::ustring str, int pr);
void reallocAll ();
void updateLRGBHistograms ();
void setScale (int prevscale);

View File

@ -869,7 +869,9 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int pW, int pw
mean = (sum / ((height) * width)) / 327.68f; //for Yb for all image...if one day "pipette" we can adapt Yb for each zone
}
}
#ifdef _OPENMP
static_cast<void>(numThreads); // to silence cppcheck warning
#endif
//evaluate lightness, contrast
}
@ -1469,8 +1471,8 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int pW, int pw
if (ciedata) { //only with improccoordinator
// Data for J Q M s and C histograms
int posl, posc;
float brli = 327.f;
float chsacol = 327.f;
float brli;
float chsacol;
float libr;
float colch;
@ -2049,17 +2051,25 @@ filmlike_clip (float *r, float *g, float *b)
}
}
void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer *pipetteBuffer, LUTf & hltonecurve, LUTf & shtonecurve, LUTf & tonecurve,
int sat, LUTf & rCurve, LUTf & gCurve, LUTf & bCurve, float satLimit, float satLimitOpacity, const ColorGradientCurve & ctColorCurve, const OpacityCurve & ctOpacityCurve, bool opautili, LUTf & clToningcurve, LUTf & cl2Toningcurve,
const ToneCurve & customToneCurve1, const ToneCurve & customToneCurve2, const ToneCurve & customToneCurvebw1, const ToneCurve & customToneCurvebw2, double &rrm, double &ggm, double &bbm, float &autor, float &autog, float &autob, DCPProfile *dcpProf, const DCPProfileApplyState &asIn, LUTu &histToneCurve, size_t chunkSize, bool measure)
void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer *pipetteBuffer, const LUTf& hltonecurve, const LUTf& shtonecurve, const LUTf& tonecurve,
int sat, const LUTf& rCurve, const LUTf& gCurve, const LUTf& bCurve, float satLimit, float satLimitOpacity,
const ColorGradientCurve& ctColorCurve, const OpacityCurve& ctOpacityCurve, bool opautili, const LUTf& clToningcurve, const LUTf& cl2Toningcurve,
const ToneCurve& customToneCurve1, const ToneCurve& customToneCurve2, const ToneCurve& customToneCurvebw1, const ToneCurve& customToneCurvebw2,
double &rrm, double &ggm, double &bbm, float &autor, float &autog, float &autob, DCPProfile *dcpProf, const DCPProfileApplyState& asIn,
LUTu& histToneCurve, size_t chunkSize, bool measure)
{
rgbProc (working, lab, pipetteBuffer, hltonecurve, shtonecurve, tonecurve, sat, rCurve, gCurve, bCurve, satLimit, satLimitOpacity, ctColorCurve, ctOpacityCurve, opautili, clToningcurve, cl2Toningcurve, customToneCurve1, customToneCurve2, customToneCurvebw1, customToneCurvebw2, rrm, ggm, bbm, autor, autog, autob, params->toneCurve.expcomp, params->toneCurve.hlcompr, params->toneCurve.hlcomprthresh, dcpProf, asIn, histToneCurve, chunkSize, measure);
rgbProc(working, lab, pipetteBuffer, hltonecurve, shtonecurve, tonecurve, sat, rCurve, gCurve, bCurve, satLimit, satLimitOpacity, ctColorCurve, ctOpacityCurve, opautili,
clToningcurve, cl2Toningcurve, customToneCurve1, customToneCurve2, customToneCurvebw1, customToneCurvebw2, rrm, ggm, bbm, autor, autog, autob,
params->toneCurve.expcomp, params->toneCurve.hlcompr, params->toneCurve.hlcomprthresh, dcpProf, asIn, histToneCurve, chunkSize, measure);
}
// Process RGB image and convert to LAB space
void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer *pipetteBuffer, LUTf & hltonecurve, LUTf & shtonecurve, LUTf & tonecurve,
int sat, LUTf & rCurve, LUTf & gCurve, LUTf & bCurve, float satLimit, float satLimitOpacity, const ColorGradientCurve & ctColorCurve, const OpacityCurve & ctOpacityCurve, bool opautili, LUTf & clToningcurve, LUTf & cl2Toningcurve,
const ToneCurve & customToneCurve1, const ToneCurve & customToneCurve2, const ToneCurve & customToneCurvebw1, const ToneCurve & customToneCurvebw2, double &rrm, double &ggm, double &bbm, float &autor, float &autog, float &autob, double expcomp, int hlcompr, int hlcomprthresh, DCPProfile *dcpProf, const DCPProfileApplyState &asIn, LUTu &histToneCurve, size_t chunkSize, bool measure)
void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer *pipetteBuffer, const LUTf& hltonecurve, const LUTf& shtonecurve, const LUTf& tonecurve,
int sat, const LUTf& rCurve, const LUTf& gCurve, const LUTf& bCurve, float satLimit, float satLimitOpacity,
const ColorGradientCurve& ctColorCurve, const OpacityCurve& ctOpacityCurve, bool opautili, const LUTf& clToningcurve, const LUTf& cl2Toningcurve,
const ToneCurve& customToneCurve1, const ToneCurve& customToneCurve2, const ToneCurve& customToneCurvebw1, const ToneCurve& customToneCurvebw2,
double &rrm, double &ggm, double &bbm, float &autor, float &autog, float &autob, double expcomp, int hlcompr, int hlcomprthresh,
DCPProfile *dcpProf, const DCPProfileApplyState& asIn, LUTu& histToneCurve, size_t chunkSize, bool measure)
{
std::unique_ptr<StopWatch> stop;
@ -3759,10 +3769,9 @@ void ImProcFunctions::toningsmh(float r, float g, float b, float &ro, float &go,
float rlo; //0.4 0.5
float rlm; //1.1
float rlh; //1.1
float rlob; //for BW old mode
if (mode == 0) { //colour
rlo = rlob = strProtect; //0.5 ==> 0.75
rlo = strProtect; //0.5 ==> 0.75
rlh = 2.2f * strProtect;
rlm = 1.5f * strProtect;
constexpr float v0 = 0.15f;
@ -3779,7 +3788,6 @@ void ImProcFunctions::toningsmh(float r, float g, float b, float &ro, float &go,
}
} else { //bw coefficient to preserve same results as before for satlimtopacity = 0.5 (default)
rlo = strProtect * 0.8f; //0.4
rlob = strProtect; //0.5
rlm = strProtect * 2.2f; //1.1
rlh = strProtect * 2.4f; //1.2
if (v > 0.15f) {
@ -4081,7 +4089,7 @@ void ImProcFunctions::toning2col (float r, float g, float b, float &ro, float &g
* @param iplow iphigh [0..1] luminance
* @param wp wip 3x3 matrix and inverse conversion rgb XYZ
**/
void ImProcFunctions::labtoning (float r, float g, float b, float &ro, float &go, float &bo, int algm, int metchrom, int twoc, float satLimit, float satLimitOpacity, const ColorGradientCurve & ctColorCurve, const OpacityCurve & ctOpacityCurve, LUTf & clToningcurve, LUTf & cl2Toningcurve, float iplow, float iphigh, double wp[3][3], double wip[3][3] )
void ImProcFunctions::labtoning (float r, float g, float b, float &ro, float &go, float &bo, int algm, int metchrom, int twoc, float satLimit, float satLimitOpacity, const ColorGradientCurve & ctColorCurve, const OpacityCurve & ctOpacityCurve, const LUTf & clToningcurve, const LUTf & cl2Toningcurve, float iplow, float iphigh, double wp[3][3], double wip[3][3] )
{
ro = CLIP(r);
go = CLIP(g);
@ -4140,7 +4148,7 @@ void ImProcFunctions::labtoning (float r, float g, float b, float &ro, float &go
}
void ImProcFunctions::luminanceCurve (LabImage* lold, LabImage* lnew, LUTf & curve)
void ImProcFunctions::luminanceCurve (LabImage* lold, LabImage* lnew, const LUTf& curve)
{
int W = lold->W;
@ -4160,7 +4168,7 @@ void ImProcFunctions::luminanceCurve (LabImage* lold, LabImage* lnew, LUTf & cur
void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBuffer, int pW, LabImage* lold, LabImage* lnew, LUTf & acurve, LUTf & bcurve, LUTf & satcurve, LUTf & lhskcurve, LUTf & clcurve, LUTf & curve, bool utili, bool autili, bool butili, bool ccutili, bool cclutili, bool clcutili, LUTu &histCCurve, LUTu &histLCurve)
void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBuffer, int pW, LabImage* lold, LabImage* lnew, const LUTf& acurve, const LUTf& bcurve, const LUTf& satcurve, const LUTf& lhskcurve, const LUTf& clcurve, LUTf & curve, bool utili, bool autili, bool butili, bool ccutili, bool cclutili, bool clcutili, LUTu &histCCurve, LUTu &histLCurve)
{
int W = lold->W;
@ -5354,7 +5362,7 @@ void ImProcFunctions::getAutoExp (const LUTu &histogram, int histcompr, double
int imax = 65536 >> histcompr;
int overex = 0;
float sum = 0.f, hisum = 0.f, losum = 0.f;
float ave = 0.f, hidev = 0.f, lodev = 0.f;
float ave = 0.f;
//find average luminance
histogram.getSumAndAverage (sum, ave);
@ -5382,36 +5390,32 @@ void ImProcFunctions::getAutoExp (const LUTu &histogram, int histcompr, double
float octile[8] = {0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f}, ospread = 0.f;
count = 0;
int i = 0;
int j = 0;
for (; i < min ((int)ave, imax); i++) {
for (; j < min ((int)ave, imax); ++j) {
if (count < 8) {
octile[count] += histogram[i];
octile[count] += histogram[j];
if (octile[count] > sum / 8.f || (count == 7 && octile[count] > sum / 16.f)) {
octile[count] = xlog (1. + (float)i) / log (2.f);
octile[count] = xlog (1. + j) / log (2.f);
count++;// = min(count+1,7);
}
}
//lodev += SQR(ave-i)*histogram[i];
lodev += (xlog (ave + 1.f) - xlog ((float)i + 1.)) * histogram[i];
losum += histogram[i];
losum += histogram[j];
}
for (; i < imax; i++) {
for (; j < imax; ++j) {
if (count < 8) {
octile[count] += histogram[i];
octile[count] += histogram[j];
if (octile[count] > sum / 8.f || (count == 7 && octile[count] > sum / 16.f)) {
octile[count] = xlog (1. + (float)i) / log (2.f);
octile[count] = xlog (1. + j) / log (2.f);
count++;// = min(count+1,7);
}
}
//hidev += SQR(i-ave)*histogram[i];
hidev += (xlog ((float)i + 1.) - xlog (ave + 1.f)) * histogram[i];
hisum += histogram[i];
hisum += histogram[j];
}

View File

@ -23,7 +23,6 @@
#include "coord2d.h"
#include "gamutwarning.h"
#include "pipettebuffer.h"
#include "shmap.h"
template<typename T>
class LUT;
@ -125,14 +124,19 @@ public:
void firstAnalysis(const Imagefloat* const working, const procparams::ProcParams &params, LUTu & vhist16);
void updateColorProfiles(const Glib::ustring& monitorProfile, RenderingIntent monitorIntent, bool softProof, bool gamutCheck);
void rgbProc(Imagefloat* working, LabImage* lab, PipetteBuffer *pipetteBuffer, LUTf & hltonecurve, LUTf & shtonecurve, LUTf & tonecurve,
int sat, LUTf & rCurve, LUTf & gCurve, LUTf & bCurve, float satLimit, float satLimitOpacity, const ColorGradientCurve & ctColorCurve, const OpacityCurve & ctOpacityCurve, bool opautili, LUTf & clcurve, LUTf & cl2curve, const ToneCurve & customToneCurve1, const ToneCurve & customToneCurve2,
const ToneCurve & customToneCurvebw1, const ToneCurve & customToneCurvebw2, double &rrm, double &ggm, double &bbm, float &autor, float &autog, float &autob, DCPProfile *dcpProf, const DCPProfileApplyState &asIn, LUTu &histToneCurve, size_t chunkSize = 1, bool measure = false);
void rgbProc(Imagefloat* working, LabImage* lab, PipetteBuffer *pipetteBuffer, LUTf & hltonecurve, LUTf & shtonecurve, LUTf & tonecurve,
int sat, LUTf & rCurve, LUTf & gCurve, LUTf & bCurve, float satLimit, float satLimitOpacity, const ColorGradientCurve & ctColorCurve, const OpacityCurve & ctOpacityCurve, bool opautili, LUTf & clcurve, LUTf & cl2curve, const ToneCurve & customToneCurve1, const ToneCurve & customToneCurve2,
const ToneCurve & customToneCurvebw1, const ToneCurve & customToneCurvebw2, double &rrm, double &ggm, double &bbm, float &autor, float &autog, float &autob,
double expcomp, int hlcompr, int hlcomprthresh, DCPProfile *dcpProf, const DCPProfileApplyState &asIn, LUTu &histToneCurve, size_t chunkSize = 1, bool measure = false);
void labtoning(float r, float g, float b, float &ro, float &go, float &bo, int algm, int metchrom, int twoc, float satLimit, float satLimitOpacity, const ColorGradientCurve & ctColorCurve, const OpacityCurve & ctOpacityCurve, LUTf & clToningcurve, LUTf & cl2Toningcurve, float iplow, float iphigh, double wp[3][3], double wip[3][3]);
void rgbProc(Imagefloat* working, LabImage* lab, PipetteBuffer *pipetteBuffer, const LUTf& hltonecurve, const LUTf& shtonecurve, const LUTf& tonecurve,
int sat, const LUTf& rCurve, const LUTf& gCurve, const LUTf& bCurve, float satLimit, float satLimitOpacity, const ColorGradientCurve& ctColorCurve,
const OpacityCurve& ctOpacityCurve, bool opautili, const LUTf& clcurve, const LUTf& cl2curve, const ToneCurve& customToneCurve1,
const ToneCurve& customToneCurve2, const ToneCurve& customToneCurvebw1, const ToneCurve& customToneCurvebw2,
double &rrm, double &ggm, double &bbm, float &autor, float &autog, float &autob, DCPProfile *dcpProf,
const DCPProfileApplyState& asIn, LUTu& histToneCurve, size_t chunkSize = 1, bool measure = false);
void rgbProc(Imagefloat* working, LabImage* lab, PipetteBuffer *pipetteBuffer, const LUTf& hltonecurve, const LUTf& shtonecurve, const LUTf& tonecurve,
int sat, const LUTf& rCurve, const LUTf& gCurve, const LUTf& bCurve, float satLimit, float satLimitOpacity, const ColorGradientCurve& ctColorCurve,
const OpacityCurve& ctOpacityCurve, bool opautili, const LUTf& clcurve, const LUTf& cl2curve, const ToneCurve& customToneCurve1,
const ToneCurve& customToneCurve2, const ToneCurve& customToneCurvebw1, const ToneCurve& customToneCurvebw2,
double &rrm, double &ggm, double &bbm, float &autor, float &autog, float &autob, double expcomp, int hlcompr,
int hlcomprthresh, DCPProfile *dcpProf, const DCPProfileApplyState& asIn, LUTu& histToneCurve, size_t chunkSize = 1, bool measure = false);
void labtoning(float r, float g, float b, float &ro, float &go, float &bo, int algm, int metchrom, int twoc, float satLimit, float satLimitOpacity, const ColorGradientCurve & ctColorCurve, const OpacityCurve & ctOpacityCurve, const LUTf & clToningcurve, const LUTf & cl2Toningcurve, float iplow, float iphigh, double wp[3][3], double wip[3][3]);
void toning2col(float r, float g, float b, float &ro, float &go, float &bo, float iplow, float iphigh, float rl, float gl, float bl, float rh, float gh, float bh, float SatLow, float SatHigh, float balanS, float balanH, float reducac, int mode, int preser, float strProtect);
void toningsmh(float r, float g, float b, float &ro, float &go, float &bo, float RedLow, float GreenLow, float BlueLow, float RedMed, float GreenMed, float BlueMed, float RedHigh, float GreenHigh, float BlueHigh, float reducac, int mode, float strProtect);
void toningsmh2(float r, float g, float b, float &ro, float &go, float &bo, float low[3], float satLow, float med[3], float satMed, float high[3], float satHigh, float reducac, int mode, int preser);
@ -142,12 +146,12 @@ public:
void retreavergb(float &r, float &g, float &b);
void moyeqt(Imagefloat* working, float &moyS, float &eqty);
void luminanceCurve(LabImage* lold, LabImage* lnew, LUTf &curve);
void luminanceCurve(LabImage* lold, LabImage* lnew, const LUTf &curve);
void ciecam_02float(CieImage* ncie, float adap, int pW, int pwb, LabImage* lab, const procparams::ProcParams* params,
const ColorAppearance & customColCurve1, const ColorAppearance & customColCurve, const ColorAppearance & customColCurve3,
LUTu &histLCAM, LUTu &histCCAM, LUTf & CAMBrightCurveJ, LUTf & CAMBrightCurveQ, float &mean, int Iterates, int scale, bool execsharp, float &d, float &dj, float &yb, int rtt,
bool showSharpMask = false);
void chromiLuminanceCurve(PipetteBuffer *pipetteBuffer, int pW, LabImage* lold, LabImage* lnew, LUTf &acurve, LUTf &bcurve, LUTf & satcurve, LUTf & satclcurve, LUTf &clcurve, LUTf &curve, bool utili, bool autili, bool butili, bool ccutili, bool cclutili, bool clcutili, LUTu &histCCurve, LUTu &histLurve);
void chromiLuminanceCurve(PipetteBuffer *pipetteBuffer, int pW, LabImage* lold, LabImage* lnew, const LUTf& acurve, const LUTf& bcurve, const LUTf& satcurve, const LUTf& satclcurve, const LUTf& clcurve, LUTf &curve, bool utili, bool autili, bool butili, bool ccutili, bool cclutili, bool clcutili, LUTu &histCCurve, LUTu &histLurve);
void vibrance(LabImage* lab); //Jacques' vibrance
// void colorCurve (LabImage* lold, LabImage* lnew);
void sharpening(LabImage* lab, const procparams::SharpeningParams &sharpenParam, bool showMask = false);

View File

@ -18,6 +18,7 @@
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/
#include "array2D.h"
#include "color.h"
#include "curves.h"
#include "guidedfilter.h"

View File

@ -51,6 +51,7 @@
#include "procparams.h"
#include "rawimagesource.h"
#include "rtengine.h"
#include "shmap.h"
#include "StopWatch.h"
namespace

View File

@ -20,6 +20,7 @@
#include "improcfun.h"
#include "array2D.h"
#include "color.h"
#include "curves.h"
#include "gauss.h"

View File

@ -220,7 +220,7 @@ bool ImProcFunctions::transCoord (int W, int H, const std::vector<Coord2D> &src,
blue.push_back (Coord2D (src[i].x, src[i].y));
}
return clipped;
return false;
}
double oW = W, oH = H;

View File

@ -1205,7 +1205,7 @@ void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int kall, const
b = 327.68f * Chprov * sincosv.x; //aply Munsell
} else {//general case
L = labco->L[i1][j1];
const float Lin = labco->L[i1][j1];
const float Lin = std::max(0.f, L);
if (wavclCurve && cp.finena) {
labco->L[i1][j1] = (0.5f * Lin + 1.5f * wavclCurve[Lin]) / 2.f; //apply contrast curve

View File

@ -27,7 +27,6 @@
#ifdef WIN32
#include <shlobj.h>
#include <windows.h>
#endif
#include "lcp.h"

View File

@ -19,7 +19,7 @@
#pragma once
#ifdef WIN32
#include <windows.h>
#include <profileapi.h>
#elif defined __APPLE__
#include <sys/time.h>
#else

View File

@ -64,7 +64,7 @@ class pana_cs6_page_decoder
unsigned char current, *buffer;
public:
pana_cs6_page_decoder(unsigned char *_buffer, unsigned int bsize)
: lastoffset(0), maxoffset(bsize), current(0), buffer(_buffer)
: pixelbuffer{}, lastoffset(0), maxoffset(bsize), current(0), buffer(_buffer)
{
}
void read_page(); // will throw IO error if not enough space in buffer

View File

@ -206,7 +206,7 @@ std::unique_ptr<RawImageSource::CFALineDenoiseRowBlender> PDAFLinesFilter::lineD
}
int PDAFLinesFilter::markLine(array2D<float> &rawData, PixelsMap &bpMap, int y)
int PDAFLinesFilter::markLine(const array2D<float> &rawData, PixelsMap &bpMap, int y)
{
rowmap_.clear();
rowmap_.resize((W_+1)/2, false);
@ -258,7 +258,7 @@ int PDAFLinesFilter::markLine(array2D<float> &rawData, PixelsMap &bpMap, int y)
}
int PDAFLinesFilter::mark(array2D<float> &rawData, PixelsMap &bpMap)
int PDAFLinesFilter::mark(const array2D<float> &rawData, PixelsMap &bpMap)
{
if (pattern_.empty()) {

View File

@ -36,12 +36,12 @@ public:
explicit PDAFLinesFilter(RawImage *ri);
~PDAFLinesFilter();
int mark(array2D<float> &rawData, PixelsMap &bpMap);
int mark(const array2D<float> &rawData, PixelsMap &bpMap);
RawImageSource::GreenEqulibrateThreshold &greenEqThreshold();
std::unique_ptr<RawImageSource::CFALineDenoiseRowBlender> lineDenoiseRowBlender();
private:
int markLine(array2D<float> &rawData, PixelsMap &bpMap, int y);
int markLine(const array2D<float>& rawData, PixelsMap &bpMap, int y);
RawImage *ri_;
int W_;

View File

@ -18,7 +18,6 @@
*/
#pragma once
#include "array2D.h"
#include "iimage.h"
class EditDataProvider;

View File

@ -339,6 +339,8 @@ BENCHFUN
lmmse_interpolate_omp(winw, winh, *(rawDataFrames[0]), red, green, blue, bayerParams.lmmse_iterations);
} else if (bayerParams.pixelShiftDemosaicMethod == bayerParams.getPSDemosaicMethodString(procparams::RAWParams::BayerSensor::PSDemosaicMethod::AMAZEVNG4)) {
dual_demosaic_RT (true, rawParamsIn, winw, winh, *(rawDataFrames[0]), red, green, blue, bayerParams.dualDemosaicContrast, true);
} else if (bayerParams.pixelShiftDemosaicMethod == bayerParams.getPSDemosaicMethodString(procparams::RAWParams::BayerSensor::PSDemosaicMethod::RCDVNG4)) {
dual_demosaic_RT (true, rawParamsIn, winw, winh, *(rawDataFrames[0]), red, green, blue, bayerParams.dualDemosaicContrast, true);
} else {
amaze_demosaic_RT(winx, winy, winw, winh, *(rawDataFrames[0]), red, green, blue, options.chunkSizeAMAZE, options.measure);
}
@ -351,6 +353,8 @@ BENCHFUN
lmmse_interpolate_omp(winw, winh, *(rawDataFrames[i + 1]), redTmp[i], greenTmp[i], blueTmp[i], bayerParams.lmmse_iterations);
} else if (bayerParams.pixelShiftDemosaicMethod == bayerParams.getPSDemosaicMethodString(procparams::RAWParams::BayerSensor::PSDemosaicMethod::AMAZEVNG4)) {
dual_demosaic_RT (true, rawParamsIn, winw, winh, *(rawDataFrames[i + 1]), redTmp[i], greenTmp[i], blueTmp[i], bayerParams.dualDemosaicContrast, true);
} else if (bayerParams.pixelShiftDemosaicMethod == bayerParams.getPSDemosaicMethodString(procparams::RAWParams::BayerSensor::PSDemosaicMethod::RCDVNG4)) {
dual_demosaic_RT (true, rawParamsIn, winw, winh, *(rawDataFrames[i + 1]), redTmp[i], greenTmp[i], blueTmp[i], bayerParams.dualDemosaicContrast, true);
} else {
amaze_demosaic_RT(winx, winy, winw, winh, *(rawDataFrames[i + 1]), redTmp[i], greenTmp[i], blueTmp[i], options.chunkSizeAMAZE, options.measure);
}
@ -380,6 +384,10 @@ BENCHFUN
procparams::RAWParams rawParamsTmp = rawParamsIn;
rawParamsTmp.bayersensor.method = procparams::RAWParams::BayerSensor::getMethodString(procparams::RAWParams::BayerSensor::Method::AMAZEVNG4);
dual_demosaic_RT (true, rawParamsTmp, winw, winh, rawData, red, green, blue, bayerParams.dualDemosaicContrast, true);
} else if (bayerParams.pixelShiftDemosaicMethod == bayerParams.getPSDemosaicMethodString(procparams::RAWParams::BayerSensor::PSDemosaicMethod::RCDVNG4)) {
procparams::RAWParams rawParamsTmp = rawParamsIn;
rawParamsTmp.bayersensor.method = procparams::RAWParams::BayerSensor::getMethodString(procparams::RAWParams::BayerSensor::Method::RCDVNG4);
dual_demosaic_RT (true, rawParamsTmp, winw, winh, rawData, red, green, blue, bayerParams.dualDemosaicContrast, true);
} else {
amaze_demosaic_RT(winx, winy, winw, winh, rawData, red, green, blue, options.chunkSizeAMAZE, options.measure);
}

View File

@ -2692,6 +2692,7 @@ const std::vector<const char*>& RAWParams::BayerSensor::getPSDemosaicMethodStrin
static const std::vector<const char*> method_strings {
"amaze",
"amazevng4",
"rcdvng4",
"lmmse"
};
return method_strings;

View File

@ -1398,6 +1398,7 @@ struct RAWParams {
enum class PSDemosaicMethod {
AMAZE,
AMAZEVNG4,
RCDVNG4,
LMMSE
};

View File

@ -500,6 +500,7 @@ std::unique_ptr<LFModifier> LFDatabase::getModifier(const LFCamera &camera, cons
return ret;
}
std::set<std::string> LFDatabase::notFound;
std::unique_ptr<LFModifier> LFDatabase::findModifier(const procparams::LensProfParams &lensProf, const FramesMetaData *idata, int width, int height, const procparams::CoarseTransformParams &coarse, int rawRotationDeg)
{
@ -521,6 +522,11 @@ std::unique_ptr<LFModifier> LFDatabase::findModifier(const procparams::LensProfP
return nullptr;
}
const std::string key = (make + model + lens).collate_key();
if (notFound.find(key) != notFound.end()) {
// This combination was not found => do not search again
return nullptr;
}
const LFDatabase *db = getInstance();
LFCamera c = db->findCamera(make, model);
LFLens l = db->findLens(lensProf.lfAutoMatch() ? c : LFCamera(), lens);
@ -549,6 +555,10 @@ std::unique_ptr<LFModifier> LFDatabase::findModifier(const procparams::LensProfP
<< (ret ? ret->getDisplayString() : "NONE") << std::endl;
}
if (!ret) {
notFound.emplace(key);
}
return ret;
}

View File

@ -21,6 +21,7 @@
#pragma once
#include <memory>
#include <set>
#include <vector>
#include <glibmm/ustring.h>
@ -135,6 +136,7 @@ private:
mutable MyMutex lfDBMutex;
static LFDatabase instance_;
lfDatabase *data_;
static std::set<std::string> notFound;
};
} // namespace rtengine

View File

@ -351,7 +351,7 @@ void SHMap::forceStat (float max_, float min_, float avg_)
avg = avg_;
}
void SHMap::dirpyr_shmap(float ** data_fine, float ** data_coarse, int width, int height, LUTf & rangefn, int level, int scale)
void SHMap::dirpyr_shmap(float ** data_fine, float ** data_coarse, int width, int height, const LUTf& rangefn, int level, int scale)
{
//scale is spacing of directional averaging weights

View File

@ -50,7 +50,7 @@ private:
void fillLuminance( Imagefloat * img, float **luminance, double lumi[3] );
void fillLuminanceL( float ** L, float **luminance );
void dirpyr_shmap(float ** data_fine, float ** data_coarse, int width, int height, LUTf & rangefn, int level, int scale);
void dirpyr_shmap(float ** data_fine, float ** data_coarse, int width, int height, const LUTf& rangefn, int level, int scale);
};

View File

@ -810,17 +810,7 @@ private:
void stage_denoise()
{
procparams::ProcParams& params = job->pparams;
//ImProcFunctions ipf (&params, true);
ImProcFunctions &ipf = * (ipf_p.get());
// perform luma/chroma denoise
// CieImage *cieView;
// NoisCurve noiseLCurve;
// bool lldenoiseutili=false;
// Imagefloat *calclum ;
// params.dirpyrDenoise.getCurves(noiseLCurve, lldenoiseutili);
// if (params.dirpyrDenoise.enabled && lldenoiseutili) {
const procparams::ProcParams& params = job->pparams;
DirPyrDenoiseParams denoiseParams = params.dirpyrDenoise; // make a copy because we cheat here
@ -853,9 +843,7 @@ private:
}
if (denoiseParams.enabled) {
// CurveFactory::denoiseLL(lldenoiseutili, denoiseParams.lcurve, Noisecurve,1);
//denoiseParams.getCurves(noiseLCurve);
// ipf.RGB_denoise(baseImg, baseImg, calclum, imgsrc->isRAW(), denoiseParams, params.defringe, imgsrc->getDirPyrDenoiseExpComp(), noiseLCurve, lldenoiseutili);
ImProcFunctions &ipf = * (ipf_p.get());
float nresi, highresi;
int kall = 2;
ipf.RGB_denoise(kall, baseImg, baseImg, calclum, ch_M, max_r, max_b, imgsrc->isRAW(), denoiseParams, imgsrc->getDirPyrDenoiseExpComp(), noiseLCurve, noiseCCurve, nresi, highresi);
@ -877,7 +865,7 @@ private:
void stage_transform()
{
procparams::ProcParams& params = job->pparams;
const procparams::ProcParams& params = job->pparams;
//ImProcFunctions ipf (&params, true);
ImProcFunctions &ipf = * (ipf_p.get());
@ -1095,13 +1083,10 @@ private:
ipf.vibrance(labView);
ipf.labColorCorrectionRegions(labView);
if ((params.colorappearance.enabled && !settings->autocielab) || (!params.colorappearance.enabled)) {
ipf.impulsedenoise(labView);
}
// for all treatments Defringe, Sharpening, Contrast detail ,Microcontrast they are activated if "CIECAM" function are disabled
if ((params.colorappearance.enabled && !settings->autocielab) || (!params.colorappearance.enabled)) {
ipf.impulsedenoise (labView);
ipf.defringe(labView);
}

View File

@ -246,7 +246,7 @@ void Adjuster::autoToggled ()
}
if (adjusterListener != nullptr && !blocked) {
adjusterListener->adjusterAutoToggled(this, automatic->get_active());
adjusterListener->adjusterAutoToggled(this);
}
}
@ -493,7 +493,7 @@ bool Adjuster::notifyListenerAutoToggled ()
{
if (adjusterListener != nullptr && !blocked) {
adjusterListener->adjusterAutoToggled(this, automatic->get_active());
adjusterListener->adjusterAutoToggled(this);
}
return false;

View File

@ -28,7 +28,7 @@ class AdjusterListener
public:
virtual ~AdjusterListener() = default;
virtual void adjusterChanged (Adjuster* a, double newval) = 0;
virtual void adjusterAutoToggled (Adjuster* a, bool newval) {}
virtual void adjusterAutoToggled (Adjuster* a) {}
};
typedef double(*double2double_fun)(double val);

View File

@ -147,7 +147,7 @@ int BatchQueue::getThumbnailHeight ()
return std::max(std::min(options.thumbSizeQueue, 200), 10);
}
void BatchQueue::rightClicked (ThumbBrowserEntryBase* entry)
void BatchQueue::rightClicked ()
{
pmenu.popup (3, this->eventTime);
}
@ -344,9 +344,8 @@ bool BatchQueue::loadBatchQueue ()
auto job = rtengine::ProcessingJob::create (source, thumb->getType () == FT_Raw, pparams, fast);
auto prevh = getMaxThumbnailHeight ();
auto prevw = prevh;
thumb->getThumbnailSize (prevw, prevh, &pparams);
const auto prevh = getMaxThumbnailHeight ();
const auto prevw = thumb->getThumbnailWidth(prevh, &pparams);
auto entry = new BatchQueueEntry (job, pparams, source, prevw, prevh, thumb, options.overwriteOutputFile);
thumb->decreaseRef (); // Removing the refCount acquired by cacheMgr->getEntry

View File

@ -74,7 +74,7 @@ public:
void error(const Glib::ustring& descr) override;
rtengine::ProcessingJob* imageReady(rtengine::IImagefloat* img) override;
void rightClicked (ThumbBrowserEntryBase* entry) override;
void rightClicked () override;
void doubleClicked (ThumbBrowserEntryBase* entry) override;
bool keyPressed (GdkEventKey* event) override;
void buttonPressed (LWButton* button, int actionCode, void* actionData) override;

View File

@ -18,7 +18,6 @@
*/
#include "batchqueuepanel.h"
#include "options.h"
#include "preferences.h"
#include "multilangmgr.h"
#include "rtwindow.h"
#include "soundman.h"

View File

@ -672,7 +672,7 @@ void BayerProcess::checkBoxToggled (CheckBox* c, CheckValue newval)
}
}
void BayerProcess::adjusterAutoToggled(Adjuster* a, bool newval)
void BayerProcess::adjusterAutoToggled(Adjuster* a)
{
if (multiImage) {
if (dualDemosaicContrast->getAutoInconsistent()) {

View File

@ -88,7 +88,7 @@ public:
void methodChanged();
void imageNumberChanged();
void adjusterChanged(Adjuster* a, double newval) override;
void adjusterAutoToggled (Adjuster* a, bool newval) override;
void adjusterAutoToggled (Adjuster* a) override;
void checkBoxToggled(CheckBox* c, CheckValue newval) override;
void pixelShiftMotionMethodChanged();
void pixelShiftDemosaicMethodChanged();

View File

@ -25,7 +25,7 @@
#include <glib/gstdio.h>
#ifdef WIN32
#include <windows.h>
#include <fileapi.h>
#endif
#include "cachemanager.h"

View File

@ -1565,7 +1565,7 @@ void ColorAppearance::adjusterChanged(Adjuster* a, double newval)
}
}
void ColorAppearance::adjusterAutoToggled(Adjuster* a, bool newval)
void ColorAppearance::adjusterAutoToggled(Adjuster* a)
{
if (multiImage) {
if (degree->getAutoInconsistent()) {

View File

@ -47,7 +47,7 @@ public:
void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited = nullptr) override;
void setBatchMode (bool batchMode) override;
void adjusterChanged (Adjuster* a, double newval) override;
void adjusterAutoToggled (Adjuster* a, bool newval) override;
void adjusterAutoToggled (Adjuster* a) override;
// void adjusterAdapToggled (Adjuster* a, bool newval);
void enabledChanged () override;
void surroundChanged ();

View File

@ -24,7 +24,6 @@
#include <gtkmm.h>
#include "editbuffer.h"
#include "lockablecolorpicker.h"
#include "threadutils.h"

View File

@ -33,6 +33,7 @@
#include "editcallbacks.h"
#include "editbuffer.h"
#include "editwidgets.h"
#include "pointermotionlistener.h"
#include "rtsurface.h"
#include "../rtengine/dcrop.h"
@ -259,7 +260,7 @@ void CropWindow::getCropAnchorPosition (int& x, int& y)
cropHandler.getAnchorPosition(x, y);
}
void CropWindow::setCropAnchorPosition (int& x, int& y)
void CropWindow::setCropAnchorPosition (int x, int y)
{
cropHandler.setAnchorPosition(x, y);
}

View File

@ -30,7 +30,6 @@
#include "editenums.h"
#include "lwbutton.h"
#include "lwbuttonset.h"
#include "pointermotionlistener.h"
#include "../rtengine/noncopyable.h"
@ -42,6 +41,7 @@ struct Coord;
}
class CropWindow;
class PointerMotionListener;
class CropWindowListener
{
@ -224,7 +224,7 @@ public:
void centerCrop (bool update = true);
void getCropSize (int& w, int& h);
void getCropAnchorPosition (int& w, int& h);
void setCropAnchorPosition (int& w, int& h);
void setCropAnchorPosition (int w, int h);
// listeners
void setCropGUIListener (CropGUIListener* cgl);

View File

@ -23,7 +23,6 @@
#include <gtkmm.h>
#include "adjuster.h"
#include "guiutils.h"
#include "mycurve.h"
#include "shcselector.h"

View File

@ -21,7 +21,7 @@
#include <gtkmm.h>
#include "curveeditorgroup.h"
#include "adjuster.h"
#include "../rtengine/noncopyable.h"
class DiagonalCurveEditor;

View File

@ -23,10 +23,6 @@
#include "guiutils.h"
#ifdef WIN32
#include "windows.h"
#endif
class DirBrowser : public Gtk::VBox
{
public:

View File

@ -28,9 +28,12 @@
#include "soundman.h"
#include "rtimage.h"
#include "rtwindow.h"
#include "filepanel.h"
#include "guiutils.h"
#include "popupbutton.h"
#include "options.h"
#include "navigator.h"
#include "previewwindow.h"
#include "progressconnector.h"
#include "procparamchangers.h"
#include "placesbrowser.h"
@ -38,6 +41,10 @@
#include "thumbnail.h"
#include "toolpanelcoord.h"
#ifdef WIN32
#include "windows.h"
#endif
using namespace rtengine::procparams;
namespace

View File

@ -21,11 +21,9 @@
#include <gtkmm.h>
#include "filepanel.h"
#include "histogrampanel.h"
#include "history.h"
#include "imageareapanel.h"
#include "navigator.h"
#include "profilepanel.h"
#include "progressconnector.h"
#include "saveasdlg.h"
@ -38,6 +36,7 @@ class BatchQueueEntry;
class EditorPanel;
class FilePanel;
class MyProgressBar;
class Navigator;
class Thumbnail;
class ToolPanelCoordinator;

View File

@ -20,9 +20,9 @@
#ifdef GUIVERSION
#include <cairomm/cairomm.h>
#include <glibmm/ustring.h>
#include "editbuffer.h"
#include "editcoordsys.h"
#include "../rtengine/coord.h"
@ -285,7 +285,7 @@ public:
rtengine::Coord end;
Line ();
Line (rtengine::Coord& begin, rtengine::Coord& end);
Line (const rtengine::Coord& begin, const rtengine::Coord& end);
Line (int beginX, int beginY, int endX, int endY);
void drawOuterGeometry (Cairo::RefPtr<Cairo::Context> &cr, ObjectMOBuffer *objectBuffer, EditCoordSystem &coordSystem) override;
@ -532,7 +532,7 @@ inline Circle::Circle (int centerX, int centerY, int radius, bool filled,
radiusInImageSpace) {
}
inline Line::Line (rtengine::Coord& begin, rtengine::Coord& end) :
inline Line::Line (const rtengine::Coord& begin, const rtengine::Coord& end) :
begin (begin), end (end) {
}

View File

@ -16,13 +16,14 @@
*/
#include "editwindow.h"
#include "editorpanel.h"
#include "filepanel.h"
#include "../rtengine/procparams.h"
#include "options.h"
#include "preferences.h"
#include "cursormanager.h"
#include "rtwindow.h"
#include <gtk/gtk.h>
#include "rtimage.h"
#include "threadutils.h"
extern Glib::ustring argv0;

View File

@ -20,10 +20,11 @@
#include <gtkmm.h>
#include "editorpanel.h"
#include "filepanel.h"
#include "rtimage.h"
class EditorPanel;
class RTWindow;
class EditWindow :
public Gtk::Window
{

View File

@ -21,7 +21,6 @@
#include <gtkmm.h>
#include "adjuster.h"
#include "guiutils.h"
class ExportPanelListener

View File

@ -22,8 +22,8 @@
#include <iostream>
#ifdef WIN32
#include <windows.h>
#include <shlobj.h>
#include <shellapi.h>
#endif
#include <gtkmm.h>
@ -157,7 +157,6 @@ bool ExtProgStore::searchProgram (const Glib::ustring& name,
break;
}
}
filePath.clear();
}
} else {
@ -178,9 +177,7 @@ bool ExtProgStore::searchProgram (const Glib::ustring& name,
break;
}
}
filePath.clear();
} while (false);
}
@ -264,7 +261,7 @@ bool ExtProgStore::openInGimp (const Glib::ustring& fileName)
#endif
#ifdef WIN32
if ((uintptr_t)success > 32) {
if (reinterpret_cast<uintptr_t>(success) > 32) {
return true;
}
#else
@ -279,9 +276,9 @@ bool ExtProgStore::openInGimp (const Glib::ustring& fileName)
for (auto ver = 12; ver >= 0; --ver) {
executable = Glib::build_filename (options.gimpDir, "bin", Glib::ustring::compose (Glib::ustring("gimp-2.%1.exe"), ver));
auto success = ShellExecute( NULL, "open", executable.c_str(), fileName.c_str(), NULL, SW_SHOWNORMAL );
auto lsuccess = ShellExecute( NULL, "open", executable.c_str(), fileName.c_str(), NULL, SW_SHOWNORMAL );
if ((uintptr_t)success > 32) {
if (reinterpret_cast<uintptr_t>(lsuccess) > 32) {
return true;
}
}

View File

@ -90,41 +90,36 @@ ThumbBrowserEntryBase* selectOriginalEntry (ThumbBrowserEntryBase* original, Thu
void findOriginalEntries (const std::vector<ThumbBrowserEntryBase*>& entries)
{
typedef std::vector<ThumbBrowserEntryBase*> EntryVector;
typedef EntryVector::const_iterator EntryIterator;
typedef std::map<Glib::ustring, EntryVector> BasenameMap;
typedef BasenameMap::const_iterator BasenameIterator;
// Sort all entries into buckets by basename without extension
BasenameMap byBasename;
std::map<Glib::ustring, std::vector<ThumbBrowserEntryBase*>> byBasename;
for (EntryIterator entry = entries.begin (); entry != entries.end (); ++entry) {
const Glib::ustring basename = Glib::path_get_basename ((*entry)->filename.lowercase());
for (const auto entry : entries) {
const auto basename = Glib::path_get_basename(entry->filename.lowercase());
const Glib::ustring::size_type pos = basename.find_last_of ('.');
const auto pos = basename.find_last_of('.');
if (pos >= basename.length() - 1) {
(*entry)->setOriginal (nullptr);
entry->setOriginal(nullptr);
continue;
}
const Glib::ustring withoutExtension = basename.substr (0, pos);
const auto withoutExtension = basename.substr(0, pos);
byBasename[withoutExtension].push_back (*entry);
byBasename[withoutExtension].push_back(entry);
}
// Find the original image for each bucket
for (BasenameIterator bucket = byBasename.begin (); bucket != byBasename.end (); ++bucket) {
const EntryVector& entries = bucket->second;
for (const auto& bucket : byBasename) {
const auto& lentries = bucket.second;
ThumbBrowserEntryBase* original = nullptr;
// Select the most likely original in a first pass...
for (EntryIterator entry = entries.begin (); entry != entries.end (); ++entry) {
original = selectOriginalEntry (original, *entry);
for (const auto entry : lentries) {
original = selectOriginalEntry(original, entry);
}
// ...and link all other images to it in a second pass.
for (EntryIterator entry = entries.begin (); entry != entries.end (); ++entry) {
(*entry)->setOriginal (*entry != original ? original : nullptr);
for (const auto entry : lentries) {
entry->setOriginal(entry != original ? original : nullptr);
}
}
}
@ -487,7 +482,7 @@ FileBrowser::~FileBrowser ()
delete[] amiExtProg;
}
void FileBrowser::rightClicked (ThumbBrowserEntryBase* entry)
void FileBrowser::rightClicked ()
{
{

View File

@ -23,7 +23,6 @@
#include <gtkmm.h>
#include "browserfilter.h"
#include "exiffiltersettings.h"
#include "exportpanel.h"
#include "extprog.h"
#include "filebrowserentry.h"
@ -174,7 +173,7 @@ public:
void buttonPressed (LWButton* button, int actionCode, void* actionData) override;
void redrawNeeded (LWButton* button) override;
bool checkFilter (ThumbBrowserEntryBase* entry) const override;
void rightClicked (ThumbBrowserEntryBase* entry) override;
void rightClicked () override;
void doubleClicked (ThumbBrowserEntryBase* entry) override;
bool keyPressed (GdkEventKey* event) override;

View File

@ -118,7 +118,7 @@ void FileBrowserEntry::calcThumbnailSize ()
{
if (thumbnail) {
thumbnail->getThumbnailSize (prew, preh);
prew = thumbnail->getThumbnailWidth(preh);
}
}

View File

@ -23,7 +23,6 @@
#include <gtkmm.h>
#include "crophandler.h"
#include "editenums.h"
#include "filethumbnailbuttonset.h"
#include "imageareatoollistener.h"

View File

@ -32,6 +32,7 @@
#include "rtimage.h"
#include "cachemanager.h"
#include "multilangmgr.h"
#include "coarsepanel.h"
#include "filepanel.h"
#include "renamedlg.h"
#include "thumbimageupdater.h"
@ -40,6 +41,7 @@
#include "placesbrowser.h"
#include "pathutils.h"
#include "thumbnail.h"
#include "toolbar.h"
using namespace std;
@ -1222,9 +1224,8 @@ void FileCatalog::developRequested(const std::vector<FileBrowserEntry*>& tbe, bo
rtengine::ProcessingJob* pjob = rtengine::ProcessingJob::create (fbe->filename, th->getType() == FT_Raw, params, fastmode && options.fastexport_use_fast_pipeline);
int pw;
int ph = BatchQueue::calcMaxThumbnailHeight();
th->getThumbnailSize (pw, ph);
const int ph = BatchQueue::calcMaxThumbnailHeight();
const int pw = th->getThumbnailWidth(ph);
// processThumbImage is the processing intensive part, but adding to queue must be ordered
//#pragma omp ordered

View File

@ -22,21 +22,21 @@
#include <giomm.h>
#include "coarsepanel.h"
#include "exiffiltersettings.h"
#include "exportpanel.h"
#include "filebrowser.h"
#include "fileselectionchangelistener.h"
#include "fileselectionlistener.h"
#include "filterpanel.h"
#include "multilangmgr.h"
#include "previewloader.h"
#include "threadutils.h"
#include "toolbar.h"
#include "../rtengine/noncopyable.h"
class FilePanel;
class CoarsePanel;
class ToolBar;
/*
* Class:
* - handling the list of file (add/remove them)

View File

@ -18,6 +18,7 @@
*/
#include "filepanel.h"
#include "dirbrowser.h"
#include "batchtoolpanelcoord.h"
#include "editorpanel.h"
#include "rtwindow.h"
@ -25,6 +26,10 @@
#include "placesbrowser.h"
#include "thumbnail.h"
#ifdef WIN32
#include "windows.h"
#endif
FilePanel::FilePanel () : parent(nullptr), error(0)
{

View File

@ -20,7 +20,6 @@
#include <gtkmm.h>
#include "dirbrowser.h"
#include "exportpanel.h"
#include "filecatalog.h"
#include "fileselectionlistener.h"
@ -35,6 +34,7 @@
class BatchToolPanelCoordinator;
class RTWindow;
class DirBrowser;
class FilePanel final :
public Gtk::HPaned,

View File

@ -252,7 +252,7 @@ void FlatField::adjusterChanged(Adjuster* a, double newval)
}
}
void FlatField::adjusterAutoToggled (Adjuster* a, bool newval)
void FlatField::adjusterAutoToggled (Adjuster* a)
{
if (multiImage) {
if (flatFieldClipControl->getAutoInconsistent()) {

View File

@ -79,7 +79,7 @@ public:
void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited = nullptr) override;
void adjusterChanged (Adjuster* a, double newval) override;
void adjusterAutoToggled (Adjuster* a, bool newval) override;
void adjusterAutoToggled (Adjuster* a) override;
void flatFieldFileChanged ();
void flatFieldFile_Reset ();
void flatFieldAutoSelectChanged ();

View File

@ -946,22 +946,21 @@ bool MyScrolledWindow::on_scroll_event (GdkEventScroll* event)
const double lowerBound = adjust->get_lower();
double value = adjust->get_value();
double step = adjust->get_step_increment();
double value2 = 0.;
if (event->direction == GDK_SCROLL_DOWN) {
value2 = rtengine::min<double>(value + step, upperBound);
const double value2 = rtengine::min<double>(value + step, upperBound);
if (value2 != value) {
scroll->set_value(value2);
}
} else if (event->direction == GDK_SCROLL_UP) {
value2 = rtengine::max<double>(value - step, lowerBound);
const double value2 = rtengine::max<double>(value - step, lowerBound);
if (value2 != value) {
scroll->set_value(value2);
}
} else if (event->direction == GDK_SCROLL_SMOOTH) {
value2 = rtengine::LIM<double>(value + event->delta_y * step, lowerBound, upperBound);
const double value2 = rtengine::LIM<double>(value + event->delta_y * step, lowerBound, upperBound);
if (value2 != value) {
scroll->set_value(value2);

View File

@ -983,7 +983,7 @@ void HistogramArea::on_realize ()
}
void HistogramArea::drawCurve(Cairo::RefPtr<Cairo::Context> &cr,
LUTu & data, double scale, int hsize, int vsize)
const LUTu & data, double scale, int hsize, int vsize)
{
double s = RTScalable::getScale();
@ -1013,7 +1013,7 @@ void HistogramArea::drawCurve(Cairo::RefPtr<Cairo::Context> &cr,
}
void HistogramArea::drawMarks(Cairo::RefPtr<Cairo::Context> &cr,
LUTu & data, double scale, int hsize, int & ui, int & oi)
const LUTu & data, double scale, int hsize, int & ui, int & oi)
{
int s = 8 * RTScalable::getScale();

View File

@ -165,8 +165,8 @@ public:
type_signal_factor_changed signal_factor_changed();
private:
void drawCurve(Cairo::RefPtr<Cairo::Context> &cr, LUTu & data, double scale, int hsize, int vsize);
void drawMarks(Cairo::RefPtr<Cairo::Context> &cr, LUTu & data, double scale, int hsize, int & ui, int & oi);
void drawCurve(Cairo::RefPtr<Cairo::Context> &cr, const LUTu & data, double scale, int hsize, int vsize);
void drawMarks(Cairo::RefPtr<Cairo::Context> &cr, const LUTu & data, double scale, int hsize, int & ui, int & oi);
Gtk::SizeRequestMode get_request_mode_vfunc () const override;
void get_preferred_height_vfunc (int& minimum_height, int& natural_height) const override;
void get_preferred_width_vfunc (int &minimum_width, int &natural_width) const override;

View File

@ -20,7 +20,6 @@
#include <gtkmm.h>
#include "adjuster.h"
#include "colorprovider.h"
#include "curvelistener.h"
#include "guiutils.h"
@ -58,6 +57,5 @@ public:
void autoOpenCurve () override;
void colorForValue (double valX, double valY, enum ColorCaller::ElemType elemType, int callerId, ColorCaller* caller) override;
//void adjusterChanged (Adjuster* a, double newval);
void enabledChanged() override;
};

View File

@ -240,7 +240,7 @@ void LockableColorPicker::updateBackBuffer ()
}
void LockableColorPicker::draw (Cairo::RefPtr<Cairo::Context> &cr)
void LockableColorPicker::draw (const Cairo::RefPtr<Cairo::Context> &cr)
{
if (validity == Validity::OUTSIDE) {
return;
@ -284,12 +284,12 @@ void LockableColorPicker::setRGB (const float R, const float G, const float B, c
}
}
void LockableColorPicker::getImagePosition (rtengine::Coord &imgPos)
void LockableColorPicker::getImagePosition (rtengine::Coord &imgPos) const
{
imgPos = position;
}
void LockableColorPicker::getScreenPosition (rtengine::Coord &screenPos)
void LockableColorPicker::getScreenPosition (rtengine::Coord &screenPos) const
{
if (cropWindow) {
cropWindow->imageCoordToScreen(position.x, position.y, screenPos.x, screenPos.y);
@ -328,7 +328,7 @@ void LockableColorPicker::setSize (Size newSize)
}
}
LockableColorPicker::Size LockableColorPicker::getSize ()
LockableColorPicker::Size LockableColorPicker::getSize () const
{
return size;
}

View File

@ -74,14 +74,14 @@ public:
LockableColorPicker (CropWindow* cropWindow, Glib::ustring *oProfile, Glib::ustring *wProfile);
void draw (Cairo::RefPtr<Cairo::Context> &cr);
void draw (const Cairo::RefPtr<Cairo::Context> &cr);
// Used to update the RGB color, the HSV values will be updated accordingly
void setPosition (const rtengine::Coord &newPos);
void setRGB (const float R, const float G, const float B, const float previewR, const float previewG, const float previewB);
void getImagePosition (rtengine::Coord &imgPos);
void getScreenPosition (rtengine::Coord &screenPos);
Size getSize ();
void getImagePosition (rtengine::Coord &imgPos) const;
void getScreenPosition (rtengine::Coord &screenPos) const;
Size getSize () const;
bool isOver (int x, int y);
void setValidity (Validity isValid);
void setSize (Size newSize);

View File

@ -153,7 +153,7 @@ bool LWButton::releaseNotify (int x, int y)
{
bool in = inside (x, y);
State nstate = state;
State nstate;
bool action = false;
if (in && (state == Pressed_In || state == Pressed_Out)) {

View File

@ -53,6 +53,7 @@
#else
#include <glibmm/thread.h>
#include "conio.h"
#include "windows.h"
#endif
// Set this to 1 to make RT work when started with Eclipse and arguments, at least on Windows platform

View File

@ -592,7 +592,6 @@ bool MyDiagonalCurve::handleEvents (GdkEvent* event)
curve.x.insert (itx, 0);
curve.y.insert (ity, 0);
num++;
// the graph is refreshed only if a new point is created
curve.x.at(closest_point) = clampedX;
@ -1504,7 +1503,7 @@ void MyDiagonalCurve::setActiveParam (int ac)
queue_draw ();
}
void MyDiagonalCurve::updateBackgroundHistogram (LUTu & hist)
void MyDiagonalCurve::updateBackgroundHistogram (const LUTu & hist)
{
if (hist) {
//memcpy (bghist, hist, 256*sizeof(unsigned int));

View File

@ -85,7 +85,7 @@ public:
bool handleEvents (GdkEvent* event) override;
void setActiveParam (int ac);
void reset (const std::vector<double> &resetCurve, double identityValue = 0.5) override;
void updateBackgroundHistogram (LUTu & hist);
void updateBackgroundHistogram (const LUTu & hist);
void pipetteMouseOver (CurveEditor *ce, EditDataProvider *provider, int modifierKey) override;
bool pipetteButton1Pressed(EditDataProvider *provider, int modifierKey) override;

View File

@ -653,7 +653,6 @@ bool MyFlatCurve::handleEvents (GdkEvent* event)
curve.y.insert (ity, 0);
curve.leftTangent.insert (itlt, 0);
curve.rightTangent.insert (itrt, 0);
num++;
if (mod_type & GDK_CONTROL_MASK) {
clampedY = point.getVal01(clampedX);

View File

@ -18,6 +18,7 @@
*/
#include <iomanip>
#include "navigator.h"
#include "previewwindow.h"
#include "toolpanel.h"
#include "../rtengine/color.h"
#include "../rtengine/rt_math.h"

View File

@ -22,7 +22,8 @@
#include "options.h"
#include "pointermotionlistener.h"
#include "previewwindow.h"
class PreviewWindow;
class Navigator :
public Gtk::Frame,

View File

@ -136,6 +136,8 @@ PartialPasteDlg::PartialPasteDlg (const Glib::ustring &title, Gtk::Window* paren
raw_ca_avoid_colourshift = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_RAWCACORR_AVOIDCOLORSHIFT")));
//---
filmNegative = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_FILMNEGATIVE")) );
//---
captureSharpening = Gtk::manage (new Gtk::CheckButton (M("TP_PDSHARPENING_LABEL")) );
Gtk::VBox* vboxes[8];
Gtk::HSeparator* hseps[8];
@ -253,6 +255,7 @@ PartialPasteDlg::PartialPasteDlg (const Glib::ustring &title, Gtk::Window* paren
vboxes[7]->pack_start (*raw_ca_avoid_colourshift, Gtk::PACK_SHRINK, 2);
vboxes[7]->pack_start (*Gtk::manage (new Gtk::HSeparator ()), Gtk::PACK_SHRINK, 0);
vboxes[7]->pack_start (*filmNegative, Gtk::PACK_SHRINK, 2);
vboxes[7]->pack_start (*captureSharpening, Gtk::PACK_SHRINK, 2);
Gtk::VBox* vbCol1 = Gtk::manage (new Gtk::VBox ());
Gtk::VBox* vbCol2 = Gtk::manage (new Gtk::VBox ());
@ -402,6 +405,8 @@ PartialPasteDlg::PartialPasteDlg (const Glib::ustring &title, Gtk::Window* paren
raw_ca_avoid_colourshiftconn = raw_ca_avoid_colourshift->signal_toggled().connect (sigc::bind (sigc::mem_fun(*raw, &Gtk::CheckButton::set_inconsistent), true));
//---
filmNegativeConn = filmNegative->signal_toggled().connect (sigc::bind (sigc::mem_fun(*raw, &Gtk::CheckButton::set_inconsistent), true));
//---
captureSharpeningConn = captureSharpening->signal_toggled().connect (sigc::bind (sigc::mem_fun(*raw, &Gtk::CheckButton::set_inconsistent), true));
add_button (M("GENERAL_OK"), Gtk::RESPONSE_OK);
add_button (M("GENERAL_CANCEL"), Gtk::RESPONSE_CANCEL);
@ -474,6 +479,7 @@ void PartialPasteDlg::rawToggled ()
ConnectionBlocker raw_caredblueBlocker(raw_caredblueConn);
ConnectionBlocker raw_ca_avoid_colourshiftBlocker(raw_ca_avoid_colourshiftconn);
ConnectionBlocker filmNegativeBlocker(filmNegativeConn);
ConnectionBlocker captureSharpeningBlocker(captureSharpeningConn);
raw->set_inconsistent (false);
@ -503,6 +509,7 @@ void PartialPasteDlg::rawToggled ()
raw_caredblue->set_active (raw->get_active ());
raw_ca_avoid_colourshift->set_active (raw->get_active ());
filmNegative->set_active (raw->get_active());
captureSharpening->set_active (raw->get_active());
}
void PartialPasteDlg::basicToggled ()
@ -981,6 +988,17 @@ void PartialPasteDlg::applyPaste (rtengine::procparams::ProcParams* dstPP, Param
filterPE.filmNegative.blueRatio = falsePE.filmNegative.blueRatio;
}
if (!captureSharpening->get_active ()) {
filterPE.pdsharpening.enabled = falsePE.pdsharpening.enabled;
filterPE.pdsharpening.contrast = falsePE.pdsharpening.contrast;
filterPE.pdsharpening.autoContrast = falsePE.pdsharpening.autoContrast;
filterPE.pdsharpening.autoRadius = falsePE.pdsharpening.autoRadius;
filterPE.pdsharpening.deconvradius = falsePE.pdsharpening.deconvradius;
filterPE.pdsharpening.deconvradiusOffset = falsePE.pdsharpening.deconvradiusOffset;
filterPE.pdsharpening.deconviter = falsePE.pdsharpening.deconviter;
filterPE.pdsharpening.deconvitercheck = falsePE.pdsharpening.deconvitercheck;
}
if (dstPE) {
*dstPE = filterPE;
}

View File

@ -141,6 +141,7 @@ public:
Gtk::CheckButton* ff_ClipControl;
Gtk::CheckButton* filmNegative;
Gtk::CheckButton* captureSharpening;
sigc::connection everythingConn, basicConn, detailConn, colorConn, lensConn, compositionConn, metaConn, rawConn, advancedConn;
@ -153,6 +154,7 @@ public:
sigc::connection df_fileConn, df_AutoSelectConn, ff_fileConn, ff_AutoSelectConn, ff_BlurRadiusConn, ff_BlurTypeConn, ff_ClipControlConn;
sigc::connection raw_caredblueConn, raw_ca_autocorrectConn, raw_ca_avoid_colourshiftconn, raw_hotpix_filtConn, raw_deadpix_filtConn, raw_pdaf_lines_filterConn, raw_linenoiseConn, raw_greenthreshConn, raw_ccStepsConn, raw_methodConn, raw_borderConn, raw_imagenumConn, raw_dcb_iterationsConn, raw_lmmse_iterationsConn, raw_pixelshiftConn, raw_dcb_enhanceConn, raw_exposConn, raw_blackConn;
sigc::connection filmNegativeConn;
sigc::connection captureSharpeningConn;
public:
PartialPasteDlg (const Glib::ustring &title, Gtk::Window* parent);

View File

@ -270,7 +270,7 @@ void PdSharpening::autoRadiusChanged(double autoRadius)
);
}
void PdSharpening::adjusterAutoToggled(Adjuster* a, bool newval)
void PdSharpening::adjusterAutoToggled(Adjuster* a)
{
if (multiImage) {
if (a->getAutoInconsistent()) {

View File

@ -59,7 +59,7 @@ public:
void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited = nullptr) override;
void setBatchMode (bool batchMode) override;
void adjusterAutoToggled (Adjuster* a, bool newval) override;
void adjusterAutoToggled (Adjuster* a) override;
void adjusterChanged (Adjuster* a, double newval) override;
void enabledChanged () override;

View File

@ -22,8 +22,6 @@
#include <giomm.h>
#include "multilangmgr.h"
class PlacesBrowser :
public Gtk::VBox
{

View File

@ -128,7 +128,7 @@ Preferences::~Preferences ()
get_size (options.preferencesWidth, options.preferencesHeight);
}
int Preferences::getThemeRowNumber (Glib::ustring& longThemeFName)
int Preferences::getThemeRowNumber (const Glib::ustring& longThemeFName)
{
if (regex->match (longThemeFName + ".css", matchInfo)) {

View File

@ -22,7 +22,6 @@
#include <gtkmm.h>
#include "adjuster.h"
#include "dynamicprofilepanel.h"
#include "options.h"
#include "../rtengine/profilestore.h"
@ -249,7 +248,7 @@ class Preferences :
void switchFontTo (const Glib::ustring &newFontFamily, const int newFontSize);
bool splashClosed (GdkEventAny* event);
int getThemeRowNumber (Glib::ustring& longThemeFName);
int getThemeRowNumber (const Glib::ustring& longThemeFName);
void appendBehavList (Gtk::TreeModel::iterator& parent, Glib::ustring label, int id, bool set);

View File

@ -19,8 +19,6 @@
#include <gtkmm.h>
#include "adjuster.h"
class ImageArea;
class PreviewModePanel :

View File

@ -230,7 +230,7 @@ bool PreviewWindow::on_motion_notify_event (GdkEventMotion* event)
if (x>imgX || y>imgY || w < imgW || h < imgH) {
bool inside = event->x > x - 6 && event->x < x + w - 1 + 6 && event->y > y - 6 && event->y < y + h - 1 + 6;
CursorShape newType = cursor_type;
CursorShape newType;
if (isMoving) {
mainCropWin->remoteMove ((event->x - press_x) / zoom, (event->y - press_y) / zoom);

Some files were not shown because too many files have changed in this diff Show More