Format with astyle 3. changed files

This commit is contained in:
Desmis 2017-08-17 09:38:27 +02:00
parent 986bbaa2cf
commit db17c68f1e
13 changed files with 1419 additions and 1376 deletions

View File

@ -318,6 +318,7 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
params.wb.temperature = currWB.getTemp ();
params.wb.green = currWB.getGreen ();
if (params.wb.method == "Auto" && awbListener) {
awbListener->WBChanged (params.wb.temperature, params.wb.green);
}
@ -394,14 +395,17 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
}
if ((needstransform || ((todo & (M_TRANSFORM | M_RGBCURVE)) && params.dirpyrequalizer.cbdlMethod == "bef" && params.dirpyrequalizer.enabled && !params.colorappearance.enabled)) ) {
if(!oprevi || oprevi == orig_prev)
if (!oprevi || oprevi == orig_prev) {
oprevi = new Imagefloat (pW, pH);
}
if (needstransform)
ipf.transform (orig_prev, oprevi, 0, 0, 0, 0, pW, pH, fw, fh, imgsrc->getMetaData()->getFocalLen(),
imgsrc->getMetaData()->getFocalLen35mm(), imgsrc->getMetaData()->getFocusDist(), imgsrc->getMetaData()->getFNumber(), imgsrc->getRotateDegree(), false);
else
else {
orig_prev->copyData (oprevi);
}
}
if ((todo & (M_TRANSFORM | M_RGBCURVE)) && params.dirpyrequalizer.cbdlMethod == "bef" && params.dirpyrequalizer.enabled && !params.colorappearance.enabled) {
const int W = oprevi->getWidth();

View File

@ -316,6 +316,7 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh
c2 = 0.41;
nc2 = 0.8;
}
/*
//scene condition for surround
if (params->colorappearance.surrsource) {
@ -1585,6 +1586,7 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int
c2 = 0.41f;
nc2 = 0.8f;
}
/*
//scene condition for surround
if (params->colorappearance.surrsource) {
@ -1894,6 +1896,7 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int
} else {
yb = 90.0f;
}
// } else if (settings->viewinggreySc == 1) {
} else {
yb = (float) params->colorappearance.ybscen;

View File

@ -60,13 +60,16 @@ namespace
void scale_colors (rtengine::RawImage *ri, float scale_mul[4], float cblack[4])
{
DCraw::dcrawImage_t image = ri->get_image();
if (ri->isBayer()) {
const int height = ri->get_iheight();
const int width = ri->get_iwidth();
for (int row = 0; row < height; ++row) {
unsigned c0 = ri->FC (row, 0);
unsigned c1 = ri->FC (row, 1);
int col = 0;
for (; col < width - 1; col += 2) {
float val0 = image[row * width + col][c0];
float val1 = image[row * width + col + 1][c1];
@ -77,6 +80,7 @@ void scale_colors(rtengine::RawImage *ri, float scale_mul[4], float cblack[4])
image[row * width + col][c0] = rtengine::CLIP (val0);
image[row * width + col + 1][c1] = rtengine::CLIP (val1);
}
if (col < width) { // in case width is odd
float val0 = image[row * width + col][c0];
val0 -= cblack[c0];
@ -88,12 +92,14 @@ void scale_colors(rtengine::RawImage *ri, float scale_mul[4], float cblack[4])
const int height = ri->get_iheight();
const int width = ri->get_iwidth();
unsigned c[6];
for (int row = 0; row < height; ++row) {
for (int i = 0; i < 6; ++i) {
c[i] = ri->XTRANSFC (row, i);
}
int col = 0;
for (; col < width - 5; col += 6) {
for (int i = 0; i < 6; ++i) {
const unsigned ccol = c[i];
@ -103,6 +109,7 @@ void scale_colors(rtengine::RawImage *ri, float scale_mul[4], float cblack[4])
image[row * width + col + i][ccol] = rtengine::CLIP (val);
}
}
for (; col < width; ++col) { // remaining columns
const unsigned ccol = ri->XTRANSFC (row, col);
float val = image[row * width + col][ccol];
@ -113,6 +120,7 @@ void scale_colors(rtengine::RawImage *ri, float scale_mul[4], float cblack[4])
}
} else {
const int size = ri->get_iheight() * ri->get_iwidth();
for (int i = 0; i < size; ++i) {
for (int j = 0; j < 4; ++j) {
float val = image[i][j];
@ -546,26 +554,31 @@ Thumbnail* Thumbnail::loadFromRaw (const Glib::ustring& fname, RawMetaDataLocati
int top_margin = ri->get_topmargin();
int wmax = tmpw;
int hmax = tmph;
if (ri->get_maker() == "Sigma" && ri->DNGVERSION()) { // Hack to prevent sigma dng files from crashing
wmax = (width - 2 - left_margin) / hskip;
hmax = (height - 2 - top_margin) / vskip;
}
int y = 0;
for (int row = 1 + top_margin; row < iheight + top_margin - 1 && y < hmax; row += vskip, y++) {
rofs = row * iwidth;
int x = 0;
for (int col = firstgreen; col < iwidth + left_margin - 1 && x < wmax; col += hskip, x++) {
int ofs = rofs + col;
tmpImg->r (y, x) = image[ofs][0];
tmpImg->g (y, x) = image[ofs][1];
tmpImg->b (y, x) = image[ofs][2];
}
for (; x < tmpw; ++x) {
tmpImg->r (y, x) = tmpImg->g (y, x) = tmpImg->b (y, x) = 0;
}
}
for (; y < tmph; ++y) {
for (int x = 0; x < tmpw; ++x) {
tmpImg->r (y, x) = tmpImg->g (y, x) = tmpImg->b (y, x) = 0;
@ -630,6 +643,7 @@ Thumbnail* Thumbnail::loadFromRaw (const Glib::ustring& fname, RawMetaDataLocati
} else {
tpp->thumbImg = resizeTo<Image16> (w, h, TI_Bilinear, tmpImg);
}
delete tmpImg;
@ -1993,11 +2007,14 @@ bool Thumbnail::readEmbProfile (const Glib::ustring& fname)
embProfileLength = 0;
FILE* f = g_fopen (fname.c_str (), "rb");
if (f) {
if (!fseek (f, 0, SEEK_END)) {
int profileLength = ftell (f);
if (profileLength > 0) {
embProfileLength = profileLength;
if (!fseek (f, 0, SEEK_SET)) {
embProfileData = new unsigned char[embProfileLength];
fread (embProfileData, 1, embProfileLength, f);
@ -2005,6 +2022,7 @@ bool Thumbnail::readEmbProfile (const Glib::ustring& fname)
}
}
}
fclose (f);
return embProfile != nullptr;
}

View File

@ -35,7 +35,8 @@ namespace rtengine
{
extern const Settings* settings;
namespace {
namespace
{
template <typename T>
void adjust_radius (const T &default_param, double scale_factor, T &param)
@ -45,7 +46,8 @@ void adjust_radius(const T &default_param, double scale_factor, T &param)
}
class ImageProcessor {
class ImageProcessor
{
public:
ImageProcessor (ProcessingJob* pjob, int& errorCode,
ProgressListener* pl, bool tunnelMetaData, bool flush):
@ -79,6 +81,7 @@ private:
if (!stage_init()) {
return nullptr;
}
stage_denoise();
stage_transform();
return stage_finish();
@ -95,6 +98,7 @@ private:
if (!stage_init()) {
return nullptr;
}
stage_transform();
stage_early_resize();
stage_denoise();
@ -1408,29 +1412,38 @@ private:
adjust_radius (defaultparams.sharpening.radius, scale_factor,
params.sharpening.radius);
}
params.impulseDenoise.thresh *= scale_factor;
if (scale_factor < 0.5) {
params.impulseDenoise.enabled = false;
}
params.wavelet.strength *= scale_factor;
params.dirpyrDenoise.luma *= scale_factor;
//params.dirpyrDenoise.Ldetail += (100 - params.dirpyrDenoise.Ldetail) * scale_factor;
auto &lcurve = params.dirpyrDenoise.lcurve;
for (size_t i = 2; i < lcurve.size(); i += 4) {
lcurve[i] *= min (scale_factor * 2, 1.0);
}
noiseLCurve.Set (lcurve);
const char *medmethods[] = { "soft", "33", "55soft", "55", "77", "99" };
if (params.dirpyrDenoise.median) {
auto &key = params.dirpyrDenoise.methodmed == "RGB" ? params.dirpyrDenoise.rgbmethod : params.dirpyrDenoise.medmethod;
for (int i = 1; i < int (sizeof (medmethods) / sizeof (const char *)); ++i) {
if (key == medmethods[i]) {
int j = i - int (1.0 / scale_factor);
if (j < 0) {
params.dirpyrDenoise.median = false;
} else {
key = medmethods[j];
}
break;
}
}
@ -1440,10 +1453,12 @@ private:
//params.epd.edgeStopping *= scale_factor;
const double dirpyreq_scale = min (scale_factor * 1.5, 1.0);
for (int i = 0; i < 6; ++i) {
adjust_radius (defaultparams.dirpyrequalizer.mult[i], dirpyreq_scale,
params.dirpyrequalizer.mult[i]);
}
params.dirpyrequalizer.threshold *= scale_factor;
adjust_radius (defaultparams.defringe.radius, scale_factor,
@ -1457,6 +1472,7 @@ private:
procparams::RAWParams::XTransSensor::methodstring[
procparams::RAWParams::XTransSensor::onePass];
}
if (params.raw.bayersensor.method == procparams::RAWParams::BayerSensor::methodstring[procparams::RAWParams::BayerSensor::pixelshift]) {
params.raw.bayersensor.method = procparams::RAWParams::BayerSensor::methodstring[params.raw.bayersensor.pixelShiftLmmse ? procparams::RAWParams::BayerSensor::lmmse : procparams::RAWParams::BayerSensor::amaze];
}
@ -1572,8 +1588,9 @@ void batchProcessingThread (ProcessingJob* job, BatchProcessingListener* bpl, bo
void startBatchProcessing (ProcessingJob* job, BatchProcessingListener* bpl, bool tunnelMetaData)
{
if (bpl)
if (bpl) {
Glib::Thread::create (sigc::bind (sigc::ptr_fun (batchProcessingThread), job, bpl, tunnelMetaData), 0, true, true, Glib::THREAD_PRIORITY_LOW);
}
}

View File

@ -1721,6 +1721,7 @@ void ColorAppearance::wbmodelChanged ()
tempsc->hide();
greensc->hide();
}
if (wbmodel->get_active_row_number() == 2) {
tempsc->show();
greensc->show();