mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-07-05 02:09:37 +00:00
app: remove checks from stuff that now works on indexed layers
This commit is contained in:
parent
0053494c18
commit
e01189ca77
8 changed files with 14 additions and 43 deletions
|
@ -211,7 +211,7 @@ drawable_actions_update (GimpActionGroup *group,
|
||||||
gimp_action_group_set_action_active (group, action, (condition) != 0)
|
gimp_action_group_set_action_active (group, action, (condition) != 0)
|
||||||
|
|
||||||
SET_SENSITIVE ("drawable-equalize", writable && !children && !is_indexed);
|
SET_SENSITIVE ("drawable-equalize", writable && !children && !is_indexed);
|
||||||
SET_SENSITIVE ("drawable-invert", writable && !children && !is_indexed);
|
SET_SENSITIVE ("drawable-invert", writable && !children);
|
||||||
SET_SENSITIVE ("drawable-levels-stretch", writable && !children && is_rgb);
|
SET_SENSITIVE ("drawable-levels-stretch", writable && !children && is_rgb);
|
||||||
SET_SENSITIVE ("drawable-offset", writable && !children);
|
SET_SENSITIVE ("drawable-offset", writable && !children);
|
||||||
|
|
||||||
|
|
|
@ -67,8 +67,7 @@ brightness_contrast_invoker (GimpProcedure *procedure,
|
||||||
if (success)
|
if (success)
|
||||||
{
|
{
|
||||||
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, TRUE, error) &&
|
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, TRUE, error) &&
|
||||||
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) &&
|
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
|
||||||
! gimp_drawable_is_indexed (drawable))
|
|
||||||
{
|
{
|
||||||
GObject *config = g_object_new (GIMP_TYPE_BRIGHTNESS_CONTRAST_CONFIG,
|
GObject *config = g_object_new (GIMP_TYPE_BRIGHTNESS_CONTRAST_CONFIG,
|
||||||
"brightness", brightness / 127.0,
|
"brightness", brightness / 127.0,
|
||||||
|
@ -212,8 +211,7 @@ posterize_invoker (GimpProcedure *procedure,
|
||||||
if (success)
|
if (success)
|
||||||
{
|
{
|
||||||
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, TRUE, error) &&
|
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, TRUE, error) &&
|
||||||
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) &&
|
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
|
||||||
! gimp_drawable_is_indexed (drawable))
|
|
||||||
{
|
{
|
||||||
GObject *config = g_object_new (GIMP_TYPE_POSTERIZE_CONFIG,
|
GObject *config = g_object_new (GIMP_TYPE_POSTERIZE_CONFIG,
|
||||||
"levels", levels,
|
"levels", levels,
|
||||||
|
@ -516,7 +514,7 @@ colorize_invoker (GimpProcedure *procedure,
|
||||||
{
|
{
|
||||||
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, TRUE, error) &&
|
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, TRUE, error) &&
|
||||||
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) &&
|
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) &&
|
||||||
gimp_drawable_is_rgb (drawable))
|
! gimp_drawable_is_gray (drawable))
|
||||||
{
|
{
|
||||||
GObject *config = g_object_new (GIMP_TYPE_COLORIZE_CONFIG,
|
GObject *config = g_object_new (GIMP_TYPE_COLORIZE_CONFIG,
|
||||||
"hue", hue / 360.0,
|
"hue", hue / 360.0,
|
||||||
|
@ -669,8 +667,7 @@ threshold_invoker (GimpProcedure *procedure,
|
||||||
if (success)
|
if (success)
|
||||||
{
|
{
|
||||||
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, TRUE, error) &&
|
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, TRUE, error) &&
|
||||||
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) &&
|
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
|
||||||
! gimp_drawable_is_indexed (drawable))
|
|
||||||
{
|
{
|
||||||
GObject *config = g_object_new (GIMP_TYPE_THRESHOLD_CONFIG,
|
GObject *config = g_object_new (GIMP_TYPE_THRESHOLD_CONFIG,
|
||||||
"low", low_threshold / 255.0,
|
"low", low_threshold / 255.0,
|
||||||
|
@ -1117,7 +1114,7 @@ register_color_procs (GimpPDB *pdb)
|
||||||
gimp_procedure_set_static_strings (procedure,
|
gimp_procedure_set_static_strings (procedure,
|
||||||
"gimp-colorize",
|
"gimp-colorize",
|
||||||
"Render the drawable as a grayscale image seen through a colored glass.",
|
"Render the drawable as a grayscale image seen through a colored glass.",
|
||||||
"Desaturates the drawable, then tints it with the specified color. This tool is only valid on RGB color images. It will not operate on grayscale or indexed drawables.",
|
"Desaturates the drawable, then tints it with the specified color. This tool is only valid on RGB color images. It will not operate on grayscale drawables.",
|
||||||
"Sven Neumann <sven@gimp.org>",
|
"Sven Neumann <sven@gimp.org>",
|
||||||
"Sven Neumann",
|
"Sven Neumann",
|
||||||
"2004",
|
"2004",
|
||||||
|
|
|
@ -147,14 +147,6 @@ gimp_brightness_contrast_tool_initialize (GimpTool *tool,
|
||||||
if (! drawable)
|
if (! drawable)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (gimp_drawable_is_indexed (drawable))
|
|
||||||
{
|
|
||||||
g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
|
|
||||||
_("Brightness-Contrast does not operate "
|
|
||||||
"on indexed layers."));
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
gimp_config_reset (GIMP_CONFIG (bc_tool->config));
|
gimp_config_reset (GIMP_CONFIG (bc_tool->config));
|
||||||
|
|
||||||
return GIMP_TOOL_CLASS (parent_class)->initialize (tool, display, error);
|
return GIMP_TOOL_CLASS (parent_class)->initialize (tool, display, error);
|
||||||
|
|
|
@ -124,10 +124,10 @@ gimp_colorize_tool_initialize (GimpTool *tool,
|
||||||
if (! drawable)
|
if (! drawable)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (! gimp_drawable_is_rgb (drawable))
|
if (gimp_drawable_is_gray (drawable))
|
||||||
{
|
{
|
||||||
g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
|
g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
|
||||||
_("Colorize operates only on RGB color layers."));
|
_("Colorize does not operate on grayscale layers."));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -116,13 +116,6 @@ gimp_posterize_tool_initialize (GimpTool *tool,
|
||||||
if (! drawable)
|
if (! drawable)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (gimp_drawable_is_indexed (drawable))
|
|
||||||
{
|
|
||||||
g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
|
|
||||||
_("Posterize does not operate on indexed layers."));
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
gimp_config_reset (GIMP_CONFIG (posterize_tool->config));
|
gimp_config_reset (GIMP_CONFIG (posterize_tool->config));
|
||||||
|
|
||||||
if (! GIMP_TOOL_CLASS (parent_class)->initialize (tool, display, error))
|
if (! GIMP_TOOL_CLASS (parent_class)->initialize (tool, display, error))
|
||||||
|
|
|
@ -145,13 +145,6 @@ gimp_threshold_tool_initialize (GimpTool *tool,
|
||||||
if (! drawable)
|
if (! drawable)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (gimp_drawable_is_indexed (drawable))
|
|
||||||
{
|
|
||||||
g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
|
|
||||||
_("Threshold does not operate on indexed layers."));
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
gimp_config_reset (GIMP_CONFIG (t_tool->config));
|
gimp_config_reset (GIMP_CONFIG (t_tool->config));
|
||||||
|
|
||||||
if (! GIMP_TOOL_CLASS (parent_class)->initialize (tool, display, error))
|
if (! GIMP_TOOL_CLASS (parent_class)->initialize (tool, display, error))
|
||||||
|
|
|
@ -514,7 +514,7 @@ gimp_color_balance (gint32 drawable_ID,
|
||||||
*
|
*
|
||||||
* Desaturates the drawable, then tints it with the specified color.
|
* Desaturates the drawable, then tints it with the specified color.
|
||||||
* This tool is only valid on RGB color images. It will not operate on
|
* This tool is only valid on RGB color images. It will not operate on
|
||||||
* grayscale or indexed drawables.
|
* grayscale drawables.
|
||||||
*
|
*
|
||||||
* Returns: TRUE on success.
|
* Returns: TRUE on success.
|
||||||
*
|
*
|
||||||
|
|
|
@ -42,8 +42,7 @@ HELP
|
||||||
code => <<'CODE'
|
code => <<'CODE'
|
||||||
{
|
{
|
||||||
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, TRUE, error) &&
|
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, TRUE, error) &&
|
||||||
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) &&
|
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
|
||||||
! gimp_drawable_is_indexed (drawable))
|
|
||||||
{
|
{
|
||||||
GObject *config = g_object_new (GIMP_TYPE_BRIGHTNESS_CONTRAST_CONFIG,
|
GObject *config = g_object_new (GIMP_TYPE_BRIGHTNESS_CONTRAST_CONFIG,
|
||||||
"brightness", brightness / 127.0,
|
"brightness", brightness / 127.0,
|
||||||
|
@ -206,8 +205,7 @@ HELP
|
||||||
code => <<'CODE'
|
code => <<'CODE'
|
||||||
{
|
{
|
||||||
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, TRUE, error) &&
|
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, TRUE, error) &&
|
||||||
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) &&
|
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
|
||||||
! gimp_drawable_is_indexed (drawable))
|
|
||||||
{
|
{
|
||||||
GObject *config = g_object_new (GIMP_TYPE_POSTERIZE_CONFIG,
|
GObject *config = g_object_new (GIMP_TYPE_POSTERIZE_CONFIG,
|
||||||
"levels", levels,
|
"levels", levels,
|
||||||
|
@ -539,8 +537,7 @@ sub colorize {
|
||||||
|
|
||||||
$help = <<'HELP';
|
$help = <<'HELP';
|
||||||
Desaturates the drawable, then tints it with the specified color. This tool is
|
Desaturates the drawable, then tints it with the specified color. This tool is
|
||||||
only valid on RGB color images. It will not operate on grayscale or indexed
|
only valid on RGB color images. It will not operate on grayscale drawables.
|
||||||
drawables.
|
|
||||||
HELP
|
HELP
|
||||||
|
|
||||||
&neo_pdb_misc('2004', '2.2');
|
&neo_pdb_misc('2004', '2.2');
|
||||||
|
@ -562,7 +559,7 @@ HELP
|
||||||
{
|
{
|
||||||
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, TRUE, error) &&
|
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, TRUE, error) &&
|
||||||
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) &&
|
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) &&
|
||||||
gimp_drawable_is_rgb (drawable))
|
! gimp_drawable_is_gray (drawable))
|
||||||
{
|
{
|
||||||
GObject *config = g_object_new (GIMP_TYPE_COLORIZE_CONFIG,
|
GObject *config = g_object_new (GIMP_TYPE_COLORIZE_CONFIG,
|
||||||
"hue", hue / 360.0,
|
"hue", hue / 360.0,
|
||||||
|
@ -738,8 +735,7 @@ HELP
|
||||||
code => <<'CODE'
|
code => <<'CODE'
|
||||||
{
|
{
|
||||||
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, TRUE, error) &&
|
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, TRUE, error) &&
|
||||||
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) &&
|
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
|
||||||
! gimp_drawable_is_indexed (drawable))
|
|
||||||
{
|
{
|
||||||
GObject *config = g_object_new (GIMP_TYPE_THRESHOLD_CONFIG,
|
GObject *config = g_object_new (GIMP_TYPE_THRESHOLD_CONFIG,
|
||||||
"low", low_threshold / 255.0,
|
"low", low_threshold / 255.0,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue