mirror of https://github.com/GNOME/gimp.git
core: Add simulation intent and BPC to GimpImage
Adds a simulation_bpc and simulation_intent to GimpImage to allow plug-ins to access it for CMYK import/export. Four pdb functions were added to enable this access: image_get_simulation_bpc (), image_set_simulation_bpc (), image_get_simulation_intent (), and image_set_simulation_intent (). Next, it updates menu options and code to support GimpImage's internal simulation intent and bpc. New 'simulation-intent-changed' and 'simulation-bpc-changed signal are emitted via GimpColorManagedInterface so that relevant tools (such as the CYMK color picker, GimpColorFrame, and future pop-overs) are aware of these changes.
This commit is contained in:
parent
08686fff8b
commit
0587a10543
|
@ -410,9 +410,6 @@ image_actions_update (GimpActionGroup *group,
|
|||
gpointer data)
|
||||
{
|
||||
GimpImage *image = action_data_get_image (data);
|
||||
GimpDisplay *display = action_data_get_display (data);
|
||||
GimpDisplayShell *shell = NULL;
|
||||
GimpColorConfig *color_config = NULL;
|
||||
gboolean is_indexed = FALSE;
|
||||
gboolean is_u8_gamma = FALSE;
|
||||
gboolean is_double = FALSE;
|
||||
|
@ -504,12 +501,7 @@ image_actions_update (GimpActionGroup *group,
|
|||
profile_srgb = gimp_image_get_use_srgb_profile (image, &profile_hidden);
|
||||
profile = (gimp_image_get_color_profile (image) != NULL);
|
||||
|
||||
if (display)
|
||||
{
|
||||
shell = gimp_display_get_shell (display);
|
||||
color_config = gimp_display_shell_get_color_config (shell);
|
||||
|
||||
switch (gimp_color_config_get_simulation_intent (color_config))
|
||||
switch (gimp_image_get_simulation_intent (image))
|
||||
{
|
||||
case GIMP_COLOR_RENDERING_INTENT_PERCEPTUAL:
|
||||
action = "image-softproof-intent-perceptual";
|
||||
|
@ -530,8 +522,7 @@ image_actions_update (GimpActionGroup *group,
|
|||
|
||||
gimp_action_group_set_action_active (group, action, TRUE);
|
||||
|
||||
s_bpc = gimp_color_config_get_simulation_bpc (color_config);
|
||||
}
|
||||
s_bpc = gimp_image_get_simulation_bpc (image);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -1635,21 +1635,19 @@ image_softproof_intent_cmd_callback (GimpAction *action,
|
|||
GVariant *value,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *image;
|
||||
GimpDisplayShell *shell;
|
||||
GimpColorConfig *color_config;
|
||||
GimpColorRenderingIntent intent;
|
||||
return_if_no_image (image, data);
|
||||
return_if_no_shell (shell, data);
|
||||
|
||||
intent = (GimpColorRenderingIntent) g_variant_get_int32 (value);
|
||||
|
||||
color_config = gimp_display_shell_get_color_config (shell);
|
||||
|
||||
if (intent != gimp_color_config_get_simulation_intent (color_config))
|
||||
if (intent != gimp_image_get_simulation_intent (image))
|
||||
{
|
||||
g_object_set (color_config,
|
||||
"simulation-rendering-intent", intent,
|
||||
NULL);
|
||||
gimp_image_set_simulation_intent (image, intent);
|
||||
shell->color_config_set = TRUE;
|
||||
gimp_color_managed_simulation_intent_changed (GIMP_COLOR_MANAGED (shell));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1658,20 +1656,18 @@ image_softproof_bpc_cmd_callback (GimpAction *action,
|
|||
GVariant *value,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *image;
|
||||
GimpDisplayShell *shell;
|
||||
GimpColorConfig *color_config;
|
||||
gboolean active;
|
||||
gboolean bpc;
|
||||
return_if_no_image (image, data);
|
||||
return_if_no_shell (shell, data);
|
||||
|
||||
color_config = gimp_display_shell_get_color_config (shell);
|
||||
bpc = g_variant_get_boolean (value);
|
||||
|
||||
active = g_variant_get_boolean (value);
|
||||
|
||||
if (active != gimp_color_config_get_simulation_bpc (color_config))
|
||||
if (bpc != gimp_image_get_simulation_bpc (image))
|
||||
{
|
||||
g_object_set (color_config,
|
||||
"simulation-use-black-point-compensation", active,
|
||||
NULL);
|
||||
gimp_image_set_simulation_bpc (image, bpc);
|
||||
shell->color_config_set = TRUE;
|
||||
gimp_color_managed_simulation_bpc_changed (GIMP_COLOR_MANAGED (shell));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -456,6 +456,57 @@ gimp_image_set_simulation_profile (GimpImage *image,
|
|||
NULL);
|
||||
}
|
||||
|
||||
GimpColorRenderingIntent
|
||||
gimp_image_get_simulation_intent (GimpImage *image)
|
||||
{
|
||||
g_return_val_if_fail (GIMP_IS_IMAGE (image),
|
||||
GIMP_COLOR_RENDERING_INTENT_RELATIVE_COLORIMETRIC);
|
||||
|
||||
return GIMP_IMAGE_GET_PRIVATE (image)->simulation_intent;
|
||||
}
|
||||
|
||||
void
|
||||
gimp_image_set_simulation_intent (GimpImage *image,
|
||||
GimpColorRenderingIntent intent)
|
||||
{
|
||||
GimpImagePrivate *private;
|
||||
|
||||
g_return_if_fail (GIMP_IS_IMAGE (image));
|
||||
|
||||
private = GIMP_IMAGE_GET_PRIVATE (image);
|
||||
|
||||
if (intent != private->simulation_intent)
|
||||
{
|
||||
private->simulation_intent = intent;
|
||||
gimp_color_managed_simulation_intent_changed (GIMP_COLOR_MANAGED (image));
|
||||
}
|
||||
}
|
||||
|
||||
gboolean
|
||||
gimp_image_get_simulation_bpc (GimpImage *image)
|
||||
{
|
||||
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
|
||||
|
||||
return GIMP_IMAGE_GET_PRIVATE (image)->simulation_bpc;
|
||||
}
|
||||
|
||||
void
|
||||
gimp_image_set_simulation_bpc (GimpImage *image,
|
||||
gboolean bpc)
|
||||
{
|
||||
GimpImagePrivate *private;
|
||||
|
||||
g_return_if_fail (GIMP_IS_IMAGE (image));
|
||||
|
||||
private = GIMP_IMAGE_GET_PRIVATE (image);
|
||||
|
||||
if (bpc != private->simulation_bpc)
|
||||
{
|
||||
private->simulation_bpc = bpc;
|
||||
gimp_color_managed_simulation_bpc_changed (GIMP_COLOR_MANAGED (image));
|
||||
}
|
||||
}
|
||||
|
||||
gboolean
|
||||
gimp_image_validate_color_profile_by_format (const Babl *format,
|
||||
GimpColorProfile *profile,
|
||||
|
|
|
@ -73,6 +73,15 @@ GimpColorProfile * gimp_image_get_simulation_profile (GimpImage *ima
|
|||
gboolean gimp_image_set_simulation_profile (GimpImage *image,
|
||||
GimpColorProfile *profile);
|
||||
|
||||
GimpColorRenderingIntent
|
||||
gimp_image_get_simulation_intent (GimpImage *image);
|
||||
void gimp_image_set_simulation_intent (GimpImage *image,
|
||||
GimpColorRenderingIntent intent);
|
||||
|
||||
gboolean gimp_image_get_simulation_bpc (GimpImage *image);
|
||||
void gimp_image_set_simulation_bpc (GimpImage *image,
|
||||
gboolean bpc);
|
||||
|
||||
gboolean gimp_image_validate_color_profile_by_format
|
||||
(const Babl *format,
|
||||
GimpColorProfile *profile,
|
||||
|
|
|
@ -63,7 +63,11 @@ struct _GimpImagePrivate
|
|||
GimpColorProfile *color_profile; /* image's color profile */
|
||||
const Babl *layer_space; /* image's Babl layer space */
|
||||
GimpColorProfile *hidden_profile; /* hidden by "use sRGB" */
|
||||
GimpColorProfile *simulation_profile; /* image's softproof profile */
|
||||
|
||||
/* image's simulation/soft-proofing settings */
|
||||
GimpColorProfile *simulation_profile;
|
||||
GimpColorRenderingIntent simulation_intent;
|
||||
gboolean simulation_bpc;
|
||||
|
||||
/* Cached color transforms: from layer to sRGB u8 and double, and back */
|
||||
gboolean color_transforms_created;
|
||||
|
|
|
@ -203,6 +203,16 @@ static GimpColorProfile *
|
|||
static void
|
||||
gimp_image_color_managed_simulation_profile_changed (GimpColorManaged *managed);
|
||||
|
||||
static GimpColorRenderingIntent
|
||||
gimp_image_color_managed_get_simulation_intent (GimpColorManaged *managed);
|
||||
static void
|
||||
gimp_image_color_managed_simulation_intent_changed (GimpColorManaged *managed);
|
||||
|
||||
static gboolean
|
||||
gimp_image_color_managed_get_simulation_bpc (GimpColorManaged *managed);
|
||||
static void
|
||||
gimp_image_color_managed_simulation_bpc_changed (GimpColorManaged *managed);
|
||||
|
||||
static void gimp_image_projectable_flush (GimpProjectable *projectable,
|
||||
gboolean invalidate_preview);
|
||||
static GeglRectangle gimp_image_get_bounding_box (GimpProjectable *projectable);
|
||||
|
@ -707,6 +717,10 @@ gimp_color_managed_iface_init (GimpColorManagedInterface *iface)
|
|||
iface->profile_changed = gimp_image_color_managed_profile_changed;
|
||||
iface->get_simulation_profile = gimp_image_color_managed_get_simulation_profile;
|
||||
iface->simulation_profile_changed = gimp_image_color_managed_simulation_profile_changed;
|
||||
iface->get_simulation_intent = gimp_image_color_managed_get_simulation_intent;
|
||||
iface->simulation_intent_changed = gimp_image_color_managed_simulation_intent_changed;
|
||||
iface->get_simulation_bpc = gimp_image_color_managed_get_simulation_bpc;
|
||||
iface->simulation_bpc_changed = gimp_image_color_managed_simulation_bpc_changed;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1465,6 +1479,40 @@ gimp_image_color_managed_simulation_profile_changed (GimpColorManaged *managed)
|
|||
gimp_viewable_invalidate_preview (GIMP_VIEWABLE (image));
|
||||
}
|
||||
|
||||
static GimpColorRenderingIntent
|
||||
gimp_image_color_managed_get_simulation_intent (GimpColorManaged *managed)
|
||||
{
|
||||
GimpImage *image = GIMP_IMAGE (managed);
|
||||
|
||||
return gimp_image_get_simulation_intent (image);
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_image_color_managed_simulation_intent_changed (GimpColorManaged *managed)
|
||||
{
|
||||
GimpImage *image = GIMP_IMAGE (managed);
|
||||
|
||||
gimp_projectable_structure_changed (GIMP_PROJECTABLE (image));
|
||||
gimp_viewable_invalidate_preview (GIMP_VIEWABLE (image));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gimp_image_color_managed_get_simulation_bpc (GimpColorManaged *managed)
|
||||
{
|
||||
GimpImage *image = GIMP_IMAGE (managed);
|
||||
|
||||
return gimp_image_get_simulation_bpc (image);
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_image_color_managed_simulation_bpc_changed (GimpColorManaged *managed)
|
||||
{
|
||||
GimpImage *image = GIMP_IMAGE (managed);
|
||||
|
||||
gimp_projectable_structure_changed (GIMP_PROJECTABLE (image));
|
||||
gimp_viewable_invalidate_preview (GIMP_VIEWABLE (image));
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_image_projectable_flush (GimpProjectable *projectable,
|
||||
gboolean invalidate_preview)
|
||||
|
|
|
@ -129,9 +129,6 @@ static void gimp_display_shell_precision_changed_handler (GimpImage *i
|
|||
GimpDisplayShell *shell);
|
||||
static void gimp_display_shell_profile_changed_handler (GimpColorManaged *image,
|
||||
GimpDisplayShell *shell);
|
||||
static void gimp_display_shell_simulation_profile_changed_handler
|
||||
(GimpColorManaged *image,
|
||||
GimpDisplayShell *shell);
|
||||
static void gimp_display_shell_saved_handler (GimpImage *image,
|
||||
GFile *file,
|
||||
GimpDisplayShell *shell);
|
||||
|
@ -285,9 +282,16 @@ gimp_display_shell_connect (GimpDisplayShell *shell)
|
|||
g_signal_connect (image, "profile-changed",
|
||||
G_CALLBACK (gimp_display_shell_profile_changed_handler),
|
||||
shell);
|
||||
g_signal_connect (image, "simulation-profile-changed",
|
||||
G_CALLBACK (gimp_display_shell_simulation_profile_changed_handler),
|
||||
g_signal_connect_swapped (image, "simulation-profile-changed",
|
||||
G_CALLBACK (gimp_display_shell_profile_update),
|
||||
shell);
|
||||
g_signal_connect_swapped (image, "simulation-intent-changed",
|
||||
G_CALLBACK (gimp_display_shell_profile_update),
|
||||
shell);
|
||||
g_signal_connect_swapped (image, "simulation-bpc-changed",
|
||||
G_CALLBACK (gimp_display_shell_profile_update),
|
||||
shell);
|
||||
|
||||
g_signal_connect (image, "saved",
|
||||
G_CALLBACK (gimp_display_shell_saved_handler),
|
||||
shell);
|
||||
|
@ -526,7 +530,7 @@ gimp_display_shell_disconnect (GimpDisplayShell *shell)
|
|||
gimp_display_shell_profile_changed_handler,
|
||||
shell);
|
||||
g_signal_handlers_disconnect_by_func (image,
|
||||
gimp_display_shell_simulation_profile_changed_handler,
|
||||
gimp_display_shell_profile_update,
|
||||
shell);
|
||||
g_signal_handlers_disconnect_by_func (image,
|
||||
gimp_display_shell_precision_changed_handler,
|
||||
|
@ -932,14 +936,6 @@ gimp_display_shell_profile_changed_handler (GimpColorManaged *image,
|
|||
gimp_color_managed_profile_changed (GIMP_COLOR_MANAGED (shell));
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_display_shell_simulation_profile_changed_handler (GimpColorManaged *image,
|
||||
GimpDisplayShell *shell)
|
||||
{
|
||||
gimp_display_shell_profile_update (shell);
|
||||
gimp_color_managed_simulation_profile_changed (GIMP_COLOR_MANAGED (shell));
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_display_shell_saved_handler (GimpImage *image,
|
||||
GFile *file,
|
||||
|
@ -1207,8 +1203,6 @@ gimp_display_shell_color_config_notify_handler (GObject *config,
|
|||
if (! strcmp (param_spec->name, "mode") ||
|
||||
! strcmp (param_spec->name, "display-rendering-intent") ||
|
||||
! strcmp (param_spec->name, "display-use-black-point-compensation") ||
|
||||
! strcmp (param_spec->name, "simulation-rendering-intent") ||
|
||||
! strcmp (param_spec->name, "simulation-use-black-point-compensation") ||
|
||||
! strcmp (param_spec->name, "simulation-gamut-check"))
|
||||
{
|
||||
if (shell->color_config_set)
|
||||
|
|
|
@ -90,6 +90,9 @@ gimp_display_shell_profile_update (GimpDisplayShell *shell)
|
|||
const Babl *filter_format;
|
||||
const Babl *dest_format;
|
||||
GimpColorProfile *proof_profile;
|
||||
GimpColorRenderingIntent simulation_intent =
|
||||
GIMP_COLOR_RENDERING_INTENT_RELATIVE_COLORIMETRIC;
|
||||
gboolean simulation_bpc = FALSE;
|
||||
|
||||
gimp_display_shell_profile_free (shell);
|
||||
|
||||
|
@ -104,6 +107,8 @@ gimp_display_shell_profile_update (GimpDisplayShell *shell)
|
|||
return;
|
||||
|
||||
proof_profile = gimp_color_managed_get_simulation_profile (GIMP_COLOR_MANAGED (image));
|
||||
simulation_intent = gimp_color_managed_get_simulation_intent (GIMP_COLOR_MANAGED (image));
|
||||
simulation_bpc = gimp_color_managed_get_simulation_bpc (GIMP_COLOR_MANAGED (image));
|
||||
|
||||
src_format = gimp_projectable_get_format (GIMP_PROJECTABLE (image));
|
||||
|
||||
|
@ -158,7 +163,9 @@ gimp_display_shell_profile_update (GimpDisplayShell *shell)
|
|||
filter_profile,
|
||||
filter_format,
|
||||
dest_format,
|
||||
proof_profile);
|
||||
proof_profile,
|
||||
simulation_intent,
|
||||
simulation_bpc);
|
||||
|
||||
if (shell->filter_transform || shell->profile_transform)
|
||||
{
|
||||
|
@ -236,8 +243,6 @@ gimp_display_shell_color_config_notify (GimpColorConfig *config,
|
|||
if (! strcmp (pspec->name, "mode") ||
|
||||
! strcmp (pspec->name, "display-rendering-intent") ||
|
||||
! strcmp (pspec->name, "display-use-black-point-compensation") ||
|
||||
! strcmp (pspec->name, "simulation-rendering-intent") ||
|
||||
! strcmp (pspec->name, "simulation-use-black-point-compensation") ||
|
||||
! strcmp (pspec->name, "simulation-gamut-check"))
|
||||
{
|
||||
gboolean managed = FALSE;
|
||||
|
|
|
@ -164,7 +164,10 @@ static GimpColorProfile *
|
|||
static void gimp_display_shell_profile_changed(GimpColorManaged *managed);
|
||||
static void gimp_display_shell_simulation_profile_changed
|
||||
(GimpColorManaged *managed);
|
||||
|
||||
static void gimp_display_shell_simulation_intent_changed
|
||||
(GimpColorManaged *managed);
|
||||
static void gimp_display_shell_simulation_bpc_changed
|
||||
(GimpColorManaged *managed);
|
||||
static void gimp_display_shell_zoom_button_callback
|
||||
(GimpDisplayShell *shell,
|
||||
GtkWidget *zoom_button);
|
||||
|
@ -309,6 +312,8 @@ gimp_color_managed_iface_init (GimpColorManagedInterface *iface)
|
|||
iface->get_color_profile = gimp_display_shell_get_color_profile;
|
||||
iface->profile_changed = gimp_display_shell_profile_changed;
|
||||
iface->simulation_profile_changed = gimp_display_shell_simulation_profile_changed;
|
||||
iface->simulation_intent_changed = gimp_display_shell_simulation_intent_changed;
|
||||
iface->simulation_bpc_changed = gimp_display_shell_simulation_bpc_changed;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1096,6 +1101,24 @@ gimp_display_shell_simulation_profile_changed (GimpColorManaged *managed)
|
|||
gimp_display_shell_render_invalidate_full (shell);
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_display_shell_simulation_intent_changed (GimpColorManaged *managed)
|
||||
{
|
||||
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (managed);
|
||||
|
||||
gimp_display_shell_expose_full (shell);
|
||||
gimp_display_shell_render_invalidate_full (shell);
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_display_shell_simulation_bpc_changed (GimpColorManaged *managed)
|
||||
{
|
||||
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (managed);
|
||||
|
||||
gimp_display_shell_expose_full (shell);
|
||||
gimp_display_shell_render_invalidate_full (shell);
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_display_shell_zoom_button_callback (GimpDisplayShell *shell,
|
||||
GtkWidget *zoom_button)
|
||||
|
@ -1369,6 +1392,8 @@ gimp_display_shell_reconnect (GimpDisplayShell *shell)
|
|||
|
||||
gimp_color_managed_profile_changed (GIMP_COLOR_MANAGED (shell));
|
||||
gimp_display_shell_simulation_profile_changed (GIMP_COLOR_MANAGED (shell));
|
||||
gimp_display_shell_simulation_intent_changed (GIMP_COLOR_MANAGED (shell));
|
||||
gimp_display_shell_simulation_bpc_changed (GIMP_COLOR_MANAGED (shell));
|
||||
|
||||
gimp_display_shell_scroll_clamp_and_update (shell);
|
||||
|
||||
|
|
|
@ -362,6 +362,112 @@ image_set_simulation_profile_from_file_invoker (GimpProcedure *procedure
|
|||
error ? *error : NULL);
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
image_get_simulation_intent_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpValueArray *return_vals;
|
||||
GimpImage *image;
|
||||
gint intent = 0;
|
||||
|
||||
image = g_value_get_object (gimp_value_array_index (args, 0));
|
||||
|
||||
if (success)
|
||||
{
|
||||
intent = gimp_image_get_simulation_intent (image);
|
||||
}
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
|
||||
if (success)
|
||||
g_value_set_enum (gimp_value_array_index (return_vals, 1), intent);
|
||||
|
||||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
image_set_simulation_intent_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpImage *image;
|
||||
gint intent;
|
||||
|
||||
image = g_value_get_object (gimp_value_array_index (args, 0));
|
||||
intent = g_value_get_enum (gimp_value_array_index (args, 1));
|
||||
|
||||
if (success)
|
||||
{
|
||||
gimp_image_set_simulation_intent (image, intent);
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
image_get_simulation_bpc_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpValueArray *return_vals;
|
||||
GimpImage *image;
|
||||
gboolean bpc = FALSE;
|
||||
|
||||
image = g_value_get_object (gimp_value_array_index (args, 0));
|
||||
|
||||
if (success)
|
||||
{
|
||||
bpc = gimp_image_get_simulation_bpc (image);
|
||||
}
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
|
||||
if (success)
|
||||
g_value_set_boolean (gimp_value_array_index (return_vals, 1), bpc);
|
||||
|
||||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
image_set_simulation_bpc_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpImage *image;
|
||||
gboolean bpc;
|
||||
|
||||
image = g_value_get_object (gimp_value_array_index (args, 0));
|
||||
bpc = g_value_get_boolean (gimp_value_array_index (args, 1));
|
||||
|
||||
if (success)
|
||||
{
|
||||
gimp_image_set_simulation_bpc (image, bpc);
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
image_convert_color_profile_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -689,6 +795,124 @@ register_image_color_profile_procs (GimpPDB *pdb)
|
|||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-image-get-simulation-intent
|
||||
*/
|
||||
procedure = gimp_procedure_new (image_get_simulation_intent_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-image-get-simulation-intent");
|
||||
gimp_procedure_set_static_help (procedure,
|
||||
"Returns the image's simulation rendering intent",
|
||||
"This procedure returns the image's simulation rendering intent.",
|
||||
NULL);
|
||||
gimp_procedure_set_static_attribution (procedure,
|
||||
"Alex S.",
|
||||
"Alex S.",
|
||||
"2022");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image ("image",
|
||||
"image",
|
||||
"The image",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_enum ("intent",
|
||||
"intent",
|
||||
"The image's simulation rendering intent.",
|
||||
GIMP_TYPE_COLOR_RENDERING_INTENT,
|
||||
GIMP_COLOR_RENDERING_INTENT_PERCEPTUAL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-image-set-simulation-intent
|
||||
*/
|
||||
procedure = gimp_procedure_new (image_set_simulation_intent_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-image-set-simulation-intent");
|
||||
gimp_procedure_set_static_help (procedure,
|
||||
"Sets the image's simulation rendering intent",
|
||||
"This procedure sets the image's simulation rendering intent.",
|
||||
NULL);
|
||||
gimp_procedure_set_static_attribution (procedure,
|
||||
"Alex S.",
|
||||
"Alex S.",
|
||||
"2022");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image ("image",
|
||||
"image",
|
||||
"The image",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_enum ("intent",
|
||||
"intent",
|
||||
"A GimpColorRenderingIntent",
|
||||
GIMP_TYPE_COLOR_RENDERING_INTENT,
|
||||
GIMP_COLOR_RENDERING_INTENT_PERCEPTUAL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-image-get-simulation-bpc
|
||||
*/
|
||||
procedure = gimp_procedure_new (image_get_simulation_bpc_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-image-get-simulation-bpc");
|
||||
gimp_procedure_set_static_help (procedure,
|
||||
"Returns whether the image has Black Point Compensation enabled for its simulation",
|
||||
"This procedure returns whether the image has Black Point Compensation enabled for its simulation",
|
||||
NULL);
|
||||
gimp_procedure_set_static_attribution (procedure,
|
||||
"Alex S.",
|
||||
"Alex S.",
|
||||
"2022");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image ("image",
|
||||
"image",
|
||||
"The image",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_boolean ("bpc",
|
||||
"bpc",
|
||||
"The Black Point Compensation status.",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-image-set-simulation-bpc
|
||||
*/
|
||||
procedure = gimp_procedure_new (image_set_simulation_bpc_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-image-set-simulation-bpc");
|
||||
gimp_procedure_set_static_help (procedure,
|
||||
"Sets whether the image has Black Point Compensation enabled for its simulation",
|
||||
"This procedure whether the image has Black Point Compensation enabled for its simulation",
|
||||
NULL);
|
||||
gimp_procedure_set_static_attribution (procedure,
|
||||
"Alex S.",
|
||||
"Alex S.",
|
||||
"2022");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image ("image",
|
||||
"image",
|
||||
"The image",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("bpc",
|
||||
"bpc",
|
||||
"The Black Point Compensation status.",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-image-convert-color-profile
|
||||
*/
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#include "internal-procs.h"
|
||||
|
||||
|
||||
/* 758 procedures registered total */
|
||||
/* 762 procedures registered total */
|
||||
|
||||
void
|
||||
internal_procs_init (GimpPDB *pdb)
|
||||
|
|
|
@ -795,7 +795,9 @@ gimp_fg_bg_editor_create_transform (GimpFgBgEditor *editor)
|
|||
profile,
|
||||
babl_format ("R'G'B'A double"),
|
||||
babl_format ("R'G'B'A double"),
|
||||
NULL);
|
||||
NULL,
|
||||
GIMP_COLOR_RENDERING_INTENT_RELATIVE_COLORIMETRIC,
|
||||
FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -256,7 +256,9 @@ gimp_fg_bg_view_create_transform (GimpFgBgView *view)
|
|||
profile,
|
||||
babl_format ("R'G'B'A double"),
|
||||
babl_format ("R'G'B'A double"),
|
||||
NULL);
|
||||
NULL,
|
||||
GIMP_COLOR_RENDERING_INTENT_RELATIVE_COLORIMETRIC,
|
||||
FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1030,6 +1030,9 @@ gimp_view_renderer_get_color_transform (GimpViewRenderer *renderer,
|
|||
{
|
||||
GimpColorProfile *profile;
|
||||
GimpColorProfile *proof_profile = NULL;
|
||||
GimpColorRenderingIntent simulation_intent =
|
||||
GIMP_COLOR_RENDERING_INTENT_RELATIVE_COLORIMETRIC;
|
||||
gboolean simulation_bpc = FALSE;
|
||||
GimpImage *image;
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_VIEW_RENDERER (renderer), NULL);
|
||||
|
@ -1066,8 +1069,14 @@ gimp_view_renderer_get_color_transform (GimpViewRenderer *renderer,
|
|||
{
|
||||
image = gimp_context_get_image (GIMP_CONTEXT (renderer->context));
|
||||
if (image)
|
||||
{
|
||||
proof_profile =
|
||||
gimp_color_managed_get_simulation_profile (GIMP_COLOR_MANAGED (image));
|
||||
simulation_intent =
|
||||
gimp_color_managed_get_simulation_intent (GIMP_COLOR_MANAGED (image));
|
||||
simulation_bpc =
|
||||
gimp_color_managed_get_simulation_bpc (GIMP_COLOR_MANAGED (image));
|
||||
}
|
||||
}
|
||||
|
||||
renderer->priv->profile_transform =
|
||||
|
@ -1076,7 +1085,9 @@ gimp_view_renderer_get_color_transform (GimpViewRenderer *renderer,
|
|||
profile,
|
||||
src_format,
|
||||
dest_format,
|
||||
proof_profile);
|
||||
proof_profile,
|
||||
simulation_intent,
|
||||
simulation_bpc);
|
||||
|
||||
return renderer->priv->profile_transform;
|
||||
}
|
||||
|
|
|
@ -417,6 +417,8 @@ EXPORTS
|
|||
gimp_image_get_selected_drawables
|
||||
gimp_image_get_selected_layers
|
||||
gimp_image_get_selection
|
||||
gimp_image_get_simulation_bpc
|
||||
gimp_image_get_simulation_intent
|
||||
gimp_image_get_simulation_profile
|
||||
gimp_image_get_tattoo_state
|
||||
gimp_image_get_thumbnail
|
||||
|
@ -493,6 +495,8 @@ EXPORTS
|
|||
gimp_image_set_metadata
|
||||
gimp_image_set_resolution
|
||||
gimp_image_set_selected_layers
|
||||
gimp_image_set_simulation_bpc
|
||||
gimp_image_set_simulation_intent
|
||||
gimp_image_set_simulation_profile
|
||||
gimp_image_set_simulation_profile_from_file
|
||||
gimp_image_set_tattoo_state
|
||||
|
|
|
@ -350,6 +350,158 @@ gimp_image_set_simulation_profile_from_file (GimpImage *image,
|
|||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_image_get_simulation_intent:
|
||||
* @image: The image.
|
||||
*
|
||||
* Returns the image's simulation rendering intent
|
||||
*
|
||||
* This procedure returns the image's simulation rendering intent.
|
||||
*
|
||||
* Returns: The image's simulation rendering intent.
|
||||
*
|
||||
* Since: 3.0
|
||||
**/
|
||||
GimpColorRenderingIntent
|
||||
gimp_image_get_simulation_intent (GimpImage *image)
|
||||
{
|
||||
GimpValueArray *args;
|
||||
GimpValueArray *return_vals;
|
||||
GimpColorRenderingIntent intent = 0;
|
||||
|
||||
args = gimp_value_array_new_from_types (NULL,
|
||||
GIMP_TYPE_IMAGE, image,
|
||||
G_TYPE_NONE);
|
||||
|
||||
return_vals = gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
||||
"gimp-image-get-simulation-intent",
|
||||
args);
|
||||
gimp_value_array_unref (args);
|
||||
|
||||
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
||||
intent = GIMP_VALUES_GET_ENUM (return_vals, 1);
|
||||
|
||||
gimp_value_array_unref (return_vals);
|
||||
|
||||
return intent;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_image_set_simulation_intent:
|
||||
* @image: The image.
|
||||
* @intent: A GimpColorRenderingIntent.
|
||||
*
|
||||
* Sets the image's simulation rendering intent
|
||||
*
|
||||
* This procedure sets the image's simulation rendering intent.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
*
|
||||
* Since: 3.0
|
||||
**/
|
||||
gboolean
|
||||
gimp_image_set_simulation_intent (GimpImage *image,
|
||||
GimpColorRenderingIntent intent)
|
||||
{
|
||||
GimpValueArray *args;
|
||||
GimpValueArray *return_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
args = gimp_value_array_new_from_types (NULL,
|
||||
GIMP_TYPE_IMAGE, image,
|
||||
GIMP_TYPE_COLOR_RENDERING_INTENT, intent,
|
||||
G_TYPE_NONE);
|
||||
|
||||
return_vals = gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
||||
"gimp-image-set-simulation-intent",
|
||||
args);
|
||||
gimp_value_array_unref (args);
|
||||
|
||||
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_value_array_unref (return_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_image_get_simulation_bpc:
|
||||
* @image: The image.
|
||||
*
|
||||
* Returns whether the image has Black Point Compensation enabled for
|
||||
* its simulation
|
||||
*
|
||||
* This procedure returns whether the image has Black Point
|
||||
* Compensation enabled for its simulation
|
||||
*
|
||||
* Returns: The Black Point Compensation status.
|
||||
*
|
||||
* Since: 3.0
|
||||
**/
|
||||
gboolean
|
||||
gimp_image_get_simulation_bpc (GimpImage *image)
|
||||
{
|
||||
GimpValueArray *args;
|
||||
GimpValueArray *return_vals;
|
||||
gboolean bpc = FALSE;
|
||||
|
||||
args = gimp_value_array_new_from_types (NULL,
|
||||
GIMP_TYPE_IMAGE, image,
|
||||
G_TYPE_NONE);
|
||||
|
||||
return_vals = gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
||||
"gimp-image-get-simulation-bpc",
|
||||
args);
|
||||
gimp_value_array_unref (args);
|
||||
|
||||
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
||||
bpc = GIMP_VALUES_GET_BOOLEAN (return_vals, 1);
|
||||
|
||||
gimp_value_array_unref (return_vals);
|
||||
|
||||
return bpc;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_image_set_simulation_bpc:
|
||||
* @image: The image.
|
||||
* @bpc: The Black Point Compensation status.
|
||||
*
|
||||
* Sets whether the image has Black Point Compensation enabled for its
|
||||
* simulation
|
||||
*
|
||||
* This procedure whether the image has Black Point Compensation
|
||||
* enabled for its simulation
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
*
|
||||
* Since: 3.0
|
||||
**/
|
||||
gboolean
|
||||
gimp_image_set_simulation_bpc (GimpImage *image,
|
||||
gboolean bpc)
|
||||
{
|
||||
GimpValueArray *args;
|
||||
GimpValueArray *return_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
args = gimp_value_array_new_from_types (NULL,
|
||||
GIMP_TYPE_IMAGE, image,
|
||||
G_TYPE_BOOLEAN, bpc,
|
||||
G_TYPE_NONE);
|
||||
|
||||
return_vals = gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
||||
"gimp-image-set-simulation-bpc",
|
||||
args);
|
||||
gimp_value_array_unref (args);
|
||||
|
||||
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_value_array_unref (return_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* _gimp_image_convert_color_profile:
|
||||
* @image: The image.
|
||||
|
|
|
@ -48,6 +48,12 @@ G_GNUC_INTERNAL gboolean _gimp_image_set_simulation_profile (GimpImage
|
|||
const guint8 *color_profile);
|
||||
gboolean gimp_image_set_simulation_profile_from_file (GimpImage *image,
|
||||
GFile *file);
|
||||
GimpColorRenderingIntent gimp_image_get_simulation_intent (GimpImage *image);
|
||||
gboolean gimp_image_set_simulation_intent (GimpImage *image,
|
||||
GimpColorRenderingIntent intent);
|
||||
gboolean gimp_image_get_simulation_bpc (GimpImage *image);
|
||||
gboolean gimp_image_set_simulation_bpc (GimpImage *image,
|
||||
gboolean bpc);
|
||||
G_GNUC_INTERNAL gboolean _gimp_image_convert_color_profile (GimpImage *image,
|
||||
gint num_bytes,
|
||||
const guint8 *color_profile,
|
||||
|
|
|
@ -21,9 +21,13 @@ EXPORTS
|
|||
gimp_cmyka_set_uchar
|
||||
gimp_color_managed_get_color_profile
|
||||
gimp_color_managed_get_icc_profile
|
||||
gimp_color_managed_get_simulation_bpc
|
||||
gimp_color_managed_get_simulation_intent
|
||||
gimp_color_managed_get_simulation_profile
|
||||
gimp_color_managed_get_type
|
||||
gimp_color_managed_profile_changed
|
||||
gimp_color_managed_simulation_bpc_changed
|
||||
gimp_color_managed_simulation_intent_changed
|
||||
gimp_color_managed_simulation_profile_changed
|
||||
gimp_color_profile_get_copyright
|
||||
gimp_color_profile_get_description
|
||||
|
|
|
@ -43,6 +43,8 @@ enum
|
|||
{
|
||||
PROFILE_CHANGED,
|
||||
SIMULATION_PROFILE_CHANGED,
|
||||
SIMULATION_INTENT_CHANGED,
|
||||
SIMULATION_BPC_CHANGED,
|
||||
LAST_SIGNAL
|
||||
};
|
||||
|
||||
|
@ -76,6 +78,24 @@ gimp_color_managed_default_init (GimpColorManagedInterface *iface)
|
|||
simulation_profile_changed),
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
gimp_color_managed_signals[SIMULATION_INTENT_CHANGED] =
|
||||
g_signal_new ("simulation-intent-changed",
|
||||
G_TYPE_FROM_INTERFACE (iface),
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
G_STRUCT_OFFSET (GimpColorManagedInterface,
|
||||
simulation_intent_changed),
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
gimp_color_managed_signals[SIMULATION_BPC_CHANGED] =
|
||||
g_signal_new ("simulation-bpc-changed",
|
||||
G_TYPE_FROM_INTERFACE (iface),
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
G_STRUCT_OFFSET (GimpColorManagedInterface,
|
||||
simulation_bpc_changed),
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
}
|
||||
|
||||
|
||||
|
@ -162,6 +182,59 @@ gimp_color_managed_get_simulation_profile (GimpColorManaged *managed)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_color_managed_get_simulation_intent:
|
||||
* @managed: an object the implements the #GimpColorManaged interface
|
||||
*
|
||||
* This function always returns a #GimpColorRenderingIntent
|
||||
*
|
||||
* Returns: The @managed's simulation #GimpColorRenderingIntent.
|
||||
*
|
||||
* Since: 3.0
|
||||
**/
|
||||
GimpColorRenderingIntent
|
||||
gimp_color_managed_get_simulation_intent (GimpColorManaged *managed)
|
||||
{
|
||||
GimpColorManagedInterface *iface;
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_COLOR_MANAGED (managed),
|
||||
GIMP_COLOR_RENDERING_INTENT_RELATIVE_COLORIMETRIC);
|
||||
|
||||
iface = GIMP_COLOR_MANAGED_GET_IFACE (managed);
|
||||
|
||||
if (iface->get_simulation_intent)
|
||||
return iface->get_simulation_intent (managed);
|
||||
|
||||
return GIMP_COLOR_RENDERING_INTENT_RELATIVE_COLORIMETRIC;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_color_managed_get_simulation_bpc:
|
||||
* @managed: an object the implements the #GimpColorManaged interface
|
||||
*
|
||||
* This function always returns a gboolean representing whether
|
||||
* Black Point Compensation is enabled
|
||||
*
|
||||
* Returns: The @managed's simulation Black Point Compensation value.
|
||||
*
|
||||
* Since: 3.0
|
||||
**/
|
||||
gboolean
|
||||
gimp_color_managed_get_simulation_bpc (GimpColorManaged *managed)
|
||||
{
|
||||
GimpColorManagedInterface *iface;
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_COLOR_MANAGED (managed), FALSE);
|
||||
|
||||
iface = GIMP_COLOR_MANAGED_GET_IFACE (managed);
|
||||
|
||||
if (iface->get_simulation_bpc)
|
||||
return iface->get_simulation_bpc (managed);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* gimp_color_managed_profile_changed:
|
||||
* @managed: an object that implements the #GimpColorManaged interface
|
||||
|
@ -193,3 +266,35 @@ gimp_color_managed_simulation_profile_changed (GimpColorManaged *managed)
|
|||
|
||||
g_signal_emit (managed, gimp_color_managed_signals[SIMULATION_PROFILE_CHANGED], 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_color_managed_simulation_intent_changed:
|
||||
* @managed: an object that implements the #GimpColorManaged interface
|
||||
*
|
||||
* Emits the "simulation-intent-changed" signal.
|
||||
*
|
||||
* Since: 3.0
|
||||
**/
|
||||
void
|
||||
gimp_color_managed_simulation_intent_changed (GimpColorManaged *managed)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_COLOR_MANAGED (managed));
|
||||
|
||||
g_signal_emit (managed, gimp_color_managed_signals[SIMULATION_INTENT_CHANGED], 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_color_managed_simulation_bpc_changed:
|
||||
* @managed: an object that implements the #GimpColorManaged interface
|
||||
*
|
||||
* Emits the "simulation-bpc-changed" signal.
|
||||
*
|
||||
* Since: 3.0
|
||||
**/
|
||||
void
|
||||
gimp_color_managed_simulation_bpc_changed (GimpColorManaged *managed)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_COLOR_MANAGED (managed));
|
||||
|
||||
g_signal_emit (managed, gimp_color_managed_signals[SIMULATION_BPC_CHANGED], 0);
|
||||
}
|
||||
|
|
|
@ -45,6 +45,10 @@ G_DECLARE_INTERFACE (GimpColorManaged, gimp_color_managed, GIMP, COLOR_MANAGED,
|
|||
* by the object
|
||||
* @get_simulation_profile: Returns the simulation #GimpColorProfile of the
|
||||
* pixels managed by the object
|
||||
* @get_simulation_rendering_intent: Returns the simulation #GimpColorRenderingIntent
|
||||
* of the pixels managed by the object
|
||||
* @get_simulation_bpc: Returns whether black point compensation is enabled for the
|
||||
* simulation of the pixels managed by the object
|
||||
**/
|
||||
struct _GimpColorManagedInterface
|
||||
{
|
||||
|
@ -68,9 +72,16 @@ struct _GimpColorManagedInterface
|
|||
|
||||
void (* simulation_profile_changed) (GimpColorManaged *managed);
|
||||
|
||||
void (* simulation_intent_changed) (GimpColorManaged *managed);
|
||||
|
||||
void (* simulation_bpc_changed) (GimpColorManaged *managed);
|
||||
|
||||
/* virtual functions */
|
||||
GimpColorProfile * (* get_color_profile) (GimpColorManaged *managed);
|
||||
GimpColorProfile * (* get_simulation_profile) (GimpColorManaged *managed);
|
||||
GimpColorRenderingIntent
|
||||
(* get_simulation_intent) (GimpColorManaged *managed);
|
||||
gboolean (* get_simulation_bpc) (GimpColorManaged *managed);
|
||||
};
|
||||
|
||||
|
||||
|
@ -80,10 +91,18 @@ GimpColorProfile * gimp_color_managed_get_color_profile (GimpColorManag
|
|||
|
||||
GimpColorProfile * gimp_color_managed_get_simulation_profile (GimpColorManaged *managed);
|
||||
|
||||
GimpColorRenderingIntent gimp_color_managed_get_simulation_intent (GimpColorManaged *managed);
|
||||
|
||||
gboolean gimp_color_managed_get_simulation_bpc (GimpColorManaged *managed);
|
||||
|
||||
void gimp_color_managed_profile_changed (GimpColorManaged *managed);
|
||||
|
||||
void gimp_color_managed_simulation_profile_changed (GimpColorManaged *managed);
|
||||
|
||||
void gimp_color_managed_simulation_intent_changed (GimpColorManaged *managed);
|
||||
|
||||
void gimp_color_managed_simulation_bpc_changed (GimpColorManaged *managed);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
|
|
@ -1025,7 +1025,9 @@ gimp_color_area_create_transform (GimpColorArea *area)
|
|||
profile,
|
||||
format,
|
||||
format,
|
||||
NULL);
|
||||
NULL,
|
||||
GIMP_COLOR_RENDERING_INTENT_RELATIVE_COLORIMETRIC,
|
||||
FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -943,7 +943,9 @@ gimp_color_scale_create_transform (GimpColorScale *scale)
|
|||
profile,
|
||||
format,
|
||||
format,
|
||||
NULL);
|
||||
NULL,
|
||||
GIMP_COLOR_RENDERING_INTENT_RELATIVE_COLORIMETRIC,
|
||||
FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1957,7 +1957,9 @@ gimp_color_select_create_transform (GimpColorSelect *select)
|
|||
profile,
|
||||
format,
|
||||
format,
|
||||
NULL);
|
||||
NULL,
|
||||
GIMP_COLOR_RENDERING_INTENT_RELATIVE_COLORIMETRIC,
|
||||
FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -438,7 +438,9 @@ gimp_preview_area_create_transform (GimpPreviewArea *area)
|
|||
profile,
|
||||
format,
|
||||
format,
|
||||
NULL);
|
||||
NULL,
|
||||
GIMP_COLOR_RENDERING_INTENT_RELATIVE_COLORIMETRIC,
|
||||
FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -778,6 +778,8 @@ struct _TransformCache
|
|||
GimpColorProfile *dest_profile;
|
||||
const Babl *dest_format;
|
||||
GimpColorProfile *proof_profile;
|
||||
GimpColorRenderingIntent proof_intent;
|
||||
gboolean proof_bpc;
|
||||
|
||||
gulong notify_id;
|
||||
};
|
||||
|
@ -800,7 +802,9 @@ transform_cache_get (GimpColorConfig *config,
|
|||
const Babl *src_format,
|
||||
GimpColorProfile *dest_profile,
|
||||
const Babl *dest_format,
|
||||
GimpColorProfile *proof_profile)
|
||||
GimpColorProfile *proof_profile,
|
||||
GimpColorRenderingIntent proof_intent,
|
||||
gboolean proof_bpc)
|
||||
{
|
||||
GList *list;
|
||||
|
||||
|
@ -813,7 +817,9 @@ transform_cache_get (GimpColorConfig *config,
|
|||
dest_format == cache->dest_format &&
|
||||
profiles_equal (src_profile, cache->src_profile) &&
|
||||
profiles_equal (dest_profile, cache->dest_profile) &&
|
||||
profiles_equal (proof_profile, cache->proof_profile))
|
||||
profiles_equal (proof_profile, cache->proof_profile) &&
|
||||
proof_intent == cache->proof_intent &&
|
||||
proof_bpc == cache->proof_bpc)
|
||||
{
|
||||
if (debug_cache)
|
||||
g_printerr ("found cache %p\n", cache);
|
||||
|
@ -871,7 +877,9 @@ gimp_widget_get_color_transform (GtkWidget *widget,
|
|||
GimpColorProfile *src_profile,
|
||||
const Babl *src_format,
|
||||
const Babl *dest_format,
|
||||
GimpColorProfile *softproof_profile)
|
||||
GimpColorProfile *softproof_profile,
|
||||
GimpColorRenderingIntent proof_intent,
|
||||
gboolean proof_bpc)
|
||||
{
|
||||
static gboolean initialized = FALSE;
|
||||
GimpColorProfile *proof_profile = NULL;
|
||||
|
@ -914,7 +922,9 @@ gimp_widget_get_color_transform (GtkWidget *widget,
|
|||
src_format,
|
||||
dest_profile,
|
||||
dest_format,
|
||||
proof_profile);
|
||||
proof_profile,
|
||||
proof_intent,
|
||||
proof_bpc);
|
||||
|
||||
if (cache)
|
||||
{
|
||||
|
@ -948,6 +958,8 @@ gimp_widget_get_color_transform (GtkWidget *widget,
|
|||
cache->dest_profile = dest_profile;
|
||||
cache->dest_format = dest_format;
|
||||
cache->proof_profile = proof_profile;
|
||||
cache->proof_intent = proof_intent;
|
||||
cache->proof_bpc = proof_bpc;
|
||||
|
||||
cache->notify_id =
|
||||
g_signal_connect (cache->config, "notify",
|
||||
|
@ -960,7 +972,7 @@ gimp_widget_get_color_transform (GtkWidget *widget,
|
|||
{
|
||||
GimpColorTransformFlags flags = 0;
|
||||
|
||||
if (gimp_color_config_get_simulation_bpc (config))
|
||||
if (proof_bpc)
|
||||
flags |= GIMP_COLOR_TRANSFORM_FLAGS_BLACK_POINT_COMPENSATION;
|
||||
|
||||
if (! gimp_color_config_get_simulation_optimize (config))
|
||||
|
@ -990,7 +1002,7 @@ gimp_widget_get_color_transform (GtkWidget *widget,
|
|||
cache->dest_profile,
|
||||
cache->dest_format,
|
||||
cache->proof_profile,
|
||||
gimp_color_config_get_simulation_intent (config),
|
||||
cache->proof_intent,
|
||||
gimp_color_config_get_display_intent (config),
|
||||
flags);
|
||||
}
|
||||
|
|
|
@ -61,7 +61,9 @@ GimpColorTransform * gimp_widget_get_color_transform (GtkWidget *widget,
|
|||
GimpColorProfile *src_profile,
|
||||
const Babl *src_format,
|
||||
const Babl *dest_format,
|
||||
GimpColorProfile *softproof_profile);
|
||||
GimpColorProfile *softproof_profile,
|
||||
GimpColorRenderingIntent proof_intent,
|
||||
gboolean proof_bpc);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
|
|
@ -269,7 +269,9 @@ colorsel_water_create_transform (ColorselWater *water)
|
|||
profile,
|
||||
format,
|
||||
format,
|
||||
NULL);
|
||||
NULL,
|
||||
GIMP_COLOR_RENDERING_INTENT_RELATIVE_COLORIMETRIC,
|
||||
FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1552,7 +1552,9 @@ gimp_color_wheel_create_transform (GimpColorWheel *wheel)
|
|||
profile,
|
||||
format,
|
||||
format,
|
||||
NULL);
|
||||
NULL,
|
||||
GIMP_COLOR_RENDERING_INTENT_RELATIVE_COLORIMETRIC,
|
||||
FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -356,6 +356,112 @@ CODE
|
|||
);
|
||||
}
|
||||
|
||||
sub image_get_simulation_intent {
|
||||
$blurb = "Returns the image's simulation rendering intent";
|
||||
|
||||
$help = <<'HELP';
|
||||
This procedure returns the image's simulation rendering intent.
|
||||
HELP
|
||||
|
||||
&alxsa_pdb_misc('2022', '3.0');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'image', type => 'image',
|
||||
desc => 'The image' }
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
{ name => 'intent', type => 'enum GimpColorRenderingIntent',
|
||||
desc => "The image's simulation rendering intent." }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
intent = gimp_image_get_simulation_intent (image);
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub image_set_simulation_intent {
|
||||
$blurb = "Sets the image's simulation rendering intent";
|
||||
|
||||
$help = <<'HELP';
|
||||
This procedure sets the image's simulation rendering intent.
|
||||
HELP
|
||||
|
||||
&alxsa_pdb_misc('2022', '3.0');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'image', type => 'image',
|
||||
desc => 'The image' },
|
||||
{ name => 'intent', type => 'enum GimpColorRenderingIntent',
|
||||
desc => 'A GimpColorRenderingIntent' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
gimp_image_set_simulation_intent (image, intent);
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub image_get_simulation_bpc {
|
||||
$blurb = "Returns whether the image has Black Point Compensation enabled for its simulation";
|
||||
|
||||
$help = <<'HELP';
|
||||
This procedure returns whether the image has Black Point Compensation enabled for its simulation
|
||||
HELP
|
||||
|
||||
&alxsa_pdb_misc('2022', '3.0');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'image', type => 'image',
|
||||
desc => 'The image' }
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
{ name => 'bpc', type => 'boolean',
|
||||
desc => "The Black Point Compensation status." }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
bpc = gimp_image_get_simulation_bpc (image);
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub image_set_simulation_bpc {
|
||||
$blurb = "Sets whether the image has Black Point Compensation enabled for its simulation";
|
||||
|
||||
$help = <<'HELP';
|
||||
This procedure whether the image has Black Point Compensation enabled for its simulation
|
||||
HELP
|
||||
|
||||
&alxsa_pdb_misc('2022', '3.0');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'image', type => 'image',
|
||||
desc => 'The image' },
|
||||
{ name => 'bpc', type => 'boolean',
|
||||
desc => 'The Black Point Compensation status.' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
gimp_image_set_simulation_bpc (image, bpc);
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub image_convert_color_profile {
|
||||
$blurb = "Convert the image's layers to a color profile";
|
||||
|
||||
|
@ -472,6 +578,10 @@ CODE
|
|||
image_get_simulation_profile
|
||||
image_set_simulation_profile
|
||||
image_set_simulation_profile_from_file
|
||||
image_get_simulation_intent
|
||||
image_set_simulation_intent
|
||||
image_get_simulation_bpc
|
||||
image_set_simulation_bpc
|
||||
image_convert_color_profile
|
||||
image_convert_color_profile_from_file);
|
||||
|
||||
|
|
Loading…
Reference in New Issue