Fix new color propagation method (#6109)
* Fixed artifacts thanks to Alberto * Added blur to Color propagation * Clean format code - small improvments * color propagation: Enable old mode at blur = 0 * Improve GUI * color propagation: smooth progress bar for blur > 0 * change label * Some cleanups * color propagation: small speedup for blur > 0 * color propagation: speedup for blur > 0 when region with clipped highlights is small * Speed-up for blur=1 - clean GUI code * color propagation: cleanups * Harmonize events in tonecurve.cc * tonecurve.cc : cleanup * Highlight reconstruction: small changes to gui * Use Gtk::Box instead of Gtk::VBox * Change maximum number of blur levels to 4 * Suppress BENCHFUN * Suppress bad commit locallabtools Co-authored-by: Desmis <jdesmis@gmail.com> Co-authored-by: Ingo Weyrich <heckflosse67@gmx.de>
This commit is contained in:
@@ -35,23 +35,22 @@ inline float getBilinearValue(const array2D<float> &src, float x, float y)
|
||||
const int H = src.getHeight();
|
||||
|
||||
// Get integer and fractional parts of numbers
|
||||
int xi = x;
|
||||
int yi = y;
|
||||
float xf = x - xi;
|
||||
float yf = y - yi;
|
||||
int xi1 = std::min(xi + 1, W - 1);
|
||||
int yi1 = std::min(yi + 1, H - 1);
|
||||
const int xi = x;
|
||||
const int yi = y;
|
||||
const float xf = x - xi;
|
||||
const float yf = y - yi;
|
||||
const int xi1 = std::min(xi + 1, W - 1);
|
||||
const int yi1 = std::min(yi + 1, H - 1);
|
||||
|
||||
float bl = src[yi][xi];
|
||||
float br = src[yi][xi1];
|
||||
float tl = src[yi1][xi];
|
||||
float tr = src[yi1][xi1];
|
||||
const float bl = src[yi][xi];
|
||||
const float br = src[yi][xi1];
|
||||
const float tl = src[yi1][xi];
|
||||
const float tr = src[yi1][xi1];
|
||||
|
||||
// interpolate
|
||||
float b = xf * br + (1.f - xf) * bl;
|
||||
float t = xf * tr + (1.f - xf) * tl;
|
||||
float pxf = yf * t + (1.f - yf) * b;
|
||||
return pxf;
|
||||
const float b = intp(xf, br, bl);
|
||||
const float t = intp(xf, tr, tl);
|
||||
return intp(yf, t, b);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user