Increased precision for Shadows/Highlights (and a small speedup and reduced memory consumption for method 'Sharp mask'), Issue 2523

This commit is contained in:
Ingo
2014-10-09 01:21:52 +02:00
parent 96d80d1102
commit ef66cb2e7f
4 changed files with 120 additions and 101 deletions

View File

@@ -204,6 +204,8 @@ void Crop::update (int todo) {
double radius = sqrt (double(SKIPS(parent->fw,skip)*SKIPS(parent->fw,skip)+SKIPS(parent->fh,skip)*SKIPS(parent->fh,skip))) / 2.0;
double shradius = params.sh.radius;
if (!params.sh.hq) shradius *= radius / 1800.0;
if(!cshmap)
cshmap = new SHMap (cropw, croph, true);
cshmap->update (baseCrop, shradius, parent->ipf.lumimul, params.sh.hq, skip);
if(parent->shmap->min_f < 65535.f) // don't call forceStat with wrong values
cshmap->forceStat (parent->shmap->max_f, parent->shmap->min_f, parent->shmap->avg);
@@ -525,12 +527,14 @@ if (settings->verbose) printf ("setcropsizes before lock\n");
if (cbuffer ) delete [] cbuffer;
if (cbuf_real) delete [] cbuf_real;
if (cshmap ) delete cshmap;
if (cshmap ) { delete cshmap; cshmap = NULL;}
cbuffer = new float*[croph];
cbuf_real= new float[(croph+2)*cropw];
for (int i=0; i<croph; i++)
cbuffer[i] = cbuf_real+cropw*i+cropw;
cshmap = new SHMap (cropw, croph, true);
if(params.sh.enabled) {
cshmap = new SHMap (cropw, croph, true);
}
EditBuffer::resize(cropw, croph);