aboutsummaryrefslogtreecommitdiffstats
path: root/libglitter_get_colour_space_conversion_matrix_float.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2023-01-22 01:06:50 +0100
committerMattias Andrée <maandree@kth.se>2023-01-22 01:08:26 +0100
commitb8ece8550e52b26924e5096d03706dc379ec46d4 (patch)
tree30f73817e7e5c69d066bedea2dddf5d27637eae8 /libglitter_get_colour_space_conversion_matrix_float.c
parentFetching output colour space belongs in libfonts, not libglitter (diff)
downloadlibglitter-b8ece8550e52b26924e5096d03706dc379ec46d4.tar.gz
libglitter-b8ece8550e52b26924e5096d03706dc379ec46d4.tar.bz2
libglitter-b8ece8550e52b26924e5096d03706dc379ec46d4.tar.xz
Add libglitter_get_colour_space_conversion_matrix_{double,float}
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'libglitter_get_colour_space_conversion_matrix_float.c')
-rw-r--r--libglitter_get_colour_space_conversion_matrix_float.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/libglitter_get_colour_space_conversion_matrix_float.c b/libglitter_get_colour_space_conversion_matrix_float.c
new file mode 100644
index 0000000..022c2a4
--- /dev/null
+++ b/libglitter_get_colour_space_conversion_matrix_float.c
@@ -0,0 +1,25 @@
+/* See LICENSE file for copyright and license details. */
+#include "common.h"
+
+
+void
+libglitter_get_colour_space_conversion_matrix_float(float matrix[3][3], float c1x, float c1y,
+ float c2x, float c2y, float c3x, float c3y,
+ float white_x, float white_y, float white_Y)
+{
+ double double_matrix[3][3];
+ libglitter_get_colour_space_conversion_matrix_double(double_matrix,
+ (double)c1x, (double)c1y,
+ (double)c2x, (double)c2y,
+ (double)c3x, (double)c3y,
+ (double)white_x, (double)white_y, (double)white_Y);
+ matrix[0][0] = (float)double_matrix[0][0];
+ matrix[0][1] = (float)double_matrix[0][1];
+ matrix[0][2] = (float)double_matrix[0][2];
+ matrix[1][0] = (float)double_matrix[1][0];
+ matrix[1][1] = (float)double_matrix[1][1];
+ matrix[1][2] = (float)double_matrix[1][2];
+ matrix[2][0] = (float)double_matrix[2][0];
+ matrix[2][1] = (float)double_matrix[2][1];
+ matrix[2][2] = (float)double_matrix[2][2];
+}