Bug 756389 - Color-managing grayscale images

Rename profile constructors to say "d65_gray" instead of just "gray",
"srgb_trc" instead of "srgb_gamma", and drop the "srgb" from
"srgb_linear" because we now say "d65". This should be a naming scheme
that doesn't conflict with whatever future functions we might add.
This commit is contained in:
Michael Natterer 2016-04-09 18:47:51 +02:00
parent 6ba19a5d46
commit f34aa5fa6b
7 changed files with 31 additions and 29 deletions

View File

@ -323,7 +323,7 @@ gimp_image_get_builtin_color_profile (GimpImage *image)
{
if (! linear_gray_profile)
{
linear_gray_profile = gimp_color_profile_new_gray_srgb_linear ();
linear_gray_profile = gimp_color_profile_new_d65_gray_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_gray_srgb ();
gray_profile = gimp_color_profile_new_d65_gray_srgb_trc ();
g_object_add_weak_pointer (G_OBJECT (gray_profile),
(gpointer) &gray_profile);
}

View File

@ -173,12 +173,12 @@ gimp_image_convert_precision (GimpImage *image,
if (gimp_babl_format_get_linear (new_format))
{
new_profile =
gimp_color_profile_new_linear_gamma_from_color_profile (old_profile);
gimp_color_profile_new_linear_from_color_profile (old_profile);
}
else
{
new_profile =
gimp_color_profile_new_srgb_gamma_from_color_profile (old_profile);
gimp_color_profile_new_srgb_trc_from_color_profile (old_profile);
}
gimp_image_set_color_profile (image, new_profile, NULL);

View File

@ -1138,12 +1138,12 @@ gimp_layer_convert_type (GimpDrawable *drawable,
if (gimp_babl_format_get_linear (new_format))
{
dest_profile =
gimp_color_profile_new_linear_gamma_from_color_profile (src_profile);
gimp_color_profile_new_linear_from_color_profile (src_profile);
}
else
{
dest_profile =
gimp_color_profile_new_srgb_gamma_from_color_profile (src_profile);
gimp_color_profile_new_srgb_trc_from_color_profile (src_profile);
}
/* if a new profile cannot be be generated, convert to

View File

@ -679,8 +679,8 @@ gimp_color_profile_can_gegl_copy (GimpColorProfile *src_profile,
{
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 ();
gray_profile = gimp_color_profile_new_d65_gray_srgb_trc ();
gray_linear_profile = gimp_color_profile_new_d65_gray_linear ();
}
if ((gimp_color_profile_is_equal (src_profile, srgb_profile) ||
@ -692,7 +692,9 @@ gimp_color_profile_can_gegl_copy (GimpColorProfile *src_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 TRUE;
}
return FALSE;
}

View File

@ -40,16 +40,16 @@ EXPORTS
gimp_color_profile_is_gray
gimp_color_profile_is_linear
gimp_color_profile_is_rgb
gimp_color_profile_new_d65_gray_linear
gimp_color_profile_new_d65_gray_srgb_trc
gimp_color_profile_new_from_file
gimp_color_profile_new_from_icc_profile
gimp_color_profile_new_from_lcms_profile
gimp_color_profile_new_gray_srgb
gimp_color_profile_new_gray_srgb_linear
gimp_color_profile_new_linear_gamma_from_color_profile
gimp_color_profile_new_linear_from_color_profile
gimp_color_profile_new_rgb_adobe
gimp_color_profile_new_rgb_srgb
gimp_color_profile_new_rgb_srgb_linear
gimp_color_profile_new_srgb_gamma_from_color_profile
gimp_color_profile_new_srgb_trc_from_color_profile
gimp_hsl_get_type
gimp_hsl_set
gimp_hsl_set_alpha

View File

@ -921,7 +921,7 @@ gimp_color_profile_new_from_color_profile (GimpColorProfile *profile,
}
/**
* gimp_color_profile_new_srgb_gamma_from_color_profile:
* gimp_color_profile_new_srgb_trc_from_color_profile:
* @profile: a #GimpColorProfile
*
* This function creates a new RGB #GimpColorProfile with a sRGB gamma
@ -933,7 +933,7 @@ gimp_color_profile_new_from_color_profile (GimpColorProfile *profile,
* Since: 2.10
**/
GimpColorProfile *
gimp_color_profile_new_srgb_gamma_from_color_profile (GimpColorProfile *profile)
gimp_color_profile_new_srgb_trc_from_color_profile (GimpColorProfile *profile)
{
g_return_val_if_fail (GIMP_IS_COLOR_PROFILE (profile), NULL);
@ -941,7 +941,7 @@ gimp_color_profile_new_srgb_gamma_from_color_profile (GimpColorProfile *profile)
}
/**
* gimp_color_profile_new_linear_gamma_from_color_profile:
* gimp_color_profile_new_linear_from_color_profile:
* @profile: a #GimpColorProfile
*
* This function creates a new RGB #GimpColorProfile with a linear TRC
@ -953,7 +953,7 @@ gimp_color_profile_new_srgb_gamma_from_color_profile (GimpColorProfile *profile)
* Since: 2.10
**/
GimpColorProfile *
gimp_color_profile_new_linear_gamma_from_color_profile (GimpColorProfile *profile)
gimp_color_profile_new_linear_from_color_profile (GimpColorProfile *profile)
{
g_return_val_if_fail (GIMP_IS_COLOR_PROFILE (profile), NULL);
@ -1225,7 +1225,7 @@ gimp_color_profile_new_rgb_adobe (void)
}
static cmsHPROFILE *
gimp_color_profile_new_gray_srgb_internal (void)
gimp_color_profile_new_d65_gray_srgb_trc_internal (void)
{
cmsHPROFILE profile;
@ -1255,7 +1255,7 @@ gimp_color_profile_new_gray_srgb_internal (void)
}
/**
* gimp_color_profile_new_gray_srgb
* gimp_color_profile_new_d65_gray_srgb_trc
*
* This function creates a grayscale #GimpColorProfile with an
* sRGB TRC. See gimp_color_profile_new_srgb().
@ -1265,7 +1265,7 @@ gimp_color_profile_new_gray_srgb_internal (void)
* Since: 2.10
**/
GimpColorProfile *
gimp_color_profile_new_gray_srgb (void)
gimp_color_profile_new_d65_gray_srgb_trc (void)
{
static GimpColorProfile *profile = NULL;
@ -1274,7 +1274,7 @@ gimp_color_profile_new_gray_srgb (void)
if (G_UNLIKELY (profile == NULL))
{
cmsHPROFILE lcms_profile = gimp_color_profile_new_gray_srgb_internal ();
cmsHPROFILE lcms_profile = gimp_color_profile_new_d65_gray_srgb_trc_internal ();
profile = gimp_color_profile_new_from_lcms_profile (lcms_profile, NULL);
@ -1287,7 +1287,7 @@ gimp_color_profile_new_gray_srgb (void)
}
static cmsHPROFILE
gimp_color_profile_new_gray_srgb_linear_internal (void)
gimp_color_profile_new_d65_gray_linear_internal (void)
{
cmsHPROFILE profile;
@ -1313,7 +1313,7 @@ gimp_color_profile_new_gray_srgb_linear_internal (void)
}
/**
* gimp_color_profile_new_gray_srgb_linear_gray:
* gimp_color_profile_new_d65_gray_srgb_gray:
*
* This function creates a profile for babl_model("Y"). Please
* somebody write someting smarter here.
@ -1323,7 +1323,7 @@ gimp_color_profile_new_gray_srgb_linear_internal (void)
* Since: 2.10
**/
GimpColorProfile *
gimp_color_profile_new_gray_srgb_linear (void)
gimp_color_profile_new_d65_gray_linear (void)
{
static GimpColorProfile *profile = NULL;
@ -1332,7 +1332,7 @@ gimp_color_profile_new_gray_srgb_linear (void)
if (G_UNLIKELY (profile == NULL))
{
cmsHPROFILE lcms_profile = gimp_color_profile_new_gray_srgb_linear_internal ();
cmsHPROFILE lcms_profile = gimp_color_profile_new_d65_gray_linear_internal ();
profile = gimp_color_profile_new_from_lcms_profile (lcms_profile, NULL);

View File

@ -68,13 +68,13 @@ 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_gray_srgb (void);
GimpColorProfile * gimp_color_profile_new_gray_srgb_linear (void);
GimpColorProfile * gimp_color_profile_new_d65_gray_srgb_trc (void);
GimpColorProfile * gimp_color_profile_new_d65_gray_linear (void);
GimpColorProfile *
gimp_color_profile_new_srgb_gamma_from_color_profile (GimpColorProfile *profile);
gimp_color_profile_new_srgb_trc_from_color_profile (GimpColorProfile *profile);
GimpColorProfile *
gimp_color_profile_new_linear_gamma_from_color_profile (GimpColorProfile *profile);
gimp_color_profile_new_linear_from_color_profile (GimpColorProfile *profile);
GimpColorProfile * gimp_color_profile_new_from_file (GFile *file,
GError **error);