Commit fd0203ce authored by Michael Natterer's avatar Michael Natterer 😴
Browse files

libgimpwidgets: change parameters of gimp_widget_get_color_transform()

Change GimpColorManaged to GimpColorProfile.
parent ebcd7cac
......@@ -69,12 +69,11 @@ gimp_display_shell_profile_dispose (GimpDisplayShell *shell)
void
gimp_display_shell_profile_update (GimpDisplayShell *shell)
{
GimpImage *image;
GimpDisplayConfig *display_config;
GimpColorConfig *config;
GimpColorManaged *managed;
const Babl *src_format;
const Babl *dest_format;
GimpImage *image;
GimpColorConfig *config;
GimpColorProfile *src_profile;
const Babl *src_format;
const Babl *dest_format;
gimp_display_shell_profile_dispose (shell);
......@@ -85,9 +84,9 @@ gimp_display_shell_profile_update (GimpDisplayShell *shell)
if (! image)
return;
display_config = shell->display->config;
config = GIMP_CORE_CONFIG (display_config)->color_management;
managed = GIMP_COLOR_MANAGED (shell);
config = GIMP_CORE_CONFIG (shell->display->config)->color_management;
src_profile = gimp_color_managed_get_color_profile (GIMP_COLOR_MANAGED (shell));
src_format = gimp_babl_format (GIMP_RGB,
gimp_image_get_precision (image),
......@@ -108,7 +107,8 @@ gimp_display_shell_profile_update (GimpDisplayShell *shell)
shell->profile_transform =
gimp_widget_get_color_transform (gtk_widget_get_toplevel (GTK_WIDGET (shell)),
managed, config,
config,
src_profile,
&src_format,
&dest_format);
......
......@@ -480,13 +480,12 @@ get_display_profile (GtkWidget *widget,
GimpColorTransform
gimp_widget_get_color_transform (GtkWidget *widget,
GimpColorManaged *managed,
GimpColorConfig *config,
GimpColorProfile *src_profile,
const Babl **src_format,
const Babl **dest_format)
{
GimpColorTransform transform = NULL;
GimpColorProfile *src_profile = NULL;
GimpColorProfile *dest_profile = NULL;
GimpColorProfile *proof_profile = NULL;
cmsHPROFILE src_lcms;
......@@ -496,7 +495,7 @@ gimp_widget_get_color_transform (GtkWidget *widget,
cmsUInt16Number alarmCodes[cmsMAXCHANNELS] = { 0, };
g_return_val_if_fail (widget == NULL || GTK_IS_WIDGET (widget), NULL);
g_return_val_if_fail (GIMP_IS_COLOR_MANAGED (managed), NULL);
g_return_val_if_fail (GIMP_IS_COLOR_PROFILE (src_profile), NULL);
g_return_val_if_fail (GIMP_IS_COLOR_CONFIG (config), NULL);
g_return_val_if_fail (src_format != NULL, NULL);
g_return_val_if_fail (dest_format != NULL, NULL);
......@@ -511,7 +510,6 @@ gimp_widget_get_color_transform (GtkWidget *widget,
/* fallthru */
case GIMP_COLOR_MANAGEMENT_DISPLAY:
src_profile = gimp_color_managed_get_color_profile (managed);
dest_profile = get_display_profile (widget, config);
break;
}
......@@ -573,7 +571,6 @@ gimp_widget_get_color_transform (GtkWidget *widget,
display_flags);
}
g_object_unref (src_profile);
g_object_unref (dest_profile);
return transform;
......
......@@ -49,8 +49,8 @@ gint gimp_get_monitor_at_pointer (GdkScreen **screen)
GimpColorProfile * gimp_widget_get_color_profile (GtkWidget *widget);
GimpColorTransform gimp_widget_get_color_transform (GtkWidget *widget,
GimpColorManaged *managed,
GimpColorConfig *config,
GimpColorProfile *src_profile,
const Babl **src_format,
const Babl **dest_format);
......
......@@ -257,8 +257,9 @@ cdisplay_lcms_changed (GimpColorDisplay *display)
{
CdisplayLcms *lcms = CDISPLAY_LCMS (display);
GtkWidget *widget = NULL;
GimpColorManaged *managed;
GimpColorConfig *config;
GimpColorManaged *managed;
GimpColorProfile *src_profile;
if (lcms->transform)
{
......@@ -266,8 +267,8 @@ cdisplay_lcms_changed (GimpColorDisplay *display)
lcms->transform = NULL;
}
managed = gimp_color_display_get_managed (display);
config = gimp_color_display_get_config (display);
managed = gimp_color_display_get_managed (display);
if (! config || ! managed)
return;
......@@ -275,13 +276,17 @@ cdisplay_lcms_changed (GimpColorDisplay *display)
if (GTK_IS_WIDGET (managed))
widget = gtk_widget_get_toplevel (GTK_WIDGET (managed));
src_profile = gimp_color_managed_get_color_profile (managed);
lcms->src_format = babl_format ("R'G'B'A float");
lcms->dest_format = babl_format ("R'G'B'A float");
lcms->transform = gimp_widget_get_color_transform (widget,
managed, config,
config, src_profile,
&lcms->src_format,
&lcms->dest_format);
g_object_unref (src_profile);
}
static GimpColorProfile *
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment