aboutsummaryrefslogtreecommitdiffstats
path: root/color.h
diff options
context:
space:
mode:
Diffstat (limited to 'color.h')
-rw-r--r--color.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/color.h b/color.h
index e4811c4..7c7ab8b 100644
--- a/color.h
+++ b/color.h
@@ -54,9 +54,19 @@ struct cie_Luv const_func XYZ_to_Luv(struct cie_XYZ XYZ, struct cie_XYZ white);
struct cie_XYZ const_func Luv_to_XYZ(struct cie_Luv Luv, struct cie_XYZ white);
struct cie_xy pure_func spectral(double nm);
struct cie_XYZ pure_func planckian(double T);
-struct RGB const_func XYZ_to_RGB(struct cie_XYZ XYZ);
-struct cie_XYZ const_func RGB_to_XYZ(struct RGB RGB);
+struct RGB pure_func XYZ_to_RGB(struct cie_XYZ XYZ);
+struct cie_XYZ pure_func RGB_to_XYZ(struct RGB RGB);
+void RGBXYZ_init(void);
struct RGB const_func XYZ_to_sRGB(struct cie_XYZ XYZ);
-struct cie_XYZ sRGB_to_XYZ(struct RGB sRGB);
+struct cie_XYZ const_func sRGB_to_XYZ(struct RGB sRGB);
+/* y = A x */
+static inline void color_mat_multiply(double y[3], const double A[3][3],
+ const double x[3])
+{
+ y[0] = A[0][0] * x[0] + A[0][1] * x[1] + A[0][2] * x[2];
+ y[1] = A[1][0] * x[0] + A[1][1] * x[1] + A[1][2] * x[2];
+ y[2] = A[2][0] * x[0] + A[2][1] * x[1] + A[2][2] * x[2];
+}
+void color_mat_inverse(double X[3][3], const double A[3][3]); /* X = A^-1 */
#endif /* COLOR_H */