Fixing bug in ComplexCurve.
This commit is contained in:
parent
0f8bb7322c
commit
15517c0c5d
@ -24,8 +24,8 @@
|
|||||||
#include <mytime.h>
|
#include <mytime.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#undef CLIPD
|
|
||||||
#define CLIPD(a) ((a)>0.0?((a)<1.0?(a):1.0):0.0)
|
#define CLIPD(a) ((a)>0.0?((a)<1.0?(a):1.0):0.0)
|
||||||
|
#define CLIP(a) ((a)<65535 ? (a) : (65535))
|
||||||
|
|
||||||
|
|
||||||
namespace rtengine {
|
namespace rtengine {
|
||||||
@ -537,7 +537,7 @@ double CurveFactory::centercontrast (double x, double b, double m) {
|
|||||||
double avg = 0;
|
double avg = 0;
|
||||||
//double sqavg = 0;
|
//double sqavg = 0;
|
||||||
for (int i=0; i<=0xffff; i++) {
|
for (int i=0; i<=0xffff; i++) {
|
||||||
avg += dcurve[(int)shCurve[(int)hlCurve[i]*i]] * histogram[i];
|
avg += dcurve[(int)shCurve[CLIP((int)hlCurve[i]*i)]] * histogram[i];
|
||||||
//sqavg += dcurve[i]*dcurve[i] * histogram[i];
|
//sqavg += dcurve[i]*dcurve[i] * histogram[i];
|
||||||
sum += histogram[i];
|
sum += histogram[i];
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
#include <mytime.h>
|
#include <mytime.h>
|
||||||
#include <refreshmap.h>
|
#include <refreshmap.h>
|
||||||
#define CLIPTO(a,b,c) ((a)>b?((a)<c?(a):c):b)
|
#define CLIPTO(a,b,c) ((a)>b?((a)<c?(a):c):b)
|
||||||
#define CLIP(a) ((a)<65535 ? (a) : (65535));
|
#define CLIP(a) ((a)<65535 ? (a) : (65535))
|
||||||
#define SKIPS(a,b) ((a) / (b) + ((a) % (b) > 0))
|
#define SKIPS(a,b) ((a) / (b) + ((a) % (b) > 0))
|
||||||
|
|
||||||
namespace rtengine {
|
namespace rtengine {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user