[gimp] pdb: remove all compat procedures for the old lcms plug-in



commit 8511eb645152f83d0be1742e5b0ebe582b9c8195
Author: Michael Natterer <mitch gimp org>
Date:   Sat May 5 19:28:05 2018 +0200

    pdb: remove all compat procedures for the old lcms plug-in

 app/pdb/internal-procs.c      |    2 +-
 app/pdb/plug-in-compat-cmds.c |  596 -----------------------------------------
 pdb/groups/plug_in_compat.pdb |  379 --------------------------
 3 files changed, 1 insertions(+), 976 deletions(-)
---
diff --git a/app/pdb/internal-procs.c b/app/pdb/internal-procs.c
index 3ef50df..c572824 100644
--- a/app/pdb/internal-procs.c
+++ b/app/pdb/internal-procs.c
@@ -28,7 +28,7 @@
 #include "internal-procs.h"
 
 
-/* 739 procedures registered total */
+/* 733 procedures registered total */
 
 void
 internal_procs_init (GimpPDB *pdb)
diff --git a/app/pdb/plug-in-compat-cmds.c b/app/pdb/plug-in-compat-cmds.c
index 4931e76..0582bbf 100644
--- a/app/pdb/plug-in-compat-cmds.c
+++ b/app/pdb/plug-in-compat-cmds.c
@@ -40,7 +40,6 @@
 #include "core/gimpcontext.h"
 #include "core/gimpdrawable-operation.h"
 #include "core/gimpdrawable.h"
-#include "core/gimpimage-color-profile.h"
 #include "core/gimpimage-crop.h"
 #include "core/gimpimage-resize.h"
 #include "core/gimpimage-rotate.h"
@@ -1867,352 +1866,6 @@ plug_in_hsv_noise_invoker (GimpProcedure         *procedure,
 }
 
 static GimpValueArray *
-plug_in_icc_profile_info_invoker (GimpProcedure         *procedure,
-                                  Gimp                  *gimp,
-                                  GimpContext           *context,
-                                  GimpProgress          *progress,
-                                  const GimpValueArray  *args,
-                                  GError               **error)
-{
-  gboolean success = TRUE;
-  GimpValueArray *return_vals;
-  GimpImage *image;
-  gchar *profile_name = NULL;
-  gchar *profile_desc = NULL;
-  gchar *profile_info = NULL;
-
-  image = gimp_value_get_image (gimp_value_array_index (args, 0), gimp);
-
-  if (success)
-    {
-      GimpColorProfile *profile;
-
-      profile = gimp_color_managed_get_color_profile (GIMP_COLOR_MANAGED (image));
-
-      if (profile)
-        {
-          profile_name = g_strdup (gimp_color_profile_get_model (profile));
-          profile_desc = g_strdup (gimp_color_profile_get_description (profile));
-          profile_info = g_strdup (gimp_color_profile_get_summary (profile));
-        }
-    }
-
-  return_vals = gimp_procedure_get_return_values (procedure, success,
-                                                  error ? *error : NULL);
-
-  if (success)
-    {
-      g_value_take_string (gimp_value_array_index (return_vals, 1), profile_name);
-      g_value_take_string (gimp_value_array_index (return_vals, 2), profile_desc);
-      g_value_take_string (gimp_value_array_index (return_vals, 3), profile_info);
-    }
-
-  return return_vals;
-}
-
-static GimpValueArray *
-plug_in_icc_profile_file_info_invoker (GimpProcedure         *procedure,
-                                       Gimp                  *gimp,
-                                       GimpContext           *context,
-                                       GimpProgress          *progress,
-                                       const GimpValueArray  *args,
-                                       GError               **error)
-{
-  gboolean success = TRUE;
-  GimpValueArray *return_vals;
-  const gchar *profile;
-  gchar *profile_name = NULL;
-  gchar *profile_desc = NULL;
-  gchar *profile_info = NULL;
-
-  profile = g_value_get_string (gimp_value_array_index (args, 0));
-
-  if (success)
-    {
-      GFile *file = g_file_new_for_path (profile);
-
-      if (file)
-        {
-          GimpColorProfile *p;
-
-          p = gimp_color_profile_new_from_file (file, error);
-          g_object_unref (file);
-
-          if (p)
-            {
-              profile_name = g_strdup (gimp_color_profile_get_model (p));
-              profile_desc = g_strdup (gimp_color_profile_get_description (p));
-              profile_info = g_strdup (gimp_color_profile_get_summary (p));
-
-              g_object_unref (p);
-            }
-          else
-            success = FALSE;
-        }
-      else
-        success = FALSE;
-    }
-
-  return_vals = gimp_procedure_get_return_values (procedure, success,
-                                                  error ? *error : NULL);
-
-  if (success)
-    {
-      g_value_take_string (gimp_value_array_index (return_vals, 1), profile_name);
-      g_value_take_string (gimp_value_array_index (return_vals, 2), profile_desc);
-      g_value_take_string (gimp_value_array_index (return_vals, 3), profile_info);
-    }
-
-  return return_vals;
-}
-
-static GimpValueArray *
-plug_in_icc_profile_apply_invoker (GimpProcedure         *procedure,
-                                   Gimp                  *gimp,
-                                   GimpContext           *context,
-                                   GimpProgress          *progress,
-                                   const GimpValueArray  *args,
-                                   GError               **error)
-{
-  gboolean success = TRUE;
-  GimpImage *image;
-  const gchar *profile;
-  gint32 intent;
-  gboolean bpc;
-
-  image = gimp_value_get_image (gimp_value_array_index (args, 1), gimp);
-  profile = g_value_get_string (gimp_value_array_index (args, 2));
-  intent = g_value_get_enum (gimp_value_array_index (args, 3));
-  bpc = g_value_get_boolean (gimp_value_array_index (args, 4));
-
-  if (success)
-    {
-      if (gimp_pdb_image_is_not_base_type (image, GIMP_GRAY, error))
-        {
-          GimpColorProfile *p = NULL;
-
-          if (profile)
-            {
-              GFile *file = g_file_new_for_path (profile);
-
-              if (file)
-                {
-                  p = gimp_color_profile_new_from_file (file, error);
-
-                  if (! p)
-                    success = FALSE;
-
-                  g_object_unref (file);
-                }
-              else
-                {
-                  success = FALSE;
-                }
-            }
-          else if (image->gimp->config->color_management->rgb_profile)
-            {
-              p = gimp_color_config_get_rgb_color_profile (image->gimp->config->color_management,
-                                                           error);
-
-              if (! p)
-                success = FALSE;
-            }
-
-          if (success)
-            {
-              if (! p)
-                p = gimp_image_get_builtin_color_profile (image);
-
-              success = gimp_image_convert_color_profile (image, p, intent, bpc,
-                                                          progress, error);
-            }
-        }
-      else
-        success = FALSE;
-    }
-
-  return gimp_procedure_get_return_values (procedure, success,
-                                           error ? *error : NULL);
-}
-
-static GimpValueArray *
-plug_in_icc_profile_apply_rgb_invoker (GimpProcedure         *procedure,
-                                       Gimp                  *gimp,
-                                       GimpContext           *context,
-                                       GimpProgress          *progress,
-                                       const GimpValueArray  *args,
-                                       GError               **error)
-{
-  gboolean success = TRUE;
-  GimpImage *image;
-  gint32 intent;
-  gboolean bpc;
-
-  image = gimp_value_get_image (gimp_value_array_index (args, 1), gimp);
-  intent = g_value_get_enum (gimp_value_array_index (args, 2));
-  bpc = g_value_get_boolean (gimp_value_array_index (args, 3));
-
-  if (success)
-    {
-      if (gimp_pdb_image_is_not_base_type (image, GIMP_GRAY, error))
-        {
-          GimpColorProfile *p = NULL;
-
-          if (image->gimp->config->color_management->rgb_profile)
-            {
-              p = gimp_color_config_get_rgb_color_profile (image->gimp->config->color_management,
-                                                           error);
-
-              if (! p)
-                success = FALSE;
-            }
-
-          if (success)
-            {
-              if (! p)
-                p = gimp_image_get_builtin_color_profile (image);
-
-              success = gimp_image_convert_color_profile (image, p, intent, bpc,
-                                                          progress, error);
-            }
-        }
-      else
-        success = FALSE;
-    }
-
-  return gimp_procedure_get_return_values (procedure, success,
-                                           error ? *error : NULL);
-}
-
-static GimpValueArray *
-plug_in_icc_profile_set_invoker (GimpProcedure         *procedure,
-                                 Gimp                  *gimp,
-                                 GimpContext           *context,
-                                 GimpProgress          *progress,
-                                 const GimpValueArray  *args,
-                                 GError               **error)
-{
-  gboolean success = TRUE;
-  GimpImage *image;
-  const gchar *profile;
-
-  image = gimp_value_get_image (gimp_value_array_index (args, 1), gimp);
-  profile = g_value_get_string (gimp_value_array_index (args, 2));
-
-  if (success)
-    {
-      if (gimp_pdb_image_is_not_base_type (image, GIMP_GRAY, error))
-        {
-          GimpColorProfile *p = NULL;
-
-          if (profile)
-            {
-              GFile *file = g_file_new_for_path (profile);
-
-              if (file)
-                {
-                  p = gimp_color_profile_new_from_file (file, error);
-
-                  if (! p)
-                    success = FALSE;
-
-                  g_object_unref (file);
-                }
-              else
-                success = FALSE;
-            }
-          else if (image->gimp->config->color_management->rgb_profile)
-            {
-              p = gimp_color_config_get_rgb_color_profile (image->gimp->config->color_management,
-                                                           error);
-
-              if (! p)
-                success = FALSE;
-            }
-
-          if (success)
-            {
-              gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_MISC,
-                                           _("Set color profile"));
-
-              if (gimp_image_set_color_profile (image, p, error))
-                gimp_image_parasite_detach (image, "icc-profile-name");
-              else
-                success = FALSE;
-
-              gimp_image_undo_group_end (image);
-
-              if (! success)
-                gimp_image_undo (image);
-
-              if (p)
-                g_object_unref (p);
-            }
-        }
-      else
-        success = FALSE;
-    }
-
-  return gimp_procedure_get_return_values (procedure, success,
-                                           error ? *error : NULL);
-}
-
-static GimpValueArray *
-plug_in_icc_profile_set_rgb_invoker (GimpProcedure         *procedure,
-                                     Gimp                  *gimp,
-                                     GimpContext           *context,
-                                     GimpProgress          *progress,
-                                     const GimpValueArray  *args,
-                                     GError               **error)
-{
-  gboolean success = TRUE;
-  GimpImage *image;
-
-  image = gimp_value_get_image (gimp_value_array_index (args, 1), gimp);
-
-  if (success)
-    {
-      if (gimp_pdb_image_is_not_base_type (image, GIMP_GRAY, error))
-        {
-          GimpColorProfile *p = NULL;
-
-          if (image->gimp->config->color_management->rgb_profile)
-            {
-              p = gimp_color_config_get_rgb_color_profile (image->gimp->config->color_management,
-                                                           error);
-
-              if (! p)
-                success = FALSE;
-            }
-
-          if (success)
-            {
-              gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_MISC,
-                                           _("Set color profile"));
-
-              if (gimp_image_set_color_profile (image, p, error))
-                gimp_image_parasite_detach (image, "icc-profile-name");
-              else
-                success = FALSE;
-
-              gimp_image_undo_group_end (image);
-
-              if (! success)
-                gimp_image_undo (image);
-
-              if (p)
-                g_object_unref (p);
-            }
-        }
-      else
-        success = FALSE;
-    }
-
-  return gimp_procedure_get_return_values (procedure, success,
-                                           error ? *error : NULL);
-}
-
-static GimpValueArray *
 plug_in_illusion_invoker (GimpProcedure         *procedure,
                           Gimp                  *gimp,
                           GimpContext           *context,
@@ -6206,255 +5859,6 @@ register_plug_in_compat_procs (GimpPDB *pdb)
   g_object_unref (procedure);
 
   /*
-   * gimp-plug-in-icc-profile-info
-   */
-  procedure = gimp_procedure_new (plug_in_icc_profile_info_invoker);
-  gimp_object_set_static_name (GIMP_OBJECT (procedure),
-                               "plug-in-icc-profile-info");
-  gimp_procedure_set_static_strings (procedure,
-                                     "plug-in-icc-profile-info",
-                                     "Retrieve information about an image's color profile",
-                                     "This procedure returns information about the RGB color profile 
attached to an image. If no RGB color profile is attached, sRGB is assumed.",
-                                     "Sven Neumann <sven gimp org>",
-                                     "Sven Neumann",
-                                     "2015",
-                                     NULL);
-  gimp_procedure_add_argument (procedure,
-                               gimp_param_spec_image_id ("image",
-                                                         "image",
-                                                         "Input image",
-                                                         pdb->gimp, FALSE,
-                                                         GIMP_PARAM_READWRITE));
-  gimp_procedure_add_return_value (procedure,
-                                   gimp_param_spec_string ("profile-name",
-                                                           "profile name",
-                                                           "Name",
-                                                           FALSE, FALSE, FALSE,
-                                                           NULL,
-                                                           GIMP_PARAM_READWRITE));
-  gimp_procedure_add_return_value (procedure,
-                                   gimp_param_spec_string ("profile-desc",
-                                                           "profile desc",
-                                                           "Description",
-                                                           FALSE, FALSE, FALSE,
-                                                           NULL,
-                                                           GIMP_PARAM_READWRITE));
-  gimp_procedure_add_return_value (procedure,
-                                   gimp_param_spec_string ("profile-info",
-                                                           "profile info",
-                                                           "Info",
-                                                           FALSE, FALSE, FALSE,
-                                                           NULL,
-                                                           GIMP_PARAM_READWRITE));
-  gimp_pdb_register_procedure (pdb, procedure);
-  g_object_unref (procedure);
-
-  /*
-   * gimp-plug-in-icc-profile-file-info
-   */
-  procedure = gimp_procedure_new (plug_in_icc_profile_file_info_invoker);
-  gimp_object_set_static_name (GIMP_OBJECT (procedure),
-                               "plug-in-icc-profile-file-info");
-  gimp_procedure_set_static_strings (procedure,
-                                     "plug-in-icc-profile-file-info",
-                                     "Retrieve information about a color profile",
-                                     "This procedure returns information about an ICC color profile on 
disk.",
-                                     "Sven Neumann <sven gimp org>",
-                                     "Sven Neumann",
-                                     "2015",
-                                     NULL);
-  gimp_procedure_add_argument (procedure,
-                               gimp_param_spec_string ("profile",
-                                                       "profile",
-                                                       "Filename of an ICC color profile",
-                                                       TRUE, FALSE, FALSE,
-                                                       NULL,
-                                                       GIMP_PARAM_READWRITE));
-  gimp_procedure_add_return_value (procedure,
-                                   gimp_param_spec_string ("profile-name",
-                                                           "profile name",
-                                                           "Name",
-                                                           FALSE, FALSE, FALSE,
-                                                           NULL,
-                                                           GIMP_PARAM_READWRITE));
-  gimp_procedure_add_return_value (procedure,
-                                   gimp_param_spec_string ("profile-desc",
-                                                           "profile desc",
-                                                           "Description",
-                                                           FALSE, FALSE, FALSE,
-                                                           NULL,
-                                                           GIMP_PARAM_READWRITE));
-  gimp_procedure_add_return_value (procedure,
-                                   gimp_param_spec_string ("profile-info",
-                                                           "profile info",
-                                                           "Info",
-                                                           FALSE, FALSE, FALSE,
-                                                           NULL,
-                                                           GIMP_PARAM_READWRITE));
-  gimp_pdb_register_procedure (pdb, procedure);
-  g_object_unref (procedure);
-
-  /*
-   * gimp-plug-in-icc-profile-apply
-   */
-  procedure = gimp_procedure_new (plug_in_icc_profile_apply_invoker);
-  gimp_object_set_static_name (GIMP_OBJECT (procedure),
-                               "plug-in-icc-profile-apply");
-  gimp_procedure_set_static_strings (procedure,
-                                     "plug-in-icc-profile-apply",
-                                     "Apply a color profile on the image",
-                                     "This procedure transform from the image's color profile (or the 
default RGB profile if none is set) to the given ICC color profile. Only RGB color profiles are accepted. The 
profile is then set on the image using the 'icc-profile' \"parasite.",
-                                     "Sven Neumann <sven gimp org>",
-                                     "Sven Neumann",
-                                     "2015",
-                                     NULL);
-  gimp_procedure_add_argument (procedure,
-                               g_param_spec_enum ("run-mode",
-                                                  "run mode",
-                                                  "The run mode",
-                                                  GIMP_TYPE_RUN_MODE,
-                                                  GIMP_RUN_INTERACTIVE,
-                                                  GIMP_PARAM_READWRITE));
-  gimp_procedure_add_argument (procedure,
-                               gimp_param_spec_image_id ("image",
-                                                         "image",
-                                                         "Input image",
-                                                         pdb->gimp, FALSE,
-                                                         GIMP_PARAM_READWRITE));
-  gimp_procedure_add_argument (procedure,
-                               gimp_param_spec_string ("profile",
-                                                       "profile",
-                                                       "Filename of an ICC color profile",
-                                                       TRUE, FALSE, FALSE,
-                                                       NULL,
-                                                       GIMP_PARAM_READWRITE));
-  gimp_procedure_add_argument (procedure,
-                               g_param_spec_enum ("intent",
-                                                  "intent",
-                                                  "Rendering intent",
-                                                  GIMP_TYPE_COLOR_RENDERING_INTENT,
-                                                  GIMP_COLOR_RENDERING_INTENT_PERCEPTUAL,
-                                                  GIMP_PARAM_READWRITE));
-  gimp_procedure_add_argument (procedure,
-                               g_param_spec_boolean ("bpc",
-                                                     "bpc",
-                                                     "Black point compensation",
-                                                     FALSE,
-                                                     GIMP_PARAM_READWRITE));
-  gimp_pdb_register_procedure (pdb, procedure);
-  g_object_unref (procedure);
-
-  /*
-   * gimp-plug-in-icc-profile-apply-rgb
-   */
-  procedure = gimp_procedure_new (plug_in_icc_profile_apply_rgb_invoker);
-  gimp_object_set_static_name (GIMP_OBJECT (procedure),
-                               "plug-in-icc-profile-apply-rgb");
-  gimp_procedure_set_static_strings (procedure,
-                                     "plug-in-icc-profile-apply-rgb",
-                                     "Apply default RGB color profile on the image",
-                                     "This procedure transform from the image's color profile (or the 
default RGB profile if none is set) to the configured default RGB color profile. The profile is then set on 
the image using the 'icc-profile' parasite. If no RGB color profile is configured, sRGB is assumed and the 
parasite is unset.",
-                                     "Sven Neumann <sven gimp org>",
-                                     "Sven Neumann",
-                                     "2015",
-                                     NULL);
-  gimp_procedure_add_argument (procedure,
-                               g_param_spec_enum ("run-mode",
-                                                  "run mode",
-                                                  "The run mode",
-                                                  GIMP_TYPE_RUN_MODE,
-                                                  GIMP_RUN_INTERACTIVE,
-                                                  GIMP_PARAM_READWRITE));
-  gimp_procedure_add_argument (procedure,
-                               gimp_param_spec_image_id ("image",
-                                                         "image",
-                                                         "Input image",
-                                                         pdb->gimp, FALSE,
-                                                         GIMP_PARAM_READWRITE));
-  gimp_procedure_add_argument (procedure,
-                               g_param_spec_enum ("intent",
-                                                  "intent",
-                                                  "Rendering intent",
-                                                  GIMP_TYPE_COLOR_RENDERING_INTENT,
-                                                  GIMP_COLOR_RENDERING_INTENT_PERCEPTUAL,
-                                                  GIMP_PARAM_READWRITE));
-  gimp_procedure_add_argument (procedure,
-                               g_param_spec_boolean ("bpc",
-                                                     "bpc",
-                                                     "Black point compensation",
-                                                     FALSE,
-                                                     GIMP_PARAM_READWRITE));
-  gimp_pdb_register_procedure (pdb, procedure);
-  g_object_unref (procedure);
-
-  /*
-   * gimp-plug-in-icc-profile-set
-   */
-  procedure = gimp_procedure_new (plug_in_icc_profile_set_invoker);
-  gimp_object_set_static_name (GIMP_OBJECT (procedure),
-                               "plug-in-icc-profile-set");
-  gimp_procedure_set_static_strings (procedure,
-                                     "plug-in-icc-profile-set",
-                                     "Set a color profile on the image",
-                                     "This procedure sets the user-configured RGB profile on an image using 
the 'icc-profile' parasite. This procedure does not do any color conversion.",
-                                     "Sven Neumann <sven gimp org>",
-                                     "Sven Neumann",
-                                     "2015",
-                                     NULL);
-  gimp_procedure_add_argument (procedure,
-                               g_param_spec_enum ("run-mode",
-                                                  "run mode",
-                                                  "The run mode",
-                                                  GIMP_TYPE_RUN_MODE,
-                                                  GIMP_RUN_INTERACTIVE,
-                                                  GIMP_PARAM_READWRITE));
-  gimp_procedure_add_argument (procedure,
-                               gimp_param_spec_image_id ("image",
-                                                         "image",
-                                                         "Input image",
-                                                         pdb->gimp, FALSE,
-                                                         GIMP_PARAM_READWRITE));
-  gimp_procedure_add_argument (procedure,
-                               gimp_param_spec_string ("profile",
-                                                       "profile",
-                                                       "Filename of an ICC color profile",
-                                                       TRUE, FALSE, FALSE,
-                                                       NULL,
-                                                       GIMP_PARAM_READWRITE));
-  gimp_pdb_register_procedure (pdb, procedure);
-  g_object_unref (procedure);
-
-  /*
-   * gimp-plug-in-icc-profile-set-rgb
-   */
-  procedure = gimp_procedure_new (plug_in_icc_profile_set_rgb_invoker);
-  gimp_object_set_static_name (GIMP_OBJECT (procedure),
-                               "plug-in-icc-profile-set-rgb");
-  gimp_procedure_set_static_strings (procedure,
-                                     "plug-in-icc-profile-set-rgb",
-                                     "Set the default RGB color profile on the image",
-                                     "This procedure sets the user-configured RGB profile on an image using 
the 'icc-profile' parasite. If no RGB profile is configured, sRGB is assumed and the parasite is unset. This 
procedure does not do any color conversion.",
-                                     "Sven Neumann <sven gimp org>",
-                                     "Sven Neumann",
-                                     "2015",
-                                     NULL);
-  gimp_procedure_add_argument (procedure,
-                               g_param_spec_enum ("run-mode",
-                                                  "run mode",
-                                                  "The run mode",
-                                                  GIMP_TYPE_RUN_MODE,
-                                                  GIMP_RUN_INTERACTIVE,
-                                                  GIMP_PARAM_READWRITE));
-  gimp_procedure_add_argument (procedure,
-                               gimp_param_spec_image_id ("image",
-                                                         "image",
-                                                         "Input image",
-                                                         pdb->gimp, FALSE,
-                                                         GIMP_PARAM_READWRITE));
-  gimp_pdb_register_procedure (pdb, procedure);
-  g_object_unref (procedure);
-
-  /*
    * gimp-plug-in-illusion
    */
   procedure = gimp_procedure_new (plug_in_illusion_invoker);
diff --git a/pdb/groups/plug_in_compat.pdb b/pdb/groups/plug_in_compat.pdb
index b5c0b4f..fb7102c 100644
--- a/pdb/groups/plug_in_compat.pdb
+++ b/pdb/groups/plug_in_compat.pdb
@@ -1751,378 +1751,6 @@ CODE
     );
 }
 
-sub plug_in_icc_profile_info {
-    $blurb = "Retrieve information about an image's color profile";
-
-    $help = <<'HELP';
-This procedure returns information about the RGB color profile
-attached to an image. If no RGB color profile is attached, sRGB is
-assumed.
-HELP
-
-    &neo_pdb_misc;
-    $date = '2015';
-
-    @inargs = (
-        { name => 'image', type => 'image',
-          desc => 'Input image' }
-    );
-
-    @outargs = (
-        { name => 'profile_name', type => 'string',
-          desc => 'Name' },
-        { name => 'profile_desc', type => 'string',
-          desc => 'Description' },
-        { name => 'profile_info', type => 'string',
-          desc => 'Info' }
-    );
-
-    %invoke = (
-        code => <<'CODE'
-{
-  GimpColorProfile *profile;
-
-  profile = gimp_color_managed_get_color_profile (GIMP_COLOR_MANAGED (image));
-
-  if (profile)
-    {
-      profile_name = g_strdup (gimp_color_profile_get_model (profile));
-      profile_desc = g_strdup (gimp_color_profile_get_description (profile));
-      profile_info = g_strdup (gimp_color_profile_get_summary (profile));
-    }
-}
-CODE
-    );
-}
-
-sub plug_in_icc_profile_file_info {
-    $blurb = "Retrieve information about a color profile";
-
-    $help = <<'HELP';
-This procedure returns information about an ICC color profile on disk.
-HELP
-
-    &neo_pdb_misc;
-    $date = '2015';
-
-    @inargs = (
-        { name => 'profile', type => 'string',
-          desc => 'Filename of an ICC color profile', allow_non_utf8 => 1 }
-    );
-
-    @outargs = (
-        { name => 'profile_name', type => 'string',
-          desc => 'Name' },
-        { name => 'profile_desc', type => 'string',
-          desc => 'Description' },
-        { name => 'profile_info', type => 'string',
-          desc => 'Info' }
-    );
-
-    %invoke = (
-        code => <<'CODE'
-{
-  GFile *file = g_file_new_for_path (profile);
-
-  if (file)
-    {
-      GimpColorProfile *p;
-
-      p = gimp_color_profile_new_from_file (file, error);
-      g_object_unref (file);
-
-      if (p)
-        {
-          profile_name = g_strdup (gimp_color_profile_get_model (p));
-          profile_desc = g_strdup (gimp_color_profile_get_description (p));
-          profile_info = g_strdup (gimp_color_profile_get_summary (p));
-
-          g_object_unref (p);
-        }
-      else
-        success = FALSE;
-    }
-  else
-    success = FALSE;
-}
-CODE
-    );
-}
-
-sub plug_in_icc_profile_apply {
-    $blurb = "Apply a color profile on the image";
-
-    $help = <<'HELP';
-This procedure transform from the image's color profile (or the
-default RGB profile if none is set) to the given ICC color
-profile. Only RGB color profiles are accepted. The profile is then set
-on the image using the 'icc-profile' "parasite.
-HELP
-
-    &neo_pdb_misc;
-    $date = '2015';
-
-    @inargs = (
-       { name => 'run_mode', type => 'enum GimpRunMode', dead => 1,
-         desc => 'The run mode' },
-        { name => 'image', type => 'image',
-          desc => 'Input image' },
-        { name => 'profile', type => 'string',
-          desc => 'Filename of an ICC color profile', allow_non_utf8 => 1 },
-        { name => 'intent', type => 'enum GimpColorRenderingIntent',
-          desc => 'Rendering intent' },
-        { name => 'bpc', type => 'boolean',
-          desc => 'Black point compensation' }
-    );
-
-    %invoke = (
-        code => <<'CODE'
-{
-  if (gimp_pdb_image_is_not_base_type (image, GIMP_GRAY, error))
-    {
-      GimpColorProfile *p = NULL;
-
-      if (profile)
-        {
-          GFile *file = g_file_new_for_path (profile);
-
-          if (file)
-            {
-              p = gimp_color_profile_new_from_file (file, error);
-
-              if (! p)
-                success = FALSE;
-
-              g_object_unref (file);
-           }
-          else
-            {
-              success = FALSE;
-            }
-        }
-      else if (image->gimp->config->color_management->rgb_profile)
-        {
-          p = gimp_color_config_get_rgb_color_profile (image->gimp->config->color_management,
-                                                       error);
-
-          if (! p)
-            success = FALSE;
-        }
-
-      if (success)
-        {
-          if (! p)
-            p = gimp_image_get_builtin_color_profile (image);
-
-          success = gimp_image_convert_color_profile (image, p, intent, bpc,
-                                                      progress, error);
-       }
-    }
-  else
-    success = FALSE;
-}
-CODE
-    );
-}
-
-sub plug_in_icc_profile_apply_rgb {
-    $blurb = "Apply default RGB color profile on the image";
-
-    $help = <<'HELP';
-This procedure transform from the image's color profile (or the
-default RGB profile if none is set) to the configured default RGB
-color profile.  The profile is then set on the image using the
-'icc-profile' parasite.  If no RGB color profile is configured, sRGB
-is assumed and the parasite is unset.
-HELP
-
-    &neo_pdb_misc;
-    $date = '2015';
-
-    @inargs = (
-       { name => 'run_mode', type => 'enum GimpRunMode', dead => 1,
-         desc => 'The run mode' },
-        { name => 'image', type => 'image',
-          desc => 'Input image' },
-        { name => 'intent', type => 'enum GimpColorRenderingIntent',
-          desc => 'Rendering intent' },
-        { name => 'bpc', type => 'boolean',
-          desc => 'Black point compensation' }
-    );
-
-    %invoke = (
-        code => <<'CODE'
-{
-  if (gimp_pdb_image_is_not_base_type (image, GIMP_GRAY, error))
-    {
-      GimpColorProfile *p = NULL;
-
-      if (image->gimp->config->color_management->rgb_profile)
-        {
-          p = gimp_color_config_get_rgb_color_profile (image->gimp->config->color_management,
-                                                       error);
-
-          if (! p)
-            success = FALSE;
-        }
-
-      if (success)
-        {
-          if (! p)
-            p = gimp_image_get_builtin_color_profile (image);
-
-          success = gimp_image_convert_color_profile (image, p, intent, bpc,
-                                                      progress, error);
-       }
-    }
-  else
-    success = FALSE;
-}
-CODE
-    );
-}
-
-sub plug_in_icc_profile_set {
-    $blurb = "Set a color profile on the image";
-
-    $help = <<'HELP';
-This procedure sets the user-configured RGB profile on an image using
-the 'icc-profile' parasite. This procedure does not do any color
-conversion.
-HELP
-
-    &neo_pdb_misc;
-    $date = '2015';
-
-    @inargs = (
-       { name => 'run_mode', type => 'enum GimpRunMode', dead => 1,
-         desc => 'The run mode' },
-        { name => 'image', type => 'image',
-          desc => 'Input image' },
-        { name => 'profile', type => 'string',
-          desc => 'Filename of an ICC color profile', allow_non_utf8 => 1 }
-    );
-
-    %invoke = (
-        code => <<'CODE'
-{
-  if (gimp_pdb_image_is_not_base_type (image, GIMP_GRAY, error))
-    {
-      GimpColorProfile *p = NULL;
-
-      if (profile)
-        {
-          GFile *file = g_file_new_for_path (profile);
-
-          if (file)
-            {
-              p = gimp_color_profile_new_from_file (file, error);
-
-              if (! p)
-                success = FALSE;
-
-              g_object_unref (file);
-           }
-          else
-            success = FALSE;
-        }
-      else if (image->gimp->config->color_management->rgb_profile)
-        {
-          p = gimp_color_config_get_rgb_color_profile (image->gimp->config->color_management,
-                                                       error);
-
-          if (! p)
-            success = FALSE;
-        }
-
-      if (success)
-        {
-          gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_MISC,
-                                       _("Set color profile"));
-
-          if (gimp_image_set_color_profile (image, p, error))
-            gimp_image_parasite_detach (image, "icc-profile-name");
-          else
-            success = FALSE;
-
-          gimp_image_undo_group_end (image);
-
-          if (! success)
-           gimp_image_undo (image);
-
-          if (p)
-            g_object_unref (p);
-       }
-    }
-  else
-    success = FALSE;
-}
-CODE
-    );
-}
-
-sub plug_in_icc_profile_set_rgb {
-    $blurb = "Set the default RGB color profile on the image";
-
-    $help = <<'HELP';
-This procedure sets the user-configured RGB profile on an image using
-the 'icc-profile' parasite. If no RGB profile is configured, sRGB is
-assumed and the parasite is unset. This procedure does not do any
-color conversion.
-HELP
-
-    &neo_pdb_misc;
-    $date = '2015';
-
-    @inargs = (
-       { name => 'run_mode', type => 'enum GimpRunMode', dead => 1,
-         desc => 'The run mode' },
-        { name => 'image', type => 'image',
-          desc => 'Input image' }
-    );
-
-    %invoke = (
-        code => <<'CODE'
-{
-  if (gimp_pdb_image_is_not_base_type (image, GIMP_GRAY, error))
-    {
-      GimpColorProfile *p = NULL;
-
-      if (image->gimp->config->color_management->rgb_profile)
-        {
-          p = gimp_color_config_get_rgb_color_profile (image->gimp->config->color_management,
-                                                       error);
-
-          if (! p)
-            success = FALSE;
-        }
-
-      if (success)
-        {
-          gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_MISC,
-                                       _("Set color profile"));
-
-          if (gimp_image_set_color_profile (image, p, error))
-            gimp_image_parasite_detach (image, "icc-profile-name");
-          else
-            success = FALSE;
-
-          gimp_image_undo_group_end (image);
-
-          if (! success)
-           gimp_image_undo (image);
-
-          if (p)
-            g_object_unref (p);
-       }
-    }
-  else
-    success = FALSE;
-}
-CODE
-    );
-}
-
 sub plug_in_illusion {
     $blurb = 'Superimpose many altered copies of the image';
 
@@ -4952,7 +4580,6 @@ CODE
               "core/gimpchannel.h"
               "core/gimpcontext.h"
               "core/gimpdrawable-operation.h"
-              "core/gimpimage-color-profile.h"
               "core/gimpimage-crop.h"
               "core/gimpimage-resize.h"
               "core/gimpimage-rotate.h"
@@ -4992,12 +4619,6 @@ CODE
             plug_in_gauss_rle2
             plug_in_glasstile
             plug_in_hsv_noise
-            plug_in_icc_profile_info
-            plug_in_icc_profile_file_info
-            plug_in_icc_profile_apply
-            plug_in_icc_profile_apply_rgb
-            plug_in_icc_profile_set
-            plug_in_icc_profile_set_rgb
             plug_in_illusion
             plug_in_laplace
             plug_in_lens_distortion



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