2006-12-10 05:33:38 +08:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
2004-04-19 22:54:24 +08:00
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
2009-01-18 06:28:01 +08:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
2004-04-19 22:54:24 +08:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
2009-01-18 06:28:01 +08:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2004-04-19 22:54:24 +08:00
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2018-07-12 05:27:07 +08:00
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2004-04-19 22:54:24 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
2008-10-10 04:24:04 +08:00
|
|
|
#include <gegl.h>
|
2004-04-19 22:54:24 +08:00
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
|
|
|
|
|
|
|
#include "actions-types.h"
|
|
|
|
|
|
|
|
#include "config/gimpguiconfig.h"
|
|
|
|
|
2015-11-23 06:19:49 +08:00
|
|
|
#include "gegl/gimp-babl.h"
|
|
|
|
|
2004-04-19 22:54:24 +08:00
|
|
|
#include "core/gimp.h"
|
|
|
|
#include "core/gimpchannel.h"
|
|
|
|
#include "core/gimpcontext.h"
|
|
|
|
#include "core/gimpimage.h"
|
2015-08-03 04:18:43 +08:00
|
|
|
#include "core/gimpimage-color-profile.h"
|
2009-09-08 03:09:24 +08:00
|
|
|
#include "core/gimpitemstack.h"
|
2004-04-19 22:54:24 +08:00
|
|
|
|
|
|
|
#include "widgets/gimpactiongroup.h"
|
|
|
|
#include "widgets/gimphelp-ids.h"
|
|
|
|
|
2004-05-03 22:03:51 +08:00
|
|
|
#include "actions.h"
|
2004-04-19 22:54:24 +08:00
|
|
|
#include "image-actions.h"
|
2004-04-20 21:25:55 +08:00
|
|
|
#include "image-commands.h"
|
2004-04-19 22:54:24 +08:00
|
|
|
|
|
|
|
#include "gimp-intl.h"
|
|
|
|
|
|
|
|
|
2006-04-10 16:06:18 +08:00
|
|
|
static const GimpActionEntry image_actions[] =
|
2004-04-19 22:54:24 +08:00
|
|
|
{
|
2004-10-18 19:29:58 +08:00
|
|
|
{ "image-menubar", NULL,
|
2008-12-03 23:27:42 +08:00
|
|
|
NC_("image-action", "Image Menu"), NULL, NULL, NULL,
|
2004-05-02 16:56:07 +08:00
|
|
|
GIMP_HELP_IMAGE_WINDOW },
|
|
|
|
|
2004-10-18 19:29:58 +08:00
|
|
|
{ "image-popup", NULL,
|
2008-12-03 23:27:42 +08:00
|
|
|
NC_("image-action", "Image Menu"), NULL, NULL, NULL,
|
2004-05-02 16:56:07 +08:00
|
|
|
GIMP_HELP_IMAGE_WINDOW },
|
|
|
|
|
2015-06-15 19:20:04 +08:00
|
|
|
{ "image-menu", NULL, NC_("image-action", "_Image") },
|
|
|
|
{ "image-mode-menu", NULL, NC_("image-action", "_Mode") },
|
2020-05-11 09:51:12 +08:00
|
|
|
{ "image-precision-menu", NULL, NC_("image-action", "_Encoding") },
|
2015-06-15 19:20:04 +08:00
|
|
|
{ "image-color-management-menu", NULL, NC_("image-action",
|
2015-12-10 08:21:07 +08:00
|
|
|
"Color Ma_nagement") },
|
2015-06-15 19:20:04 +08:00
|
|
|
{ "image-transform-menu", NULL, NC_("image-action", "_Transform") },
|
|
|
|
{ "image-guides-menu", NULL, NC_("image-action", "_Guides") },
|
2017-07-08 15:39:31 +08:00
|
|
|
{ "image-metadata-menu", NULL, NC_("image-action", "Meta_data") },
|
2005-08-17 06:56:16 +08:00
|
|
|
|
2017-02-03 03:42:58 +08:00
|
|
|
{ "colors-menu", NULL, NC_("image-action", "_Colors") },
|
|
|
|
{ "colors-info-menu", NULL, NC_("image-action", "I_nfo") },
|
|
|
|
{ "colors-auto-menu", NULL, NC_("image-action", "_Auto") },
|
|
|
|
{ "colors-map-menu", NULL, NC_("image-action", "_Map") },
|
|
|
|
{ "colors-tone-mapping-menu", NULL, NC_("image-action", "_Tone Mapping") },
|
|
|
|
{ "colors-components-menu", NULL, NC_("image-action", "C_omponents") },
|
|
|
|
{ "colors-desaturate-menu", NULL, NC_("image-action", "D_esaturate") },
|
2004-04-19 22:54:24 +08:00
|
|
|
|
2017-03-05 23:01:59 +08:00
|
|
|
{ "image-new", GIMP_ICON_DOCUMENT_NEW,
|
2011-09-17 04:56:08 +08:00
|
|
|
NC_("image-action", "_New..."), "<primary>N",
|
2008-12-04 18:32:20 +08:00
|
|
|
NC_("image-action", "Create a new image"),
|
2019-07-04 07:11:48 +08:00
|
|
|
image_new_cmd_callback,
|
2004-05-25 20:02:54 +08:00
|
|
|
GIMP_HELP_FILE_NEW },
|
|
|
|
|
2017-03-05 23:01:59 +08:00
|
|
|
{ "image-duplicate", GIMP_ICON_OBJECT_DUPLICATE,
|
2016-05-09 01:32:57 +08:00
|
|
|
NC_("image-action", "_Duplicate"), "<primary>D",
|
|
|
|
NC_("image-action", "Create a duplicate of this image"),
|
2019-07-04 07:11:48 +08:00
|
|
|
image_duplicate_cmd_callback,
|
2016-05-09 01:32:57 +08:00
|
|
|
GIMP_HELP_IMAGE_DUPLICATE },
|
|
|
|
|
2015-06-16 02:19:32 +08:00
|
|
|
{ "image-color-profile-assign", NULL,
|
|
|
|
NC_("image-action", "_Assign Color Profile..."), NULL,
|
|
|
|
NC_("image-action", "Set a color profile on the image"),
|
2019-07-04 07:11:48 +08:00
|
|
|
image_color_profile_assign_cmd_callback,
|
2015-06-16 02:19:32 +08:00
|
|
|
GIMP_HELP_IMAGE_COLOR_PROFILE_ASSIGN },
|
|
|
|
|
|
|
|
{ "image-color-profile-convert", NULL,
|
|
|
|
NC_("image-action", "_Convert to Color Profile..."), NULL,
|
|
|
|
NC_("image-action", "Apply a color profile to the image"),
|
2019-07-04 07:11:48 +08:00
|
|
|
image_color_profile_convert_cmd_callback,
|
2015-06-16 02:19:32 +08:00
|
|
|
GIMP_HELP_IMAGE_COLOR_PROFILE_CONVERT },
|
|
|
|
|
|
|
|
{ "image-color-profile-discard", NULL,
|
|
|
|
NC_("image-action", "_Discard Color Profile"), NULL,
|
|
|
|
NC_("image-action", "Remove the image's color profile"),
|
2019-07-04 07:11:48 +08:00
|
|
|
image_color_profile_discard_cmd_callback,
|
2015-06-16 02:19:32 +08:00
|
|
|
GIMP_HELP_IMAGE_COLOR_PROFILE_DISCARD },
|
|
|
|
|
2016-05-07 09:01:18 +08:00
|
|
|
{ "image-color-profile-save", NULL,
|
|
|
|
NC_("image-action", "_Save Color Profile to File..."), NULL,
|
|
|
|
NC_("image-action", "Save the image's color profile to an ICC file"),
|
2019-07-04 07:11:48 +08:00
|
|
|
image_color_profile_save_cmd_callback,
|
2016-05-07 09:01:18 +08:00
|
|
|
GIMP_HELP_IMAGE_COLOR_PROFILE_SAVE },
|
|
|
|
|
2017-03-05 23:01:59 +08:00
|
|
|
{ "image-resize", GIMP_ICON_OBJECT_RESIZE,
|
2008-12-03 23:27:42 +08:00
|
|
|
NC_("image-action", "Can_vas Size..."), NULL,
|
2008-12-04 18:32:20 +08:00
|
|
|
NC_("image-action", "Adjust the image dimensions"),
|
2019-07-04 07:11:48 +08:00
|
|
|
image_resize_cmd_callback,
|
2004-04-19 22:54:24 +08:00
|
|
|
GIMP_HELP_IMAGE_RESIZE },
|
|
|
|
|
2004-09-05 06:08:43 +08:00
|
|
|
{ "image-resize-to-layers", NULL,
|
2009-02-23 00:55:20 +08:00
|
|
|
NC_("image-action", "Fit Canvas to L_ayers"), NULL,
|
2008-12-04 18:32:20 +08:00
|
|
|
NC_("image-action", "Resize the image to enclose all layers"),
|
2019-07-04 07:11:48 +08:00
|
|
|
image_resize_to_layers_cmd_callback,
|
2004-09-05 06:08:43 +08:00
|
|
|
GIMP_HELP_IMAGE_RESIZE_TO_LAYERS },
|
|
|
|
|
2007-06-10 01:17:30 +08:00
|
|
|
{ "image-resize-to-selection", NULL,
|
2008-12-03 23:27:42 +08:00
|
|
|
NC_("image-action", "F_it Canvas to Selection"), NULL,
|
2008-12-04 18:32:20 +08:00
|
|
|
NC_("image-action", "Resize the image to the extents of the selection"),
|
2019-07-04 07:11:48 +08:00
|
|
|
image_resize_to_selection_cmd_callback,
|
2007-06-10 01:17:30 +08:00
|
|
|
GIMP_HELP_IMAGE_RESIZE_TO_SELECTION },
|
|
|
|
|
2017-03-05 23:01:59 +08:00
|
|
|
{ "image-print-size", GIMP_ICON_DOCUMENT_PRINT_RESOLUTION,
|
2008-12-03 23:27:42 +08:00
|
|
|
NC_("image-action", "_Print Size..."), NULL,
|
2008-12-04 18:32:20 +08:00
|
|
|
NC_("image-action", "Adjust the print resolution"),
|
2019-07-04 07:11:48 +08:00
|
|
|
image_print_size_cmd_callback,
|
2004-11-14 06:27:39 +08:00
|
|
|
GIMP_HELP_IMAGE_PRINT_SIZE },
|
|
|
|
|
2017-03-05 23:01:59 +08:00
|
|
|
{ "image-scale", GIMP_ICON_OBJECT_SCALE,
|
2008-12-03 23:27:42 +08:00
|
|
|
NC_("image-action", "_Scale Image..."), NULL,
|
2008-12-04 18:32:20 +08:00
|
|
|
NC_("image-action", "Change the size of the image content"),
|
2019-07-04 07:11:48 +08:00
|
|
|
image_scale_cmd_callback,
|
2004-04-19 22:54:24 +08:00
|
|
|
GIMP_HELP_IMAGE_SCALE },
|
|
|
|
|
2017-03-05 23:01:59 +08:00
|
|
|
{ "image-crop-to-selection", GIMP_ICON_TOOL_CROP,
|
2008-12-03 23:27:42 +08:00
|
|
|
NC_("image-action", "_Crop to Selection"), NULL,
|
2008-12-04 18:32:20 +08:00
|
|
|
NC_("image-action", "Crop the image to the extents of the selection"),
|
2019-07-04 07:11:48 +08:00
|
|
|
image_crop_to_selection_cmd_callback,
|
2012-09-23 02:35:36 +08:00
|
|
|
GIMP_HELP_IMAGE_CROP },
|
|
|
|
|
2017-03-05 23:01:59 +08:00
|
|
|
{ "image-crop-to-content", GIMP_ICON_TOOL_CROP,
|
2012-09-23 02:35:36 +08:00
|
|
|
NC_("image-action", "Crop to C_ontent"), NULL,
|
|
|
|
NC_("image-action", "Crop the image to the extents of its content (remove empty borders from the image)"),
|
2019-07-04 07:11:48 +08:00
|
|
|
image_crop_to_content_cmd_callback,
|
2004-04-19 22:54:24 +08:00
|
|
|
GIMP_HELP_IMAGE_CROP },
|
|
|
|
|
|
|
|
{ "image-merge-layers", NULL,
|
2011-09-17 04:56:08 +08:00
|
|
|
NC_("image-action", "Merge Visible _Layers..."), "<primary>M",
|
2008-12-04 18:32:20 +08:00
|
|
|
NC_("image-action", "Merge all visible layers into one layer"),
|
2019-07-04 07:11:48 +08:00
|
|
|
image_merge_layers_cmd_callback,
|
2004-04-19 22:54:24 +08:00
|
|
|
GIMP_HELP_IMAGE_MERGE_LAYERS },
|
|
|
|
|
|
|
|
{ "image-flatten", NULL,
|
2008-12-03 23:27:42 +08:00
|
|
|
NC_("image-action", "_Flatten Image"), NULL,
|
2008-12-04 18:32:20 +08:00
|
|
|
NC_("image-action", "Merge all layers into one and remove transparency"),
|
2019-07-04 07:11:48 +08:00
|
|
|
image_flatten_image_cmd_callback,
|
2004-04-19 22:54:24 +08:00
|
|
|
GIMP_HELP_IMAGE_FLATTEN },
|
|
|
|
|
2017-03-05 23:01:59 +08:00
|
|
|
{ "image-configure-grid", GIMP_ICON_GRID,
|
2008-12-03 23:27:42 +08:00
|
|
|
NC_("image-action", "Configure G_rid..."), NULL,
|
2008-12-04 18:32:20 +08:00
|
|
|
NC_("image-action", "Configure the grid for this image"),
|
2019-07-04 07:11:48 +08:00
|
|
|
image_configure_grid_cmd_callback,
|
2005-04-05 06:34:29 +08:00
|
|
|
GIMP_HELP_IMAGE_GRID },
|
|
|
|
|
2014-05-12 04:49:22 +08:00
|
|
|
{ "image-properties", "dialog-information",
|
2008-12-03 23:27:42 +08:00
|
|
|
NC_("image-action", "Image Pr_operties"), "<alt>Return",
|
2008-12-04 18:32:20 +08:00
|
|
|
NC_("image-action", "Display information about this image"),
|
2019-07-04 07:11:48 +08:00
|
|
|
image_properties_cmd_callback,
|
2005-04-05 06:34:29 +08:00
|
|
|
GIMP_HELP_IMAGE_PROPERTIES }
|
2004-04-19 22:54:24 +08:00
|
|
|
};
|
|
|
|
|
2016-05-09 01:27:29 +08:00
|
|
|
static const GimpToggleActionEntry image_toggle_actions[] =
|
|
|
|
{
|
2018-10-07 22:16:21 +08:00
|
|
|
{ "image-color-profile-use-srgb", NULL,
|
|
|
|
NC_("image-action", "Use _sRGB Profile"), NULL,
|
|
|
|
NC_("image-action", "Temporarily use an sRGB profile for the image. "
|
|
|
|
"This is the same as discarding the image's color profile, but "
|
|
|
|
"allows to easily restore the profile."),
|
2019-07-04 07:11:48 +08:00
|
|
|
image_color_profile_use_srgb_cmd_callback,
|
2016-05-09 01:27:29 +08:00
|
|
|
TRUE,
|
2018-10-07 22:16:21 +08:00
|
|
|
GIMP_HELP_IMAGE_COLOR_PROFILE_USE_SRGB }
|
2016-05-09 01:27:29 +08:00
|
|
|
};
|
|
|
|
|
2012-04-25 22:46:58 +08:00
|
|
|
static const GimpRadioActionEntry image_convert_base_type_actions[] =
|
2004-06-10 22:25:04 +08:00
|
|
|
{
|
2017-03-05 23:01:59 +08:00
|
|
|
{ "image-convert-rgb", GIMP_ICON_CONVERT_RGB,
|
2008-12-03 23:27:42 +08:00
|
|
|
NC_("image-convert-action", "_RGB"), NULL,
|
2008-12-04 18:32:20 +08:00
|
|
|
NC_("image-convert-action", "Convert the image to the RGB colorspace"),
|
2006-06-14 22:36:34 +08:00
|
|
|
GIMP_RGB, GIMP_HELP_IMAGE_CONVERT_RGB },
|
2004-06-10 22:25:04 +08:00
|
|
|
|
2017-03-05 23:01:59 +08:00
|
|
|
{ "image-convert-grayscale", GIMP_ICON_CONVERT_GRAYSCALE,
|
2008-12-03 23:27:42 +08:00
|
|
|
NC_("image-convert-action", "_Grayscale"), NULL,
|
2008-12-04 18:32:20 +08:00
|
|
|
NC_("image-convert-action", "Convert the image to grayscale"),
|
2006-06-14 22:36:34 +08:00
|
|
|
GIMP_GRAY, GIMP_HELP_IMAGE_CONVERT_GRAYSCALE },
|
2004-06-10 22:25:04 +08:00
|
|
|
|
2017-03-05 23:01:59 +08:00
|
|
|
{ "image-convert-indexed", GIMP_ICON_CONVERT_INDEXED,
|
2008-12-03 23:27:42 +08:00
|
|
|
NC_("image-convert-action", "_Indexed..."), NULL,
|
2008-12-04 18:32:20 +08:00
|
|
|
NC_("image-convert-action", "Convert the image to indexed colors"),
|
2006-06-14 22:36:34 +08:00
|
|
|
GIMP_INDEXED, GIMP_HELP_IMAGE_CONVERT_INDEXED }
|
2004-06-10 22:25:04 +08:00
|
|
|
};
|
|
|
|
|
2012-04-25 22:46:58 +08:00
|
|
|
static const GimpRadioActionEntry image_convert_precision_actions[] =
|
|
|
|
{
|
2015-11-23 06:19:49 +08:00
|
|
|
{ "image-convert-u8", NULL,
|
|
|
|
NC_("image-convert-action", "8 bit integer"), NULL,
|
2013-06-23 22:51:24 +08:00
|
|
|
NC_("image-convert-action",
|
2015-11-23 06:19:49 +08:00
|
|
|
"Convert the image to 8 bit integer"),
|
|
|
|
GIMP_COMPONENT_TYPE_U8, GIMP_HELP_IMAGE_CONVERT_U8 },
|
2013-06-23 22:51:24 +08:00
|
|
|
|
2015-11-23 06:19:49 +08:00
|
|
|
{ "image-convert-u16", NULL,
|
|
|
|
NC_("image-convert-action", "16 bit integer"), NULL,
|
2013-06-23 22:51:24 +08:00
|
|
|
NC_("image-convert-action",
|
2015-11-23 06:19:49 +08:00
|
|
|
"Convert the image to 16 bit integer"),
|
|
|
|
GIMP_COMPONENT_TYPE_U16, GIMP_HELP_IMAGE_CONVERT_U16 },
|
2013-06-23 22:51:24 +08:00
|
|
|
|
2015-11-23 06:19:49 +08:00
|
|
|
{ "image-convert-u32", NULL,
|
|
|
|
NC_("image-convert-action", "32 bit integer"), NULL,
|
2013-06-23 22:51:24 +08:00
|
|
|
NC_("image-convert-action",
|
2015-11-23 06:19:49 +08:00
|
|
|
"Convert the image to 32 bit integer"),
|
|
|
|
GIMP_COMPONENT_TYPE_U32, GIMP_HELP_IMAGE_CONVERT_U32 },
|
2013-06-23 22:51:24 +08:00
|
|
|
|
2015-11-23 06:19:49 +08:00
|
|
|
{ "image-convert-half", NULL,
|
|
|
|
NC_("image-convert-action", "16 bit floating point"), NULL,
|
2013-06-23 22:51:24 +08:00
|
|
|
NC_("image-convert-action",
|
2015-11-23 06:19:49 +08:00
|
|
|
"Convert the image to 16 bit floating point"),
|
|
|
|
GIMP_COMPONENT_TYPE_HALF, GIMP_HELP_IMAGE_CONVERT_HALF },
|
2013-06-23 22:51:24 +08:00
|
|
|
|
2015-11-23 06:19:49 +08:00
|
|
|
{ "image-convert-float", NULL,
|
|
|
|
NC_("image-convert-action", "32 bit floating point"), NULL,
|
2013-06-23 22:51:24 +08:00
|
|
|
NC_("image-convert-action",
|
2015-11-23 06:19:49 +08:00
|
|
|
"Convert the image to 32 bit floating point"),
|
|
|
|
GIMP_COMPONENT_TYPE_FLOAT, GIMP_HELP_IMAGE_CONVERT_FLOAT },
|
2013-06-23 22:51:24 +08:00
|
|
|
|
2015-11-23 06:19:49 +08:00
|
|
|
{ "image-convert-double", NULL,
|
|
|
|
NC_("image-convert-action", "64 bit floating point"), NULL,
|
2013-06-23 22:51:24 +08:00
|
|
|
NC_("image-convert-action",
|
2015-11-23 06:19:49 +08:00
|
|
|
"Convert the image to 64 bit floating point"),
|
|
|
|
GIMP_COMPONENT_TYPE_DOUBLE, GIMP_HELP_IMAGE_CONVERT_DOUBLE }
|
|
|
|
};
|
2014-03-09 07:41:58 +08:00
|
|
|
|
Initial space invasion commit in GIMP
All babl formats now have a space equivalent to a color profile,
determining the format's primaries and TRCs. This commit makes GIMP
aware of this.
libgimp:
- enum GimpPrecision: rename GAMMA values to NON_LINEAR and keep GAMMA
as deprecated aliases, add PERCEPTUAL values so we now have LINEAR,
NON_LINEAR and PERCPTUAL for each encoding, matching the babl
encoding variants RGB, R'G'B' and R~G~B~.
- gimp_color_transform_can_gegl_copy() now returns TRUE if both
profiles can return a babl space, increasing the amount of fast babl
color conversions significantly.
- TODO: no solution yet for getting libgimp drawable proxy buffers in
the right format with space.
plug-ins:
- follow the GimpPrecision change.
- TODO: everything else unchanged and partly broken or sub-optimal,
like setting a new image's color profile too late.
app:
- add enum GimpTRCType { LINEAR, NON_LINEAR, PERCEPTUAL } as
replacement for all "linear" booleans.
- change gimp-babl functions to take babl spaces and GimpTRCType
parameters and support all sorts of new perceptual ~ formats.
- a lot of places changed in the early days of goat invasion didn't
take advantage of gimp-babl utility functions and constructed
formats manually. They all needed revisiting and many now use much
simpler code calling gimp-babl API.
- change gimp_babl_format_get_color_profile() to really extract a
newly allocated color profile from the format, and add
gimp_babl_get_builtin_color_profile() which does the same as
gimp_babl_format_get_color_profile() did before. Visited all callers
to decide whether they are looking for the format's actual profile,
or for one of the builtin profiles, simplifying code that only needs
builtin profiles.
- drawables have a new get_space_api(), get_linear() is now get_trc().
- images now have a "layer space" and an API to get it,
gimp_image_get_layer_format() returns formats in that space.
- an image's layer space is created from the image's color profile,
change gimpimage-color-profile to deal with that correctly
- change many babl_format() calls to babl_format_with_space() and take
the space from passed formats or drawables
- add function gimp_layer_fix_format_space() which replaces the
layer's buffer with one that has the image's layer format, but
doesn't change pixel values
- use gimp_layer_fix_format_space() to make sure layers loaded from
XCF and created by plug-ins have the right space when added to the
image, because it's impossible to always assign the right space upon
layer creation
- "assign color profile" and "discard color profile" now require use
of gimp_layer_fix_format_space() too because the profile is now
embedded in all formats via the space. Add
gimp_image_assign_color_profile() which does all that and call it
instead of a simple gimp_image_set_color_profile(), also from the
PDB set-color-profile functions, which are essentially "assign" and
"discard" calls.
- generally, make sure a new image's color profile is set before
adding layers to it, gimp_image_set_color_profile() is more than
before considered know-what-you-are-doing API.
- take special precaution in all places that call
gimp_drawable_convert_type(), we now must pass a new_profile from
all callers that convert layers within the same image (such as
image_convert_type, image_convert_precision), because the layer's
new space can't be determined from the image's layer format during
the call.
- change all "linear" properties to "trc", in all config objects like
for levels and curves, in the histogram, in the widgets. This results
in some GUI that now has three choices instead of two.
TODO: we might want to reduce that back to two later.
- keep "linear" boolean properties around as compat if needed for file
pasring, but always convert the parsed parsed boolean to
GimpTRCType.
- TODO: the image's "enable color management" switch is currently
broken, will fix that in another commit.
2018-07-21 20:23:01 +08:00
|
|
|
static const GimpRadioActionEntry image_convert_trc_actions[] =
|
2015-11-23 06:19:49 +08:00
|
|
|
{
|
|
|
|
{ "image-convert-linear", NULL,
|
|
|
|
NC_("image-convert-action", "Linear light"), NULL,
|
2014-03-09 07:41:58 +08:00
|
|
|
NC_("image-convert-action",
|
2015-11-23 06:19:49 +08:00
|
|
|
"Convert the image to linear light"),
|
2019-05-31 22:48:19 +08:00
|
|
|
GIMP_TRC_LINEAR, GIMP_HELP_IMAGE_CONVERT_GAMMA },
|
|
|
|
|
|
|
|
{ "image-convert-non-linear", NULL,
|
|
|
|
NC_("image-convert-action", "Non-Linear"), NULL,
|
|
|
|
NC_("image-convert-action",
|
|
|
|
"Convert the image to non-linear gamma from the color profile"),
|
|
|
|
GIMP_TRC_NON_LINEAR, GIMP_HELP_IMAGE_CONVERT_GAMMA },
|
|
|
|
|
|
|
|
{ "image-convert-perceptual", NULL,
|
|
|
|
NC_("image-convert-action", "Perceptual (sRGB)"), NULL,
|
|
|
|
NC_("image-convert-action",
|
|
|
|
"Convert the image to perceptual (sRGB) gamma"),
|
|
|
|
GIMP_TRC_PERCEPTUAL, GIMP_HELP_IMAGE_CONVERT_GAMMA }
|
2012-04-25 22:46:58 +08:00
|
|
|
};
|
|
|
|
|
2006-04-10 16:06:18 +08:00
|
|
|
static const GimpEnumActionEntry image_flip_actions[] =
|
2004-04-19 22:54:24 +08:00
|
|
|
{
|
2017-03-05 23:01:59 +08:00
|
|
|
{ "image-flip-horizontal", GIMP_ICON_OBJECT_FLIP_HORIZONTAL,
|
2008-12-03 23:27:42 +08:00
|
|
|
NC_("image-action", "Flip _Horizontally"), NULL,
|
2008-12-04 18:32:20 +08:00
|
|
|
NC_("image-action", "Flip image horizontally"),
|
2004-11-19 00:04:41 +08:00
|
|
|
GIMP_ORIENTATION_HORIZONTAL, FALSE,
|
2004-04-19 22:54:24 +08:00
|
|
|
GIMP_HELP_IMAGE_FLIP_HORIZONTAL },
|
|
|
|
|
2017-03-05 23:01:59 +08:00
|
|
|
{ "image-flip-vertical", GIMP_ICON_OBJECT_FLIP_VERTICAL,
|
2008-12-03 23:27:42 +08:00
|
|
|
NC_("image-action", "Flip _Vertically"), NULL,
|
2008-12-04 18:32:20 +08:00
|
|
|
NC_("image-action", "Flip image vertically"),
|
2004-11-19 00:04:41 +08:00
|
|
|
GIMP_ORIENTATION_VERTICAL, FALSE,
|
2004-04-19 22:54:24 +08:00
|
|
|
GIMP_HELP_IMAGE_FLIP_VERTICAL }
|
|
|
|
};
|
|
|
|
|
2006-04-10 16:06:18 +08:00
|
|
|
static const GimpEnumActionEntry image_rotate_actions[] =
|
2004-04-19 22:54:24 +08:00
|
|
|
{
|
2017-03-05 23:01:59 +08:00
|
|
|
{ "image-rotate-90", GIMP_ICON_OBJECT_ROTATE_90,
|
2008-12-03 23:27:42 +08:00
|
|
|
NC_("image-action", "Rotate 90° _clockwise"), NULL,
|
2008-12-04 18:32:20 +08:00
|
|
|
NC_("image-action", "Rotate the image 90 degrees to the right"),
|
2004-11-19 00:04:41 +08:00
|
|
|
GIMP_ROTATE_90, FALSE,
|
2004-04-19 22:54:24 +08:00
|
|
|
GIMP_HELP_IMAGE_ROTATE_90 },
|
|
|
|
|
2017-03-05 23:01:59 +08:00
|
|
|
{ "image-rotate-180", GIMP_ICON_OBJECT_ROTATE_180,
|
2008-12-03 23:27:42 +08:00
|
|
|
NC_("image-action", "Rotate _180°"), NULL,
|
2008-12-04 18:32:20 +08:00
|
|
|
NC_("image-action", "Turn the image upside-down"),
|
2004-11-19 00:04:41 +08:00
|
|
|
GIMP_ROTATE_180, FALSE,
|
2004-04-19 22:54:24 +08:00
|
|
|
GIMP_HELP_IMAGE_ROTATE_180 },
|
|
|
|
|
2017-03-05 23:01:59 +08:00
|
|
|
{ "image-rotate-270", GIMP_ICON_OBJECT_ROTATE_270,
|
2008-12-03 23:27:42 +08:00
|
|
|
NC_("image-action", "Rotate 90° counter-clock_wise"), NULL,
|
2008-12-04 18:32:20 +08:00
|
|
|
NC_("image-action", "Rotate the image 90 degrees to the left"),
|
2004-11-19 00:04:41 +08:00
|
|
|
GIMP_ROTATE_270, FALSE,
|
2004-04-19 22:54:24 +08:00
|
|
|
GIMP_HELP_IMAGE_ROTATE_270 }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
void
|
2004-04-27 21:55:26 +08:00
|
|
|
image_actions_setup (GimpActionGroup *group)
|
2004-04-19 22:54:24 +08:00
|
|
|
{
|
2008-12-03 23:27:42 +08:00
|
|
|
gimp_action_group_add_actions (group, "image-action",
|
2004-04-19 22:54:24 +08:00
|
|
|
image_actions,
|
2004-04-27 21:55:26 +08:00
|
|
|
G_N_ELEMENTS (image_actions));
|
2004-04-19 22:54:24 +08:00
|
|
|
|
2016-05-09 01:27:29 +08:00
|
|
|
gimp_action_group_add_toggle_actions (group, "image-action",
|
|
|
|
image_toggle_actions,
|
|
|
|
G_N_ELEMENTS (image_toggle_actions));
|
|
|
|
|
2008-12-03 23:27:42 +08:00
|
|
|
gimp_action_group_add_radio_actions (group, "image-convert-action",
|
2012-04-25 22:46:58 +08:00
|
|
|
image_convert_base_type_actions,
|
|
|
|
G_N_ELEMENTS (image_convert_base_type_actions),
|
|
|
|
NULL, 0,
|
2019-07-04 07:11:48 +08:00
|
|
|
image_convert_base_type_cmd_callback);
|
2012-04-25 22:46:58 +08:00
|
|
|
|
|
|
|
gimp_action_group_add_radio_actions (group, "image-convert-action",
|
|
|
|
image_convert_precision_actions,
|
|
|
|
G_N_ELEMENTS (image_convert_precision_actions),
|
2006-06-14 22:36:34 +08:00
|
|
|
NULL, 0,
|
2019-07-04 07:11:48 +08:00
|
|
|
image_convert_precision_cmd_callback);
|
2004-06-10 22:25:04 +08:00
|
|
|
|
2015-11-23 06:19:49 +08:00
|
|
|
gimp_action_group_add_radio_actions (group, "image-convert-action",
|
Initial space invasion commit in GIMP
All babl formats now have a space equivalent to a color profile,
determining the format's primaries and TRCs. This commit makes GIMP
aware of this.
libgimp:
- enum GimpPrecision: rename GAMMA values to NON_LINEAR and keep GAMMA
as deprecated aliases, add PERCEPTUAL values so we now have LINEAR,
NON_LINEAR and PERCPTUAL for each encoding, matching the babl
encoding variants RGB, R'G'B' and R~G~B~.
- gimp_color_transform_can_gegl_copy() now returns TRUE if both
profiles can return a babl space, increasing the amount of fast babl
color conversions significantly.
- TODO: no solution yet for getting libgimp drawable proxy buffers in
the right format with space.
plug-ins:
- follow the GimpPrecision change.
- TODO: everything else unchanged and partly broken or sub-optimal,
like setting a new image's color profile too late.
app:
- add enum GimpTRCType { LINEAR, NON_LINEAR, PERCEPTUAL } as
replacement for all "linear" booleans.
- change gimp-babl functions to take babl spaces and GimpTRCType
parameters and support all sorts of new perceptual ~ formats.
- a lot of places changed in the early days of goat invasion didn't
take advantage of gimp-babl utility functions and constructed
formats manually. They all needed revisiting and many now use much
simpler code calling gimp-babl API.
- change gimp_babl_format_get_color_profile() to really extract a
newly allocated color profile from the format, and add
gimp_babl_get_builtin_color_profile() which does the same as
gimp_babl_format_get_color_profile() did before. Visited all callers
to decide whether they are looking for the format's actual profile,
or for one of the builtin profiles, simplifying code that only needs
builtin profiles.
- drawables have a new get_space_api(), get_linear() is now get_trc().
- images now have a "layer space" and an API to get it,
gimp_image_get_layer_format() returns formats in that space.
- an image's layer space is created from the image's color profile,
change gimpimage-color-profile to deal with that correctly
- change many babl_format() calls to babl_format_with_space() and take
the space from passed formats or drawables
- add function gimp_layer_fix_format_space() which replaces the
layer's buffer with one that has the image's layer format, but
doesn't change pixel values
- use gimp_layer_fix_format_space() to make sure layers loaded from
XCF and created by plug-ins have the right space when added to the
image, because it's impossible to always assign the right space upon
layer creation
- "assign color profile" and "discard color profile" now require use
of gimp_layer_fix_format_space() too because the profile is now
embedded in all formats via the space. Add
gimp_image_assign_color_profile() which does all that and call it
instead of a simple gimp_image_set_color_profile(), also from the
PDB set-color-profile functions, which are essentially "assign" and
"discard" calls.
- generally, make sure a new image's color profile is set before
adding layers to it, gimp_image_set_color_profile() is more than
before considered know-what-you-are-doing API.
- take special precaution in all places that call
gimp_drawable_convert_type(), we now must pass a new_profile from
all callers that convert layers within the same image (such as
image_convert_type, image_convert_precision), because the layer's
new space can't be determined from the image's layer format during
the call.
- change all "linear" properties to "trc", in all config objects like
for levels and curves, in the histogram, in the widgets. This results
in some GUI that now has three choices instead of two.
TODO: we might want to reduce that back to two later.
- keep "linear" boolean properties around as compat if needed for file
pasring, but always convert the parsed parsed boolean to
GimpTRCType.
- TODO: the image's "enable color management" switch is currently
broken, will fix that in another commit.
2018-07-21 20:23:01 +08:00
|
|
|
image_convert_trc_actions,
|
|
|
|
G_N_ELEMENTS (image_convert_trc_actions),
|
2015-11-23 06:19:49 +08:00
|
|
|
NULL, 0,
|
2019-07-04 07:11:48 +08:00
|
|
|
image_convert_trc_cmd_callback);
|
2015-11-23 06:19:49 +08:00
|
|
|
|
2008-12-03 23:27:42 +08:00
|
|
|
gimp_action_group_add_enum_actions (group, "image-action",
|
2004-04-19 22:54:24 +08:00
|
|
|
image_flip_actions,
|
|
|
|
G_N_ELEMENTS (image_flip_actions),
|
2019-07-04 07:11:48 +08:00
|
|
|
image_flip_cmd_callback);
|
2004-04-19 22:54:24 +08:00
|
|
|
|
2008-12-03 23:27:42 +08:00
|
|
|
gimp_action_group_add_enum_actions (group, "image-action",
|
2004-04-19 22:54:24 +08:00
|
|
|
image_rotate_actions,
|
|
|
|
G_N_ELEMENTS (image_rotate_actions),
|
2019-07-04 07:11:48 +08:00
|
|
|
image_rotate_cmd_callback);
|
2011-04-02 21:38:55 +08:00
|
|
|
|
|
|
|
#define SET_ALWAYS_SHOW_IMAGE(action,show) \
|
|
|
|
gimp_action_group_set_action_always_show_image (group, action, show)
|
|
|
|
|
|
|
|
SET_ALWAYS_SHOW_IMAGE ("image-rotate-90", TRUE);
|
|
|
|
SET_ALWAYS_SHOW_IMAGE ("image-rotate-180", TRUE);
|
|
|
|
SET_ALWAYS_SHOW_IMAGE ("image-rotate-270", TRUE);
|
|
|
|
|
|
|
|
#undef SET_ALWAYS_SHOW_IMAGE
|
2004-04-19 22:54:24 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
image_actions_update (GimpActionGroup *group,
|
|
|
|
gpointer data)
|
|
|
|
{
|
2018-10-07 22:16:21 +08:00
|
|
|
GimpImage *image = action_data_get_image (data);
|
|
|
|
gboolean is_indexed = FALSE;
|
|
|
|
gboolean is_u8_gamma = FALSE;
|
|
|
|
gboolean is_double = FALSE;
|
|
|
|
gboolean aux = FALSE;
|
|
|
|
gboolean lp = FALSE;
|
|
|
|
gboolean sel = FALSE;
|
|
|
|
gboolean groups = FALSE;
|
|
|
|
gboolean profile_srgb = FALSE;
|
|
|
|
gboolean profile_hidden = FALSE;
|
|
|
|
gboolean profile = FALSE;
|
2004-05-03 22:03:51 +08:00
|
|
|
|
2019-05-31 22:48:19 +08:00
|
|
|
#define SET_LABEL(action,label) \
|
|
|
|
gimp_action_group_set_action_label (group, action, (label))
|
|
|
|
#define SET_SENSITIVE(action,condition) \
|
|
|
|
gimp_action_group_set_action_sensitive (group, action, (condition) != 0)
|
|
|
|
#define SET_ACTIVE(action,condition) \
|
|
|
|
gimp_action_group_set_action_active (group, action, (condition) != 0)
|
|
|
|
#define SET_VISIBLE(action,condition) \
|
|
|
|
gimp_action_group_set_action_visible (group, action, (condition) != 0)
|
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
if (image)
|
2004-04-19 22:54:24 +08:00
|
|
|
{
|
2015-11-23 06:19:49 +08:00
|
|
|
GimpContainer *layers;
|
|
|
|
const gchar *action = NULL;
|
|
|
|
GimpImageBaseType base_type;
|
|
|
|
GimpPrecision precision;
|
2016-12-12 18:53:22 +08:00
|
|
|
GimpComponentType component_type;
|
2019-05-31 22:48:19 +08:00
|
|
|
GimpTRCType trc;
|
2015-11-23 06:19:49 +08:00
|
|
|
|
2016-12-12 18:53:22 +08:00
|
|
|
base_type = gimp_image_get_base_type (image);
|
|
|
|
precision = gimp_image_get_precision (image);
|
|
|
|
component_type = gimp_image_get_component_type (image);
|
2019-05-31 22:48:19 +08:00
|
|
|
trc = gimp_babl_format_get_trc
|
|
|
|
(gimp_image_get_layer_format (image, FALSE));
|
2004-04-19 22:54:24 +08:00
|
|
|
|
2015-11-23 06:19:49 +08:00
|
|
|
switch (base_type)
|
2006-06-16 03:37:15 +08:00
|
|
|
{
|
2012-04-25 22:46:58 +08:00
|
|
|
case GIMP_RGB: action = "image-convert-rgb"; break;
|
|
|
|
case GIMP_GRAY: action = "image-convert-grayscale"; break;
|
|
|
|
case GIMP_INDEXED: action = "image-convert-indexed"; break;
|
|
|
|
}
|
2004-04-19 22:54:24 +08:00
|
|
|
|
2019-05-31 22:48:19 +08:00
|
|
|
SET_ACTIVE (action, TRUE);
|
2006-06-16 03:37:15 +08:00
|
|
|
|
2016-12-12 18:53:22 +08:00
|
|
|
switch (component_type)
|
2012-04-25 22:46:58 +08:00
|
|
|
{
|
2015-11-23 06:19:49 +08:00
|
|
|
case GIMP_COMPONENT_TYPE_U8: action = "image-convert-u8"; break;
|
|
|
|
case GIMP_COMPONENT_TYPE_U16: action = "image-convert-u16"; break;
|
|
|
|
case GIMP_COMPONENT_TYPE_U32: action = "image-convert-u32"; break;
|
|
|
|
case GIMP_COMPONENT_TYPE_HALF: action = "image-convert-half"; break;
|
|
|
|
case GIMP_COMPONENT_TYPE_FLOAT: action = "image-convert-float"; break;
|
|
|
|
case GIMP_COMPONENT_TYPE_DOUBLE: action = "image-convert-double"; break;
|
2006-06-16 03:37:15 +08:00
|
|
|
}
|
|
|
|
|
2019-05-31 22:48:19 +08:00
|
|
|
SET_ACTIVE (action, TRUE);
|
2004-04-19 22:54:24 +08:00
|
|
|
|
2019-05-31 22:48:19 +08:00
|
|
|
switch (trc)
|
2015-11-23 06:19:49 +08:00
|
|
|
{
|
2019-05-31 22:48:19 +08:00
|
|
|
case GIMP_TRC_LINEAR:
|
|
|
|
action = "image-convert-linear";
|
|
|
|
SET_VISIBLE ("image-convert-perceptual", FALSE);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GIMP_TRC_NON_LINEAR:
|
|
|
|
action = "image-convert-non-linear";
|
|
|
|
SET_VISIBLE ("image-convert-perceptual", FALSE);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GIMP_TRC_PERCEPTUAL:
|
|
|
|
action = "image-convert-perceptual";
|
|
|
|
SET_VISIBLE ("image-convert-perceptual", TRUE);
|
|
|
|
break;
|
2015-11-23 06:19:49 +08:00
|
|
|
}
|
|
|
|
|
2019-05-31 22:48:19 +08:00
|
|
|
SET_ACTIVE (action, TRUE);
|
|
|
|
|
2015-11-23 06:19:49 +08:00
|
|
|
is_indexed = (base_type == GIMP_INDEXED);
|
Initial space invasion commit in GIMP
All babl formats now have a space equivalent to a color profile,
determining the format's primaries and TRCs. This commit makes GIMP
aware of this.
libgimp:
- enum GimpPrecision: rename GAMMA values to NON_LINEAR and keep GAMMA
as deprecated aliases, add PERCEPTUAL values so we now have LINEAR,
NON_LINEAR and PERCPTUAL for each encoding, matching the babl
encoding variants RGB, R'G'B' and R~G~B~.
- gimp_color_transform_can_gegl_copy() now returns TRUE if both
profiles can return a babl space, increasing the amount of fast babl
color conversions significantly.
- TODO: no solution yet for getting libgimp drawable proxy buffers in
the right format with space.
plug-ins:
- follow the GimpPrecision change.
- TODO: everything else unchanged and partly broken or sub-optimal,
like setting a new image's color profile too late.
app:
- add enum GimpTRCType { LINEAR, NON_LINEAR, PERCEPTUAL } as
replacement for all "linear" booleans.
- change gimp-babl functions to take babl spaces and GimpTRCType
parameters and support all sorts of new perceptual ~ formats.
- a lot of places changed in the early days of goat invasion didn't
take advantage of gimp-babl utility functions and constructed
formats manually. They all needed revisiting and many now use much
simpler code calling gimp-babl API.
- change gimp_babl_format_get_color_profile() to really extract a
newly allocated color profile from the format, and add
gimp_babl_get_builtin_color_profile() which does the same as
gimp_babl_format_get_color_profile() did before. Visited all callers
to decide whether they are looking for the format's actual profile,
or for one of the builtin profiles, simplifying code that only needs
builtin profiles.
- drawables have a new get_space_api(), get_linear() is now get_trc().
- images now have a "layer space" and an API to get it,
gimp_image_get_layer_format() returns formats in that space.
- an image's layer space is created from the image's color profile,
change gimpimage-color-profile to deal with that correctly
- change many babl_format() calls to babl_format_with_space() and take
the space from passed formats or drawables
- add function gimp_layer_fix_format_space() which replaces the
layer's buffer with one that has the image's layer format, but
doesn't change pixel values
- use gimp_layer_fix_format_space() to make sure layers loaded from
XCF and created by plug-ins have the right space when added to the
image, because it's impossible to always assign the right space upon
layer creation
- "assign color profile" and "discard color profile" now require use
of gimp_layer_fix_format_space() too because the profile is now
embedded in all formats via the space. Add
gimp_image_assign_color_profile() which does all that and call it
instead of a simple gimp_image_set_color_profile(), also from the
PDB set-color-profile functions, which are essentially "assign" and
"discard" calls.
- generally, make sure a new image's color profile is set before
adding layers to it, gimp_image_set_color_profile() is more than
before considered know-what-you-are-doing API.
- take special precaution in all places that call
gimp_drawable_convert_type(), we now must pass a new_profile from
all callers that convert layers within the same image (such as
image_convert_type, image_convert_precision), because the layer's
new space can't be determined from the image's layer format during
the call.
- change all "linear" properties to "trc", in all config objects like
for levels and curves, in the histogram, in the widgets. This results
in some GUI that now has three choices instead of two.
TODO: we might want to reduce that back to two later.
- keep "linear" boolean properties around as compat if needed for file
pasring, but always convert the parsed parsed boolean to
GimpTRCType.
- TODO: the image's "enable color management" switch is currently
broken, will fix that in another commit.
2018-07-21 20:23:01 +08:00
|
|
|
is_u8_gamma = (precision == GIMP_PRECISION_U8_NON_LINEAR);
|
2016-12-12 18:53:22 +08:00
|
|
|
is_double = (component_type == GIMP_COMPONENT_TYPE_DOUBLE);
|
2013-06-23 22:51:24 +08:00
|
|
|
aux = (gimp_image_get_active_channel (image) != NULL);
|
|
|
|
lp = ! gimp_image_is_empty (image);
|
|
|
|
sel = ! gimp_channel_is_empty (gimp_image_get_mask (image));
|
2009-09-08 03:09:24 +08:00
|
|
|
|
|
|
|
layers = gimp_image_get_layers (image);
|
|
|
|
|
|
|
|
groups = ! gimp_item_stack_is_flat (GIMP_ITEM_STACK (layers));
|
2015-06-16 02:19:32 +08:00
|
|
|
|
2018-10-07 22:16:21 +08:00
|
|
|
profile_srgb = gimp_image_get_use_srgb_profile (image, &profile_hidden);
|
|
|
|
profile = (gimp_image_get_color_profile (image) != NULL);
|
2004-04-19 22:54:24 +08:00
|
|
|
}
|
2019-05-31 22:48:19 +08:00
|
|
|
else
|
|
|
|
{
|
|
|
|
SET_VISIBLE ("image-convert-perceptual", FALSE);
|
|
|
|
}
|
2004-04-19 22:54:24 +08:00
|
|
|
|
2016-05-09 01:32:57 +08:00
|
|
|
SET_SENSITIVE ("image-duplicate", image);
|
|
|
|
|
2016-05-01 01:41:09 +08:00
|
|
|
if (profile)
|
|
|
|
{
|
|
|
|
SET_LABEL ("image-convert-rgb",
|
|
|
|
C_("image-convert-action", "_RGB..."));
|
|
|
|
SET_LABEL ("image-convert-grayscale",
|
|
|
|
C_("image-convert-action", "_Grayscale..."));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
SET_LABEL ("image-convert-rgb",
|
|
|
|
C_("image-convert-action", "_RGB"));
|
|
|
|
SET_LABEL ("image-convert-grayscale",
|
|
|
|
C_("image-convert-action", "_Grayscale"));
|
|
|
|
}
|
|
|
|
|
2006-06-16 03:37:15 +08:00
|
|
|
SET_SENSITIVE ("image-convert-rgb", image);
|
|
|
|
SET_SENSITIVE ("image-convert-grayscale", image);
|
2013-06-23 22:51:24 +08:00
|
|
|
SET_SENSITIVE ("image-convert-indexed", image && !groups && is_u8_gamma);
|
|
|
|
|
2015-11-23 06:19:49 +08:00
|
|
|
SET_SENSITIVE ("image-convert-u8", image);
|
|
|
|
SET_SENSITIVE ("image-convert-u16", image && !is_indexed);
|
|
|
|
SET_SENSITIVE ("image-convert-u32", image && !is_indexed);
|
|
|
|
SET_SENSITIVE ("image-convert-half", image && !is_indexed);
|
|
|
|
SET_SENSITIVE ("image-convert-float", image && !is_indexed);
|
|
|
|
SET_SENSITIVE ("image-convert-double", image && !is_indexed);
|
2016-12-12 18:53:22 +08:00
|
|
|
SET_VISIBLE ("image-convert-double", is_double);
|
2015-11-23 06:19:49 +08:00
|
|
|
|
2019-05-31 22:48:19 +08:00
|
|
|
SET_SENSITIVE ("image-convert-linear", image && !is_indexed);
|
|
|
|
SET_SENSITIVE ("image-convert-non-linear", image);
|
|
|
|
SET_SENSITIVE ("image-convert-perceptual", image && !is_indexed);
|
2012-04-25 22:46:58 +08:00
|
|
|
|
2018-10-07 22:16:21 +08:00
|
|
|
SET_SENSITIVE ("image-color-profile-use-srgb", image && (profile || profile_hidden));
|
|
|
|
SET_ACTIVE ("image-color-profile-use-srgb", image && profile_srgb);
|
2016-05-09 01:27:29 +08:00
|
|
|
|
2015-06-16 02:19:32 +08:00
|
|
|
SET_SENSITIVE ("image-color-profile-assign", image);
|
|
|
|
SET_SENSITIVE ("image-color-profile-convert", image);
|
|
|
|
SET_SENSITIVE ("image-color-profile-discard", image && profile);
|
2016-05-07 09:01:18 +08:00
|
|
|
SET_SENSITIVE ("image-color-profile-save", image);
|
2015-06-16 02:19:32 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
SET_SENSITIVE ("image-flip-horizontal", image);
|
|
|
|
SET_SENSITIVE ("image-flip-vertical", image);
|
|
|
|
SET_SENSITIVE ("image-rotate-90", image);
|
|
|
|
SET_SENSITIVE ("image-rotate-180", image);
|
|
|
|
SET_SENSITIVE ("image-rotate-270", image);
|
|
|
|
|
2007-06-10 01:17:30 +08:00
|
|
|
SET_SENSITIVE ("image-resize", image);
|
|
|
|
SET_SENSITIVE ("image-resize-to-layers", image);
|
|
|
|
SET_SENSITIVE ("image-resize-to-selection", image && sel);
|
|
|
|
SET_SENSITIVE ("image-print-size", image);
|
|
|
|
SET_SENSITIVE ("image-scale", image);
|
2012-09-23 02:35:36 +08:00
|
|
|
SET_SENSITIVE ("image-crop-to-selection", image && sel);
|
|
|
|
SET_SENSITIVE ("image-crop-to-content", image);
|
2011-02-14 08:45:16 +08:00
|
|
|
SET_SENSITIVE ("image-merge-layers", image && !aux && lp);
|
|
|
|
SET_SENSITIVE ("image-flatten", image && !aux && lp);
|
2007-06-10 01:17:30 +08:00
|
|
|
SET_SENSITIVE ("image-configure-grid", image);
|
|
|
|
SET_SENSITIVE ("image-properties", image);
|
2004-04-19 22:54:24 +08:00
|
|
|
|
2016-05-01 01:41:09 +08:00
|
|
|
#undef SET_LABEL
|
2004-04-19 22:54:24 +08:00
|
|
|
#undef SET_SENSITIVE
|
2016-05-09 01:27:29 +08:00
|
|
|
#undef SET_ACTIVE
|
2016-12-12 18:53:22 +08:00
|
|
|
#undef SET_VISIBLE
|
2004-04-19 22:54:24 +08:00
|
|
|
}
|