Lines Matching refs:tf
258 static bool tf_is_valid(const skcms_TransferFunction* tf) { in tf_is_valid() argument
260 if (!isfinitef_(tf->a + tf->b + tf->c + tf->d + tf->e + tf->f + tf->g)) { in tf_is_valid()
265 if (tf->a < 0 || tf->c < 0 || tf->d < 0 || tf->g < 0) { in tf_is_valid()
1411 float skcms_TransferFunction_eval(const skcms_TransferFunction* tf, float x) { in skcms_TransferFunction_eval() argument
1415 return sign * (x < tf->d ? tf->c * x + tf->f in skcms_TransferFunction_eval()
1416 : powf_(tf->a * x + tf->b, tf->g) + tf->e); in skcms_TransferFunction_eval()
1523 const skcms_TransferFunction* tf, in rg_nonlinear() argument
1529 c = tf->c, d = tf->d, f = tf->f; in rg_nonlinear()
1551 const skcms_TransferFunction* tf, in gauss_newton_step() argument
1597 float resid = rg_nonlinear(x,curve,tf,P, dfdP); in gauss_newton_step()
1632 static bool fit_nonlinear(const skcms_Curve* curve, int L, int N, skcms_TransferFunction* tf) { in fit_nonlinear() argument
1633 float P[3] = { tf->g, tf->a, tf->b }; in fit_nonlinear()
1645 if (P[1] * tf->d + P[2] < 0) { in fit_nonlinear()
1646 P[2] = -P[1] * tf->d; in fit_nonlinear()
1649 P[1] * tf->d + P[2] >= 0); in fit_nonlinear()
1651 if (!gauss_newton_step(curve, tf, in fit_nonlinear()
1662 if (P[1] * tf->d + P[2] < 0) { in fit_nonlinear()
1663 P[2] = -P[1] * tf->d; in fit_nonlinear()
1666 tf->g = P[0]; in fit_nonlinear()
1667 tf->a = P[1]; in fit_nonlinear()
1668 tf->b = P[2]; in fit_nonlinear()
1669 tf->e = tf->c*tf->d + tf->f in fit_nonlinear()
1670 - powf_(tf->a*tf->d + tf->b, tf->g); in fit_nonlinear()
1697 skcms_TransferFunction tf, in skcms_ApproximateCurve() local
1701 tf.f = 0.0f; in skcms_ApproximateCurve()
1702 int L = fit_linear(curve, N, kTolerances[t], &tf.c, &tf.d); in skcms_ApproximateCurve()
1707 tf.g = 1; in skcms_ApproximateCurve()
1708 tf.a = tf.c; in skcms_ApproximateCurve()
1709 tf.b = tf.f; in skcms_ApproximateCurve()
1710 tf.c = tf.d = tf.e = tf.f = 0; in skcms_ApproximateCurve()
1713 tf.g = 1; in skcms_ApproximateCurve()
1714 tf.a = (eval_curve(curve, (N-1)*dx) - in skcms_ApproximateCurve()
1717 tf.b = eval_curve(curve, (N-2)*dx) in skcms_ApproximateCurve()
1718 - tf.a * (N-2)*dx; in skcms_ApproximateCurve()
1719 tf.e = 0; in skcms_ApproximateCurve()
1725 tf.g = log2f_(mid_y) / log2f_(mid_x); in skcms_ApproximateCurve()
1726 tf.a = 1; in skcms_ApproximateCurve()
1727 tf.b = 0; in skcms_ApproximateCurve()
1728 tf.e = tf.c*tf.d + tf.f in skcms_ApproximateCurve()
1729 - powf_(tf.a*tf.d + tf.b, tf.g); in skcms_ApproximateCurve()
1732 if (!skcms_TransferFunction_invert(&tf, &tf_inv) || in skcms_ApproximateCurve()
1738 if (!skcms_TransferFunction_invert(&tf_inv, &tf)) { in skcms_ApproximateCurve()
1750 if (!skcms_TransferFunction_invert(&tf, &tf_inv)) { in skcms_ApproximateCurve()
1757 *approx = tf; in skcms_ApproximateCurve()
1984 static bool is_identity_tf(const skcms_TransferFunction* tf) { in is_identity_tf() argument
1985 return tf->g == 1 && tf->a == 1 in is_identity_tf()
1986 && tf->b == 0 && tf->c == 0 && tf->d == 0 && tf->e == 0 && tf->f == 0; in is_identity_tf()
2337 skcms_TransferFunction tf[3]; in skcms_MakeUsableAsDestination() local
2342 tf[i] = profile->trc[i].parametric; in skcms_MakeUsableAsDestination()
2348 if (!skcms_ApproximateCurve(&profile->trc[i], &tf[i], &max_error)) { in skcms_MakeUsableAsDestination()
2355 profile->trc[i].parametric = tf[i]; in skcms_MakeUsableAsDestination()