Purple fringing tool added. May also be useful for CA desaturation.
This commit is contained in:
@@ -14,6 +14,7 @@ set (RTENGINESOURCEFILES colortemp.cc curves.cc dcraw.cc iccstore.cc dfmanager.c
|
||||
processingjob.cc rtthumbnail.cc utils.cc labimage.cc slicer.cc
|
||||
iplab2rgb.cc ipsharpen.cc iptransform.cc ipresize.cc
|
||||
jpeg_memsrc.c
|
||||
PF_correct_RT.cc
|
||||
wavelet_dec.cc ipequalizer.cc dirpyrLab_denoise.cc dirpyrLab_equalizer.cc dirpyr_equalizer.cc)
|
||||
|
||||
add_library (rtengine ${RTENGINESOURCEFILES})
|
||||
|
||||
@@ -180,6 +180,7 @@ void Crop::update (int todo, bool internal) {
|
||||
|
||||
if (skip==1) {
|
||||
parent->ipf.impulsedenoise (labnCrop);
|
||||
parent->ipf.defringe (labnCrop);
|
||||
parent->ipf.lumadenoise (labnCrop, cbuffer);
|
||||
parent->ipf.colordenoise (labnCrop, cbuffer);
|
||||
parent->ipf.dirpyrdenoise (labnCrop);
|
||||
|
||||
@@ -199,6 +199,10 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) {
|
||||
progress ("Denoising luminance impulse...",100*readyphase/numofphases);
|
||||
ipf.impulsedenoise (nprevl);
|
||||
}
|
||||
if (scale==1) {
|
||||
progress ("Defringing...",100*readyphase/numofphases);
|
||||
ipf.defringe (nprevl);
|
||||
}
|
||||
if (scale==1) {
|
||||
progress ("Denoising luminance...",100*readyphase/numofphases);
|
||||
ipf.lumadenoise (nprevl, buffer);
|
||||
|
||||
@@ -543,6 +543,13 @@ void ImProcFunctions::colorCurve (LabImage* lold, LabImage* lnew) {
|
||||
impulse_nr (lab->L, lab->L, lab->W, lab->H, (float)params->impulseDenoise.thresh/20.0 );
|
||||
}
|
||||
|
||||
void ImProcFunctions::defringe (LabImage* lab) {
|
||||
|
||||
if (params->defringe.enabled && lab->W>=8 && lab->H>=8)
|
||||
|
||||
PF_correct_RT(lab, lab, params->defringe.radius, params->defringe.threshold, false /*edges only*/ );
|
||||
}
|
||||
|
||||
void ImProcFunctions::dirpyrdenoise (LabImage* lab) {
|
||||
|
||||
if (params->dirpyrDenoise.enabled && lab->W>=8 && lab->H>=8)
|
||||
@@ -634,7 +641,7 @@ void ImProcFunctions::getAutoExp (unsigned int* histogram, int histcompr, doubl
|
||||
awg = CurveFactory::igamma2 ((float)(awg/65535.0)) * 65535.0; //need to inverse gamma transform to get correct exposure compensation parameter
|
||||
|
||||
bl = (int)((65535*bl)/awg);
|
||||
br = log(65535.0 / (awg)) / log(2.0);
|
||||
br = log(65535.0 / (awg)) / log(2.0);
|
||||
if (br<0)
|
||||
br = 0;
|
||||
}
|
||||
|
||||
@@ -109,6 +109,9 @@ class ImProcFunctions {
|
||||
void dirpyr_channel(unsigned short ** data_fine, unsigned short ** data_coarse, int width, int height, int * rangefn, int level, int scale, const double * mult );
|
||||
void idirpyr_eq_channel(unsigned short ** data_coarse, unsigned short ** data_fine, int ** buffer, int width, int height, int level, const double * mult );
|
||||
|
||||
void defringe (LabImage* lab);
|
||||
void PF_correct_RT(LabImage * src, LabImage * dst, double radius, int thresh, bool edges);
|
||||
|
||||
Image8* lab2rgb (LabImage* lab, int cx, int cy, int cw, int ch, Glib::ustring profile);
|
||||
Image16* lab2rgb16 (LabImage* lab, int cx, int cy, int cw, int ch, Glib::ustring profile);
|
||||
|
||||
|
||||
@@ -126,7 +126,10 @@ enum ProcEvent {
|
||||
EvHSVEqualizerS=101,
|
||||
EvHSVEqualizerV=102,
|
||||
EvHSVEqEnabled=103,
|
||||
NUMOFEVENTS=104
|
||||
EvDefringeEnabled=104,
|
||||
EvDefringeRadius=105,
|
||||
EvDefringeThreshold=106,
|
||||
NUMOFEVENTS=107
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -103,6 +103,10 @@ void ProcParams::setDefaults () {
|
||||
|
||||
impulseDenoise.enabled = false;
|
||||
impulseDenoise.thresh = 50;
|
||||
|
||||
defringe.enabled = false;
|
||||
defringe.radius = 2.0;
|
||||
defringe.threshold = 25;
|
||||
|
||||
dirpyrDenoise.enabled = false;
|
||||
dirpyrDenoise.luma = 10;
|
||||
@@ -286,6 +290,10 @@ int ProcParams::save (Glib::ustring fname) const {
|
||||
keyFile.set_boolean ("Impulse Denoising", "Enabled", impulseDenoise.enabled);
|
||||
keyFile.set_integer ("Impulse Denoising", "Threshold", impulseDenoise.thresh);
|
||||
|
||||
// save defringe
|
||||
keyFile.set_boolean ("Defringing", "Enabled", defringe.enabled);
|
||||
keyFile.set_double ("Defringing", "Radius", defringe.radius);
|
||||
keyFile.set_integer ("Defringing", "Threshold", defringe.threshold);
|
||||
|
||||
// save dirpyrDenoise
|
||||
keyFile.set_boolean ("Directional Pyramid Denoising", "Enabled", dirpyrDenoise.enabled);
|
||||
@@ -552,6 +560,13 @@ if (keyFile.has_group ("Color Shift")) {
|
||||
if (keyFile.has_key ("Color Shift", "ChannelB")) colorShift.b = keyFile.get_double ("Color Shift", "ChannelB");
|
||||
}
|
||||
|
||||
// load defringe
|
||||
if (keyFile.has_group ("Defringing")) {
|
||||
if (keyFile.has_key ("Defringing", "Enabled")) defringe.enabled = keyFile.get_boolean ("Defringing", "Enabled");
|
||||
if (keyFile.has_key ("Defringing", "Radius")) defringe.radius = keyFile.get_double ("Defringing", "Radius");
|
||||
if (keyFile.has_key ("Defringing", "Threshold")) defringe.threshold = keyFile.get_integer ("Defringing", "Threshold");
|
||||
}
|
||||
|
||||
// load impulseDenoise
|
||||
if (keyFile.has_group ("Impulse Denoising")) {
|
||||
if (keyFile.has_key ("Impulse Denoising", "Enabled")) impulseDenoise.enabled = keyFile.get_boolean ("Impulse Denoising", "Enabled");
|
||||
@@ -853,6 +868,9 @@ bool ProcParams::operator== (const ProcParams& other) {
|
||||
&& dirpyrDenoise.luma == other.dirpyrDenoise.luma
|
||||
&& dirpyrDenoise.chroma == other.dirpyrDenoise.chroma
|
||||
&& dirpyrDenoise.gamma == other.dirpyrDenoise.gamma
|
||||
&& defringe.enabled == other.defringe.enabled
|
||||
&& defringe.radius == other.defringe.radius
|
||||
&& defringe.threshold == other.defringe.threshold
|
||||
&& lumaDenoise.enabled == other.lumaDenoise.enabled
|
||||
&& lumaDenoise.radius == other.lumaDenoise.radius
|
||||
&& lumaDenoise.edgetolerance == other.lumaDenoise.edgetolerance
|
||||
|
||||
@@ -137,6 +137,18 @@ class ColorDenoiseParams {
|
||||
int amount;
|
||||
};
|
||||
|
||||
/**
|
||||
* Parameters of defringing
|
||||
*/
|
||||
class DefringeParams {
|
||||
|
||||
public:
|
||||
bool enabled;
|
||||
double radius;
|
||||
int threshold;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Parameters of impulse denoising
|
||||
*/
|
||||
@@ -403,6 +415,7 @@ class ProcParams {
|
||||
ColorShiftParams colorShift; ///< Color shift parameters
|
||||
LumaDenoiseParams lumaDenoise; ///< Luminance denoising parameters
|
||||
ColorDenoiseParams colorDenoise; ///< Color denoising parameters
|
||||
DefringeParams defringe; ///< Impulse denoising parameters
|
||||
ImpulseDenoiseParams impulseDenoise; ///< Impulse denoising parameters
|
||||
DirPyrDenoiseParams dirpyrDenoise; ///< Directional Pyramid denoising parameters
|
||||
SHParams sh; ///< Shadow/highlight enhancement parameters
|
||||
|
||||
@@ -124,5 +124,8 @@ RGBCURVE, // EvHSVEqualizerH,
|
||||
RGBCURVE, // EvHSVEqualizerS,
|
||||
RGBCURVE, // EvHSVEqualizerV,
|
||||
RGBCURVE, // EvHSVEqEnabled,
|
||||
DEFRINGE, // EvDefringeEnabled,
|
||||
DEFRINGE, // EvDefringeRadius,
|
||||
DEFRINGE, // EvDefringeThreshold,
|
||||
};
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#define LUMINANCECURVE 6
|
||||
#define SHARPENING 2
|
||||
#define IMPULSEDENOISE 2
|
||||
#define DEFRINGE 2
|
||||
#define LUMADENOISE 2
|
||||
#define WHITEBALANCE 255
|
||||
#define DEMOSAIC 511
|
||||
|
||||
@@ -159,6 +159,7 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p
|
||||
ipf.chrominanceCurve (labView, labView, 1, curve, 0, fh);
|
||||
|
||||
ipf.impulsedenoise (labView);
|
||||
ipf.defringe (labView);
|
||||
ipf.lumadenoise (labView, buffer);
|
||||
ipf.sharpening (labView, (unsigned short**)buffer);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user