--- gimp-dimage-color-1.1.0.orig/src/transform.c
+++ gimp-dimage-color-1.1.0/src/transform.c
@@ -22,7 +22,7 @@
#include <libgimp/gimp.h>
#include <libgimp/gimpui.h>
-#include <libgimp/gimpmatrix.h>
+#include <libgimpmath/gimpmatrix.h>
#include "dimage_color.h"
#include "profile.h"
@@ -41,13 +41,13 @@
void
build_transform (void)
{
- GimpMatrix3 srgb_i;
+ GimpMatrix3 srgb_i = srgb_prim;
gint i;
/* Build color gamut transformation: t = (sRGB)-1 * dimage */
- gimp_matrix3_invert(srgb_prim, srgb_i);
- memcpy (shaper, dimage_prim, sizeof (GimpMatrix3));
- gimp_matrix3_mult(srgb_i, shaper);
+ gimp_matrix3_invert(&srgb_i);
+ shaper = dimage_prim;
+ gimp_matrix3_mult(&srgb_i, &shaper);
/* Build input gamma lookup table */
for (i = 0; i < 256; i++)
@@ -79,9 +79,9 @@
p1[2] = input_gamma[src[2]];
/* Color gamut transform */
- p2[0] = p1[0] * shaper[0][0] + p1[1] * shaper[0][1] + p1[2] *shaper[0][2];
- p2[1] = p1[0] * shaper[1][0] + p1[1] * shaper[1][1] + p1[2] *shaper[1][2];
- p2[2] = p1[0] * shaper[2][0] + p1[1] * shaper[2][1] + p1[2] *shaper[2][2];
+ p2[0] = p1[0] * shaper.coeff[0][0] + p1[1] * shaper.coeff[0][1] + p1[2] *shaper.coeff[0][2];
+ p2[1] = p1[0] * shaper.coeff[1][0] + p1[1] * shaper.coeff[1][1] + p1[2] *shaper.coeff[1][2];
+ p2[2] = p1[0] * shaper.coeff[2][0] + p1[1] * shaper.coeff[2][1] + p1[2] *shaper.coeff[2][2];
/* Clipping / Out of gamut */
for (i = 0; i < 3; i++)