summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2014-10-08 21:36:57 +0100
committerRichard Hughes <richard@hughsie.com>2014-10-08 21:36:57 +0100
commitef24a3accf82f1e89904ac469f89cceb04cfb4dc (patch)
tree8379415bdfafdba4363aa344cb30260d054ba80d /lib
parent1f3f4e0ac8421034ac73250f334af9a930ec2945 (diff)
downloadcolord-ef24a3accf82f1e89904ac469f89cceb04cfb4dc.tar.gz
libcolord: Add cd_mat33_init() helper function
Diffstat (limited to 'lib')
-rw-r--r--lib/colord/cd-math.c34
-rw-r--r--lib/colord/cd-math.h10
2 files changed, 44 insertions, 0 deletions
diff --git a/lib/colord/cd-math.c b/lib/colord/cd-math.c
index f17b0e8..50d8d80 100644
--- a/lib/colord/cd-math.c
+++ b/lib/colord/cd-math.c
@@ -184,6 +184,40 @@ cd_vec3_squared_error (const CdVec3 *src1, const CdVec3 *src2)
}
/**
+ * cd_mat33_init:
+ * @dest: the destination matrix
+ * @m00: component value
+ * @m01: component value
+ * @m02: component value
+ * @m10: component value
+ * @m11: component value
+ * @m12: component value
+ * @m20: component value
+ * @m21: component value
+ * @m22: component value
+ *
+ * Initialises a matrix.
+ **/
+void
+cd_mat33_init (CdMat3x3 *dest,
+ gdouble m00, gdouble m01, gdouble m02,
+ gdouble m10, gdouble m11, gdouble m12,
+ gdouble m20, gdouble m21, gdouble m22)
+{
+ g_return_if_fail (dest != NULL);
+
+ dest->m00 = m00;
+ dest->m01 = m01;
+ dest->m02 = m02;
+ dest->m10 = m10;
+ dest->m11 = m11;
+ dest->m12 = m12;
+ dest->m20 = m20;
+ dest->m21 = m21;
+ dest->m22 = m22;
+}
+
+/**
* cd_mat33_clear:
* @src: the source
*
diff --git a/lib/colord/cd-math.h b/lib/colord/cd-math.h
index 4d49365..5f6c39c 100644
--- a/lib/colord/cd-math.h
+++ b/lib/colord/cd-math.h
@@ -57,6 +57,16 @@ void cd_vec3_init (CdVec3 *dest,
gdouble v0,
gdouble v1,
gdouble v2);
+void cd_mat33_init (CdMat3x3 *dest,
+ gdouble m00,
+ gdouble m01,
+ gdouble m02,
+ gdouble m10,
+ gdouble m11,
+ gdouble m12,
+ gdouble m20,
+ gdouble m21,
+ gdouble m22);
void cd_mat33_clear (const CdMat3x3 *src);
gchar *cd_mat33_to_string (const CdMat3x3 *src);
gdouble *cd_mat33_get_data (const CdMat3x3 *src);