aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@member.fsf.org>2016-01-11 01:07:05 +0100
committerMattias Andrée <maandree@member.fsf.org>2016-01-11 01:07:05 +0100
commita791bbf5a0866dfcaf9e1555937beaafc56edd2a (patch)
treef153afb75ffbb9313cf42292e396bcfa023c2b25
parentlinking requirements for macros (diff)
downloadlibclut-a791bbf5a0866dfcaf9e1555937beaafc56edd2a.tar.gz
libclut-a791bbf5a0866dfcaf9e1555937beaafc56edd2a.tar.bz2
libclut-a791bbf5a0866dfcaf9e1555937beaafc56edd2a.tar.xz
typo + remove libclut_model_delta_e, it is irrelevant
Signed-off-by: Mattias Andrée <maandree@member.fsf.org>
Diffstat (limited to '')
-rw-r--r--src/libclut.c32
-rw-r--r--src/libclut.h14
2 files changed, 4 insertions, 42 deletions
diff --git a/src/libclut.c b/src/libclut.c
index 6c6e379..f2efd6b 100644
--- a/src/libclut.c
+++ b/src/libclut.c
@@ -42,7 +42,7 @@ double libclut_model_linear_to_standard1(double c)
*/
void libclut_model_linear_to_standard(double* r, double* g, double* b)
{
- *r = libclut_model_linear_to_standard1(*r):
+ *r = libclut_model_linear_to_standard1(*r);
*g = libclut_model_linear_to_standard1(*g);
*b = libclut_model_linear_to_standard1(*b);
}
@@ -72,7 +72,7 @@ double libclut_model_standard_to_linear1(double c)
*/
void libclut_model_standard_to_linear(double* r, double* g, double* b)
{
- *r = libclut_model_standard_to_linear1(*r):
+ *r = libclut_model_standard_to_linear1(*r);
*g = libclut_model_standard_to_linear1(*g);
*b = libclut_model_standard_to_linear1(*b);
}
@@ -182,7 +182,7 @@ void libclut_model_ciexyy_to_srgb(double x, double y, double Y, double* r, doubl
{
double X, Z;
libclut_model_ciexyy_to_ciexyz(x, y, Y, &X, &Z);
- libclut_model_ciexyz_to_linear(X, *Y, Z, r, g, b);
+ libclut_model_ciexyz_to_linear(X, Y, Z, r, g, b);
libclut_model_linear_to_standard(r, g, b);
}
@@ -222,7 +222,7 @@ void libclut_model_ciexyz_to_cielab(double X, double Y, double Z, double* L, dou
void libclut_model_cielab_to_xiexyz(double L, double a, double b, double* X, double* Y, double* Z)
{
#define F(C) (((C)*(C)*(C) > 0.00885642) ? ((C)*(C)*(C)) : (((C) - 0.1379310) / (7.78 + 703.0 / 99900.0)))
- *Y = (l + 16.0) / 116.0;
+ *Y = (L + 16.0) / 116.0;
*X = a / 500.0 + *Y;
*Z = *Y - b / 200.0;
*X = F(*X) * 0.95047;
@@ -231,27 +231,3 @@ void libclut_model_cielab_to_xiexyz(double L, double a, double b, double* X, dou
#undef F
}
-
-/**
- * Convert the distance (∆E*_ab) between two [0, 1] sRGB colours.
- *
- * @param r1 The red component of the first colour.
- * @param g1 The green component of the first colour.
- * @param b1 The blue component of the first colour.
- * @param r2 The red component of the second colour.
- * @param g2 The green component of the second colour.
- * @param b2 The blue component of the second colour.
- * @return The difference.
- */
-double libclut_model_delta_e(double r1, double g1, double b1, double r2, double g2, double b2)
-{
- double X1, Y1, Z1, L1, a1, b1, X2, Y2, Z2, L2, a2, b2;
- standard_to_linear(&r1, &g1, &b1), standard_to_linear(&r2, &g2, &b2);
- linear_to_ciexyz(r1, g1, b1, &X1, &Y1, &Z1), linear_to_ciexyz(r2, g2, b2, &X2, &Y2, &Z2);
- ciexyz_to_cielab(X1, Y1, Z1, &L1, &a1, &b1), ciexyz_to_cielab(X2, Y2, Z2, &L2, &a2, &b2);
- L1 -= L2, L1 *= L1;
- a1 -= a2, a1 *= a1;
- b1 -= b2, b1 *= b1;
- return L1 + a1 + b1;
-}
-
diff --git a/src/libclut.h b/src/libclut.h
index 2e5949d..eab4f8e 100644
--- a/src/libclut.h
+++ b/src/libclut.h
@@ -1069,20 +1069,6 @@ void libclut_model_ciexyz_to_cielab(double, double, double, double*, double*, do
LIBCLUT_GCC_ONLY__(__attribute__((__leaf__)))
void libclut_model_cielab_to_xiexyz(double, double, double, double*, double*, double*);
-/**
- * Convert the distance (∆E*_ab) between two [0, 1] sRGB colours.
- *
- * @param r1 The red component of the first colour.
- * @param g1 The green component of the first colour.
- * @param b1 The blue component of the first colour.
- * @param r2 The red component of the second colour.
- * @param g2 The green component of the second colour.
- * @param b2 The blue component of the second colour.
- * @return The difference.
- */
-LIBCLUT_GCC_ONLY__(__attribute__((__const__)))
-double libclut_model_delta_e(double, double, double, double, double, double);
-
#endif