2000-05-31 14:15:06 +08:00
|
|
|
/* LIBGIMP - The GIMP Library
|
2003-07-03 08:47:26 +08:00
|
|
|
* Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
|
1998-01-25 18:26:47 +08:00
|
|
|
*
|
2000-05-31 14:15:06 +08:00
|
|
|
* gimpimage_pdb.c
|
|
|
|
*
|
2009-01-18 06:28:01 +08:00
|
|
|
* This library is free software: you can redistribute it and/or
|
1999-11-18 05:13:50 +08:00
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
1998-01-25 18:26:47 +08:00
|
|
|
* License as published by the Free Software Foundation; either
|
2009-01-18 06:28:01 +08:00
|
|
|
* version 3 of the License, or (at your option) any later version.
|
1999-11-18 19:37:35 +08:00
|
|
|
*
|
|
|
|
* This library 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
|
2000-06-01 20:20:13 +08:00
|
|
|
* Lesser General Public License for more details.
|
1998-01-25 18:26:47 +08:00
|
|
|
*
|
1999-11-18 05:13:50 +08:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2009-01-18 06:28:01 +08:00
|
|
|
* License along with this library. If not, see
|
2018-07-12 05:27:07 +08:00
|
|
|
* <https://www.gnu.org/licenses/>.
|
1999-11-18 19:37:35 +08:00
|
|
|
*/
|
|
|
|
|
2007-01-09 18:52:47 +08:00
|
|
|
/* NOTE: This file is auto-generated by pdbgen.pl */
|
2000-06-01 20:20:13 +08:00
|
|
|
|
2002-05-14 07:30:23 +08:00
|
|
|
#include "config.h"
|
|
|
|
|
2022-03-28 21:13:17 +08:00
|
|
|
#include "stamp-pdbgen.h"
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "gimp.h"
|
|
|
|
|
2010-07-07 17:43:10 +08:00
|
|
|
|
|
|
|
/**
|
2019-07-31 16:04:43 +08:00
|
|
|
* SECTION: gimpimage
|
2010-07-07 17:43:10 +08:00
|
|
|
* @title: gimpimage
|
|
|
|
* @short_description: Operations on complete images.
|
|
|
|
*
|
|
|
|
* Operations on complete images: creation, resizing/rescaling, and
|
|
|
|
* operations involving multiple layers.
|
|
|
|
**/
|
|
|
|
|
|
|
|
|
2007-01-13 03:59:36 +08:00
|
|
|
/**
|
2019-08-29 17:25:35 +08:00
|
|
|
* gimp_image_id_is_valid:
|
|
|
|
* @image_id: The image ID to check.
|
2007-01-13 03:59:36 +08:00
|
|
|
*
|
2019-08-29 17:25:35 +08:00
|
|
|
* Returns TRUE if the image ID is valid.
|
2007-01-13 03:59:36 +08:00
|
|
|
*
|
2019-08-29 17:25:35 +08:00
|
|
|
* This procedure checks if the given image ID is valid and refers to
|
|
|
|
* an existing image.
|
2007-01-13 03:59:36 +08:00
|
|
|
*
|
2019-08-29 17:25:35 +08:00
|
|
|
* Returns: Whether the image ID is valid.
|
2007-01-13 03:59:36 +08:00
|
|
|
*
|
2019-08-29 17:25:35 +08:00
|
|
|
* Since: 3.0
|
2019-08-12 20:44:07 +08:00
|
|
|
**/
|
|
|
|
gboolean
|
2019-08-29 17:25:35 +08:00
|
|
|
gimp_image_id_is_valid (gint image_id)
|
2019-08-12 20:44:07 +08:00
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
gboolean valid = FALSE;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
G_TYPE_INT, image_id,
|
2019-08-12 20:44:07 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-id-is-valid",
|
|
|
|
args);
|
2019-08-12 20:44:07 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
valid = GIMP_VALUES_GET_BOOLEAN (return_vals, 1);
|
2019-08-12 20:44:07 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
|
|
|
return valid;
|
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
2022-06-27 19:40:27 +08:00
|
|
|
* gimp_get_images: (skip)
|
2019-08-01 04:51:35 +08:00
|
|
|
* @num_images: (out): The number of images currently open.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* Returns the list of images currently open.
|
|
|
|
*
|
2007-06-06 16:44:52 +08:00
|
|
|
* This procedure returns the list of images currently open in GIMP.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2019-09-05 18:57:43 +08:00
|
|
|
* Returns: (array length=num_images) (element-type GimpImage) (transfer container):
|
2019-08-05 04:09:04 +08:00
|
|
|
* The list of images currently open.
|
|
|
|
* The returned value must be freed with g_free().
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2019-09-05 18:57:43 +08:00
|
|
|
GimpImage **
|
|
|
|
gimp_get_images (gint *num_images)
|
2000-06-01 20:20:13 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-09-05 18:57:43 +08:00
|
|
|
GimpImage **images = NULL;
|
2000-06-01 20:20:13 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2019-07-30 16:51:16 +08:00
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-get-images",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2000-06-01 20:20:13 +08:00
|
|
|
|
|
|
|
*num_images = 0;
|
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2000-06-01 20:20:13 +08:00
|
|
|
{
|
2019-09-04 08:49:33 +08:00
|
|
|
*num_images = GIMP_VALUES_GET_INT (return_vals, 1);
|
2021-08-26 23:18:32 +08:00
|
|
|
{ GimpObjectArray *a = g_value_get_boxed (gimp_value_array_index (return_vals, 2)); if (a) images = g_memdup2 (a->data, a->length * sizeof (gpointer)); };
|
2000-06-01 20:20:13 +08:00
|
|
|
}
|
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2000-06-01 20:20:13 +08:00
|
|
|
|
2019-09-05 18:57:43 +08:00
|
|
|
return images;
|
2000-06-01 20:20:13 +08:00
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_new:
|
|
|
|
* @width: The width of the image.
|
|
|
|
* @height: The height of the image.
|
|
|
|
* @type: The type of image.
|
|
|
|
*
|
|
|
|
* Creates a new image with the specified width, height, and type.
|
|
|
|
*
|
2013-10-04 20:47:05 +08:00
|
|
|
* Creates a new image, undisplayed, with the specified extents and
|
2000-08-25 07:06:53 +08:00
|
|
|
* type. A layer should be created and added before this image is
|
2006-06-14 16:32:08 +08:00
|
|
|
* displayed, or subsequent calls to gimp_display_new() with this image
|
2000-08-25 07:06:53 +08:00
|
|
|
* as an argument will fail. Layers can be created using the
|
2006-06-14 16:32:08 +08:00
|
|
|
* gimp_layer_new() commands. They can be added to an image using the
|
2010-09-06 05:54:23 +08:00
|
|
|
* gimp_image_insert_layer() command.
|
2013-10-05 14:48:39 +08:00
|
|
|
*
|
2013-10-04 20:47:05 +08:00
|
|
|
* If your image's type if INDEXED, a colormap must also be added with
|
|
|
|
* gimp_image_set_colormap(). An indexed image without a colormap will
|
|
|
|
* output unexpected colors.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2019-08-15 16:01:08 +08:00
|
|
|
* Returns: (transfer none): The newly created image.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2019-08-11 20:20:05 +08:00
|
|
|
GimpImage *
|
2000-06-01 20:20:13 +08:00
|
|
|
gimp_image_new (gint width,
|
2006-04-12 18:27:31 +08:00
|
|
|
gint height,
|
|
|
|
GimpImageBaseType type)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-08-11 20:20:05 +08:00
|
|
|
GimpImage *image = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-15 20:04:56 +08:00
|
|
|
G_TYPE_INT, width,
|
|
|
|
G_TYPE_INT, height,
|
2019-08-08 19:01:50 +08:00
|
|
|
GIMP_TYPE_IMAGE_BASE_TYPE, type,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-new",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
image = GIMP_VALUES_GET_IMAGE (return_vals, 1);
|
2019-07-30 16:51:16 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-08-11 20:20:05 +08:00
|
|
|
return image;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2012-04-26 02:39:23 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_new_with_precision:
|
|
|
|
* @width: The width of the image.
|
|
|
|
* @height: The height of the image.
|
|
|
|
* @type: The type of image.
|
|
|
|
* @precision: The precision.
|
|
|
|
*
|
|
|
|
* Creates a new image with the specified width, height, type and
|
|
|
|
* precision.
|
|
|
|
*
|
|
|
|
* Creates a new image, undisplayed with the specified extents, type
|
|
|
|
* and precision. Indexed images can only be created at
|
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
|
|
|
* GIMP_PRECISION_U8_NON_LINEAR precision. See gimp_image_new() for
|
|
|
|
* further details.
|
2012-04-26 02:39:23 +08:00
|
|
|
*
|
2019-08-15 16:01:08 +08:00
|
|
|
* Returns: (transfer none): The newly created image.
|
2012-04-26 02:39:23 +08:00
|
|
|
*
|
2015-06-01 03:18:09 +08:00
|
|
|
* Since: 2.10
|
2012-04-26 02:39:23 +08:00
|
|
|
**/
|
2019-08-11 20:20:05 +08:00
|
|
|
GimpImage *
|
2012-04-26 02:39:23 +08:00
|
|
|
gimp_image_new_with_precision (gint width,
|
|
|
|
gint height,
|
|
|
|
GimpImageBaseType type,
|
|
|
|
GimpPrecision precision)
|
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-08-11 20:20:05 +08:00
|
|
|
GimpImage *image = NULL;
|
2012-04-26 02:39:23 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-15 20:04:56 +08:00
|
|
|
G_TYPE_INT, width,
|
|
|
|
G_TYPE_INT, height,
|
2019-08-08 19:01:50 +08:00
|
|
|
GIMP_TYPE_IMAGE_BASE_TYPE, type,
|
|
|
|
GIMP_TYPE_PRECISION, precision,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-new-with-precision",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2012-04-26 02:39:23 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
image = GIMP_VALUES_GET_IMAGE (return_vals, 1);
|
2012-04-26 02:39:23 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2012-04-26 02:39:23 +08:00
|
|
|
|
2019-08-11 20:20:05 +08:00
|
|
|
return image;
|
2012-04-26 02:39:23 +08:00
|
|
|
}
|
|
|
|
|
2003-12-09 01:26:55 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_duplicate:
|
2019-08-11 20:20:05 +08:00
|
|
|
* @image: The image.
|
2003-12-09 01:26:55 +08:00
|
|
|
*
|
|
|
|
* Duplicate the specified image
|
|
|
|
*
|
|
|
|
* This procedure duplicates the specified image, copying all layers,
|
|
|
|
* channels, and image information.
|
|
|
|
*
|
2019-08-15 16:01:08 +08:00
|
|
|
* Returns: (transfer none): The new, duplicated image.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2019-08-11 20:20:05 +08:00
|
|
|
GimpImage *
|
|
|
|
gimp_image_duplicate (GimpImage *image)
|
2003-12-09 01:26:55 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-08-11 20:20:05 +08:00
|
|
|
GimpImage *new_image = NULL;
|
2003-12-09 01:26:55 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-duplicate",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2003-12-09 01:26:55 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
new_image = GIMP_VALUES_GET_IMAGE (return_vals, 1);
|
2003-12-09 01:26:55 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2003-12-09 01:26:55 +08:00
|
|
|
|
2019-08-11 20:20:05 +08:00
|
|
|
return new_image;
|
2003-12-09 01:26:55 +08:00
|
|
|
}
|
|
|
|
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_delete:
|
2019-08-11 20:20:05 +08:00
|
|
|
* @image: The image.
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
*
|
|
|
|
* Delete the specified image.
|
|
|
|
*
|
|
|
|
* If there are no displays associated with this image it will be
|
|
|
|
* deleted. This means that you can not delete an image through the PDB
|
|
|
|
* that was created by the user. If the associated display was however
|
|
|
|
* created through the PDB and you know the display ID, you may delete
|
|
|
|
* the display. Removal of the last associated display will then delete
|
|
|
|
* the image.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
gboolean
|
2019-08-11 20:20:05 +08:00
|
|
|
gimp_image_delete (GimpImage *image)
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-delete",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-07-30 16:51:16 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2021-04-06 06:47:07 +08:00
|
|
|
* gimp_image_get_base_type:
|
2019-08-11 20:20:05 +08:00
|
|
|
* @image: The image.
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
*
|
|
|
|
* Get the base type of the image.
|
|
|
|
*
|
|
|
|
* This procedure returns the image's base type. Layers in the image
|
|
|
|
* must be of this subtype, but can have an optional alpha channel.
|
|
|
|
*
|
|
|
|
* Returns: The image's base type.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
GimpImageBaseType
|
2021-04-06 06:47:07 +08:00
|
|
|
gimp_image_get_base_type (GimpImage *image)
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
GimpImageBaseType base_type = 0;
|
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-get-base-type",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
base_type = GIMP_VALUES_GET_ENUM (return_vals, 1);
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
|
|
|
|
return base_type;
|
|
|
|
}
|
|
|
|
|
2019-08-12 20:44:07 +08:00
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_image_get_precision:
|
|
|
|
* @image: The image.
|
2019-08-12 20:44:07 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Get the precision of the image.
|
2019-08-12 20:44:07 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure returns the image's precision.
|
2019-08-12 20:44:07 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns: The image's precision.
|
|
|
|
*
|
|
|
|
* Since: 2.10
|
2019-08-12 20:44:07 +08:00
|
|
|
**/
|
2019-09-03 19:31:27 +08:00
|
|
|
GimpPrecision
|
|
|
|
gimp_image_get_precision (GimpImage *image)
|
2019-08-12 20:44:07 +08:00
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-09-03 19:31:27 +08:00
|
|
|
GimpPrecision precision = 0;
|
2019-08-12 20:44:07 +08:00
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-09-03 19:31:27 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-08-12 20:44:07 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-get-precision",
|
|
|
|
args);
|
2019-08-12 20:44:07 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
precision = GIMP_VALUES_GET_ENUM (return_vals, 1);
|
2019-08-12 20:44:07 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
2019-09-03 19:31:27 +08:00
|
|
|
return precision;
|
2019-08-12 20:44:07 +08:00
|
|
|
}
|
|
|
|
|
2012-04-26 02:51:29 +08:00
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_image_get_default_new_layer_mode:
|
2019-08-11 20:20:05 +08:00
|
|
|
* @image: The image.
|
2012-04-26 02:51:29 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Get the default mode for newly created layers of this image.
|
2012-04-26 02:51:29 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns the default mode for newly created layers of this image.
|
2012-04-26 02:51:29 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns: The layer mode.
|
2012-04-26 02:51:29 +08:00
|
|
|
*
|
2015-06-01 03:18:09 +08:00
|
|
|
* Since: 2.10
|
2012-04-26 02:51:29 +08:00
|
|
|
**/
|
2019-09-03 19:31:27 +08:00
|
|
|
GimpLayerMode
|
|
|
|
gimp_image_get_default_new_layer_mode (GimpImage *image)
|
2012-04-26 02:51:29 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-09-03 19:31:27 +08:00
|
|
|
GimpLayerMode mode = 0;
|
2012-04-26 02:51:29 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-get-default-new-layer-mode",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2012-04-26 02:51:29 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
mode = GIMP_VALUES_GET_ENUM (return_vals, 1);
|
2012-04-26 02:51:29 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2012-04-26 02:51:29 +08:00
|
|
|
|
2019-09-03 19:31:27 +08:00
|
|
|
return mode;
|
2012-04-26 02:51:29 +08:00
|
|
|
}
|
|
|
|
|
2017-08-22 02:04:25 +08:00
|
|
|
/**
|
2021-04-06 06:47:07 +08:00
|
|
|
* gimp_image_get_width:
|
2019-09-03 19:31:27 +08:00
|
|
|
* @image: The image.
|
2017-08-22 02:04:25 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Return the width of the image
|
2017-08-22 02:04:25 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure returns the image's width. This value is independent
|
|
|
|
* of any of the layers in this image. This is the \"canvas\" width.
|
2017-08-22 02:04:25 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns: The image's width.
|
2017-08-22 02:04:25 +08:00
|
|
|
**/
|
2019-09-03 19:31:27 +08:00
|
|
|
gint
|
2021-04-06 06:47:07 +08:00
|
|
|
gimp_image_get_width (GimpImage *image)
|
2017-08-22 02:04:25 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-09-03 19:31:27 +08:00
|
|
|
gint width = 0;
|
2017-08-22 02:04:25 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-09-03 19:31:27 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
2017-08-22 02:04:25 +08:00
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-get-width",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2017-08-22 02:04:25 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
width = GIMP_VALUES_GET_INT (return_vals, 1);
|
2019-08-12 20:44:07 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
2019-09-03 19:31:27 +08:00
|
|
|
return width;
|
2019-08-12 20:44:07 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2021-04-06 06:47:07 +08:00
|
|
|
* gimp_image_get_height:
|
2019-08-12 20:44:07 +08:00
|
|
|
* @image: The image.
|
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Return the height of the image
|
2019-08-12 20:44:07 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure returns the image's height. This value is independent
|
|
|
|
* of any of the layers in this image. This is the \"canvas\" height.
|
2019-08-12 20:44:07 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns: The image's height.
|
2019-08-12 20:44:07 +08:00
|
|
|
**/
|
2019-09-03 19:31:27 +08:00
|
|
|
gint
|
2021-04-06 06:47:07 +08:00
|
|
|
gimp_image_get_height (GimpImage *image)
|
2019-08-12 20:44:07 +08:00
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-09-03 19:31:27 +08:00
|
|
|
gint height = 0;
|
2019-08-12 20:44:07 +08:00
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-08-12 20:44:07 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-get-height",
|
|
|
|
args);
|
2019-08-12 20:44:07 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
height = GIMP_VALUES_GET_INT (return_vals, 1);
|
2019-08-12 20:44:07 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
2019-09-03 19:31:27 +08:00
|
|
|
return height;
|
2019-08-12 20:44:07 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
2022-06-27 19:40:27 +08:00
|
|
|
* gimp_image_get_layers: (skip)
|
2019-08-11 20:20:05 +08:00
|
|
|
* @image: The image.
|
2021-04-04 06:02:19 +08:00
|
|
|
* @num_layers: (out): The number of root layers contained in the image.
|
|
|
|
*
|
|
|
|
* Returns the list of root layers contained in the specified image.
|
|
|
|
*
|
|
|
|
* This procedure returns the list of root layers contained in the
|
|
|
|
* specified image. The order of layers is from topmost to bottommost.
|
|
|
|
* Note that this is not the full list of layers, but only the root
|
|
|
|
* layers, i.e. layers with no parents themselves. If you need all
|
|
|
|
* layers, it is up to you to verify that any of these layers is a
|
|
|
|
* group layer with gimp_item_is_group() and to obtain its children
|
|
|
|
* with gimp_item_get_children() (possibly recursively checking if
|
|
|
|
* these have children too).
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2019-09-05 18:57:43 +08:00
|
|
|
* Returns: (array length=num_layers) (element-type GimpLayer) (transfer container):
|
2019-08-05 04:09:04 +08:00
|
|
|
* The list of layers contained in the image.
|
|
|
|
* The returned value must be freed with g_free().
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2019-09-05 18:57:43 +08:00
|
|
|
GimpLayer **
|
|
|
|
gimp_image_get_layers (GimpImage *image,
|
|
|
|
gint *num_layers)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-09-05 18:57:43 +08:00
|
|
|
GimpLayer **layers = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-get-layers",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-06-01 20:20:13 +08:00
|
|
|
*num_layers = 0;
|
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2000-06-01 20:20:13 +08:00
|
|
|
{
|
2019-09-04 08:49:33 +08:00
|
|
|
*num_layers = GIMP_VALUES_GET_INT (return_vals, 1);
|
2021-08-26 23:18:32 +08:00
|
|
|
{ GimpObjectArray *a = g_value_get_boxed (gimp_value_array_index (return_vals, 2)); if (a) layers = g_memdup2 (a->data, a->length * sizeof (gpointer)); };
|
2000-06-01 20:20:13 +08:00
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-09-05 18:57:43 +08:00
|
|
|
return layers;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2019-08-12 20:44:07 +08:00
|
|
|
/**
|
2022-06-27 19:40:27 +08:00
|
|
|
* gimp_image_get_channels: (skip)
|
2019-08-11 20:20:05 +08:00
|
|
|
* @image: The image.
|
2019-08-01 04:51:35 +08:00
|
|
|
* @num_channels: (out): The number of channels contained in the image.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* Returns the list of channels contained in the specified image.
|
|
|
|
*
|
|
|
|
* This procedure returns the list of channels contained in the
|
|
|
|
* specified image. This does not include the selection mask, or layer
|
2013-05-11 04:11:14 +08:00
|
|
|
* masks. The order is from topmost to bottommost. Note that
|
|
|
|
* \"channels\" are custom channels and do not include the image's
|
|
|
|
* color components.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2019-09-05 18:57:43 +08:00
|
|
|
* Returns: (array length=num_channels) (element-type GimpChannel) (transfer container):
|
2019-08-05 04:09:04 +08:00
|
|
|
* The list of channels contained in the image.
|
|
|
|
* The returned value must be freed with g_free().
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2019-09-05 18:57:43 +08:00
|
|
|
GimpChannel **
|
|
|
|
gimp_image_get_channels (GimpImage *image,
|
|
|
|
gint *num_channels)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-09-05 18:57:43 +08:00
|
|
|
GimpChannel **channels = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-get-channels",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-06-01 20:20:13 +08:00
|
|
|
*num_channels = 0;
|
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2000-06-01 20:20:13 +08:00
|
|
|
{
|
2019-09-04 08:49:33 +08:00
|
|
|
*num_channels = GIMP_VALUES_GET_INT (return_vals, 1);
|
2021-08-26 23:18:32 +08:00
|
|
|
{ GimpObjectArray *a = g_value_get_boxed (gimp_value_array_index (return_vals, 2)); if (a) channels = g_memdup2 (a->data, a->length * sizeof (gpointer)); };
|
2000-06-01 20:20:13 +08:00
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-09-05 18:57:43 +08:00
|
|
|
return channels;
|
2000-06-01 20:20:13 +08:00
|
|
|
}
|
|
|
|
|
2019-08-12 20:44:07 +08:00
|
|
|
/**
|
2022-06-27 19:40:27 +08:00
|
|
|
* gimp_image_get_vectors: (skip)
|
2019-08-11 20:20:05 +08:00
|
|
|
* @image: The image.
|
2019-08-01 04:51:35 +08:00
|
|
|
* @num_vectors: (out): The number of vectors contained in the image.
|
2005-04-14 10:32:23 +08:00
|
|
|
*
|
|
|
|
* Returns the list of vectors contained in the specified image.
|
|
|
|
*
|
|
|
|
* This procedure returns the list of vectors contained in the
|
|
|
|
* specified image.
|
|
|
|
*
|
2019-09-05 18:57:43 +08:00
|
|
|
* Returns: (array length=num_vectors) (element-type GimpVectors) (transfer container):
|
2019-08-05 04:09:04 +08:00
|
|
|
* The list of vectors contained in the image.
|
|
|
|
* The returned value must be freed with g_free().
|
2005-04-14 10:32:23 +08:00
|
|
|
*
|
2015-06-01 03:18:09 +08:00
|
|
|
* Since: 2.4
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2019-09-05 18:57:43 +08:00
|
|
|
GimpVectors **
|
|
|
|
gimp_image_get_vectors (GimpImage *image,
|
|
|
|
gint *num_vectors)
|
2005-04-14 10:32:23 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-09-05 18:57:43 +08:00
|
|
|
GimpVectors **vectors = NULL;
|
2005-04-14 10:32:23 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-get-vectors",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2005-04-14 10:32:23 +08:00
|
|
|
|
|
|
|
*num_vectors = 0;
|
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-08-12 20:44:07 +08:00
|
|
|
{
|
2019-09-04 08:49:33 +08:00
|
|
|
*num_vectors = GIMP_VALUES_GET_INT (return_vals, 1);
|
2021-08-26 23:18:32 +08:00
|
|
|
{ GimpObjectArray *a = g_value_get_boxed (gimp_value_array_index (return_vals, 2)); if (a) vectors = g_memdup2 (a->data, a->length * sizeof (gpointer)); };
|
2019-08-12 20:44:07 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
2019-09-05 18:57:43 +08:00
|
|
|
return vectors;
|
2019-08-12 20:44:07 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_unset_active_channel:
|
2019-08-11 20:20:05 +08:00
|
|
|
* @image: The image.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* Unsets the active channel in the specified image.
|
|
|
|
*
|
|
|
|
* If an active channel exists, it is unset. There then exists no
|
|
|
|
* active channel, and if desired, one can be set through a call to
|
|
|
|
* 'Set Active Channel'. No error is returned in the case of no
|
|
|
|
* existing active channel.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2019-08-11 20:20:05 +08:00
|
|
|
gimp_image_unset_active_channel (GimpImage *image)
|
2000-06-01 20:20:13 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
2000-06-01 20:20:13 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
2000-06-01 20:20:13 +08:00
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-unset-active-channel",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-07-30 16:51:16 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2019-08-12 20:44:07 +08:00
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_image_get_floating_sel:
|
|
|
|
* @image: The image.
|
2019-08-12 20:44:07 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Return the floating selection of the image.
|
2019-08-12 20:44:07 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure returns the image's floating selection, if it exists.
|
|
|
|
* If it doesn't exist, -1 is returned as the layer ID.
|
2019-08-12 20:44:07 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns: (transfer none): The image's floating selection.
|
2019-08-12 20:44:07 +08:00
|
|
|
**/
|
2019-09-03 19:31:27 +08:00
|
|
|
GimpLayer *
|
|
|
|
gimp_image_get_floating_sel (GimpImage *image)
|
2019-08-12 20:44:07 +08:00
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-09-03 19:31:27 +08:00
|
|
|
GimpLayer *floating_sel = NULL;
|
2019-08-12 20:44:07 +08:00
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-09-03 19:31:27 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-08-12 20:44:07 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-get-floating-sel",
|
|
|
|
args);
|
2019-08-12 20:44:07 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
floating_sel = GIMP_VALUES_GET_LAYER (return_vals, 1);
|
2019-08-12 20:44:07 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
2019-09-03 19:31:27 +08:00
|
|
|
return floating_sel;
|
2019-08-12 20:44:07 +08:00
|
|
|
}
|
|
|
|
|
2003-12-09 01:26:55 +08:00
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_image_floating_sel_attached_to:
|
2019-08-11 20:20:05 +08:00
|
|
|
* @image: The image.
|
2003-12-09 01:26:55 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Return the drawable the floating selection is attached to.
|
2003-12-09 01:26:55 +08:00
|
|
|
*
|
|
|
|
* This procedure returns the drawable the image's floating selection
|
|
|
|
* is attached to, if it exists. If it doesn't exist, -1 is returned as
|
|
|
|
* the drawable ID.
|
|
|
|
*
|
2019-08-15 18:12:25 +08:00
|
|
|
* Returns: (transfer none):
|
2019-08-13 19:59:33 +08:00
|
|
|
* The drawable the floating selection is attached to.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2019-08-13 19:59:33 +08:00
|
|
|
GimpDrawable *
|
2019-08-11 20:20:05 +08:00
|
|
|
gimp_image_floating_sel_attached_to (GimpImage *image)
|
2003-12-09 01:26:55 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-08-13 19:59:33 +08:00
|
|
|
GimpDrawable *drawable = NULL;
|
2003-12-09 01:26:55 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-floating-sel-attached-to",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2003-12-09 01:26:55 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
drawable = GIMP_VALUES_GET_DRAWABLE (return_vals, 1);
|
2003-12-09 01:26:55 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2003-12-09 01:26:55 +08:00
|
|
|
|
2019-08-13 19:59:33 +08:00
|
|
|
return drawable;
|
2003-12-09 01:26:55 +08:00
|
|
|
}
|
|
|
|
|
2004-01-05 22:35:19 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_pick_color:
|
2019-08-11 20:20:05 +08:00
|
|
|
* @image: The image.
|
2020-05-17 23:51:32 +08:00
|
|
|
* @num_drawables: The number of drawables.
|
|
|
|
* @drawables: (array length=num_drawables) (element-type GimpItem): The drawables to pick from.
|
2004-01-05 22:35:19 +08:00
|
|
|
* @x: x coordinate of upper-left corner of rectangle.
|
|
|
|
* @y: y coordinate of upper-left corner of rectangle.
|
2020-05-17 23:51:32 +08:00
|
|
|
* @sample_merged: Use the composite image, not the drawables.
|
2004-01-05 22:35:19 +08:00
|
|
|
* @sample_average: Average the color of all the pixels in a specified radius.
|
|
|
|
* @average_radius: The radius of pixels to average.
|
2023-11-13 00:56:32 +08:00
|
|
|
* @color: (out) (transfer full): The return color.
|
2004-01-05 22:35:19 +08:00
|
|
|
*
|
2020-05-17 23:51:32 +08:00
|
|
|
* Determine the color at the given coordinates
|
2004-01-05 22:35:19 +08:00
|
|
|
*
|
|
|
|
* This tool determines the color at the specified coordinates. The
|
|
|
|
* returned color is an RGB triplet even for grayscale and indexed
|
|
|
|
* drawables. If the coordinates lie outside of the extents of the
|
2020-05-17 23:51:32 +08:00
|
|
|
* specified drawables, then an error is returned. All drawables must
|
|
|
|
* belong to the image and be of the same type.
|
|
|
|
* If only one drawable is given and it has an alpha channel, the
|
|
|
|
* algorithm examines the alpha value of the drawable at the
|
|
|
|
* coordinates. If the alpha value is completely transparent (0), then
|
|
|
|
* an error is returned. With several drawables specified, the
|
|
|
|
* composite image with only these drawables is used.
|
|
|
|
* If the sample_merged parameter is TRUE, the data of the composite
|
|
|
|
* image will be used instead of that for the specified drawables. This
|
|
|
|
* is equivalent to sampling for colors after merging all visible
|
|
|
|
* layers. In the case of a merged sampling, the supplied drawables are
|
|
|
|
* ignored.
|
2004-01-05 22:35:19 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2004-01-05 22:35:19 +08:00
|
|
|
gboolean
|
2020-05-17 23:51:32 +08:00
|
|
|
gimp_image_pick_color (GimpImage *image,
|
|
|
|
gint num_drawables,
|
|
|
|
const GimpItem **drawables,
|
|
|
|
gdouble x,
|
|
|
|
gdouble y,
|
|
|
|
gboolean sample_merged,
|
|
|
|
gboolean sample_average,
|
|
|
|
gdouble average_radius,
|
2023-11-13 00:56:32 +08:00
|
|
|
GeglColor **color)
|
2004-01-05 22:35:19 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2004-01-05 22:35:19 +08:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2020-05-17 23:51:32 +08:00
|
|
|
G_TYPE_INT, num_drawables,
|
|
|
|
GIMP_TYPE_OBJECT_ARRAY, NULL,
|
2019-08-08 19:01:50 +08:00
|
|
|
G_TYPE_DOUBLE, x,
|
|
|
|
G_TYPE_DOUBLE, y,
|
|
|
|
G_TYPE_BOOLEAN, sample_merged,
|
|
|
|
G_TYPE_BOOLEAN, sample_average,
|
|
|
|
G_TYPE_DOUBLE, average_radius,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
2020-05-17 23:51:32 +08:00
|
|
|
gimp_value_set_object_array (gimp_value_array_index (args, 2), GIMP_TYPE_ITEM, (GObject **) drawables, num_drawables);
|
2019-07-30 16:51:16 +08:00
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-pick-color",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
2023-11-13 00:56:32 +08:00
|
|
|
*color = NULL;
|
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2004-01-05 22:35:19 +08:00
|
|
|
|
|
|
|
if (success)
|
2023-11-13 00:56:32 +08:00
|
|
|
*color = g_value_dup_object (gimp_value_array_index (return_vals, 1));
|
2004-01-05 22:35:19 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2004-01-05 22:35:19 +08:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
2019-08-12 20:44:07 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_pick_correlate_layer:
|
|
|
|
* @image: The image.
|
|
|
|
* @x: The x coordinate for the pick.
|
|
|
|
* @y: The y coordinate for the pick.
|
|
|
|
*
|
|
|
|
* Find the layer visible at the specified coordinates.
|
|
|
|
*
|
|
|
|
* This procedure finds the layer which is visible at the specified
|
|
|
|
* coordinates. Layers which do not qualify are those whose extents do
|
|
|
|
* not pass within the specified coordinates, or which are transparent
|
|
|
|
* at the specified coordinates. This procedure will return -1 if no
|
|
|
|
* layer is found.
|
|
|
|
*
|
2019-08-15 18:12:25 +08:00
|
|
|
* Returns: (transfer none): The layer found at the specified coordinates.
|
2019-08-12 20:44:07 +08:00
|
|
|
**/
|
2019-08-13 19:59:33 +08:00
|
|
|
GimpLayer *
|
2019-08-12 20:44:07 +08:00
|
|
|
gimp_image_pick_correlate_layer (GimpImage *image,
|
|
|
|
gint x,
|
|
|
|
gint y)
|
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-08-13 19:59:33 +08:00
|
|
|
GimpLayer *layer = NULL;
|
2019-08-12 20:44:07 +08:00
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-08-12 20:44:07 +08:00
|
|
|
G_TYPE_INT, x,
|
|
|
|
G_TYPE_INT, y,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-pick-correlate-layer",
|
|
|
|
args);
|
2019-08-12 20:44:07 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
layer = GIMP_VALUES_GET_LAYER (return_vals, 1);
|
2019-08-12 20:44:07 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
2019-08-13 19:59:33 +08:00
|
|
|
return layer;
|
2019-08-12 20:44:07 +08:00
|
|
|
}
|
|
|
|
|
2010-09-06 05:54:23 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_insert_layer:
|
2019-08-11 20:20:05 +08:00
|
|
|
* @image: The image.
|
2019-08-13 19:59:33 +08:00
|
|
|
* @layer: The layer.
|
2019-08-25 05:02:35 +08:00
|
|
|
* @parent: (nullable): The parent layer.
|
2010-09-06 05:54:23 +08:00
|
|
|
* @position: The layer position.
|
|
|
|
*
|
|
|
|
* Add the specified layer to the image.
|
|
|
|
*
|
|
|
|
* This procedure adds the specified layer to the image at the given
|
2010-09-15 06:02:28 +08:00
|
|
|
* position. If the specified parent is a valid layer group (See
|
|
|
|
* gimp_item_is_group() and gimp_layer_group_new()) then the layer is
|
2011-03-02 06:06:59 +08:00
|
|
|
* added inside the group. If the parent is 0, the layer is added
|
2010-09-15 06:02:28 +08:00
|
|
|
* inside the main stack, outside of any group. The position argument
|
|
|
|
* specifies the location of the layer inside the stack (or the group,
|
|
|
|
* if a valid parent was supplied), starting from the top (0) and
|
|
|
|
* increasing. If the position is specified as -1 and the parent is
|
2012-08-04 08:18:15 +08:00
|
|
|
* specified as 0, then the layer is inserted above the active layer,
|
|
|
|
* or inside the group if the active layer is a layer group. The layer
|
|
|
|
* type must be compatible with the image base type.
|
2010-09-06 05:54:23 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2010-09-06 05:54:23 +08:00
|
|
|
gboolean
|
2019-08-11 20:20:05 +08:00
|
|
|
gimp_image_insert_layer (GimpImage *image,
|
2019-08-13 19:59:33 +08:00
|
|
|
GimpLayer *layer,
|
|
|
|
GimpLayer *parent,
|
2019-08-11 20:20:05 +08:00
|
|
|
gint position)
|
2010-09-06 05:54:23 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2010-09-06 05:54:23 +08:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
|
|
|
GIMP_TYPE_LAYER, layer,
|
|
|
|
GIMP_TYPE_LAYER, parent,
|
2019-08-15 20:04:56 +08:00
|
|
|
G_TYPE_INT, position,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
2010-09-06 05:54:23 +08:00
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-insert-layer",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2010-09-06 05:54:23 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-07-30 16:51:16 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2010-09-06 05:54:23 +08:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_image_remove_layer:
|
|
|
|
* @image: The image.
|
|
|
|
* @layer: The layer.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Remove the specified layer from the image.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure removes the specified layer from the image. If the
|
|
|
|
* layer doesn't exist, an error is returned. If there are no layers
|
|
|
|
* left in the image, this call will fail. If this layer is the last
|
|
|
|
* layer remaining, the image will become empty and have no active
|
|
|
|
* layer.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2019-09-03 19:31:27 +08:00
|
|
|
gimp_image_remove_layer (GimpImage *image,
|
|
|
|
GimpLayer *layer)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-09-03 19:31:27 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
|
|
|
GIMP_TYPE_LAYER, layer,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-remove-layer",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2000-08-23 09:44:59 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2018-05-07 14:21:49 +08:00
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_image_freeze_layers:
|
2019-08-11 20:20:05 +08:00
|
|
|
* @image: The image.
|
2018-05-07 14:21:49 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Freeze the image's layer list.
|
2018-05-07 14:21:49 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure freezes the layer list of the image, suppressing any
|
|
|
|
* updates to the Layers dialog in response to changes to the image's
|
|
|
|
* layers. This can significantly improve performance while applying
|
|
|
|
* changes affecting the layer list.
|
|
|
|
*
|
|
|
|
* Each call to gimp_image_freeze_layers() should be matched by a
|
|
|
|
* corresponding call to gimp_image_thaw_layers(), undoing its effects.
|
2018-05-07 14:21:49 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
2019-09-03 19:31:27 +08:00
|
|
|
*
|
|
|
|
* Since: 2.10.2
|
2018-05-07 14:21:49 +08:00
|
|
|
**/
|
|
|
|
gboolean
|
2019-09-03 19:31:27 +08:00
|
|
|
gimp_image_freeze_layers (GimpImage *image)
|
2018-05-07 14:21:49 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2018-05-07 14:21:49 +08:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-freeze-layers",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2018-05-07 14:21:49 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2018-05-07 14:21:49 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2018-05-07 14:21:49 +08:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_image_thaw_layers:
|
|
|
|
* @image: The image.
|
2018-05-07 14:21:49 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Thaw the image's layer list.
|
2018-05-07 14:21:49 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure thaws the layer list of the image, re-enabling
|
|
|
|
* updates to the Layers dialog.
|
|
|
|
*
|
|
|
|
* This procedure should match a corresponding call to
|
|
|
|
* gimp_image_freeze_layers().
|
2018-05-07 14:21:49 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
2019-09-03 19:31:27 +08:00
|
|
|
*
|
|
|
|
* Since: 2.10.2
|
2018-05-07 14:21:49 +08:00
|
|
|
**/
|
|
|
|
gboolean
|
2019-09-03 19:31:27 +08:00
|
|
|
gimp_image_thaw_layers (GimpImage *image)
|
2018-05-07 14:21:49 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2018-05-07 14:21:49 +08:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-09-03 19:31:27 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
2018-05-07 14:21:49 +08:00
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-thaw-layers",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2018-05-07 14:21:49 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-07-30 16:51:16 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2018-05-07 14:21:49 +08:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
2010-09-06 05:54:23 +08:00
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_image_insert_channel:
|
2019-08-11 20:20:05 +08:00
|
|
|
* @image: The image.
|
2019-09-03 19:31:27 +08:00
|
|
|
* @channel: The channel.
|
|
|
|
* @parent: (nullable): The parent channel.
|
|
|
|
* @position: The channel position.
|
2010-09-06 05:54:23 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Add the specified channel to the image.
|
2019-08-12 20:44:07 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure adds the specified channel to the image at the given
|
|
|
|
* position. Since channel groups are not currently supported, the
|
|
|
|
* parent argument must always be 0. The position argument specifies
|
|
|
|
* the location of the channel inside the stack, starting from the top
|
|
|
|
* (0) and increasing. If the position is specified as -1, then the
|
|
|
|
* channel is inserted above the active channel.
|
2010-09-06 05:54:23 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2010-09-06 05:54:23 +08:00
|
|
|
gboolean
|
2019-09-03 19:31:27 +08:00
|
|
|
gimp_image_insert_channel (GimpImage *image,
|
|
|
|
GimpChannel *channel,
|
|
|
|
GimpChannel *parent,
|
|
|
|
gint position)
|
2010-09-06 05:54:23 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2010-09-06 05:54:23 +08:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-09-03 19:31:27 +08:00
|
|
|
GIMP_TYPE_CHANNEL, channel,
|
|
|
|
GIMP_TYPE_CHANNEL, parent,
|
|
|
|
G_TYPE_INT, position,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-insert-channel",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2010-09-06 05:54:23 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2010-09-06 05:54:23 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2010-09-06 05:54:23 +08:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_image_remove_channel:
|
|
|
|
* @image: The image.
|
|
|
|
* @channel: The channel.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Remove the specified channel from the image.
|
2019-08-12 20:44:07 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure removes the specified channel from the image. If the
|
|
|
|
* channel doesn't exist, an error is returned.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2019-09-03 19:31:27 +08:00
|
|
|
gimp_image_remove_channel (GimpImage *image,
|
|
|
|
GimpChannel *channel)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-09-03 19:31:27 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
|
|
|
GIMP_TYPE_CHANNEL, channel,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-remove-channel",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2000-08-23 09:44:59 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2018-05-07 14:21:49 +08:00
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_image_freeze_channels:
|
2019-08-11 20:20:05 +08:00
|
|
|
* @image: The image.
|
2018-05-07 14:21:49 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Freeze the image's channel list.
|
2018-05-07 14:21:49 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure freezes the channel list of the image, suppressing
|
|
|
|
* any updates to the Channels dialog in response to changes to the
|
|
|
|
* image's channels. This can significantly improve performance while
|
|
|
|
* applying changes affecting the channel list.
|
2018-05-07 14:21:49 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Each call to gimp_image_freeze_channels() should be matched by a
|
|
|
|
* corresponding call to gimp_image_thaw_channels(), undoing its
|
|
|
|
* effects.
|
2018-05-07 14:21:49 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
2018-05-07 16:16:52 +08:00
|
|
|
*
|
2018-05-30 01:22:12 +08:00
|
|
|
* Since: 2.10.2
|
2018-05-07 14:21:49 +08:00
|
|
|
**/
|
|
|
|
gboolean
|
2019-09-03 19:31:27 +08:00
|
|
|
gimp_image_freeze_channels (GimpImage *image)
|
2018-05-07 14:21:49 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2018-05-07 14:21:49 +08:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
2018-05-07 14:21:49 +08:00
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-freeze-channels",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2018-05-07 14:21:49 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-07-30 16:51:16 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2018-05-07 14:21:49 +08:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_image_thaw_channels:
|
|
|
|
* @image: The image.
|
2018-05-07 14:21:49 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Thaw the image's channel list.
|
2018-05-07 14:21:49 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure thaws the channel list of the image, re-enabling
|
|
|
|
* updates to the Channels dialog.
|
2018-05-07 14:21:49 +08:00
|
|
|
*
|
2018-05-13 00:13:12 +08:00
|
|
|
* This procedure should match a corresponding call to
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_image_freeze_channels().
|
2018-05-07 14:21:49 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
2018-05-07 16:16:52 +08:00
|
|
|
*
|
2018-05-30 01:22:12 +08:00
|
|
|
* Since: 2.10.2
|
2018-05-07 14:21:49 +08:00
|
|
|
**/
|
|
|
|
gboolean
|
2019-09-03 19:31:27 +08:00
|
|
|
gimp_image_thaw_channels (GimpImage *image)
|
2018-05-07 14:21:49 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2018-05-07 14:21:49 +08:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-09-03 19:31:27 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-thaw-channels",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2018-05-07 14:21:49 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2000-08-23 09:44:59 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
2000-06-01 20:20:13 +08:00
|
|
|
}
|
1998-07-17 10:19:56 +08:00
|
|
|
|
2010-09-06 05:54:23 +08:00
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_image_insert_vectors:
|
2019-08-11 20:20:05 +08:00
|
|
|
* @image: The image.
|
2019-09-03 19:31:27 +08:00
|
|
|
* @vectors: The vectors.
|
|
|
|
* @parent: (nullable): The parent vectors.
|
|
|
|
* @position: The vectors position.
|
2010-09-06 05:54:23 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Add the specified vectors to the image.
|
2010-09-06 05:54:23 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure adds the specified vectors to the image at the given
|
|
|
|
* position. Since vectors groups are not currently supported, the
|
2011-03-02 06:06:59 +08:00
|
|
|
* parent argument must always be 0. The position argument specifies
|
2019-09-03 19:31:27 +08:00
|
|
|
* the location of the vectors inside the stack, starting from the top
|
2010-09-15 06:02:28 +08:00
|
|
|
* (0) and increasing. If the position is specified as -1, then the
|
2019-09-03 19:31:27 +08:00
|
|
|
* vectors is inserted above the active vectors.
|
2010-09-06 05:54:23 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2010-09-06 05:54:23 +08:00
|
|
|
gboolean
|
2019-09-03 19:31:27 +08:00
|
|
|
gimp_image_insert_vectors (GimpImage *image,
|
|
|
|
GimpVectors *vectors,
|
|
|
|
GimpVectors *parent,
|
2019-08-14 03:36:03 +08:00
|
|
|
gint position)
|
2010-09-06 05:54:23 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2010-09-06 05:54:23 +08:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-09-03 19:31:27 +08:00
|
|
|
GIMP_TYPE_VECTORS, vectors,
|
|
|
|
GIMP_TYPE_VECTORS, parent,
|
2019-08-15 20:04:56 +08:00
|
|
|
G_TYPE_INT, position,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-insert-vectors",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2010-09-06 05:54:23 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2010-09-06 05:54:23 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2010-09-06 05:54:23 +08:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_image_remove_vectors:
|
|
|
|
* @image: The image.
|
|
|
|
* @vectors: The vectors object.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Remove the specified path from the image.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure removes the specified path from the image. If the
|
|
|
|
* path doesn't exist, an error is returned.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
2019-09-03 19:31:27 +08:00
|
|
|
*
|
|
|
|
* Since: 2.4
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2019-09-03 19:31:27 +08:00
|
|
|
gimp_image_remove_vectors (GimpImage *image,
|
|
|
|
GimpVectors *vectors)
|
2000-06-01 20:20:13 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
2000-06-01 20:20:13 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-09-03 19:31:27 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
|
|
|
GIMP_TYPE_VECTORS, vectors,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
2000-06-01 20:20:13 +08:00
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-remove-vectors",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-07-30 16:51:16 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2018-05-07 14:21:49 +08:00
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_image_freeze_vectors:
|
2019-08-11 20:20:05 +08:00
|
|
|
* @image: The image.
|
2018-05-07 14:21:49 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Freeze the image's vectors list.
|
2018-05-07 14:21:49 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure freezes the vectors list of the image, suppressing
|
|
|
|
* any updates to the Paths dialog in response to changes to the
|
|
|
|
* image's vectors. This can significantly improve performance while
|
|
|
|
* applying changes affecting the vectors list.
|
|
|
|
*
|
|
|
|
* Each call to gimp_image_freeze_vectors() should be matched by a
|
|
|
|
* corresponding call to gimp_image_thaw_vectors(), undoing its
|
|
|
|
* effects.
|
2018-05-07 14:21:49 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
2019-09-03 19:31:27 +08:00
|
|
|
*
|
|
|
|
* Since: 2.10.2
|
2018-05-07 14:21:49 +08:00
|
|
|
**/
|
|
|
|
gboolean
|
2019-09-03 19:31:27 +08:00
|
|
|
gimp_image_freeze_vectors (GimpImage *image)
|
2018-05-07 14:21:49 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2018-05-07 14:21:49 +08:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-freeze-vectors",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2018-05-07 14:21:49 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2018-05-07 14:21:49 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2018-05-07 14:21:49 +08:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_image_thaw_vectors:
|
|
|
|
* @image: The image.
|
2018-05-07 14:21:49 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Thaw the image's vectors list.
|
2018-05-07 14:21:49 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure thaws the vectors list of the image, re-enabling
|
|
|
|
* updates to the Paths dialog.
|
|
|
|
*
|
|
|
|
* This procedure should match a corresponding call to
|
|
|
|
* gimp_image_freeze_vectors().
|
2018-05-07 14:21:49 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
2019-09-03 19:31:27 +08:00
|
|
|
*
|
|
|
|
* Since: 2.10.2
|
2018-05-07 14:21:49 +08:00
|
|
|
**/
|
|
|
|
gboolean
|
2019-09-03 19:31:27 +08:00
|
|
|
gimp_image_thaw_vectors (GimpImage *image)
|
2018-05-07 14:21:49 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2018-05-07 14:21:49 +08:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-09-03 19:31:27 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
2018-05-07 14:21:49 +08:00
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-thaw-vectors",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2018-05-07 14:21:49 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-07-30 16:51:16 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2018-05-07 14:21:49 +08:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_image_get_item_position:
|
2019-08-11 20:20:05 +08:00
|
|
|
* @image: The image.
|
2019-09-03 19:31:27 +08:00
|
|
|
* @item: The item.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns the position of the item in its level of its item tree.
|
2010-08-27 22:11:06 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure determines the position of the specified item in its
|
|
|
|
* level in its item tree in the image. If the item doesn't exist in
|
|
|
|
* the image, or the item is not part of an item tree, an error is
|
|
|
|
* returned.
|
2010-08-27 22:11:06 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns: The position of the item in its level in the item tree.
|
2019-08-12 20:44:07 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Since: 2.8
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2019-09-03 19:31:27 +08:00
|
|
|
gint
|
|
|
|
gimp_image_get_item_position (GimpImage *image,
|
|
|
|
GimpItem *item)
|
2010-08-27 22:11:06 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-09-03 19:31:27 +08:00
|
|
|
gint position = 0;
|
2010-08-27 22:11:06 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-09-03 19:31:27 +08:00
|
|
|
GIMP_TYPE_ITEM, item,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-get-item-position",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2010-08-27 22:11:06 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
position = GIMP_VALUES_GET_INT (return_vals, 1);
|
2010-08-27 22:11:06 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2010-08-27 22:11:06 +08:00
|
|
|
|
2019-09-03 19:31:27 +08:00
|
|
|
return position;
|
2010-08-27 22:11:06 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_image_raise_item:
|
|
|
|
* @image: The image.
|
|
|
|
* @item: The item to raise.
|
2010-08-27 22:11:06 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Raise the specified item in its level in its item tree
|
2019-08-12 20:44:07 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure raises the specified item one step in the item tree.
|
|
|
|
* The procedure call will fail if there is no item above it.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
2010-08-27 22:11:06 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Since: 2.8
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2019-09-03 19:31:27 +08:00
|
|
|
gimp_image_raise_item (GimpImage *image,
|
|
|
|
GimpItem *item)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-09-03 19:31:27 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
|
|
|
GIMP_TYPE_ITEM, item,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-raise-item",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2000-06-01 20:20:13 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2000-08-23 09:44:59 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
2000-06-01 20:20:13 +08:00
|
|
|
}
|
|
|
|
|
2005-12-29 05:24:12 +08:00
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_image_lower_item:
|
2019-08-11 20:20:05 +08:00
|
|
|
* @image: The image.
|
2019-09-03 19:31:27 +08:00
|
|
|
* @item: The item to lower.
|
2005-12-29 05:24:12 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Lower the specified item in its level in its item tree
|
2019-08-12 20:44:07 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure lowers the specified item one step in the item tree.
|
|
|
|
* The procedure call will fail if there is no item below it.
|
2005-12-29 05:24:12 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
2010-08-27 22:11:06 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Since: 2.8
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2005-12-29 05:24:12 +08:00
|
|
|
gboolean
|
2019-09-03 19:31:27 +08:00
|
|
|
gimp_image_lower_item (GimpImage *image,
|
|
|
|
GimpItem *item)
|
2005-12-29 05:24:12 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2005-12-29 05:24:12 +08:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-09-03 19:31:27 +08:00
|
|
|
GIMP_TYPE_ITEM, item,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
2005-12-29 05:24:12 +08:00
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-lower-item",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2005-12-29 05:24:12 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-07-30 16:51:16 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2005-12-29 05:24:12 +08:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_image_raise_item_to_top:
|
|
|
|
* @image: The image.
|
|
|
|
* @item: The item to raise to top.
|
2005-12-29 05:24:12 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Raise the specified item to the top of its level in its item tree
|
2019-08-12 20:44:07 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure raises the specified item to top of its level in the
|
|
|
|
* item tree. It will not move the item if there is no item above it.
|
2005-12-29 05:24:12 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
2010-08-27 22:11:06 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Since: 2.8
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2005-12-29 05:24:12 +08:00
|
|
|
gboolean
|
2019-09-03 19:31:27 +08:00
|
|
|
gimp_image_raise_item_to_top (GimpImage *image,
|
|
|
|
GimpItem *item)
|
2005-12-29 05:24:12 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2005-12-29 05:24:12 +08:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-09-03 19:31:27 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
|
|
|
GIMP_TYPE_ITEM, item,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-raise-item-to-top",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2005-12-29 05:24:12 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2005-12-29 05:24:12 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2005-12-29 05:24:12 +08:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
2006-11-23 06:54:53 +08:00
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_image_lower_item_to_bottom:
|
2019-08-11 20:20:05 +08:00
|
|
|
* @image: The image.
|
2019-09-03 19:31:27 +08:00
|
|
|
* @item: The item to lower to bottom.
|
2006-11-23 06:54:53 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Lower the specified item to the bottom of its level in its item tree
|
2006-11-23 06:54:53 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure lowers the specified item to bottom of its level in
|
|
|
|
* the item tree. It will not move the layer if there is no layer below
|
|
|
|
* it.
|
2006-11-23 06:54:53 +08:00
|
|
|
*
|
2010-08-27 22:11:06 +08:00
|
|
|
* Returns: TRUE on success.
|
2019-09-03 19:31:27 +08:00
|
|
|
*
|
|
|
|
* Since: 2.8
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2010-08-27 22:11:06 +08:00
|
|
|
gboolean
|
2019-09-03 19:31:27 +08:00
|
|
|
gimp_image_lower_item_to_bottom (GimpImage *image,
|
|
|
|
GimpItem *item)
|
2010-08-27 22:11:06 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2010-08-27 22:11:06 +08:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-09-03 19:31:27 +08:00
|
|
|
GIMP_TYPE_ITEM, item,
|
2019-08-12 20:44:07 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-lower-item-to-bottom",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2010-08-27 22:11:06 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-07-30 16:51:16 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2010-08-27 22:11:06 +08:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
2010-08-31 02:36:11 +08:00
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_image_reorder_item:
|
|
|
|
* @image: The image.
|
|
|
|
* @item: The item to reorder.
|
|
|
|
* @parent: (nullable): The new parent item.
|
|
|
|
* @position: The new position of the item.
|
2010-08-31 02:36:11 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Reorder the specified item within its item tree
|
2010-08-31 02:36:11 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure reorders the specified item within its item tree.
|
2010-08-31 02:36:11 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
2019-09-03 19:31:27 +08:00
|
|
|
*
|
|
|
|
* Since: 2.8
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2010-08-31 02:36:11 +08:00
|
|
|
gboolean
|
2019-09-03 19:31:27 +08:00
|
|
|
gimp_image_reorder_item (GimpImage *image,
|
|
|
|
GimpItem *item,
|
|
|
|
GimpItem *parent,
|
|
|
|
gint position)
|
2010-08-31 02:36:11 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2010-08-31 02:36:11 +08:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-09-03 19:31:27 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
|
|
|
GIMP_TYPE_ITEM, item,
|
|
|
|
GIMP_TYPE_ITEM, parent,
|
2019-08-15 20:04:56 +08:00
|
|
|
G_TYPE_INT, position,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-reorder-item",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2010-08-31 02:36:11 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2010-08-31 02:36:11 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2010-08-31 02:36:11 +08:00
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
return success;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_image_flatten:
|
2019-08-11 20:20:05 +08:00
|
|
|
* @image: The image.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Flatten all visible layers into a single layer. Discard all
|
|
|
|
* invisible layers.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure combines the visible layers in a manner analogous to
|
|
|
|
* merging with the CLIP_TO_IMAGE merge type. Non-visible layers are
|
|
|
|
* discarded, and the resulting image is stripped of its alpha channel.
|
2019-08-12 20:44:07 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns: (transfer none): The resulting layer.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2019-09-03 19:31:27 +08:00
|
|
|
GimpLayer *
|
|
|
|
gimp_image_flatten (GimpImage *image)
|
2000-06-01 20:20:13 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-09-03 19:31:27 +08:00
|
|
|
GimpLayer *layer = NULL;
|
2000-06-01 20:20:13 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-flatten",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2000-06-01 20:20:13 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
layer = GIMP_VALUES_GET_LAYER (return_vals, 1);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
2019-09-03 19:31:27 +08:00
|
|
|
return layer;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2002-12-13 21:12:03 +08:00
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_image_merge_visible_layers:
|
|
|
|
* @image: The image.
|
|
|
|
* @merge_type: The type of merge.
|
2002-12-13 21:12:03 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Merge the visible image layers into one.
|
2002-12-13 21:12:03 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure combines the visible layers into a single layer using
|
|
|
|
* the specified merge type. A merge type of EXPAND_AS_NECESSARY
|
|
|
|
* expands the final layer to encompass the areas of the visible
|
|
|
|
* layers. A merge type of CLIP_TO_IMAGE clips the final layer to the
|
|
|
|
* extents of the image. A merge type of CLIP_TO_BOTTOM_LAYER clips the
|
|
|
|
* final layer to the size of the bottommost layer.
|
2019-08-12 20:44:07 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns: (transfer none): The resulting layer.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2019-09-03 19:31:27 +08:00
|
|
|
GimpLayer *
|
|
|
|
gimp_image_merge_visible_layers (GimpImage *image,
|
|
|
|
GimpMergeType merge_type)
|
2002-12-13 21:12:03 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-09-03 19:31:27 +08:00
|
|
|
GimpLayer *layer = NULL;
|
2002-12-13 21:12:03 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-09-03 19:31:27 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
|
|
|
GIMP_TYPE_MERGE_TYPE, merge_type,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
2002-12-13 21:12:03 +08:00
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-merge-visible-layers",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2002-12-13 21:12:03 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
layer = GIMP_VALUES_GET_LAYER (return_vals, 1);
|
2019-07-30 16:51:16 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2002-12-13 21:12:03 +08:00
|
|
|
|
2019-09-03 19:31:27 +08:00
|
|
|
return layer;
|
2002-12-13 21:12:03 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_image_merge_down:
|
2019-08-11 20:20:05 +08:00
|
|
|
* @image: The image.
|
2019-09-03 19:31:27 +08:00
|
|
|
* @merge_layer: The layer to merge down from.
|
|
|
|
* @merge_type: The type of merge.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Merge the layer passed and the first visible layer below.
|
2019-08-12 20:44:07 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure combines the passed layer and the first visible layer
|
|
|
|
* below it using the specified merge type. A merge type of
|
|
|
|
* EXPAND_AS_NECESSARY expands the final layer to encompass the areas
|
|
|
|
* of the visible layers. A merge type of CLIP_TO_IMAGE clips the final
|
|
|
|
* layer to the extents of the image. A merge type of
|
|
|
|
* CLIP_TO_BOTTOM_LAYER clips the final layer to the size of the
|
|
|
|
* bottommost layer.
|
2019-08-12 20:44:07 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns: (transfer none): The resulting layer.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2019-09-03 19:31:27 +08:00
|
|
|
GimpLayer *
|
|
|
|
gimp_image_merge_down (GimpImage *image,
|
|
|
|
GimpLayer *merge_layer,
|
|
|
|
GimpMergeType merge_type)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-09-03 19:31:27 +08:00
|
|
|
GimpLayer *layer = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-09-03 19:31:27 +08:00
|
|
|
GIMP_TYPE_LAYER, merge_layer,
|
|
|
|
GIMP_TYPE_MERGE_TYPE, merge_type,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-merge-down",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
layer = GIMP_VALUES_GET_LAYER (return_vals, 1);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-09-03 19:31:27 +08:00
|
|
|
return layer;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2019-09-07 15:20:03 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_merge_layer_group:
|
|
|
|
* @image: The image.
|
|
|
|
* @layer_group: The layer group to merge.
|
|
|
|
*
|
|
|
|
* Merge the passed layer group's layers into one normal layer.
|
|
|
|
*
|
|
|
|
* This procedure combines the layers of the passed layer group into a
|
|
|
|
* single normal layer, replacing the group.
|
|
|
|
*
|
|
|
|
* Returns: (transfer none): The resulting layer.
|
2019-09-07 15:53:26 +08:00
|
|
|
*
|
|
|
|
* Since: 2.10.14
|
2019-09-07 15:20:03 +08:00
|
|
|
**/
|
|
|
|
GimpLayer *
|
|
|
|
gimp_image_merge_layer_group (GimpImage *image,
|
|
|
|
GimpLayer *layer_group)
|
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
GimpLayer *layer = NULL;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
GIMP_TYPE_IMAGE, image,
|
|
|
|
GIMP_TYPE_LAYER, layer_group,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-merge-layer-group",
|
|
|
|
args);
|
2019-09-07 15:20:03 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
|
|
|
layer = GIMP_VALUES_GET_LAYER (return_vals, 1);
|
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
|
|
|
return layer;
|
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* _gimp_image_get_colormap:
|
|
|
|
* @image: The image.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns the image's colormap
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure returns an actual pointer to the image's colormap, as
|
|
|
|
* well as the number of bytes contained in the colormap. The actual
|
|
|
|
* number of colors in the transmitted colormap will be 'num-bytes' /
|
|
|
|
* 3. If the image is not in Indexed color mode, no colormap is
|
|
|
|
* returned.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2023-05-24 05:37:46 +08:00
|
|
|
* Returns: (transfer full): The image's colormap.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2023-05-24 05:37:46 +08:00
|
|
|
GBytes *
|
|
|
|
_gimp_image_get_colormap (GimpImage *image)
|
2000-06-01 20:20:13 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2023-05-24 05:37:46 +08:00
|
|
|
GBytes *colormap = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-09-03 19:31:27 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-get-colormap",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2000-06-01 20:20:13 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2023-05-24 05:37:46 +08:00
|
|
|
colormap = GIMP_VALUES_DUP_BYTES (return_vals, 1);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
2019-09-03 19:31:27 +08:00
|
|
|
return colormap;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* _gimp_image_set_colormap:
|
2019-08-11 20:20:05 +08:00
|
|
|
* @image: The image.
|
2023-05-24 05:37:46 +08:00
|
|
|
* @colormap: The new colormap values.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Sets the entries in the image's colormap.
|
2019-08-12 20:44:07 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure sets the entries in the specified image's colormap.
|
|
|
|
* The number of entries is specified by the 'num-bytes' parameter and
|
|
|
|
* corresponds to the number of INT8 triples that must be contained in
|
|
|
|
* the 'colormap' array. The actual number of colors in the transmitted
|
|
|
|
* colormap is 'num-bytes' / 3.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2003-12-09 01:26:55 +08:00
|
|
|
* Returns: TRUE on success.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2003-12-09 01:26:55 +08:00
|
|
|
gboolean
|
2023-05-24 05:37:46 +08:00
|
|
|
_gimp_image_set_colormap (GimpImage *image,
|
|
|
|
GBytes *colormap)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2003-12-09 01:26:55 +08:00
|
|
|
gboolean success = TRUE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2023-05-24 05:37:46 +08:00
|
|
|
G_TYPE_BYTES, colormap,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-set-colormap",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2013-10-20 00:38:01 +08:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
app, libgimp, pdb: new gimp_image_get_palette().
This is meant to replace gimp_image_get_colormap() (see also #9477).
We likely won't need a gimp_image_set_palette() because we can simply edit the
image's colormap/palette with GimpPalette API now and it is directly updated.
For instance, the following code changes the first entry in the image palette to
red, immediately:
```python
i = Gimp.list_images()[0]
p = i.get_palette()
c = Gimp.RGB()
c.r = 1.0
p.entry_set_color(0, c)
```
For this to work fine, I added a new concept to GimpData, which is that they can
be tied to a GimpImage (instead of a GFile). Image palettes are not considered
internals, they are just tied to their image, therefore they can be edited by
scripts/plug-ins.
Additionally with this commit, editing an image's colormap from libgimp API also
generates undo steps now.
2023-10-06 22:16:57 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_get_palette:
|
|
|
|
* @image: The image.
|
|
|
|
*
|
|
|
|
* Returns the image's colormap
|
|
|
|
*
|
|
|
|
* This procedure returns the image's colormap as a GimpPalette. If the
|
|
|
|
* image is not in Indexed color mode, %NULL is returned.
|
|
|
|
*
|
|
|
|
* Returns: (transfer none): The image's colormap.
|
|
|
|
*
|
|
|
|
* Since: 3.0
|
|
|
|
**/
|
|
|
|
GimpPalette *
|
|
|
|
gimp_image_get_palette (GimpImage *image)
|
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
GimpPalette *colormap = NULL;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
GIMP_TYPE_IMAGE, image,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-get-palette",
|
|
|
|
args);
|
app, libgimp, pdb: new gimp_image_get_palette().
This is meant to replace gimp_image_get_colormap() (see also #9477).
We likely won't need a gimp_image_set_palette() because we can simply edit the
image's colormap/palette with GimpPalette API now and it is directly updated.
For instance, the following code changes the first entry in the image palette to
red, immediately:
```python
i = Gimp.list_images()[0]
p = i.get_palette()
c = Gimp.RGB()
c.r = 1.0
p.entry_set_color(0, c)
```
For this to work fine, I added a new concept to GimpData, which is that they can
be tied to a GimpImage (instead of a GFile). Image palettes are not considered
internals, they are just tied to their image, therefore they can be edited by
scripts/plug-ins.
Additionally with this commit, editing an image's colormap from libgimp API also
generates undo steps now.
2023-10-06 22:16:57 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
|
|
|
colormap = GIMP_VALUES_GET_PALETTE (return_vals, 1);
|
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
|
|
|
return colormap;
|
|
|
|
}
|
|
|
|
|
2013-10-20 00:38:01 +08:00
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* _gimp_image_get_metadata:
|
|
|
|
* @image: The image.
|
2013-10-20 00:38:01 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns the image's metadata.
|
2019-08-12 20:44:07 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns exif/iptc/xmp metadata from the image.
|
2019-08-12 20:44:07 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns: (transfer full): The exif/ptc/xmp metadata as a string.
|
|
|
|
* The returned value must be freed with g_free().
|
2013-10-20 00:38:01 +08:00
|
|
|
**/
|
2019-09-03 19:31:27 +08:00
|
|
|
gchar *
|
|
|
|
_gimp_image_get_metadata (GimpImage *image)
|
2013-10-20 00:38:01 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-09-03 19:31:27 +08:00
|
|
|
gchar *metadata_string = NULL;
|
2013-10-20 00:38:01 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-09-03 19:31:27 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-get-metadata",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2013-10-20 00:38:01 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
metadata_string = GIMP_VALUES_DUP_STRING (return_vals, 1);
|
2013-10-20 00:38:01 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2013-10-20 00:38:01 +08:00
|
|
|
|
2019-09-03 19:31:27 +08:00
|
|
|
return metadata_string;
|
2013-10-20 00:38:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* _gimp_image_set_metadata:
|
2019-08-11 20:20:05 +08:00
|
|
|
* @image: The image.
|
2019-09-03 19:31:27 +08:00
|
|
|
* @metadata_string: The exif/ptc/xmp metadata as a string.
|
2013-10-20 00:38:01 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Set the image's metadata.
|
2013-10-20 00:38:01 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Sets exif/iptc/xmp metadata on the image.
|
2019-08-12 20:44:07 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns: TRUE on success.
|
2013-10-20 00:38:01 +08:00
|
|
|
**/
|
2019-09-03 19:31:27 +08:00
|
|
|
gboolean
|
|
|
|
_gimp_image_set_metadata (GimpImage *image,
|
|
|
|
const gchar *metadata_string)
|
2013-10-20 00:38:01 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-09-03 19:31:27 +08:00
|
|
|
gboolean success = TRUE;
|
2013-10-20 00:38:01 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-09-03 19:31:27 +08:00
|
|
|
G_TYPE_STRING, metadata_string,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
2013-10-20 00:38:01 +08:00
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-set-metadata",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2013-10-20 00:38:01 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-07-30 16:51:16 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-09-03 19:31:27 +08:00
|
|
|
return success;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2001-04-19 04:41:15 +08:00
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_image_clean_all:
|
|
|
|
* @image: The image.
|
2001-04-19 04:41:15 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Set the image dirty count to 0.
|
2001-04-19 04:41:15 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure sets the specified image's dirty count to 0, allowing
|
|
|
|
* operations to occur without having a 'dirtied' image. This is
|
|
|
|
* especially useful for creating and loading images which should not
|
|
|
|
* initially be considered dirty, even though layers must be created,
|
|
|
|
* filled, and installed in the image. Note that save plug-ins must NOT
|
|
|
|
* call this function themselves after saving the image.
|
2019-08-12 20:44:07 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns: TRUE on success.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2019-09-03 19:31:27 +08:00
|
|
|
gboolean
|
|
|
|
gimp_image_clean_all (GimpImage *image)
|
2001-04-19 04:41:15 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-09-03 19:31:27 +08:00
|
|
|
gboolean success = TRUE;
|
2001-04-19 04:41:15 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-09-03 19:31:27 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-clean-all",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2001-04-19 04:41:15 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2001-04-19 04:41:15 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2001-04-19 04:41:15 +08:00
|
|
|
|
2019-09-03 19:31:27 +08:00
|
|
|
return success;
|
2001-04-19 04:41:15 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_image_is_dirty:
|
2019-08-11 20:20:05 +08:00
|
|
|
* @image: The image.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Checks if the image has unsaved changes.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure checks the specified image's dirty count to see if it
|
|
|
|
* needs to be saved. Note that saving the image does not automatically
|
|
|
|
* set the dirty count to 0, you need to call gimp_image_clean_all()
|
|
|
|
* after calling a save procedure to make the image clean.
|
2019-08-12 20:44:07 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns: TRUE if the image has unsaved changes.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2003-12-09 01:26:55 +08:00
|
|
|
gboolean
|
2019-09-03 19:31:27 +08:00
|
|
|
gimp_image_is_dirty (GimpImage *image)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-09-03 19:31:27 +08:00
|
|
|
gboolean dirty = FALSE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-is-dirty",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
dirty = GIMP_VALUES_GET_BOOLEAN (return_vals, 1);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-09-03 19:31:27 +08:00
|
|
|
return dirty;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* _gimp_image_thumbnail:
|
|
|
|
* @image: The image.
|
|
|
|
* @width: The requested thumbnail width.
|
|
|
|
* @height: The requested thumbnail height.
|
|
|
|
* @actual_width: (out): The previews width.
|
|
|
|
* @actual_height: (out): The previews height.
|
|
|
|
* @bpp: (out): The previews bpp.
|
2023-05-24 05:37:46 +08:00
|
|
|
* @thumbnail_data: (out) (transfer full): The thumbnail data.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Get a thumbnail of an image.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This function gets data from which a thumbnail of an image preview
|
|
|
|
* can be created. Maximum x or y dimension is 1024 pixels. The pixels
|
|
|
|
* are returned in RGB[A] or GRAY[A] format. The bpp return value gives
|
|
|
|
* the number of bits per pixel in the image.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2003-12-09 01:26:55 +08:00
|
|
|
* Returns: TRUE on success.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2003-12-09 01:26:55 +08:00
|
|
|
gboolean
|
2019-09-03 19:31:27 +08:00
|
|
|
_gimp_image_thumbnail (GimpImage *image,
|
|
|
|
gint width,
|
|
|
|
gint height,
|
|
|
|
gint *actual_width,
|
|
|
|
gint *actual_height,
|
|
|
|
gint *bpp,
|
2023-05-24 05:37:46 +08:00
|
|
|
GBytes **thumbnail_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2003-12-09 01:26:55 +08:00
|
|
|
gboolean success = TRUE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-09-03 19:31:27 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
|
|
|
G_TYPE_INT, width,
|
|
|
|
G_TYPE_INT, height,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-thumbnail",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-09-03 19:31:27 +08:00
|
|
|
*actual_width = 0;
|
|
|
|
*actual_height = 0;
|
|
|
|
*bpp = 0;
|
|
|
|
*thumbnail_data = NULL;
|
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2003-12-09 01:26:55 +08:00
|
|
|
|
2019-09-03 19:31:27 +08:00
|
|
|
if (success)
|
|
|
|
{
|
2019-09-04 08:49:33 +08:00
|
|
|
*actual_width = GIMP_VALUES_GET_INT (return_vals, 1);
|
|
|
|
*actual_height = GIMP_VALUES_GET_INT (return_vals, 2);
|
|
|
|
*bpp = GIMP_VALUES_GET_INT (return_vals, 3);
|
2023-05-24 05:37:46 +08:00
|
|
|
*thumbnail_data = GIMP_VALUES_DUP_BYTES (return_vals, 4);
|
2019-09-03 19:31:27 +08:00
|
|
|
}
|
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2003-12-09 01:26:55 +08:00
|
|
|
return success;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2020-04-09 21:47:16 +08:00
|
|
|
/**
|
2022-06-27 19:40:27 +08:00
|
|
|
* gimp_image_get_selected_layers: (skip)
|
2020-04-09 21:47:16 +08:00
|
|
|
* @image: The image.
|
|
|
|
* @num_layers: (out): The number of selected layers in the image.
|
|
|
|
*
|
|
|
|
* Returns the specified image's selected layers.
|
|
|
|
*
|
|
|
|
* This procedure returns the list of selected layers in the specified
|
|
|
|
* image.
|
|
|
|
*
|
|
|
|
* Returns: (array length=num_layers) (element-type GimpLayer) (transfer container):
|
|
|
|
* The list of selected layers in the image.
|
|
|
|
* The returned value must be freed with g_free().
|
|
|
|
*
|
2021-02-22 06:17:30 +08:00
|
|
|
* Since: 3.0.0
|
2020-04-09 21:47:16 +08:00
|
|
|
**/
|
|
|
|
GimpLayer **
|
|
|
|
gimp_image_get_selected_layers (GimpImage *image,
|
|
|
|
gint *num_layers)
|
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
GimpLayer **layers = NULL;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
GIMP_TYPE_IMAGE, image,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-get-selected-layers",
|
|
|
|
args);
|
2020-04-09 21:47:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
|
|
|
*num_layers = 0;
|
|
|
|
|
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
|
|
|
{
|
|
|
|
*num_layers = GIMP_VALUES_GET_INT (return_vals, 1);
|
2021-08-26 23:18:32 +08:00
|
|
|
{ GimpObjectArray *a = g_value_get_boxed (gimp_value_array_index (return_vals, 2)); if (a) layers = g_memdup2 (a->data, a->length * sizeof (gpointer)); };
|
2020-04-09 21:47:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
|
|
|
return layers;
|
|
|
|
}
|
|
|
|
|
2021-02-22 06:17:30 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_set_selected_layers:
|
|
|
|
* @image: The image.
|
|
|
|
* @num_layers: The number of layers to select.
|
|
|
|
* @layers: (array length=num_layers) (element-type GimpLayer): The list of layers to select.
|
|
|
|
*
|
|
|
|
* Sets the specified image's selected layers.
|
|
|
|
*
|
|
|
|
* The layers are set as the selected layers in the image. Any previous
|
|
|
|
* selected layers or channels are unselected. An exception is a
|
|
|
|
* previously existing floating selection, in which case this procedure
|
|
|
|
* will return an execution error.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: 3.0.0
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_image_set_selected_layers (GimpImage *image,
|
|
|
|
gint num_layers,
|
|
|
|
const GimpLayer **layers)
|
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
GIMP_TYPE_IMAGE, image,
|
|
|
|
G_TYPE_INT, num_layers,
|
|
|
|
GIMP_TYPE_OBJECT_ARRAY, NULL,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
gimp_value_set_object_array (gimp_value_array_index (args, 2), GIMP_TYPE_LAYER, (GObject **) layers, num_layers);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-set-selected-layers",
|
|
|
|
args);
|
2022-10-20 08:36:50 +08:00
|
|
|
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_selected_channels: (skip)
|
|
|
|
* @image: The image.
|
|
|
|
* @num_channels: (out): The number of selected channels in the image.
|
|
|
|
*
|
|
|
|
* Returns the specified image's selected channels.
|
|
|
|
*
|
|
|
|
* This procedure returns the list of selected channels in the
|
|
|
|
* specified image.
|
|
|
|
*
|
|
|
|
* Returns: (array length=num_channels) (element-type GimpChannel) (transfer container):
|
|
|
|
* The list of selected channels in the image.
|
|
|
|
* The returned value must be freed with g_free().
|
|
|
|
*
|
|
|
|
* Since: 3.0.0
|
|
|
|
**/
|
|
|
|
GimpChannel **
|
|
|
|
gimp_image_get_selected_channels (GimpImage *image,
|
|
|
|
gint *num_channels)
|
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
GimpChannel **channels = NULL;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
GIMP_TYPE_IMAGE, image,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-get-selected-channels",
|
|
|
|
args);
|
2022-10-20 08:36:50 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
|
|
|
*num_channels = 0;
|
|
|
|
|
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
|
|
|
{
|
|
|
|
*num_channels = GIMP_VALUES_GET_INT (return_vals, 1);
|
|
|
|
{ GimpObjectArray *a = g_value_get_boxed (gimp_value_array_index (return_vals, 2)); if (a) channels = g_memdup2 (a->data, a->length * sizeof (gpointer)); };
|
|
|
|
}
|
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
|
|
|
return channels;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_image_set_selected_channels:
|
|
|
|
* @image: The image.
|
|
|
|
* @num_channels: The number of channels to select.
|
|
|
|
* @channels: (array length=num_channels) (element-type GimpChannel): The list of channels to select.
|
|
|
|
*
|
|
|
|
* Sets the specified image's selected channels.
|
|
|
|
*
|
|
|
|
* The channels are set as the selected channels in the image. Any
|
|
|
|
* previous selected layers or channels are unselected. An exception is
|
|
|
|
* a previously existing floating selection, in which case this
|
|
|
|
* procedure will return an execution error.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: 3.0.0
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_image_set_selected_channels (GimpImage *image,
|
|
|
|
gint num_channels,
|
|
|
|
const GimpChannel **channels)
|
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
GIMP_TYPE_IMAGE, image,
|
|
|
|
G_TYPE_INT, num_channels,
|
|
|
|
GIMP_TYPE_OBJECT_ARRAY, NULL,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
gimp_value_set_object_array (gimp_value_array_index (args, 2), GIMP_TYPE_CHANNEL, (GObject **) channels, num_channels);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-set-selected-channels",
|
|
|
|
args);
|
2022-10-20 08:36:50 +08:00
|
|
|
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_selected_vectors: (skip)
|
|
|
|
* @image: The image.
|
|
|
|
* @num_vectors: (out): The number of selected vectors in the image.
|
|
|
|
*
|
|
|
|
* Returns the specified image's selected vectors.
|
|
|
|
*
|
|
|
|
* This procedure returns the list of selected vectors in the specified
|
|
|
|
* image.
|
|
|
|
*
|
|
|
|
* Returns: (array length=num_vectors) (element-type GimpVectors) (transfer container):
|
|
|
|
* The list of selected vectors in the image.
|
|
|
|
* The returned value must be freed with g_free().
|
|
|
|
*
|
|
|
|
* Since: 3.0.0
|
|
|
|
**/
|
|
|
|
GimpVectors **
|
|
|
|
gimp_image_get_selected_vectors (GimpImage *image,
|
|
|
|
gint *num_vectors)
|
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
GimpVectors **vectors = NULL;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
GIMP_TYPE_IMAGE, image,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-get-selected-vectors",
|
|
|
|
args);
|
2022-10-20 08:36:50 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
|
|
|
*num_vectors = 0;
|
|
|
|
|
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
|
|
|
{
|
|
|
|
*num_vectors = GIMP_VALUES_GET_INT (return_vals, 1);
|
|
|
|
{ GimpObjectArray *a = g_value_get_boxed (gimp_value_array_index (return_vals, 2)); if (a) vectors = g_memdup2 (a->data, a->length * sizeof (gpointer)); };
|
|
|
|
}
|
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
|
|
|
return vectors;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_image_set_selected_vectors:
|
|
|
|
* @image: The image.
|
|
|
|
* @num_vectors: The number of vectors to select.
|
|
|
|
* @vectors: (array length=num_vectors) (element-type GimpVectors): The list of vectors to select.
|
|
|
|
*
|
|
|
|
* Sets the specified image's selected vectors.
|
|
|
|
*
|
|
|
|
* The vectors are set as the selected vectors in the image.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: 3.0.0
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_image_set_selected_vectors (GimpImage *image,
|
|
|
|
gint num_vectors,
|
|
|
|
const GimpVectors **vectors)
|
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
GIMP_TYPE_IMAGE, image,
|
|
|
|
G_TYPE_INT, num_vectors,
|
|
|
|
GIMP_TYPE_OBJECT_ARRAY, NULL,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
gimp_value_set_object_array (gimp_value_array_index (args, 2), GIMP_TYPE_VECTORS, (GObject **) vectors, num_vectors);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-set-selected-vectors",
|
|
|
|
args);
|
2021-02-22 06:17:30 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
2022-07-20 04:38:28 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_get_selected_drawables:
|
|
|
|
* @image: The image.
|
|
|
|
* @num_drawables: (out): The number of selected drawables in the image.
|
|
|
|
*
|
|
|
|
* Get the image's selected drawables
|
|
|
|
*
|
|
|
|
* This procedure returns the list of selected drawable in the
|
|
|
|
* specified image. This can be either layers, channels, or a layer
|
|
|
|
* mask.
|
|
|
|
* The active drawables are the active image channels. If there are
|
|
|
|
* none, these are the active image layers. If the active image layer
|
|
|
|
* has a layer mask and the layer mask is in edit mode, then the layer
|
|
|
|
* mask is the active drawable.
|
|
|
|
*
|
|
|
|
* Returns: (array length=num_drawables) (element-type GimpItem) (transfer container):
|
|
|
|
* The list of selected drawables in the image.
|
|
|
|
* The returned value must be freed with g_free().
|
|
|
|
*
|
|
|
|
* Since: 3.0.0
|
|
|
|
**/
|
|
|
|
GimpItem **
|
|
|
|
gimp_image_get_selected_drawables (GimpImage *image,
|
|
|
|
gint *num_drawables)
|
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
GimpItem **drawables = NULL;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
GIMP_TYPE_IMAGE, image,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-get-selected-drawables",
|
|
|
|
args);
|
2022-07-20 04:38:28 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
|
|
|
*num_drawables = 0;
|
|
|
|
|
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
|
|
|
{
|
|
|
|
*num_drawables = GIMP_VALUES_GET_INT (return_vals, 1);
|
|
|
|
{ GimpObjectArray *a = g_value_get_boxed (gimp_value_array_index (return_vals, 2)); if (a) drawables = g_memdup2 (a->data, a->length * sizeof (gpointer)); };
|
|
|
|
}
|
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
|
|
|
return drawables;
|
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_image_get_selection:
|
2019-08-11 20:20:05 +08:00
|
|
|
* @image: The image.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns the specified image's selection.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This will always return a valid ID for a selection -- which is
|
|
|
|
* represented as a channel internally.
|
2019-08-12 20:44:07 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns: (transfer none): The selection channel.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2019-09-03 19:31:27 +08:00
|
|
|
GimpSelection *
|
|
|
|
gimp_image_get_selection (GimpImage *image)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-09-03 19:31:27 +08:00
|
|
|
GimpSelection *selection = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-get-selection",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
selection = GIMP_VALUES_GET_SELECTION (return_vals, 1);
|
2000-06-01 20:20:13 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2000-06-01 20:20:13 +08:00
|
|
|
|
2019-09-03 19:31:27 +08:00
|
|
|
return selection;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_image_get_component_active:
|
|
|
|
* @image: The image.
|
|
|
|
* @component: The image component.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns if the specified image's image component is active.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure returns if the specified image's image component
|
|
|
|
* (i.e. Red, Green, Blue intensity channels in an RGB image) is active
|
|
|
|
* or inactive -- whether or not it can be modified. If the specified
|
|
|
|
* component is not valid for the image type, an error is returned.
|
2019-08-12 20:44:07 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns: Component is active.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2000-06-01 20:20:13 +08:00
|
|
|
gboolean
|
2019-09-03 19:31:27 +08:00
|
|
|
gimp_image_get_component_active (GimpImage *image,
|
|
|
|
GimpChannelType component)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-09-03 19:31:27 +08:00
|
|
|
gboolean active = FALSE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-09-03 19:31:27 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
|
|
|
GIMP_TYPE_CHANNEL_TYPE, component,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-get-component-active",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2000-06-01 20:20:13 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
active = GIMP_VALUES_GET_BOOLEAN (return_vals, 1);
|
2019-07-30 16:51:16 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2000-06-01 20:20:13 +08:00
|
|
|
|
2019-09-03 19:31:27 +08:00
|
|
|
return active;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_image_set_component_active:
|
2019-08-11 20:20:05 +08:00
|
|
|
* @image: The image.
|
2019-09-03 19:31:27 +08:00
|
|
|
* @component: The image component.
|
|
|
|
* @active: Component is active.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Sets if the specified image's image component is active.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure sets if the specified image's image component (i.e.
|
|
|
|
* Red, Green, Blue intensity channels in an RGB image) is active or
|
|
|
|
* inactive -- whether or not it can be modified. If the specified
|
|
|
|
* component is not valid for the image type, an error is returned.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns: TRUE on success.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2019-09-03 19:31:27 +08:00
|
|
|
gboolean
|
|
|
|
gimp_image_set_component_active (GimpImage *image,
|
|
|
|
GimpChannelType component,
|
|
|
|
gboolean active)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-09-03 19:31:27 +08:00
|
|
|
gboolean success = TRUE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-09-03 19:31:27 +08:00
|
|
|
GIMP_TYPE_CHANNEL_TYPE, component,
|
|
|
|
G_TYPE_BOOLEAN, active,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-set-component-active",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2000-08-23 09:44:59 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
2019-09-03 19:31:27 +08:00
|
|
|
return success;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_image_get_component_visible:
|
|
|
|
* @image: The image.
|
|
|
|
* @component: The image component.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns if the specified image's image component is visible.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure returns if the specified image's image component
|
|
|
|
* (i.e. Red, Green, Blue intensity channels in an RGB image) is
|
|
|
|
* visible or invisible -- whether or not it can be seen. If the
|
|
|
|
* specified component is not valid for the image type, an error is
|
|
|
|
* returned.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns: Component is visible.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2019-09-03 19:31:27 +08:00
|
|
|
gboolean
|
|
|
|
gimp_image_get_component_visible (GimpImage *image,
|
|
|
|
GimpChannelType component)
|
2000-06-01 20:20:13 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-09-03 19:31:27 +08:00
|
|
|
gboolean visible = FALSE;
|
2000-06-01 20:20:13 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-09-03 19:31:27 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
|
|
|
GIMP_TYPE_CHANNEL_TYPE, component,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
2000-06-01 20:20:13 +08:00
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-get-component-visible",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2000-06-01 20:20:13 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
visible = GIMP_VALUES_GET_BOOLEAN (return_vals, 1);
|
2019-07-30 16:51:16 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2000-06-01 20:20:13 +08:00
|
|
|
|
2019-09-03 19:31:27 +08:00
|
|
|
return visible;
|
2000-06-01 20:20:13 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_image_set_component_visible:
|
2019-08-11 20:20:05 +08:00
|
|
|
* @image: The image.
|
2019-09-03 19:31:27 +08:00
|
|
|
* @component: The image component.
|
|
|
|
* @visible: Component is visible.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Sets if the specified image's image component is visible.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure sets if the specified image's image component (i.e.
|
|
|
|
* Red, Green, Blue intensity channels in an RGB image) is visible or
|
|
|
|
* invisible -- whether or not it can be seen. If the specified
|
|
|
|
* component is not valid for the image type, an error is returned.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns: TRUE on success.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2019-09-03 19:31:27 +08:00
|
|
|
gboolean
|
|
|
|
gimp_image_set_component_visible (GimpImage *image,
|
|
|
|
GimpChannelType component,
|
|
|
|
gboolean visible)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-09-03 19:31:27 +08:00
|
|
|
gboolean success = TRUE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-09-03 19:31:27 +08:00
|
|
|
GIMP_TYPE_CHANNEL_TYPE, component,
|
|
|
|
G_TYPE_BOOLEAN, visible,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-set-component-visible",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2000-08-23 09:44:59 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
2019-09-03 19:31:27 +08:00
|
|
|
return success;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
2019-09-12 03:48:34 +08:00
|
|
|
* gimp_image_get_file:
|
2019-09-03 19:31:27 +08:00
|
|
|
* @image: The image.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2019-09-12 03:48:34 +08:00
|
|
|
* Returns the file for the specified image.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2019-09-12 03:48:34 +08:00
|
|
|
* This procedure returns the file associated with the specified image.
|
|
|
|
* The image has a file only if it was loaded or imported from a file
|
|
|
|
* or has since been saved or exported. Otherwise, this function
|
|
|
|
* returns %NULL. See also gimp-image-get-imported-file to get the
|
|
|
|
* current file if it was imported from a non-GIMP file format and not
|
|
|
|
* yet saved, or gimp-image-get-exported-file if the image has been
|
|
|
|
* exported to a non-GIMP file format.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2019-09-12 03:48:34 +08:00
|
|
|
* Returns: (transfer full): The file.
|
|
|
|
*
|
|
|
|
* Since: 2.8
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2019-09-12 03:48:34 +08:00
|
|
|
GFile *
|
|
|
|
gimp_image_get_file (GimpImage *image)
|
2000-06-01 20:20:13 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-09-12 03:48:34 +08:00
|
|
|
GFile *file = NULL;
|
2000-06-01 20:20:13 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-09-03 19:31:27 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-08-12 20:44:07 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-get-file",
|
|
|
|
args);
|
2019-08-12 20:44:07 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-12 03:48:34 +08:00
|
|
|
file = GIMP_VALUES_DUP_FILE (return_vals, 1);
|
2019-08-12 20:44:07 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
2019-09-12 03:48:34 +08:00
|
|
|
return file;
|
2019-08-12 20:44:07 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-09-12 03:48:34 +08:00
|
|
|
* gimp_image_set_file:
|
2019-08-12 20:44:07 +08:00
|
|
|
* @image: The image.
|
2019-09-12 03:48:34 +08:00
|
|
|
* @file: The new image file.
|
2019-08-12 20:44:07 +08:00
|
|
|
*
|
2023-02-14 04:23:47 +08:00
|
|
|
* Sets the specified XCF image's file.
|
2019-08-12 20:44:07 +08:00
|
|
|
*
|
2019-09-12 03:48:34 +08:00
|
|
|
* This procedure sets the specified image's file.
|
2023-02-14 04:23:47 +08:00
|
|
|
* This is to set the XCF file associated with your image. In
|
|
|
|
* particular, do not use this function to set the imported file in
|
|
|
|
* file import plug-ins. This is done by the core process.
|
2019-08-12 20:44:07 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns: TRUE on success.
|
2019-08-12 20:44:07 +08:00
|
|
|
**/
|
2019-09-03 19:31:27 +08:00
|
|
|
gboolean
|
2019-09-12 03:48:34 +08:00
|
|
|
gimp_image_set_file (GimpImage *image,
|
|
|
|
GFile *file)
|
2019-08-12 20:44:07 +08:00
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-09-03 19:31:27 +08:00
|
|
|
gboolean success = TRUE;
|
2019-08-12 20:44:07 +08:00
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-09-12 03:48:34 +08:00
|
|
|
G_TYPE_FILE, file,
|
2019-08-12 20:44:07 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-set-file",
|
|
|
|
args);
|
2019-08-12 20:44:07 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-08-12 20:44:07 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
2019-09-03 19:31:27 +08:00
|
|
|
return success;
|
2019-08-12 20:44:07 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-09-12 03:48:34 +08:00
|
|
|
* gimp_image_get_xcf_file:
|
2019-08-12 20:44:07 +08:00
|
|
|
* @image: The image.
|
|
|
|
*
|
2019-09-12 03:48:34 +08:00
|
|
|
* Returns the XCF file for the specified image.
|
2019-08-12 20:44:07 +08:00
|
|
|
*
|
2019-09-12 03:48:34 +08:00
|
|
|
* This procedure returns the XCF file associated with the image. If
|
|
|
|
* there is no such file, this procedure returns %NULL.
|
2019-08-12 20:44:07 +08:00
|
|
|
*
|
2019-09-12 03:48:34 +08:00
|
|
|
* Returns: (transfer full): The imported XCF file.
|
2019-09-03 19:31:27 +08:00
|
|
|
*
|
|
|
|
* Since: 2.8
|
2019-08-12 20:44:07 +08:00
|
|
|
**/
|
2019-09-12 03:48:34 +08:00
|
|
|
GFile *
|
|
|
|
gimp_image_get_xcf_file (GimpImage *image)
|
2019-08-12 20:44:07 +08:00
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-09-12 03:48:34 +08:00
|
|
|
GFile *file = NULL;
|
2019-08-12 20:44:07 +08:00
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-08-12 20:44:07 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-get-xcf-file",
|
|
|
|
args);
|
2019-08-12 20:44:07 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-12 03:48:34 +08:00
|
|
|
file = GIMP_VALUES_DUP_FILE (return_vals, 1);
|
2019-08-12 20:44:07 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
2019-09-12 03:48:34 +08:00
|
|
|
return file;
|
2019-08-12 20:44:07 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-09-12 03:48:34 +08:00
|
|
|
* gimp_image_get_imported_file:
|
2019-08-12 20:44:07 +08:00
|
|
|
* @image: The image.
|
|
|
|
*
|
2019-09-12 03:48:34 +08:00
|
|
|
* Returns the imported file for the specified image.
|
2019-08-12 20:44:07 +08:00
|
|
|
*
|
2019-09-12 03:48:34 +08:00
|
|
|
* This procedure returns the file associated with the specified image
|
2019-09-03 19:31:27 +08:00
|
|
|
* if the image was imported from a non-native Gimp format. If the
|
|
|
|
* image was not imported, or has since been saved in the native Gimp
|
|
|
|
* format, this procedure returns %NULL.
|
2019-08-12 20:44:07 +08:00
|
|
|
*
|
2019-09-12 03:48:34 +08:00
|
|
|
* Returns: (transfer full): The imported file.
|
2019-09-03 19:31:27 +08:00
|
|
|
*
|
|
|
|
* Since: 2.8
|
2019-08-12 20:44:07 +08:00
|
|
|
**/
|
2019-09-12 03:48:34 +08:00
|
|
|
GFile *
|
|
|
|
gimp_image_get_imported_file (GimpImage *image)
|
2019-08-12 20:44:07 +08:00
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-09-12 03:48:34 +08:00
|
|
|
GFile *file = NULL;
|
2019-08-12 20:44:07 +08:00
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-08-12 20:44:07 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-get-imported-file",
|
|
|
|
args);
|
2019-08-12 20:44:07 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-12 03:48:34 +08:00
|
|
|
file = GIMP_VALUES_DUP_FILE (return_vals, 1);
|
2019-08-12 20:44:07 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
2019-09-12 03:48:34 +08:00
|
|
|
return file;
|
2019-08-12 20:44:07 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-09-12 03:48:34 +08:00
|
|
|
* gimp_image_get_exported_file:
|
2019-08-12 20:44:07 +08:00
|
|
|
* @image: The image.
|
|
|
|
*
|
2019-09-12 03:48:34 +08:00
|
|
|
* Returns the exported file for the specified image.
|
2019-08-12 20:44:07 +08:00
|
|
|
*
|
2019-09-12 03:48:34 +08:00
|
|
|
* This procedure returns the file associated with the specified image
|
2019-09-03 19:31:27 +08:00
|
|
|
* if the image was exported a non-native GIMP format. If the image was
|
|
|
|
* not exported, this procedure returns %NULL.
|
2019-08-12 20:44:07 +08:00
|
|
|
*
|
2019-09-12 03:48:34 +08:00
|
|
|
* Returns: (transfer full): The exported file.
|
2019-09-03 19:31:27 +08:00
|
|
|
*
|
|
|
|
* Since: 2.8
|
2019-08-12 20:44:07 +08:00
|
|
|
**/
|
2019-09-12 03:48:34 +08:00
|
|
|
GFile *
|
|
|
|
gimp_image_get_exported_file (GimpImage *image)
|
2019-08-12 20:44:07 +08:00
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-09-12 03:48:34 +08:00
|
|
|
GFile *file = NULL;
|
2019-08-12 20:44:07 +08:00
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-08-12 20:44:07 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-get-exported-file",
|
|
|
|
args);
|
2019-08-12 20:44:07 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-12 03:48:34 +08:00
|
|
|
file = GIMP_VALUES_DUP_FILE (return_vals, 1);
|
2019-08-12 20:44:07 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
2019-09-12 03:48:34 +08:00
|
|
|
return file;
|
2019-08-12 20:44:07 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_image_get_name:
|
2019-08-12 20:44:07 +08:00
|
|
|
* @image: The image.
|
2011-08-13 03:15:16 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns the specified image's name.
|
2019-08-12 20:44:07 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure returns the image's name. If the image has a filename
|
|
|
|
* or an URI, then the returned name contains the filename's or URI's
|
|
|
|
* base name (the last component of the path). Otherwise it is the
|
|
|
|
* translated string \"Untitled\". The returned name is formatted like
|
|
|
|
* the image name in the image window title, it may contain '[]',
|
|
|
|
* '(imported)' etc. and should only be used to label user interface
|
|
|
|
* elements. Never use it to construct filenames.
|
2019-08-12 20:44:07 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns: (transfer full): The name.
|
|
|
|
* The returned value must be freed with g_free().
|
2011-08-13 03:15:16 +08:00
|
|
|
**/
|
2019-09-03 19:31:27 +08:00
|
|
|
gchar *
|
|
|
|
gimp_image_get_name (GimpImage *image)
|
2011-08-13 03:15:16 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-09-03 19:31:27 +08:00
|
|
|
gchar *name = NULL;
|
2011-08-13 03:15:16 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-get-name",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2011-08-13 03:15:16 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
name = GIMP_VALUES_DUP_STRING (return_vals, 1);
|
2011-08-13 03:15:16 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2011-08-13 03:15:16 +08:00
|
|
|
|
2019-09-03 19:31:27 +08:00
|
|
|
return name;
|
2011-08-13 03:15:16 +08:00
|
|
|
}
|
|
|
|
|
2002-05-08 06:35:29 +08:00
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_image_get_resolution:
|
|
|
|
* @image: The image.
|
|
|
|
* @xresolution: (out): The resolution in the x-axis, in dots per inch.
|
|
|
|
* @yresolution: (out): The resolution in the y-axis, in dots per inch.
|
2002-05-08 06:35:29 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns the specified image's resolution.
|
2002-05-08 06:35:29 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure returns the specified image's resolution in dots per
|
|
|
|
* inch. This value is independent of any of the layers in this image.
|
2002-05-08 06:35:29 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns: TRUE on success.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2019-09-03 19:31:27 +08:00
|
|
|
gboolean
|
|
|
|
gimp_image_get_resolution (GimpImage *image,
|
|
|
|
gdouble *xresolution,
|
|
|
|
gdouble *yresolution)
|
2002-05-08 06:35:29 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-09-03 19:31:27 +08:00
|
|
|
gboolean success = TRUE;
|
2002-05-08 06:35:29 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-09-03 19:31:27 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
2002-05-08 06:35:29 +08:00
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-get-resolution",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2002-05-08 06:35:29 +08:00
|
|
|
|
2019-09-03 19:31:27 +08:00
|
|
|
*xresolution = 0.0;
|
|
|
|
*yresolution = 0.0;
|
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-09-03 19:31:27 +08:00
|
|
|
|
|
|
|
if (success)
|
|
|
|
{
|
2019-09-04 08:49:33 +08:00
|
|
|
*xresolution = GIMP_VALUES_GET_DOUBLE (return_vals, 1);
|
|
|
|
*yresolution = GIMP_VALUES_GET_DOUBLE (return_vals, 2);
|
2019-09-03 19:31:27 +08:00
|
|
|
}
|
2019-07-30 16:51:16 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2002-05-08 06:35:29 +08:00
|
|
|
|
2019-09-03 19:31:27 +08:00
|
|
|
return success;
|
2002-05-08 06:35:29 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_image_set_resolution:
|
2019-08-11 20:20:05 +08:00
|
|
|
* @image: The image.
|
2019-09-03 19:31:27 +08:00
|
|
|
* @xresolution: The new image resolution in the x-axis, in dots per inch.
|
|
|
|
* @yresolution: The new image resolution in the y-axis, in dots per inch.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Sets the specified image's resolution.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure sets the specified image's resolution in dots per
|
|
|
|
* inch. This value is independent of any of the layers in this image.
|
|
|
|
* No scaling or resizing is performed.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns: TRUE on success.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2019-09-03 19:31:27 +08:00
|
|
|
gboolean
|
|
|
|
gimp_image_set_resolution (GimpImage *image,
|
|
|
|
gdouble xresolution,
|
|
|
|
gdouble yresolution)
|
1998-10-05 18:05:29 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-09-03 19:31:27 +08:00
|
|
|
gboolean success = TRUE;
|
1998-11-15 07:28:47 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-09-03 19:31:27 +08:00
|
|
|
G_TYPE_DOUBLE, xresolution,
|
|
|
|
G_TYPE_DOUBLE, yresolution,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-set-resolution",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
1998-10-05 18:05:29 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
1998-10-05 18:05:29 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
2019-09-03 19:31:27 +08:00
|
|
|
return success;
|
1998-10-05 18:05:29 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_image_get_unit:
|
|
|
|
* @image: The image.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns the specified image's unit.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure returns the specified image's unit. This value is
|
|
|
|
* independent of any of the layers in this image. See the
|
|
|
|
* gimp_unit_*() procedure definitions for the valid range of unit IDs
|
|
|
|
* and a description of the unit system.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns: (transfer none): The unit.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2019-09-03 19:31:27 +08:00
|
|
|
GimpUnit
|
|
|
|
gimp_image_get_unit (GimpImage *image)
|
1998-10-05 18:05:29 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-09-03 19:31:27 +08:00
|
|
|
GimpUnit unit = GIMP_UNIT_PIXEL;
|
1998-10-05 18:05:29 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-09-03 19:31:27 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
1998-10-05 18:05:29 +08:00
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-get-unit",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
unit = GIMP_VALUES_GET_INT (return_vals, 1);
|
2019-07-30 16:51:16 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
2019-09-03 19:31:27 +08:00
|
|
|
return unit;
|
1999-03-17 04:14:07 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_image_set_unit:
|
2019-08-11 20:20:05 +08:00
|
|
|
* @image: The image.
|
2019-09-03 19:31:27 +08:00
|
|
|
* @unit: The new image unit.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Sets the specified image's unit.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure sets the specified image's unit. No scaling or
|
|
|
|
* resizing is performed. This value is independent of any of the
|
|
|
|
* layers in this image. See the gimp_unit_*() procedure definitions
|
|
|
|
* for the valid range of unit IDs and a description of the unit
|
|
|
|
* system.
|
2019-08-12 20:44:07 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns: TRUE on success.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2019-09-03 19:31:27 +08:00
|
|
|
gboolean
|
|
|
|
gimp_image_set_unit (GimpImage *image,
|
|
|
|
GimpUnit unit)
|
1999-03-17 04:14:07 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-09-03 19:31:27 +08:00
|
|
|
gboolean success = TRUE;
|
1999-03-17 04:14:07 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-09-03 19:31:27 +08:00
|
|
|
GIMP_TYPE_UNIT, unit,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-set-unit",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
1999-03-17 04:14:07 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
1999-03-17 04:14:07 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
1999-03-17 04:14:07 +08:00
|
|
|
|
2019-09-03 19:31:27 +08:00
|
|
|
return success;
|
1999-03-17 04:14:07 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_image_get_tattoo_state:
|
|
|
|
* @image: The image.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns the tattoo state associated with the image.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure returns the tattoo state of the image. Use only by
|
|
|
|
* save/load plug-ins that wish to preserve an images tattoo state.
|
|
|
|
* Using this function at other times will produce unexpected results.
|
2019-08-12 20:44:07 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns: The tattoo state.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2019-09-03 19:31:27 +08:00
|
|
|
guint
|
|
|
|
gimp_image_get_tattoo_state (GimpImage *image)
|
1999-03-17 04:14:07 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-09-03 19:31:27 +08:00
|
|
|
guint tattoo_state = 0;
|
1999-03-17 04:14:07 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-09-03 19:31:27 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-get-tattoo-state",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
1999-03-17 04:14:07 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
tattoo_state = GIMP_VALUES_GET_UINT (return_vals, 1);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
2019-09-03 19:31:27 +08:00
|
|
|
return tattoo_state;
|
1998-10-05 18:05:29 +08:00
|
|
|
}
|
1998-10-08 16:15:21 +08:00
|
|
|
|
2003-12-09 01:26:55 +08:00
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_image_set_tattoo_state:
|
2019-08-11 20:20:05 +08:00
|
|
|
* @image: The image.
|
2019-09-03 19:31:27 +08:00
|
|
|
* @tattoo_state: The new image tattoo state.
|
2003-12-09 01:26:55 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Set the tattoo state associated with the image.
|
2003-12-09 01:26:55 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure sets the tattoo state of the image. Use only by
|
|
|
|
* save/load plug-ins that wish to preserve an images tattoo state.
|
|
|
|
* Using this function at other times will produce unexpected results.
|
|
|
|
* A full check of uniqueness of states in layers, channels and paths
|
|
|
|
* will be performed by this procedure and a execution failure will be
|
|
|
|
* returned if this fails. A failure will also be returned if the new
|
|
|
|
* tattoo state value is less than the maximum tattoo value from all of
|
|
|
|
* the tattoos from the paths, layers and channels. After the image
|
|
|
|
* data has been loaded and all the tattoos have been set then this is
|
|
|
|
* the last procedure that should be called. If effectively does a
|
|
|
|
* status check on the tattoo values that have been set to make sure
|
|
|
|
* that all is OK.
|
2019-08-12 20:44:07 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns: TRUE on success.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2019-09-03 19:31:27 +08:00
|
|
|
gboolean
|
|
|
|
gimp_image_set_tattoo_state (GimpImage *image,
|
|
|
|
guint tattoo_state)
|
2003-12-09 01:26:55 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-09-03 19:31:27 +08:00
|
|
|
gboolean success = TRUE;
|
2003-12-09 01:26:55 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-09-03 19:31:27 +08:00
|
|
|
G_TYPE_UINT, tattoo_state,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
2003-12-09 01:26:55 +08:00
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-set-tattoo-state",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2003-12-09 01:26:55 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-07-30 16:51:16 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2003-12-09 01:26:55 +08:00
|
|
|
|
2019-09-03 19:31:27 +08:00
|
|
|
return success;
|
2003-12-09 01:26:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_image_get_layer_by_tattoo:
|
|
|
|
* @image: The image.
|
|
|
|
* @tattoo: The tattoo of the layer to find.
|
2003-12-09 01:26:55 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Find a layer with a given tattoo in an image.
|
2003-12-09 01:26:55 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure returns the layer with the given tattoo in the
|
2019-08-12 20:44:07 +08:00
|
|
|
* specified image.
|
2003-12-09 01:26:55 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns: (transfer none): The layer with the specified tattoo.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2019-09-03 19:31:27 +08:00
|
|
|
GimpLayer *
|
|
|
|
gimp_image_get_layer_by_tattoo (GimpImage *image,
|
|
|
|
guint tattoo)
|
2003-12-09 01:26:55 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-09-03 19:31:27 +08:00
|
|
|
GimpLayer *layer = NULL;
|
2003-12-09 01:26:55 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-09-03 19:31:27 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
|
|
|
G_TYPE_UINT, tattoo,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-get-layer-by-tattoo",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2003-12-09 01:26:55 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
layer = GIMP_VALUES_GET_LAYER (return_vals, 1);
|
2003-12-09 01:26:55 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2003-12-09 01:26:55 +08:00
|
|
|
|
2019-09-03 19:31:27 +08:00
|
|
|
return layer;
|
2003-12-09 01:26:55 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_image_get_channel_by_tattoo:
|
2019-08-11 20:20:05 +08:00
|
|
|
* @image: The image.
|
2019-09-03 19:31:27 +08:00
|
|
|
* @tattoo: The tattoo of the channel to find.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Find a channel with a given tattoo in an image.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure returns the channel with the given tattoo in the
|
2000-08-25 07:06:53 +08:00
|
|
|
* specified image.
|
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns: (transfer none): The channel with the specified tattoo.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2019-08-14 03:36:03 +08:00
|
|
|
GimpChannel *
|
2019-09-03 19:31:27 +08:00
|
|
|
gimp_image_get_channel_by_tattoo (GimpImage *image,
|
|
|
|
guint tattoo)
|
1998-10-30 18:21:33 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-08-14 03:36:03 +08:00
|
|
|
GimpChannel *channel = NULL;
|
1998-10-30 18:21:33 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-09-03 19:31:27 +08:00
|
|
|
G_TYPE_UINT, tattoo,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
1998-10-30 18:21:33 +08:00
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-get-channel-by-tattoo",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
1998-10-30 18:21:33 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
channel = GIMP_VALUES_GET_CHANNEL (return_vals, 1);
|
2019-07-30 16:51:16 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
1998-10-30 18:21:33 +08:00
|
|
|
|
2019-08-14 03:36:03 +08:00
|
|
|
return channel;
|
1998-10-30 18:21:33 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_image_get_vectors_by_tattoo:
|
|
|
|
* @image: The image.
|
|
|
|
* @tattoo: The tattoo of the vectors to find.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Find a vectors with a given tattoo in an image.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure returns the vectors with the given tattoo in the
|
2000-08-25 07:06:53 +08:00
|
|
|
* specified image.
|
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns: (transfer none): The vectors with the specified tattoo.
|
2019-08-12 20:44:07 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Since: 2.6
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2019-09-03 19:31:27 +08:00
|
|
|
GimpVectors *
|
|
|
|
gimp_image_get_vectors_by_tattoo (GimpImage *image,
|
|
|
|
guint tattoo)
|
1998-10-30 18:21:33 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-09-03 19:31:27 +08:00
|
|
|
GimpVectors *vectors = NULL;
|
1998-10-30 18:21:33 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-09-03 19:31:27 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
|
|
|
G_TYPE_UINT, tattoo,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-get-vectors-by-tattoo",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
1998-10-30 18:21:33 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
vectors = GIMP_VALUES_GET_VECTORS (return_vals, 1);
|
2000-05-31 21:24:14 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2000-05-31 21:24:14 +08:00
|
|
|
|
2019-09-03 19:31:27 +08:00
|
|
|
return vectors;
|
2000-05-31 21:24:14 +08:00
|
|
|
}
|
2007-11-06 02:19:02 +08:00
|
|
|
|
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_image_get_layer_by_name:
|
2019-08-11 20:20:05 +08:00
|
|
|
* @image: The image.
|
2019-09-03 19:31:27 +08:00
|
|
|
* @name: The name of the layer to find.
|
2007-11-06 02:19:02 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Find a layer with a given name in an image.
|
2007-11-06 02:19:02 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure returns the layer with the given name in the
|
2007-11-06 02:19:02 +08:00
|
|
|
* specified image.
|
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns: (transfer none): The layer with the specified name.
|
2007-11-06 02:19:02 +08:00
|
|
|
*
|
2019-08-12 20:44:07 +08:00
|
|
|
* Since: 2.8
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2019-09-03 19:31:27 +08:00
|
|
|
GimpLayer *
|
|
|
|
gimp_image_get_layer_by_name (GimpImage *image,
|
|
|
|
const gchar *name)
|
2007-11-06 02:19:02 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-09-03 19:31:27 +08:00
|
|
|
GimpLayer *layer = NULL;
|
2007-11-06 02:19:02 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-08-12 20:44:07 +08:00
|
|
|
G_TYPE_STRING, name,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-get-layer-by-name",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2011-09-24 22:35:59 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
layer = GIMP_VALUES_GET_LAYER (return_vals, 1);
|
2011-09-24 22:35:59 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2011-09-24 22:35:59 +08:00
|
|
|
|
2019-09-03 19:31:27 +08:00
|
|
|
return layer;
|
2011-09-24 22:35:59 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_image_get_channel_by_name:
|
|
|
|
* @image: The image.
|
|
|
|
* @name: The name of the channel to find.
|
2011-09-24 22:35:59 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Find a channel with a given name in an image.
|
2011-09-24 22:35:59 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure returns the channel with the given name in the
|
2011-09-24 22:35:59 +08:00
|
|
|
* specified image.
|
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns: (transfer none): The channel with the specified name.
|
2011-09-24 22:35:59 +08:00
|
|
|
*
|
2015-06-01 03:18:09 +08:00
|
|
|
* Since: 2.8
|
2011-09-24 22:35:59 +08:00
|
|
|
**/
|
2019-09-03 19:31:27 +08:00
|
|
|
GimpChannel *
|
|
|
|
gimp_image_get_channel_by_name (GimpImage *image,
|
|
|
|
const gchar *name)
|
2011-09-24 22:35:59 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-09-03 19:31:27 +08:00
|
|
|
GimpChannel *channel = NULL;
|
2011-09-24 22:35:59 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-09-03 19:31:27 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-08-08 19:01:50 +08:00
|
|
|
G_TYPE_STRING, name,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
2011-09-24 22:35:59 +08:00
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-get-channel-by-name",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2011-09-24 22:35:59 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
channel = GIMP_VALUES_GET_CHANNEL (return_vals, 1);
|
2019-07-30 16:51:16 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2011-09-24 22:35:59 +08:00
|
|
|
|
2019-09-03 19:31:27 +08:00
|
|
|
return channel;
|
2011-09-24 22:35:59 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_image_get_vectors_by_name:
|
2019-08-11 20:20:05 +08:00
|
|
|
* @image: The image.
|
2019-09-03 19:31:27 +08:00
|
|
|
* @name: The name of the vectors to find.
|
2011-09-24 22:35:59 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Find a vectors with a given name in an image.
|
2011-09-24 22:35:59 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* This procedure returns the vectors with the given name in the
|
|
|
|
* specified image.
|
2011-09-24 22:35:59 +08:00
|
|
|
*
|
2019-09-03 19:31:27 +08:00
|
|
|
* Returns: (transfer none): The vectors with the specified name.
|
2011-09-24 22:35:59 +08:00
|
|
|
*
|
2015-06-01 03:18:09 +08:00
|
|
|
* Since: 2.8
|
2011-09-24 22:35:59 +08:00
|
|
|
**/
|
2019-09-03 19:31:27 +08:00
|
|
|
GimpVectors *
|
|
|
|
gimp_image_get_vectors_by_name (GimpImage *image,
|
|
|
|
const gchar *name)
|
2011-09-24 22:35:59 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-09-03 19:31:27 +08:00
|
|
|
GimpVectors *vectors = NULL;
|
2011-09-24 22:35:59 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-09-03 19:31:27 +08:00
|
|
|
G_TYPE_STRING, name,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-get-vectors-by-name",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2011-09-24 22:35:59 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
vectors = GIMP_VALUES_GET_VECTORS (return_vals, 1);
|
2011-09-24 22:35:59 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2011-09-24 22:35:59 +08:00
|
|
|
|
2019-09-03 19:31:27 +08:00
|
|
|
return vectors;
|
2011-09-24 22:35:59 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-09-03 19:31:27 +08:00
|
|
|
* gimp_image_attach_parasite:
|
|
|
|
* @image: The image.
|
2019-08-12 20:44:07 +08:00
|
|
|
* @parasite: The parasite to attach to an image.
|
2011-09-24 22:35:59 +08:00
|
|
|
*
|
2019-08-12 20:44:07 +08:00
|
|
|
* Add a parasite to an image.
|
2011-09-24 22:35:59 +08:00
|
|
|
*
|
2019-08-12 20:44:07 +08:00
|
|
|
* This procedure attaches a parasite to an image. It has no return
|
|
|
|
* values.
|
2011-09-24 22:35:59 +08:00
|
|
|
*
|
2019-08-12 20:44:07 +08:00
|
|
|
* Returns: TRUE on success.
|
2011-09-24 22:35:59 +08:00
|
|
|
*
|
2015-06-01 03:18:09 +08:00
|
|
|
* Since: 2.8
|
2011-09-24 22:35:59 +08:00
|
|
|
**/
|
2019-08-12 20:44:07 +08:00
|
|
|
gboolean
|
2019-09-03 19:31:27 +08:00
|
|
|
gimp_image_attach_parasite (GimpImage *image,
|
|
|
|
const GimpParasite *parasite)
|
2011-09-24 22:35:59 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2019-08-12 20:44:07 +08:00
|
|
|
gboolean success = TRUE;
|
2011-09-24 22:35:59 +08:00
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-09-03 19:31:27 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-08-12 20:44:07 +08:00
|
|
|
GIMP_TYPE_PARASITE, parasite,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
2007-11-06 02:19:02 +08:00
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-attach-parasite",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2007-11-06 02:19:02 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-07-30 16:51:16 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2007-11-06 02:19:02 +08:00
|
|
|
|
2019-08-12 20:44:07 +08:00
|
|
|
return success;
|
2007-11-06 02:19:02 +08:00
|
|
|
}
|
2011-03-08 20:19:21 +08:00
|
|
|
|
|
|
|
/**
|
2019-08-12 20:44:07 +08:00
|
|
|
* gimp_image_detach_parasite:
|
2019-08-11 20:20:05 +08:00
|
|
|
* @image: The image.
|
2019-08-12 20:44:07 +08:00
|
|
|
* @name: The name of the parasite to detach from an image.
|
2011-03-08 20:19:21 +08:00
|
|
|
*
|
2019-08-12 20:44:07 +08:00
|
|
|
* Removes a parasite from an image.
|
2011-03-08 20:19:21 +08:00
|
|
|
*
|
2019-08-12 20:44:07 +08:00
|
|
|
* This procedure detaches a parasite from an image. It has no return
|
2011-03-08 20:19:21 +08:00
|
|
|
* values.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-06-01 03:18:09 +08:00
|
|
|
* Since: 2.8
|
2011-03-08 20:19:21 +08:00
|
|
|
**/
|
|
|
|
gboolean
|
2019-08-12 20:44:07 +08:00
|
|
|
gimp_image_detach_parasite (GimpImage *image,
|
|
|
|
const gchar *name)
|
2011-03-08 20:19:21 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2011-03-08 20:19:21 +08:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-08-12 20:44:07 +08:00
|
|
|
G_TYPE_STRING, name,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-detach-parasite",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2011-03-08 20:19:21 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2011-03-08 20:19:21 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2011-03-08 20:19:21 +08:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_image_get_parasite:
|
2019-08-11 20:20:05 +08:00
|
|
|
* @image: The image.
|
2011-03-08 20:19:21 +08:00
|
|
|
* @name: The name of the parasite to find.
|
|
|
|
*
|
|
|
|
* Look up a parasite in an image
|
|
|
|
*
|
|
|
|
* Finds and returns the parasite that was previously attached to an
|
|
|
|
* image.
|
|
|
|
*
|
2019-08-01 04:51:35 +08:00
|
|
|
* Returns: (transfer full): The found parasite.
|
2011-03-08 20:19:21 +08:00
|
|
|
*
|
2015-06-01 03:18:09 +08:00
|
|
|
* Since: 2.8
|
2011-03-08 20:19:21 +08:00
|
|
|
**/
|
|
|
|
GimpParasite *
|
2019-08-11 20:20:05 +08:00
|
|
|
gimp_image_get_parasite (GimpImage *image,
|
2011-03-08 20:19:21 +08:00
|
|
|
const gchar *name)
|
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2011-03-08 20:19:21 +08:00
|
|
|
GimpParasite *parasite = NULL;
|
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-08-08 19:01:50 +08:00
|
|
|
G_TYPE_STRING, name,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
2011-03-08 20:19:21 +08:00
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-get-parasite",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2011-03-08 20:19:21 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 08:49:33 +08:00
|
|
|
parasite = GIMP_VALUES_DUP_PARASITE (return_vals, 1);
|
2019-07-30 16:51:16 +08:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2011-03-08 20:19:21 +08:00
|
|
|
|
|
|
|
return parasite;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_image_get_parasite_list:
|
2019-08-11 20:20:05 +08:00
|
|
|
* @image: The image.
|
2011-03-08 20:19:21 +08:00
|
|
|
*
|
|
|
|
* List all parasites.
|
|
|
|
*
|
2020-10-29 19:44:18 +08:00
|
|
|
* Returns a list of the names of all currently attached parasites.
|
|
|
|
* These names can later be used to get the actual #GimpParasite with
|
|
|
|
* gimp_image_get_parasite() when needed.
|
2011-03-08 20:19:21 +08:00
|
|
|
*
|
2021-12-02 05:35:25 +08:00
|
|
|
* Returns: (array zero-terminated=1) (transfer full):
|
2019-08-05 04:09:04 +08:00
|
|
|
* The names of currently attached parasites.
|
|
|
|
* The returned value must be freed with g_strfreev().
|
2011-03-08 20:19:21 +08:00
|
|
|
*
|
2015-06-01 03:18:09 +08:00
|
|
|
* Since: 2.8
|
2011-03-08 20:19:21 +08:00
|
|
|
**/
|
|
|
|
gchar **
|
2021-12-02 05:35:25 +08:00
|
|
|
gimp_image_get_parasite_list (GimpImage *image)
|
2011-03-08 20:19:21 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2011-03-08 20:19:21 +08:00
|
|
|
gchar **parasites = NULL;
|
|
|
|
|
2019-08-08 19:01:50 +08:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_IMAGE, image,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-get-parasite-list",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2011-03-08 20:19:21 +08:00
|
|
|
|
2019-09-04 07:49:35 +08:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2021-12-02 05:35:25 +08:00
|
|
|
parasites = GIMP_VALUES_DUP_STRV (return_vals, 1);
|
2011-03-08 20:19:21 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2011-03-08 20:19:21 +08:00
|
|
|
|
|
|
|
return parasites;
|
|
|
|
}
|
2020-09-24 08:53:24 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_image_policy_rotate:
|
|
|
|
* @image: The image.
|
|
|
|
* @interactive: Querying the user through a dialog is a possibility.
|
|
|
|
*
|
|
|
|
* Execute the \"Orientation\" metadata policy.
|
|
|
|
*
|
|
|
|
* Process the image according to the rotation policy as set in
|
|
|
|
* Preferences. If GIMP is running as a GUI and interactive is TRUE, a
|
|
|
|
* dialog may be presented to the user depending on the set policy.
|
|
|
|
* Otherwise, if the policy does not mandate the action to perform, the
|
|
|
|
* image will be rotated following the Orientation metadata.
|
|
|
|
* If you wish absolutely to rotate a loaded image following the
|
|
|
|
* Orientation metadata, do not use this function and process the
|
|
|
|
* metadata yourself. Indeed even with `interactive` to FALSE, user
|
|
|
|
* settings may leave the image unrotated.
|
|
|
|
* Finally it is unnecessary to call this function in a format load
|
|
|
|
* procedure because this is called automatically by the core code when
|
|
|
|
* loading any image. You should only call this function explicitly
|
|
|
|
* when loading an image through a PDB call.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: 3.0
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_image_policy_rotate (GimpImage *image,
|
|
|
|
gboolean interactive)
|
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
GIMP_TYPE_IMAGE, image,
|
|
|
|
G_TYPE_BOOLEAN, interactive,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-policy-rotate",
|
|
|
|
args);
|
2020-09-24 08:53:24 +08:00
|
|
|
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_policy_color_profile:
|
|
|
|
* @image: The image.
|
|
|
|
* @interactive: Querying the user through a dialog is a possibility.
|
|
|
|
*
|
|
|
|
* Execute the color profile conversion policy.
|
|
|
|
*
|
|
|
|
* Process the image according to the color profile policy as set in
|
2020-09-24 22:27:34 +08:00
|
|
|
* Preferences.
|
|
|
|
* If GIMP is running as a GUI and interactive is TRUE, a dialog may be
|
|
|
|
* presented to the user depending on the policy. Otherwise, if the
|
|
|
|
* policy does not mandate the conversion to perform, the conversion to
|
|
|
|
* the preferred RGB or grayscale profile will happen, defaulting to
|
|
|
|
* built-in profiles if no preferred profiles were set in
|
|
|
|
* `Preferences`.
|
2020-09-24 08:53:24 +08:00
|
|
|
* This function should be used only if you want to follow user
|
2020-09-24 22:27:34 +08:00
|
|
|
* settings. If you intend to convert to a specific profile, call
|
Fix typos
Found via:
```
codespell -q 3 -S ./ChangeLog*,*.po,./.git,./NEWS* -L als,ang,ba,chello,daa,doubleclick,foto,hist,iff,inport,klass,mut,nd,ower,paeth,params,pard,pevent,sinc,thru,tim,uint
```
2020-11-06 00:43:53 +08:00
|
|
|
* preferably gimp_image_convert_color_profile(). And if you wish to
|
2020-09-24 08:53:24 +08:00
|
|
|
* leave whatever profile an image has, do not call any of these
|
|
|
|
* functions.
|
|
|
|
* Finally it is unnecessary to call this function in a format load
|
|
|
|
* procedure because this is called automatically by the core code when
|
|
|
|
* loading any image. You should only call this function explicitly
|
|
|
|
* when loading an image through a PDB call.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: 3.0
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_image_policy_color_profile (GimpImage *image,
|
|
|
|
gboolean interactive)
|
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
GIMP_TYPE_IMAGE, image,
|
|
|
|
G_TYPE_BOOLEAN, interactive,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-17 04:07:55 +08:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-image-policy-color-profile",
|
|
|
|
args);
|
2020-09-24 08:53:24 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|