[gnome-color-manager] Remove the 3D hull functionality



commit 6b607e8fb11f255e20cca301ab49ab077e9e5dc1
Author: Richard Hughes <richard hughsie com>
Date:   Thu Dec 12 14:07:49 2013 +0000

    Remove the 3D hull functionality
    
    The mash project is dead upstream and the clutter-gtk hack does not work
    correctly in wayland. It isn't worth so much code for such a little-used
    power-user feature.

 configure.ac                        |   24 --
 contrib/gnome-color-manager.spec.in |    2 -
 data/gcm-viewer.ui                  |   45 ----
 src/Makefile.am                     |   10 -
 src/gcm-hull-widget.c               |  386 -------------------------------
 src/gcm-hull-widget.h               |   61 -----
 src/gcm-hull.c                      |  279 -----------------------
 src/gcm-hull.h                      |   68 ------
 src/gcm-self-test.c                 |  101 --------
 src/gcm-utils.c                     |  428 -----------------------------------
 src/gcm-utils.h                     |    4 -
 src/gcm-viewer.c                    |   32 ---
 12 files changed, 0 insertions(+), 1440 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 1d4e0a6..d343a9e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -86,29 +86,6 @@ PKG_CHECK_MODULES(X11, x11)
 PKG_CHECK_MODULES(GNOME_DESKTOP, gnome-desktop-3.0)
 PKG_CHECK_MODULES(COLORD, colord >= 0.1.34 colord-gtk >= 0.1.20)
 
-dnl **** Check for clutter ****
-AC_ARG_ENABLE(clutter, AS_HELP_STRING([--enable-clutter],[Enable clutter for 3D support]), 
enable_clutter=$enableval, enable_clutter=yes)
-if test x$enable_clutter != xno; then
-       # test for new mash
-       PKG_CHECK_MODULES(CLUTTER,
-                         clutter-1.0 >= 1.12.0 clutter-gtk-1.0 mash-0.2,
-                         has_clutter=yes, has_clutter=no)
-       if test x$has_clutter == xno; then
-               # test for old mash
-               PKG_CHECK_MODULES(CLUTTER,
-                                 clutter-1.0 >= 1.12.0 clutter-gtk-1.0 mash-0.1,
-                                 has_clutter=yes, has_clutter=no)
-       fi
-else
-       has_clutter=no
-fi
-AM_CONDITIONAL(HAVE_CLUTTER, test x$has_clutter = xyes)
-if test x$has_clutter = xyes; then
-       AC_DEFINE(HAVE_CLUTTER,1,[has clutter support])
-else
-       AC_MSG_WARN([clutter-gtk and mash not found, no 3D support])
-fi
-
 dnl **** Check for VTE ****
 PKG_CHECK_MODULES(VTE, vte-2.90 >= 0.25.1, has_vte=yes, has_vte=no)
 AM_CONDITIONAL(HAVE_VTE, test x$has_vte = xyes)
@@ -243,7 +220,6 @@ echo "
         PackageKit integration:    ${enable_packagekit}
         RAW support:               ${enable_exiv}
         VTE support:               ${has_vte}
-        3D support:                ${has_clutter}
         building unit tests:       ${enable_tests}
 "
 
diff --git a/contrib/gnome-color-manager.spec.in b/contrib/gnome-color-manager.spec.in
index 81477c1..33eec5e 100644
--- a/contrib/gnome-color-manager.spec.in
+++ b/contrib/gnome-color-manager.spec.in
@@ -36,8 +36,6 @@ BuildRequires: glib2-devel >= 2.25.9-2
 BuildRequires: docbook-utils
 BuildRequires: colord-devel >= 0.1.12
 BuildRequires: colord-gtk-devel >= 0.1.22
-BuildRequires: libmash-devel
-BuildRequires: clutter-gtk-devel
 BuildRequires: gnome-desktop3-devel
 
 Requires(post):   /usr/bin/gtk-update-icon-cache
diff --git a/data/gcm-viewer.ui b/data/gcm-viewer.ui
index 4a18549..4dcebbe 100644
--- a/data/gcm-viewer.ui
+++ b/data/gcm-viewer.ui
@@ -625,51 +625,6 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkVBox" id="vbox_3d">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="border_width">9</property>
-                    <property name="spacing">6</property>
-                    <child>
-                      <object class="GtkImage" id="image8">
-                        <property name="can_focus">False</property>
-                        <property name="stock">gtk-underline</property>
-                      </object>
-                      <packing>
-                        <property name="expand">True</property>
-                        <property name="fill">True</property>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="label20">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="label" translatable="yes">This 3D hull is what the profile looks 
like in Lab space</property>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">1</property>
-                      </packing>
-                    </child>
-                  </object>
-                  <packing>
-                    <property name="position">2</property>
-                  </packing>
-                </child>
-                <child type="tab">
-                  <object class="GtkLabel" id="label130">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="label" translatable="yes">3D Gamut</property>
-                  </object>
-                  <packing>
-                    <property name="position">2</property>
-                    <property name="tab_fill">False</property>
-                  </packing>
-                </child>
-                <child>
                   <object class="GtkVBox" id="vbox_trc">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
diff --git a/src/Makefile.am b/src/Makefile.am
index 62605c9..841ec75 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -10,7 +10,6 @@ AM_CPPFLAGS =                                         \
        $(GNOME_DESKTOP_CFLAGS)                         \
        $(COLORD_CFLAGS)                                \
        $(CANBERRA_CFLAGS)                              \
-       $(CLUTTER_CFLAGS)                               \
        -DG_LOG_DOMAIN=\"Gcm\"                          \
        -DBINDIR=\"$(bindir)\"                          \
        -DLIBEXECDIR=\"$(libexecdir)\"                  \
@@ -26,8 +25,6 @@ AM_CPPFLAGS =                                         \
 
 noinst_LIBRARIES = libgcmshared.a
 libgcmshared_a_SOURCES =                               \
-       gcm-hull.c                                      \
-       gcm-hull.h                                      \
        gcm-cie-widget.c                                \
        gcm-cie-widget.h                                \
        gcm-debug.c                                     \
@@ -43,12 +40,6 @@ libgcmshared_a_SOURCES =                             \
        gcm-utils.c                                     \
        gcm-utils.h
 
-if HAVE_CLUTTER
-libgcmshared_a_SOURCES +=                              \
-       gcm-hull-widget.c                               \
-       gcm-hull-widget.h
-endif
-
 libgcmshared_a_CFLAGS =                                        \
        $(WARNINGFLAGS_C)
 
@@ -149,7 +140,6 @@ gcm_viewer_LDADD =                                  \
        $(LCMS_LIBS)                                    \
        $(EXIF_LIBS)                                    \
        $(COLORD_LIBS)                                  \
-       $(CLUTTER_LIBS)                                 \
        -lm
 
 gcm_viewer_CFLAGS =                                    \
diff --git a/src/gcm-self-test.c b/src/gcm-self-test.c
index 7e5a9fc..8c9a3a7 100644
--- a/src/gcm-self-test.c
+++ b/src/gcm-self-test.c
@@ -32,111 +32,12 @@
 #include "gcm-debug.h"
 #include "gcm-exif.h"
 #include "gcm-gamma-widget.h"
-#include "gcm-hull.h"
 #include "gcm-image.h"
 #include "gcm-print.h"
 #include "gcm-trc-widget.h"
 #include "gcm-utils.h"
 
 static void
-gcm_test_hull_func (void)
-{
-       GcmHull *hull;
-       CdColorXYZ xyz;
-       CdColorRGB color;
-       guint faces[3];
-       gchar *data;
-
-       hull = gcm_hull_new ();
-       g_assert (hull != NULL);
-
-       gcm_hull_set_flags (hull, 8);
-       g_assert_cmpint (gcm_hull_get_flags (hull), ==, 8);
-
-       /* add a point */
-       xyz.X = 1.0;
-       xyz.Y = 2.0;
-       xyz.Z = 3.0;
-       color.R = 0.25;
-       color.G = 0.5;
-       color.B = 1.0;
-       gcm_hull_add_vertex (hull, &xyz, &color);
-
-       /* add another two */
-       xyz.Z = 2.0;
-       gcm_hull_add_vertex (hull, &xyz, &color);
-       xyz.X = 2.0;
-       gcm_hull_add_vertex (hull, &xyz, &color);
-
-       /* add a face */
-       faces[0] = 0;
-       faces[1] = 1;
-       faces[2] = 2;
-       gcm_hull_add_face (hull, faces, 3);
-
-       /* export to a PLY file */
-       data = gcm_hull_export_to_ply (hull);
-       g_assert_cmpstr (data, ==, "ply\n"
-                                  "format ascii 1.0\n"
-                                  "element vertex 3\n"
-                                  "property float x\n"
-                                  "property float y\n"
-                                  "property float z\n"
-                                  "property uchar red\n"
-                                  "property uchar green\n"
-                                  "property uchar blue\n"
-                                  "element face 1\n"
-                                  "property list uchar uint vertex_indices\n"
-                                  "end_header\n"
-                                  "1.000000 2.000000 3.000000 63 127 255\n"
-                                  "1.000000 2.000000 2.000000 63 127 255\n"
-                                  "2.000000 2.000000 2.000000 63 127 255\n"
-                                  "3 0 1 2\n");
-       g_free (data);
-
-       g_object_unref (hull);
-}
-
-static void
-gcm_test_profile_func (void)
-{
-       CdIcc *profile;
-       GFile *file;
-       gboolean ret;
-       GError *error = NULL;
-       GcmHull *hull;
-       gchar *data;
-
-       /* bluish test */
-       profile = cd_icc_new ();
-       file = g_file_new_for_path (TESTDATADIR "/bluish.icc");
-       ret = cd_icc_load_file (profile, file, CD_ICC_LOAD_FLAGS_NONE, NULL, &error);
-       g_assert_no_error (error);
-       g_assert (ret);
-       g_object_unref (file);
-       g_object_unref (profile);
-
-       /* get gamut hull */
-       profile = cd_icc_new ();
-       file = g_file_new_for_path (TESTDATADIR "/ibm-t61.icc");
-       ret = cd_icc_load_file (profile, file, CD_ICC_LOAD_FLAGS_NONE, NULL, &error);
-       g_assert_no_error (error);
-       g_assert (ret);
-       hull = cd_icc_generate_gamut_hull (profile, 12);
-       g_assert (hull != NULL);
-
-       /* save as PLY file */
-       data = gcm_hull_export_to_ply (hull);
-       ret = g_file_set_contents ("/tmp/gamut.ply", data, -1, NULL);
-       g_assert (ret);
-
-       g_free (data);
-       g_object_unref (hull);
-       g_object_unref (file);
-       g_object_unref (profile);
-}
-
-static void
 gcm_test_brightness_func (void)
 {
        GcmBrightness *brightness;
@@ -552,8 +453,6 @@ main (int argc, char **argv)
        g_test_add_func ("/color/calibrate", gcm_test_calibrate_func);
        g_test_add_func ("/color/exif", gcm_test_exif_func);
        g_test_add_func ("/color/utils", gcm_test_utils_func);
-       g_test_add_func ("/color/hull", gcm_test_hull_func);
-       g_test_add_func ("/color/profile", gcm_test_profile_func);
        if (g_test_thorough ()) {
                g_test_add_func ("/color/brightness", gcm_test_brightness_func);
                g_test_add_func ("/color/image", gcm_test_image_func);
diff --git a/src/gcm-utils.c b/src/gcm-utils.c
index bd2acf6..1c2aa2f 100644
--- a/src/gcm-utils.c
+++ b/src/gcm-utils.c
@@ -339,431 +339,3 @@ cd_colorspace_to_localised_string (CdColorspace colorspace)
        }
        return NULL;
 }
-
-#define HYP(a,b)               (sqrt((a)*(a) + (b)*(b)))
-
-/**
- * cd_icc_create_lab_cube:
- *
- * The original code was taken from icc_examin,
- *  Copyright 2004-2009 Kai-Uwe Behrmann <ku b gmx de>
- **/
-static gdouble *
-cd_icc_create_lab_cube (guint res)
-{
-       gdouble *lab = NULL;
-       gdouble max = 0.99;
-       gdouble min = 0.01;
-       gint area;
-       gint channels_n = 3;
-       gint pos;
-       gsize size;
-       guint x, y;
-
-       size = 4 * res * (res+1) + 2 * (res-1) * (res-1);
-       lab = g_new0 (gdouble, size * channels_n);
-       if (lab == NULL)
-               goto out;
-
-       g_debug ("created 2*%ix%i array", (guint)size, (guint)channels_n);
-
-       /* side squares */
-       for (y = 0; y <= res; ++y) {
-               for (x = 0; x < 4 * res; ++x) {
-                       area = 0;
-                       pos = (y * 4 * res + x) * channels_n;
-
-                       lab[pos + 0] = pow(0.9999 - (gdouble)y / (gdouble)res, 2.0) + 0.0001;
-                       if (area * res <= x && x < ++area * res) {
-                               lab[pos + 1] = min + (x - (area - 1) * res) / (gdouble)res * (max-min);
-                               lab[pos + 2] = min;
-                       } else if (area * res <= x && x < ++area * res) {
-                               lab[pos + 1] = max;
-                               lab[pos + 2] = min + (x - (area - 1) * res) / (gdouble)res * (max-min);
-                       } else if (area * res <= x && x < ++area * res) {
-                               lab[pos + 1] = max - (x - (area - 1) * res) / (gdouble)res * (max-min);
-                               lab[pos + 2] = max;
-                       } else if (area * res <= x && x < ++area * res) {
-                               lab[pos + 1] = min;
-                               lab[pos + 2] = max - (x - (area - 1) * res) / (double)res * (max-min);
-                       }
-               }
-       }
-
-       /* bottom and top square */
-       for (y = 0; y < (res - 1); ++y) {
-               for (x = 0; x < 2 * (res - 1); ++x) {
-                       gint x_pos;
-                       gint y_pos;
-                       gdouble val;
-
-                       pos = (4 * res * (res + 1) + y * 2 * (res - 1) + x) * channels_n;
-                       area = 1;
-                       x_pos = x + 1;
-                       y_pos = y + 1;
-                       val = (gdouble)y_pos/(gdouble)res * (max-min);
-
-                       if (/*0 <= x &&*/ x < res - 1) {
-                               lab[pos + 0] = 1.0;
-                               lab[pos + 1] = min + (x_pos - (area - 1) * (res - 1)) / (gdouble)res * 
(max-min);
-                               lab[pos + 2] = min + val;
-                       } else if (res - 1 <= x && x < 2 * res - 2) {
-                               ++area;
-                               lab[pos + 1] = min + (x_pos - (area - 1) * (res - 1)) / (gdouble)res * 
(max-min);
-                               lab[pos + 2] = min + val;
-                               lab[pos + 0] = HYP (lab[pos + 1] - 0.5, lab[pos + 2] - 0.5)/100.; /* 0.0 */
-                       }
-               }
-       }
-out:
-       return lab;
-}
-
-/**
- * cd_icc_create_hull_for_data:
- *
- * The original code was taken from icc_examin,
- *  Copyright 2004-2009 Kai-Uwe Behrmann <ku b gmx de>
- **/
-static GcmHull *
-cd_icc_create_hull_for_data (guint res, gdouble *lab, gdouble *rgb)
-{
-       CdColorRGB color;
-       CdColorXYZ xyz;
-       GcmHull *hull = NULL;
-       gint channels_n = 3;
-       gint off;
-       gsize i;
-       gsize size;
-       guint face[3];
-       guint x, y;
-
-       size = 4 * res * (res+1) + 2 * (res-1) * (res-1);
-
-       hull = gcm_hull_new ();
-
-       /* collect colour points */
-       for (i = 0; i < size; ++i) {
-               xyz.X = lab[i*channels_n+0];
-               xyz.Y = lab[i*channels_n+1];
-               xyz.Z = lab[i*channels_n+2];
-               color.R = rgb[i*channels_n+0];
-               color.G = rgb[i*channels_n+1];
-               color.B = rgb[i*channels_n+2];
-               gcm_hull_add_vertex (hull, &xyz, &color);
-       }
-
-       for (y = 0; y < res; ++y) {
-               for (x = 0; x < 4 * res; ++x) {
-                       gint x_ = x;
-                       if (x == 4 * res - 1)
-                               x_ = -1;
-                       face[0] = y * 4*res+x;
-                       face[1] = y * 4*res+x_+1;
-                       face[2] = (y+1)*4*res+x;
-                       gcm_hull_add_face (hull, face, 3);
-
-                       face[0] = y * 4*res+x_+1;
-                       face[1] = (y+1)*4*res+x_+1;
-                       face[2] = (y+1)*4*res+x;
-                       gcm_hull_add_face (hull, face, 3);
-               }
-       }
-
-       off = 4 * res * (res + 1);
-
-       /* 1 0 0 (L res b) */
-       face[0] = 4*res-1;
-       face[1] = off;
-       face[2] = 0;
-       gcm_hull_add_face (hull, face, 3);
-
-       face[0] = off;
-       face[2] = 0;
-       face[1] = 1;
-       gcm_hull_add_face (hull, face, 3);
-
-       /* 0 0 0 */
-       face[1] = off-1;
-       face[0] = off+res-1;
-       face[2] = off-4*res;
-       gcm_hull_add_face (hull, face, 3);
-
-       face[1] = off+res-1;
-       face[2] = off-4*res;
-       face[0] = off - 4*res+1;
-       gcm_hull_add_face (hull, face, 3);
-
-       /* 0 0 1 */
-       face[2] = off-res;
-       face[1] = off-res-1;
-       face[0] = off+2*(res-1)*(res-1)-res+1;
-       gcm_hull_add_face (hull, face, 3);
-
-       face[0] = off-res;
-       face[1] = off-res+1;
-       face[2] = off+2*(res-1)*(res-1)-res+1;
-       gcm_hull_add_face (hull, face, 3);
-
-       /* 0 1 1 */
-       face[0] = off-2*res+1;
-       face[2] = off-2*res;
-       face[1] = off+2*(res-1)*(res-1)-1;
-       gcm_hull_add_face (hull, face, 3);
-
-       face[1] = off-2*res;
-       face[2] = off+2*(res-1)*(res-1)-1;
-       face[0] = off-2*res-1;
-       gcm_hull_add_face (hull, face, 3);
-
-       /* 1 1 1 */
-       face[0] = 2*res-1;
-       face[2] = 2*res;
-       face[1] = off+2*(res-1)*(res-1)-res;
-       gcm_hull_add_face (hull, face, 3);
-
-       face[1] = 2*res;
-       face[2] = off+2*(res-1)*(res-1)-res;
-       face[0] = 2*res+1;
-       gcm_hull_add_face (hull, face, 3);
-
-       /* 1 0 1 */
-       face[2] = 3*res;
-       face[0] = 3*res-1;
-       face[1] = off+2*(res-1)*(res-1)-2*res+2;
-       gcm_hull_add_face (hull, face, 3);
-
-       face[2] = 3*res;
-       face[1] = 3*res+1;
-       face[0] = off+2*(res-1)*(res-1)-2*res+2;
-       gcm_hull_add_face (hull, face, 3);
-
-       /* 1 1 0 */
-       face[0] = off+res-2;
-       face[1] = res + 1;
-       face[2] = res - 1;
-       gcm_hull_add_face (hull, face, 3);
-
-       face[0] = res + 1;
-       face[2] = res - 1;
-       face[1] = res;
-       gcm_hull_add_face (hull, face, 3);
-
-       /* 0 1 0 */
-       face[0] = off+2*(res-1)-1;
-       face[1] = off-3*res-1;
-       face[2] = off-3*res;
-       gcm_hull_add_face (hull, face, 3);
-
-       face[1] = off+2*(res-1)-1;
-       face[0] = off-3*res+1;
-       face[2] = off-3*res+0;
-       gcm_hull_add_face (hull, face, 3);
-
-       for (y = 0; y < res; ++y) {
-               if (0 < y && y < res - 1) {
-                       /* 0 0 . */
-                       face[2] = off-y;
-                       face[0] = off+(y+1)*2*(res-1)-res+1;
-                       face[1] = off-y-1;
-                       gcm_hull_add_face (hull, face, 3);
-
-                       face[0] = off+(y+0)*2*(res-1)-res+1;
-                       face[2] = off-y;
-                       face[1] = off+(y+1)*2*(res-1)-res+1;
-                       gcm_hull_add_face (hull, face, 3);
-
-                       /* 0 1 . */
-                       face[1] = off+(y+1)*2*(res-1)-1;
-                       face[0] = off-3*res+y+1;
-                       face[2] = off+(y)*2*(res-1)-1;
-                       gcm_hull_add_face (hull, face, 3);
-
-                       face[1] = off-3*res+y+1;
-                       face[2] = off+(y)*2*(res-1)-1;
-                       face[0] = off-3*res+y;
-                       gcm_hull_add_face (hull, face, 3);
-
-                       /* 1 0 . */
-                       face[0] = off+2*(res-1)*(res-1)-(y+1)*2*(res-1);
-                       face[1] = 3*res+y+1;
-                       face[2] = off+2*(res-1)*(res-1)-y*2*(res-1);
-                       gcm_hull_add_face (hull, face, 3);
-
-                       face[0] = 3*res+y+1;
-                       face[2] = off+2*(res-1)*(res-1)-y*2*(res-1);
-                       face[1] = 3*res+y;
-                       gcm_hull_add_face (hull, face, 3);
-
-                       /* 1 1 . */
-                       face[0] = off+2*(res-1)*(res-1)-(y+1)*2*(res-1)+res-2;
-                       face[1] = off+2*(res-1)*(res-1)-(y+0)*2*(res-1)+res-2;
-                       face[2] = 2*res-y;
-                       gcm_hull_add_face (hull, face, 3);
-
-                       face[0] = 2*res-y-1;
-                       face[1] = off+2*(res-1)*(res-1)-(y+1)*2*(res-1)+res-2;
-                       face[2] = 2*res-y;
-                       gcm_hull_add_face (hull, face, 3);
-               }
-
-               for (x = 0; x < 2 * res; ++x) {
-                       gint x_ = x + off;
-
-                       /* lower border */
-                       if ( y == 0 ) {
-                               if (x == 0) {
-                               } else if (x == res - 1) {
-                               } else if (x < res - 1) {
-                                       /* 1 . 0 */
-                                       face[0] = off + x - 1;
-                                       face[1] = off + x;
-                                       face[2] = x;
-                                       gcm_hull_add_face (hull, face, 3);
-
-                                       face[0] = off + x;
-                                       face[2] = x;
-                                       face[1] = x + 1;
-                                       gcm_hull_add_face (hull, face, 3);
-
-                                       /* 0 . 1 */
-                                       face[0] = off-res-x;
-                                       face[2] = off-res-x-1;
-                                       face[1] = off+2*(res-1)*(res-1)-res+x;
-                                       gcm_hull_add_face (hull, face, 3);
-
-                                       face[2] = off-res-x-1;
-                                       face[0] = off+2*(res-1)*(res-1)-res+x;
-                                       face[1] = off+2*(res-1)*(res-1)-res+x+1;
-                                       gcm_hull_add_face (hull, face, 3);
-
-                                       /* 1 . 1 */
-                                       face[0] = 3*res - x;
-                                       face[1] = 3*res - x-1;
-                                       face[2] = off+2*(res-1)*(res-1)-2*(res-1)+x-1;
-                                       gcm_hull_add_face (hull, face, 3);
-
-                                       face[0] = 3*res - x-1;
-                                       face[2] = off+2*(res-1)*(res-1)-2*(res-1)+x-1;
-                                       face[1] = off+2*(res-1)*(res-1)-2*(res-1)+x;
-                                       gcm_hull_add_face (hull, face, 3);
-
-                               } else if (x > res + 1) {
-                                       /* 0 . 0 */
-                                       face[0] = off+x-3;
-                                       face[2] = off+x-3+1;
-                                       face[1] = 4*res*(res+1)-4*res + x-res-1;
-                                       gcm_hull_add_face (hull, face, 3);
-
-                                       face[1] = off+x-3+1;
-                                       face[2] = 4*res*(res+1)-4*res + x-res-1;
-                                       face[0] = 4*res*(res+1)-4*res + x-res;
-                                       gcm_hull_add_face (hull, face, 3);
-                               }
-
-                       /* upper border */
-                       } else if ( y == res - 1 ) {
-                               if (x == 0) {
-                               }
-                       } else if (/*0 <= x &&*/ x < res - 1 - 1) {
-
-                               /* upper middle field (*L=0.0) */
-                               face[0] = (y-1) * 2*(res-1)+x_;
-                               face[2] = (y-1)*2*(res-1)+x_+1;
-                               face[1] = (y+0)*2*(res-1)+x_;
-                               gcm_hull_add_face (hull, face, 3);
-
-                               face[2] = (y-1)*2*(res-1)+x_+1;
-                               face[0] = (y+0)*2*(res-1)+x_;
-                               face[1] = (y+0)*2*(res-1)+x_+1;
-                               gcm_hull_add_face (hull, face, 3);
-
-                       } else if (res - 1 <= x && x < 2 * res - 2 - 1) {
-
-                               /* lower middle field (*L=1.0) */
-                               face[0] = (y-1) * 2*(res-1)+x_;
-                               face[1] = (y-1)*2*(res-1)+x_+1;
-                               face[2] = (y+0)*2*(res-1)+x_;
-                               gcm_hull_add_face (hull, face, 3);
-
-                               face[0] = (y-1)*2*(res-1)+x_+1;
-                               face[2] = (y+0)*2*(res-1)+x_;
-                               face[1] = (y+0)*2*(res-1)+x_+1;
-                               gcm_hull_add_face (hull, face, 3);
-                       }
-               }
-       }
-
-       return hull;
-}
-
-/**
- * cd_icc_generate_gamut_hull:
- * @icc: a #CdIcc
- * @res: The resolution. 10 is quick, 20 is more precise. 12 is a good default.
- *
- * A cube from six squares with the range of the Lab cube will be
- * transformed to a icc colour space and then converted to a
- * mesh.
- *
- * The original code was taken from icc_examin,
- *  Copyright 2004-2009 Kai-Uwe Behrmann <ku b gmx de>
- **/
-GcmHull *
-cd_icc_generate_gamut_hull (CdIcc *icc, guint res)
-{
-       cmsHPROFILE lab_profile = NULL;
-       cmsHPROFILE srgb_profile = NULL;
-       cmsHTRANSFORM lab_transform = NULL;
-       cmsHTRANSFORM srgb_transform = NULL;
-       cmsHPROFILE lcms_profile;
-       GcmHull *hull = NULL;
-       gdouble *lab = NULL;
-       gdouble *rgb = NULL;
-       gint channels_n = 3;
-       gsize size = 4 * res * (res+1) + 2 * (res-1) * (res-1);
-
-       /* create data array */
-       lab = cd_icc_create_lab_cube (res);
-       rgb = g_new0 (gdouble, size * channels_n);
-       if (rgb == NULL)
-               goto out;
-
-       /* run the cube through the Lab icc */
-       lab_profile = cmsCreateLab4Profile (cmsD50_xyY ());
-       lcms_profile = cd_icc_get_handle (icc);
-       lab_transform = cmsCreateTransform (lcms_profile, TYPE_RGB_DBL,
-                                           lab_profile, TYPE_Lab_DBL,
-                                           INTENT_ABSOLUTE_COLORIMETRIC, 0);
-       if (lab_transform == NULL) {
-               g_warning ("failed to create Lab transform");
-               goto out;
-       }
-       cmsDoTransform (lab_transform, lab, lab, size);
-
-       /* run the cube through the sRGB icc */
-       srgb_profile = cmsCreate_sRGBProfile ();
-       srgb_transform = cmsCreateTransform (lab_profile, TYPE_Lab_DBL,
-                                            srgb_profile, TYPE_RGB_DBL,
-                                            INTENT_ABSOLUTE_COLORIMETRIC, 0);
-       if (srgb_transform == NULL) {
-               g_warning ("failed to create sRGB transform");
-               goto out;
-       }
-       cmsDoTransform (srgb_transform, lab, rgb, size);
-
-       /* create gamut hull */
-       hull = cd_icc_create_hull_for_data (res, lab, rgb);
-out:
-       g_free (rgb);
-       g_free (lab);
-       if (lab_profile != NULL)
-               cmsCloseProfile (lab_profile);
-       if (srgb_profile != NULL)
-               cmsCloseProfile (srgb_profile);
-       if (lab_transform != NULL)
-               cmsDeleteTransform (lab_transform);
-       if (srgb_transform != NULL)
-               cmsDeleteTransform (srgb_transform);
-       return hull;
-}
diff --git a/src/gcm-utils.h b/src/gcm-utils.h
index 00c2afc..0d62962 100644
--- a/src/gcm-utils.h
+++ b/src/gcm-utils.h
@@ -25,8 +25,6 @@
 #include <glib-object.h>
 #include <gtk/gtk.h>
 
-#include "gcm-hull.h"
-
 #define GCM_STOCK_ICON                                 "gnome-color-manager"
 #define GCM_DBUS_SERVICE                               "org.gnome.ColorManager"
 #define GCM_DBUS_INTERFACE                             "org.gnome.ColorManager"
@@ -49,8 +47,6 @@ gboolean       gcm_utils_install_package              (const gchar            *package_name,
                                                         GtkWindow              *window);
 gchar          *gcm_utils_linkify                      (const gchar            *text);
 const gchar    *cd_colorspace_to_localised_string      (CdColorspace            colorspace);
-GcmHull                *cd_icc_generate_gamut_hull             (CdIcc                  *icc,
-                                                        guint                   res);
 
 #endif /* __GCM_UTILS_H */
 
diff --git a/src/gcm-viewer.c b/src/gcm-viewer.c
index 5c1e31e..f6dce8d 100644
--- a/src/gcm-viewer.c
+++ b/src/gcm-viewer.c
@@ -30,10 +30,6 @@
 #include <colord.h>
 #include <math.h>
 
-#ifdef HAVE_CLUTTER
- #include <clutter-gtk/clutter-gtk.h>
-#endif
-
 #include "gcm-cell-renderer-profile-text.h"
 #include "gcm-cell-renderer-color.h"
 #include "gcm-cie-widget.h"
@@ -42,17 +38,12 @@
 #include "gcm-utils.h"
 #include "gcm-debug.h"
 
-#ifdef HAVE_CLUTTER
- #include "gcm-hull-widget.h"
-#endif
-
 typedef struct {
        GtkBuilder      *builder;
        GtkApplication  *application;
        GtkListStore    *list_store_profiles;
        CdClient        *client;
        GtkWidget       *cie_widget;
-       GtkWidget       *hull_widget;
        GtkWidget       *trc_widget;
        GtkWidget       *vcgt_widget;
        GtkWidget       *preview_widget_input;
@@ -1063,15 +1054,6 @@ gcm_viewer_set_profile (GcmViewerPrivate *viewer, CdProfile *profile)
                gtk_widget_hide (widget);
        }
 
-#ifdef HAVE_CLUTTER
-       /* show 3d gamut hull */
-       gtk_widget_show (viewer->hull_widget);
-       gcm_hull_widget_clear (GCM_HULL_WIDGET (viewer->hull_widget));
-       ret = gcm_hull_widget_add (GCM_HULL_WIDGET (viewer->hull_widget), icc);
-       widget = GTK_WIDGET (gtk_builder_get_object (viewer->builder, "vbox_3d"));
-       gtk_widget_set_visible (widget, ret);
-#endif
-
        /* get vcgt data */
        widget = GTK_WIDGET (gtk_builder_get_object (viewer->builder, "vbox_vcgt"));
        clut_vcgt = cd_icc_get_vcgt (icc, 256, NULL);
@@ -1661,16 +1643,6 @@ gcm_viewer_startup_cb (GApplication *application, GcmViewerPrivate *viewer)
        gtk_box_pack_start (GTK_BOX(widget), viewer->cie_widget, TRUE, TRUE, 0);
        gtk_box_reorder_child (GTK_BOX(widget), viewer->cie_widget, 0);
 
-       /* use clutter widget */
-       widget = GTK_WIDGET (gtk_builder_get_object (viewer->builder, "vbox_3d"));
-#ifdef HAVE_CLUTTER
-       viewer->hull_widget = gcm_hull_widget_new ();
-       gtk_box_pack_start (GTK_BOX(widget), viewer->hull_widget, TRUE, TRUE, 0);
-       gtk_box_reorder_child (GTK_BOX(widget), viewer->hull_widget, 0);
-#else
-       gtk_widget_hide (widget);
-#endif
-
        /* use trc widget */
        viewer->trc_widget = gcm_trc_widget_new ();
        widget = GTK_WIDGET (gtk_builder_get_object (viewer->builder, "vbox_trc_widget"));
@@ -1833,10 +1805,6 @@ main (int argc, char **argv)
        textdomain (GETTEXT_PACKAGE);
 
        gtk_init (&argc, &argv);
-#ifdef HAVE_CLUTTER
-       if (gtk_clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
-               return 1;
-#endif
 
        context = g_option_context_new ("gnome-color-manager profile viewer");
        g_option_context_add_main_entries (context, options, NULL);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]