48static inline double _tonecurve_apply(
const double *
x,
const double *y,
const int32_t num,
const double L)
50 if(L <= 0.0 || L >= 100.0)
return L;
51 uint32_t
min = 0,
max = num;
66 const double f = (
x[
t + 1] -
x[
t] > 1e-6f) ? (
L -
x[
t]) / (
x[
t + 1] -
x[
t]) : 1.0f;
67 if(
t == num - 1)
return y[
t];
69 assert(
x[
t + 1] >=
L);
70 return y[
t + 1] *
f + y[
t] * (1.0f -
f);
static double _tonecurve_apply(const double *x, const double *y, const int32_t num, const double L)
double tonecurve_apply(const tonecurve_t *c, const double L)
double tonecurve_unapply(const tonecurve_t *c, const double L)
void tonecurve_delete(tonecurve_t *c)
void tonecurve_create(tonecurve_t *c, double *Lin, double *Lout, const int32_t num)
const dt_aligned_pixel_t f
static const float const float const float min
#define IS_NULL_PTR(p)
C is way too permissive with !=, == and if(var) checks, which can mean too many things depending on w...