Commit cdb3b0aa authored by Michael Natterer's avatar Michael Natterer 😴

libgimpcolor: add GimpColorManaged::get_color_profile()

which returns a GimpColorProfile instead of just an ICC blob like
get_icc_profile(). Also, it will always return a profile, as in
fall back to the built-in profiles automatically.
parent abef515e
......@@ -21,6 +21,7 @@ EXPORTS
gimp_cmyka_get_uchar
gimp_cmyka_set
gimp_cmyka_set_uchar
gimp_color_managed_get_color_profile
gimp_color_managed_get_icc_profile
gimp_color_managed_interface_get_type
gimp_color_managed_profile_changed
......
......@@ -91,8 +91,9 @@ gimp_color_managed_base_init (GimpColorManagedInterface *iface)
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
iface->get_icc_profile = NULL;
iface->profile_changed = NULL;
iface->get_icc_profile = NULL;
iface->get_color_profile = NULL;
iface->profile_changed = NULL;
initialized = TRUE;
}
......@@ -127,6 +128,31 @@ gimp_color_managed_get_icc_profile (GimpColorManaged *managed,
return NULL;
}
/**
* gimp_color_managed_get_color_profile:
* @managed: an object the implements the #GimpColorManaged interface
*
* This function, if implemented, always returns a #GimpColorProfile.
*
* Return value: The @managed's #GimpColorProfile.
*
* Since: GIMP 2.10
**/
GimpColorProfile
gimp_color_managed_get_color_profile (GimpColorManaged *managed)
{
GimpColorManagedInterface *iface;
g_return_val_if_fail (GIMP_IS_COLOR_MANAGED (managed), NULL);
iface = GIMP_COLOR_MANAGED_GET_INTERFACE (managed);
if (iface->get_color_profile)
return iface->get_color_profile (managed);
return NULL;
}
/**
* gimp_color_managed_profile_changed:
* @managed: an object the implements the #GimpColorManaged interface
......
......@@ -44,19 +44,24 @@ struct _GimpColorManagedInterface
GTypeInterface base_iface;
/* virtual functions */
const guint8 * (* get_icc_profile) (GimpColorManaged *managed,
gsize *len);
const guint8 * (* get_icc_profile) (GimpColorManaged *managed,
gsize *len);
/* signals */
void (* profile_changed) (GimpColorManaged *managed);
void (* profile_changed) (GimpColorManaged *managed);
/* virtual functions */
GimpColorProfile (* get_color_profile) (GimpColorManaged *managed);
};
GType gimp_color_managed_interface_get_type (void) G_GNUC_CONST;
GType gimp_color_managed_interface_get_type (void) G_GNUC_CONST;
const guint8 * gimp_color_managed_get_icc_profile (GimpColorManaged *managed,
gsize *len);
GimpColorProfile gimp_color_managed_get_color_profile (GimpColorManaged *managed);
const guint8 * gimp_color_managed_get_icc_profile (GimpColorManaged *managed,
gsize *len);
void gimp_color_managed_profile_changed (GimpColorManaged *managed);
void gimp_color_managed_profile_changed (GimpColorManaged *managed);
G_END_DECLS
......
Markdown is supported
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