[gimp] libgimpcolor: rename RGB and GRAY gimp_color_profile_new_*() functions



commit a33daf99fe87eb991481f410e1b9d3d60475ee1f
Author: Michael Natterer <mitch gimp org>
Date:   Tue Dec 15 20:42:21 2015 +0100

    libgimpcolor: rename RGB and GRAY gimp_color_profile_new_*()  functions
    
    to be more consistent, as discussed in bug #756389.

 app/core/gimpbuffer.c              |    2 +-
 app/core/gimpimage-color-profile.c |   10 ++++----
 app/core/gimplayer-new.c           |    2 +-
 app/gegl/gimp-gegl-loops.c         |   28 ++++++++++++------------
 libgimp/gimpimagemetadata.c        |    2 +-
 libgimpcolor/gimpcolorprofile.c    |   40 ++++++++++++++++++------------------
 libgimpcolor/gimpcolorprofile.h    |   10 ++++----
 libgimpwidgets/gimpwidgetsutils.c  |    2 +-
 plug-ins/file-jpeg/jpeg-load.c     |    2 +-
 9 files changed, 49 insertions(+), 49 deletions(-)
---
diff --git a/app/core/gimpbuffer.c b/app/core/gimpbuffer.c
index d787fa1..787437b 100644
--- a/app/core/gimpbuffer.c
+++ b/app/core/gimpbuffer.c
@@ -293,7 +293,7 @@ gimp_buffer_new_from_pixbuf (GdkPixbuf   *pixbuf,
 
   if (! profile && gdk_pixbuf_get_colorspace (pixbuf) == GDK_COLORSPACE_RGB)
     {
-      profile = gimp_color_profile_new_srgb ();
+      profile = gimp_color_profile_new_rgb_srgb ();
     }
 
   if (profile)
diff --git a/app/core/gimpimage-color-profile.c b/app/core/gimpimage-color-profile.c
index c325e0f..587d072 100644
--- a/app/core/gimpimage-color-profile.c
+++ b/app/core/gimpimage-color-profile.c
@@ -323,7 +323,7 @@ gimp_image_get_builtin_color_profile (GimpImage *image)
         {
           if (! linear_gray_profile)
             {
-              linear_gray_profile = gimp_color_profile_new_linear_gray ();
+              linear_gray_profile = gimp_color_profile_new_gray_srgb_linear ();
               g_object_add_weak_pointer (G_OBJECT (linear_gray_profile),
                                          (gpointer) &linear_gray_profile);
             }
@@ -334,7 +334,7 @@ gimp_image_get_builtin_color_profile (GimpImage *image)
         {
           if (! gray_profile)
             {
-              gray_profile = gimp_color_profile_new_srgb_gray ();
+              gray_profile = gimp_color_profile_new_gray_srgb ();
               g_object_add_weak_pointer (G_OBJECT (gray_profile),
                                          (gpointer) &gray_profile);
             }
@@ -348,7 +348,7 @@ gimp_image_get_builtin_color_profile (GimpImage *image)
         {
           if (! linear_rgb_profile)
             {
-              linear_rgb_profile = gimp_color_profile_new_linear_rgb ();
+              linear_rgb_profile = gimp_color_profile_new_rgb_srgb_linear ();
               g_object_add_weak_pointer (G_OBJECT (linear_rgb_profile),
                                          (gpointer) &linear_rgb_profile);
             }
@@ -359,7 +359,7 @@ gimp_image_get_builtin_color_profile (GimpImage *image)
         {
           if (! srgb_profile)
             {
-              srgb_profile = gimp_color_profile_new_srgb ();
+              srgb_profile = gimp_color_profile_new_rgb_srgb ();
               g_object_add_weak_pointer (G_OBJECT (srgb_profile),
                                          (gpointer) &srgb_profile);
             }
@@ -696,7 +696,7 @@ _gimp_image_update_color_profile (GimpImage          *image,
           cmsUInt32Number   srgb_lcms_format;
           cmsUInt32Number   flags;
 
-          srgb_profile = gimp_color_profile_new_srgb ();
+          srgb_profile = gimp_color_profile_new_rgb_srgb ();
 
           image_lcms = gimp_color_profile_get_lcms_profile (private->color_profile);
           srgb_lcms  = gimp_color_profile_get_lcms_profile (srgb_profile);
diff --git a/app/core/gimplayer-new.c b/app/core/gimplayer-new.c
index 6a9b838..4148c8b 100644
--- a/app/core/gimplayer-new.c
+++ b/app/core/gimplayer-new.c
@@ -206,7 +206,7 @@ gimp_layer_new_from_pixbuf (GdkPixbuf            *pixbuf,
 
   if (! profile && gdk_pixbuf_get_colorspace (pixbuf) == GDK_COLORSPACE_RGB)
     {
-      profile = gimp_color_profile_new_srgb ();
+      profile = gimp_color_profile_new_rgb_srgb ();
     }
 
   gimp_layer_new_convert_buffer (layer, buffer, profile, NULL);
diff --git a/app/gegl/gimp-gegl-loops.c b/app/gegl/gimp-gegl-loops.c
index f319bd0..22c38f3 100644
--- a/app/gegl/gimp-gegl-loops.c
+++ b/app/gegl/gimp-gegl-loops.c
@@ -668,30 +668,30 @@ gimp_color_profile_can_gegl_copy (GimpColorProfile *src_profile,
                                   GimpColorProfile *dest_profile)
 {
   static GimpColorProfile *srgb_profile        = NULL;
-  static GimpColorProfile *linear_rgb_profile  = NULL;
+  static GimpColorProfile *srgb_linear_profile = NULL;
   static GimpColorProfile *gray_profile        = NULL;
-  static GimpColorProfile *linear_gray_profile = NULL;
+  static GimpColorProfile *gray_linear_profile = NULL;
 
   if (gimp_color_profile_is_equal (src_profile, dest_profile))
     return TRUE;
 
   if (! srgb_profile)
     {
-      srgb_profile        = gimp_color_profile_new_srgb ();
-      linear_rgb_profile  = gimp_color_profile_new_linear_rgb ();
-      gray_profile        = gimp_color_profile_new_srgb_gray ();
-      linear_gray_profile = gimp_color_profile_new_linear_gray ();
+      srgb_profile        = gimp_color_profile_new_rgb_srgb ();
+      srgb_linear_profile = gimp_color_profile_new_rgb_srgb_linear ();
+      gray_profile        = gimp_color_profile_new_gray_srgb ();
+      gray_linear_profile = gimp_color_profile_new_gray_srgb_linear ();
     }
 
-  if ((gimp_color_profile_is_equal (src_profile, srgb_profile)       ||
-       gimp_color_profile_is_equal (src_profile, linear_rgb_profile) ||
-       gimp_color_profile_is_equal (src_profile, gray_profile)       ||
-       gimp_color_profile_is_equal (src_profile, linear_gray_profile))
+  if ((gimp_color_profile_is_equal (src_profile, srgb_profile)        ||
+       gimp_color_profile_is_equal (src_profile, srgb_linear_profile) ||
+       gimp_color_profile_is_equal (src_profile, gray_profile)        ||
+       gimp_color_profile_is_equal (src_profile, gray_linear_profile))
       &&
-      (gimp_color_profile_is_equal (dest_profile, srgb_profile)       ||
-       gimp_color_profile_is_equal (dest_profile, linear_rgb_profile) ||
-       gimp_color_profile_is_equal (dest_profile, gray_profile)       ||
-       gimp_color_profile_is_equal (dest_profile, linear_gray_profile)))
+      (gimp_color_profile_is_equal (dest_profile, srgb_profile)        ||
+       gimp_color_profile_is_equal (dest_profile, srgb_linear_profile) ||
+       gimp_color_profile_is_equal (dest_profile, gray_profile)        ||
+       gimp_color_profile_is_equal (dest_profile, gray_linear_profile)))
     return TRUE;
 
   return FALSE;
diff --git a/libgimp/gimpimagemetadata.c b/libgimp/gimpimagemetadata.c
index a65dffc..5591403 100644
--- a/libgimp/gimpimagemetadata.c
+++ b/libgimp/gimpimagemetadata.c
@@ -197,7 +197,7 @@ gimp_image_metadata_load_finish (gint32                 image_ID,
               break;
 
             case GIMP_METADATA_COLORSPACE_ADOBERGB:
-              profile = gimp_color_profile_new_adobe_rgb ();
+              profile = gimp_color_profile_new_rgb_adobe ();
               break;
             }
 
diff --git a/libgimpcolor/gimpcolorprofile.c b/libgimpcolor/gimpcolorprofile.c
index 93c08cc..8b8ca44 100644
--- a/libgimpcolor/gimpcolorprofile.c
+++ b/libgimpcolor/gimpcolorprofile.c
@@ -961,7 +961,7 @@ gimp_color_profile_new_linear_gamma_from_color_profile (GimpColorProfile *profil
 }
 
 static cmsHPROFILE *
-gimp_color_profile_new_srgb_internal (void)
+gimp_color_profile_new_rgb_srgb_internal (void)
 {
   cmsHPROFILE profile;
 
@@ -1018,7 +1018,7 @@ gimp_color_profile_new_srgb_internal (void)
 }
 
 /**
- * gimp_color_profile_new_srgb:
+ * gimp_color_profile_new_rgb_srgb:
  *
  * This function is a replacement for cmsCreate_sRGBProfile() and
  * returns an sRGB profile that is functionally the same as the
@@ -1049,7 +1049,7 @@ gimp_color_profile_new_srgb_internal (void)
  * Since: 2.10
  **/
 GimpColorProfile *
-gimp_color_profile_new_srgb (void)
+gimp_color_profile_new_rgb_srgb (void)
 {
   static GimpColorProfile *profile = NULL;
 
@@ -1058,7 +1058,7 @@ gimp_color_profile_new_srgb (void)
 
   if (G_UNLIKELY (profile == NULL))
     {
-      cmsHPROFILE lcms_profile = gimp_color_profile_new_srgb_internal ();
+      cmsHPROFILE lcms_profile = gimp_color_profile_new_rgb_srgb_internal ();
 
       profile = gimp_color_profile_new_from_lcms_profile (lcms_profile, NULL);
 
@@ -1071,7 +1071,7 @@ gimp_color_profile_new_srgb (void)
 }
 
 static cmsHPROFILE
-gimp_color_profile_new_linear_rgb_internal (void)
+gimp_color_profile_new_rgb_srgb_linear_internal (void)
 {
   cmsHPROFILE profile;
 
@@ -1114,7 +1114,7 @@ gimp_color_profile_new_linear_rgb_internal (void)
 }
 
 /**
- * gimp_color_profile_new_linear_rgb:
+ * gimp_color_profile_new_rgb_srgb_linear:
  *
  * This function creates a profile for babl_model("RGB"). Please
  * somebody write someting smarter here.
@@ -1124,7 +1124,7 @@ gimp_color_profile_new_linear_rgb_internal (void)
  * Since: 2.10
  **/
 GimpColorProfile *
-gimp_color_profile_new_linear_rgb (void)
+gimp_color_profile_new_rgb_srgb_linear (void)
 {
   static GimpColorProfile *profile = NULL;
 
@@ -1133,7 +1133,7 @@ gimp_color_profile_new_linear_rgb (void)
 
   if (G_UNLIKELY (profile == NULL))
     {
-      cmsHPROFILE lcms_profile = gimp_color_profile_new_linear_rgb_internal ();
+      cmsHPROFILE lcms_profile = gimp_color_profile_new_rgb_srgb_linear_internal ();
 
       profile = gimp_color_profile_new_from_lcms_profile (lcms_profile, NULL);
 
@@ -1146,7 +1146,7 @@ gimp_color_profile_new_linear_rgb (void)
 }
 
 static cmsHPROFILE *
-gimp_color_profile_new_adobe_rgb_internal (void)
+gimp_color_profile_new_rgb_adobe_internal (void)
 {
   cmsHPROFILE profile;
 
@@ -1194,7 +1194,7 @@ gimp_color_profile_new_adobe_rgb_internal (void)
 }
 
 /**
- * gimp_color_profile_new_adobe_rgb:
+ * gimp_color_profile_new_rgb_adobe:
  *
  * This function creates a profile compatible with AbobeRGB (1998).
  *
@@ -1203,7 +1203,7 @@ gimp_color_profile_new_adobe_rgb_internal (void)
  * Since: 2.10
  **/
 GimpColorProfile *
-gimp_color_profile_new_adobe_rgb (void)
+gimp_color_profile_new_rgb_adobe (void)
 {
   static GimpColorProfile *profile = NULL;
 
@@ -1212,7 +1212,7 @@ gimp_color_profile_new_adobe_rgb (void)
 
   if (G_UNLIKELY (profile == NULL))
     {
-      cmsHPROFILE lcms_profile = gimp_color_profile_new_adobe_rgb_internal ();
+      cmsHPROFILE lcms_profile = gimp_color_profile_new_rgb_adobe_internal ();
 
       profile = gimp_color_profile_new_from_lcms_profile (lcms_profile, NULL);
 
@@ -1225,7 +1225,7 @@ gimp_color_profile_new_adobe_rgb (void)
 }
 
 static cmsHPROFILE *
-gimp_color_profile_new_srgb_gray_internal (void)
+gimp_color_profile_new_gray_srgb_internal (void)
 {
   cmsHPROFILE profile;
 
@@ -1255,7 +1255,7 @@ gimp_color_profile_new_srgb_gray_internal (void)
 }
 
 /**
- * gimp_color_profile_new_srgb_gray
+ * gimp_color_profile_new_gray_srgb
  *
  * This function creates a grayscale #GimpColorProfile with an
  * sRGB TRC. See gimp_color_profile_new_srgb().
@@ -1265,7 +1265,7 @@ gimp_color_profile_new_srgb_gray_internal (void)
  * Since: 2.10
  **/
 GimpColorProfile *
-gimp_color_profile_new_srgb_gray (void)
+gimp_color_profile_new_gray_srgb (void)
 {
   static GimpColorProfile *profile = NULL;
 
@@ -1274,7 +1274,7 @@ gimp_color_profile_new_srgb_gray (void)
 
   if (G_UNLIKELY (profile == NULL))
     {
-      cmsHPROFILE lcms_profile = gimp_color_profile_new_srgb_gray_internal ();
+      cmsHPROFILE lcms_profile = gimp_color_profile_new_gray_srgb_internal ();
 
       profile = gimp_color_profile_new_from_lcms_profile (lcms_profile, NULL);
 
@@ -1287,7 +1287,7 @@ gimp_color_profile_new_srgb_gray (void)
 }
 
 static cmsHPROFILE
-gimp_color_profile_new_linear_gray_internal (void)
+gimp_color_profile_new_gray_srgb_linear_internal (void)
 {
   cmsHPROFILE profile;
 
@@ -1313,7 +1313,7 @@ gimp_color_profile_new_linear_gray_internal (void)
 }
 
 /**
- * gimp_color_profile_new_linear_gray:
+ * gimp_color_profile_new_gray_srgb_linear_gray:
  *
  * This function creates a profile for babl_model("Y"). Please
  * somebody write someting smarter here.
@@ -1323,7 +1323,7 @@ gimp_color_profile_new_linear_gray_internal (void)
  * Since: 2.10
  **/
 GimpColorProfile *
-gimp_color_profile_new_linear_gray (void)
+gimp_color_profile_new_gray_srgb_linear (void)
 {
   static GimpColorProfile *profile = NULL;
 
@@ -1332,7 +1332,7 @@ gimp_color_profile_new_linear_gray (void)
 
   if (G_UNLIKELY (profile == NULL))
     {
-      cmsHPROFILE lcms_profile = gimp_color_profile_new_linear_gray_internal ();
+      cmsHPROFILE lcms_profile = gimp_color_profile_new_gray_srgb_linear_internal ();
 
       profile = gimp_color_profile_new_from_lcms_profile (lcms_profile, NULL);
 
diff --git a/libgimpcolor/gimpcolorprofile.h b/libgimpcolor/gimpcolorprofile.h
index e9767a6..2c2e6a0 100644
--- a/libgimpcolor/gimpcolorprofile.h
+++ b/libgimpcolor/gimpcolorprofile.h
@@ -64,12 +64,12 @@ struct _GimpColorProfileClass
 
 GType              gimp_color_profile_get_type              (void) G_GNUC_CONST;
 
-GimpColorProfile * gimp_color_profile_new_srgb              (void);
-GimpColorProfile * gimp_color_profile_new_linear_rgb        (void);
-GimpColorProfile * gimp_color_profile_new_adobe_rgb         (void);
+GimpColorProfile * gimp_color_profile_new_rgb_srgb          (void);
+GimpColorProfile * gimp_color_profile_new_rgb_srgb_linear   (void);
+GimpColorProfile * gimp_color_profile_new_rgb_adobe         (void);
 
-GimpColorProfile * gimp_color_profile_new_srgb_gray         (void);
-GimpColorProfile * gimp_color_profile_new_linear_gray       (void);
+GimpColorProfile * gimp_color_profile_new_gray_srgb         (void);
+GimpColorProfile * gimp_color_profile_new_gray_srgb_linear  (void);
 
 GimpColorProfile *
      gimp_color_profile_new_srgb_gamma_from_color_profile   (GimpColorProfile  *profile);
diff --git a/libgimpwidgets/gimpwidgetsutils.c b/libgimpwidgets/gimpwidgetsutils.c
index 457ac0b..690b06f 100644
--- a/libgimpwidgets/gimpwidgetsutils.c
+++ b/libgimpwidgets/gimpwidgetsutils.c
@@ -473,7 +473,7 @@ get_display_profile (GtkWidget       *widget,
     profile = gimp_color_config_get_display_color_profile (config, NULL);
 
   if (! profile)
-    profile = gimp_color_profile_new_srgb ();
+    profile = gimp_color_profile_new_rgb_srgb ();
 
   return profile;
 }
diff --git a/plug-ins/file-jpeg/jpeg-load.c b/plug-ins/file-jpeg/jpeg-load.c
index d8ec8a0..6cc945f 100644
--- a/plug-ins/file-jpeg/jpeg-load.c
+++ b/plug-ins/file-jpeg/jpeg-load.c
@@ -631,7 +631,7 @@ jpeg_load_cmyk_transform (guint8 *profile_data,
     }
 
   /*  always convert to sRGB  */
-  rgb_profile = gimp_color_profile_new_srgb ();
+  rgb_profile = gimp_color_profile_new_rgb_srgb ();
 
   cmyk_lcms = gimp_color_profile_get_lcms_profile (cmyk_profile);
   rgb_lcms  = gimp_color_profile_get_lcms_profile (rgb_profile);


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