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
|
2000-05-31 14:15:06 +08:00
|
|
|
*
|
|
|
|
* gimpimage_pdb.h
|
|
|
|
*
|
2009-01-18 06:28:01 +08:00
|
|
|
* This library is free software: you can redistribute it and/or
|
2000-05-31 14:15:06 +08:00
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* 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.
|
2000-06-01 20:20:13 +08:00
|
|
|
*
|
2000-05-31 14:15:06 +08:00
|
|
|
* This library is distributed in the hope that it will be useful,
|
2000-06-01 20:20:13 +08:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2000-05-31 14:15:06 +08:00
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* 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/>.
|
2000-06-01 20:20:13 +08:00
|
|
|
*/
|
|
|
|
|
2007-01-09 18:52:47 +08:00
|
|
|
/* NOTE: This file is auto-generated by pdbgen.pl */
|
2000-05-31 14:15:06 +08:00
|
|
|
|
2011-04-29 01:59:52 +08:00
|
|
|
#if !defined (__GIMP_H_INSIDE__) && !defined (GIMP_COMPILATION)
|
|
|
|
#error "Only <libgimp/gimp.h> can be included directly."
|
|
|
|
#endif
|
|
|
|
|
2000-05-31 14:15:06 +08:00
|
|
|
#ifndef __GIMP_IMAGE_PDB_H__
|
|
|
|
#define __GIMP_IMAGE_PDB_H__
|
|
|
|
|
2001-11-23 07:46:13 +08:00
|
|
|
G_BEGIN_DECLS
|
2000-05-31 14:15:06 +08:00
|
|
|
|
|
|
|
/* For information look into the C source or the html documentation */
|
|
|
|
|
|
|
|
|
2019-09-03 19:31:27 +08:00
|
|
|
gboolean gimp_image_id_is_valid (gint image_id);
|
2019-09-05 18:57:43 +08:00
|
|
|
GimpImage** gimp_get_images (gint *num_images);
|
2019-08-13 00:00:44 +08:00
|
|
|
GimpImage* gimp_image_new (gint width,
|
|
|
|
gint height,
|
|
|
|
GimpImageBaseType type);
|
|
|
|
GimpImage* gimp_image_new_with_precision (gint width,
|
|
|
|
gint height,
|
|
|
|
GimpImageBaseType type,
|
|
|
|
GimpPrecision precision);
|
|
|
|
GimpImage* gimp_image_duplicate (GimpImage *image);
|
|
|
|
gboolean gimp_image_delete (GimpImage *image);
|
2021-04-06 06:47:07 +08:00
|
|
|
GimpImageBaseType gimp_image_get_base_type (GimpImage *image);
|
2019-08-13 00:00:44 +08:00
|
|
|
GimpPrecision gimp_image_get_precision (GimpImage *image);
|
|
|
|
GimpLayerMode gimp_image_get_default_new_layer_mode (GimpImage *image);
|
2021-04-06 06:47:07 +08:00
|
|
|
gint gimp_image_get_width (GimpImage *image);
|
|
|
|
gint gimp_image_get_height (GimpImage *image);
|
2019-09-05 18:57:43 +08:00
|
|
|
GimpLayer** gimp_image_get_layers (GimpImage *image,
|
2019-08-13 00:00:44 +08:00
|
|
|
gint *num_layers);
|
2019-09-05 18:57:43 +08:00
|
|
|
GimpChannel** gimp_image_get_channels (GimpImage *image,
|
2019-08-13 00:00:44 +08:00
|
|
|
gint *num_channels);
|
2024-07-12 14:16:25 +08:00
|
|
|
GimpPath** gimp_image_get_paths (GimpImage *image,
|
2024-07-08 10:09:42 +08:00
|
|
|
gint *num_paths);
|
2019-08-13 00:00:44 +08:00
|
|
|
gboolean gimp_image_unset_active_channel (GimpImage *image);
|
2019-08-13 19:59:33 +08:00
|
|
|
GimpLayer* gimp_image_get_floating_sel (GimpImage *image);
|
|
|
|
GimpDrawable* gimp_image_floating_sel_attached_to (GimpImage *image);
|
2019-08-13 00:00:44 +08:00
|
|
|
gboolean gimp_image_pick_color (GimpImage *image,
|
2020-05-17 23:51:32 +08:00
|
|
|
gint num_drawables,
|
|
|
|
const GimpItem **drawables,
|
2019-08-13 00:00:44 +08:00
|
|
|
gdouble x,
|
|
|
|
gdouble y,
|
|
|
|
gboolean sample_merged,
|
|
|
|
gboolean sample_average,
|
|
|
|
gdouble average_radius,
|
2023-11-13 00:56:32 +08:00
|
|
|
GeglColor **color);
|
2019-08-13 19:59:33 +08:00
|
|
|
GimpLayer* gimp_image_pick_correlate_layer (GimpImage *image,
|
2019-08-13 00:00:44 +08:00
|
|
|
gint x,
|
|
|
|
gint y);
|
|
|
|
gboolean gimp_image_insert_layer (GimpImage *image,
|
2019-08-13 19:59:33 +08:00
|
|
|
GimpLayer *layer,
|
|
|
|
GimpLayer *parent,
|
2019-08-13 00:00:44 +08:00
|
|
|
gint position);
|
|
|
|
gboolean gimp_image_remove_layer (GimpImage *image,
|
2019-08-13 19:59:33 +08:00
|
|
|
GimpLayer *layer);
|
2019-08-13 00:00:44 +08:00
|
|
|
gboolean gimp_image_freeze_layers (GimpImage *image);
|
|
|
|
gboolean gimp_image_thaw_layers (GimpImage *image);
|
|
|
|
gboolean gimp_image_insert_channel (GimpImage *image,
|
2019-08-14 03:36:03 +08:00
|
|
|
GimpChannel *channel,
|
|
|
|
GimpChannel *parent,
|
2019-08-13 00:00:44 +08:00
|
|
|
gint position);
|
|
|
|
gboolean gimp_image_remove_channel (GimpImage *image,
|
2019-08-14 03:36:03 +08:00
|
|
|
GimpChannel *channel);
|
2019-08-13 00:00:44 +08:00
|
|
|
gboolean gimp_image_freeze_channels (GimpImage *image);
|
|
|
|
gboolean gimp_image_thaw_channels (GimpImage *image);
|
2024-07-08 10:09:42 +08:00
|
|
|
gboolean gimp_image_insert_path (GimpImage *image,
|
2024-07-12 14:16:25 +08:00
|
|
|
GimpPath *path,
|
|
|
|
GimpPath *parent,
|
2019-08-13 00:00:44 +08:00
|
|
|
gint position);
|
2024-07-08 10:09:42 +08:00
|
|
|
gboolean gimp_image_remove_path (GimpImage *image,
|
2024-07-12 14:16:25 +08:00
|
|
|
GimpPath *path);
|
2024-07-08 10:09:42 +08:00
|
|
|
gboolean gimp_image_freeze_paths (GimpImage *image);
|
|
|
|
gboolean gimp_image_thaw_paths (GimpImage *image);
|
2019-08-13 00:00:44 +08:00
|
|
|
gint gimp_image_get_item_position (GimpImage *image,
|
2019-08-13 19:59:33 +08:00
|
|
|
GimpItem *item);
|
2019-08-13 00:00:44 +08:00
|
|
|
gboolean gimp_image_raise_item (GimpImage *image,
|
2019-08-13 19:59:33 +08:00
|
|
|
GimpItem *item);
|
2019-08-13 00:00:44 +08:00
|
|
|
gboolean gimp_image_lower_item (GimpImage *image,
|
2019-08-13 19:59:33 +08:00
|
|
|
GimpItem *item);
|
2019-08-13 00:00:44 +08:00
|
|
|
gboolean gimp_image_raise_item_to_top (GimpImage *image,
|
2019-08-13 19:59:33 +08:00
|
|
|
GimpItem *item);
|
2019-08-13 00:00:44 +08:00
|
|
|
gboolean gimp_image_lower_item_to_bottom (GimpImage *image,
|
2019-08-13 19:59:33 +08:00
|
|
|
GimpItem *item);
|
2019-08-13 00:00:44 +08:00
|
|
|
gboolean gimp_image_reorder_item (GimpImage *image,
|
2019-08-13 19:59:33 +08:00
|
|
|
GimpItem *item,
|
|
|
|
GimpItem *parent,
|
2019-08-13 00:00:44 +08:00
|
|
|
gint position);
|
2019-08-13 19:59:33 +08:00
|
|
|
GimpLayer* gimp_image_flatten (GimpImage *image);
|
|
|
|
GimpLayer* gimp_image_merge_visible_layers (GimpImage *image,
|
2019-08-13 00:00:44 +08:00
|
|
|
GimpMergeType merge_type);
|
2019-08-13 19:59:33 +08:00
|
|
|
GimpLayer* gimp_image_merge_down (GimpImage *image,
|
|
|
|
GimpLayer *merge_layer,
|
2019-08-13 00:00:44 +08:00
|
|
|
GimpMergeType merge_type);
|
2023-05-24 05:37:46 +08:00
|
|
|
G_GNUC_INTERNAL GBytes* _gimp_image_get_colormap (GimpImage *image);
|
2019-08-13 00:00:44 +08:00
|
|
|
G_GNUC_INTERNAL gboolean _gimp_image_set_colormap (GimpImage *image,
|
2023-05-24 05:37:46 +08:00
|
|
|
GBytes *colormap);
|
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
|
|
|
GimpPalette* gimp_image_get_palette (GimpImage *image);
|
2019-08-13 00:00:44 +08:00
|
|
|
G_GNUC_INTERNAL gchar* _gimp_image_get_metadata (GimpImage *image);
|
|
|
|
G_GNUC_INTERNAL gboolean _gimp_image_set_metadata (GimpImage *image,
|
|
|
|
const gchar *metadata_string);
|
|
|
|
gboolean gimp_image_clean_all (GimpImage *image);
|
|
|
|
gboolean gimp_image_is_dirty (GimpImage *image);
|
|
|
|
G_GNUC_INTERNAL gboolean _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);
|
2020-04-09 21:47:16 +08:00
|
|
|
GimpLayer** gimp_image_get_selected_layers (GimpImage *image,
|
|
|
|
gint *num_layers);
|
2021-02-22 06:17:30 +08:00
|
|
|
gboolean gimp_image_set_selected_layers (GimpImage *image,
|
|
|
|
gint num_layers,
|
|
|
|
const GimpLayer **layers);
|
2022-10-20 08:36:50 +08:00
|
|
|
GimpChannel** gimp_image_get_selected_channels (GimpImage *image,
|
|
|
|
gint *num_channels);
|
|
|
|
gboolean gimp_image_set_selected_channels (GimpImage *image,
|
|
|
|
gint num_channels,
|
|
|
|
const GimpChannel **channels);
|
2024-07-12 14:16:25 +08:00
|
|
|
GimpPath** gimp_image_get_selected_paths (GimpImage *image,
|
2024-07-08 10:09:42 +08:00
|
|
|
gint *num_paths);
|
|
|
|
gboolean gimp_image_set_selected_paths (GimpImage *image,
|
|
|
|
gint num_paths,
|
2024-07-12 14:16:25 +08:00
|
|
|
const GimpPath **paths);
|
2022-07-20 04:38:28 +08:00
|
|
|
GimpItem** gimp_image_get_selected_drawables (GimpImage *image,
|
|
|
|
gint *num_drawables);
|
2019-08-14 03:36:03 +08:00
|
|
|
GimpSelection* gimp_image_get_selection (GimpImage *image);
|
2019-08-13 00:00:44 +08:00
|
|
|
gboolean gimp_image_get_component_active (GimpImage *image,
|
|
|
|
GimpChannelType component);
|
|
|
|
gboolean gimp_image_set_component_active (GimpImage *image,
|
|
|
|
GimpChannelType component,
|
|
|
|
gboolean active);
|
|
|
|
gboolean gimp_image_get_component_visible (GimpImage *image,
|
|
|
|
GimpChannelType component);
|
|
|
|
gboolean gimp_image_set_component_visible (GimpImage *image,
|
|
|
|
GimpChannelType component,
|
|
|
|
gboolean visible);
|
2019-09-12 03:48:34 +08:00
|
|
|
GFile* gimp_image_get_file (GimpImage *image);
|
|
|
|
gboolean gimp_image_set_file (GimpImage *image,
|
|
|
|
GFile *file);
|
|
|
|
GFile* gimp_image_get_xcf_file (GimpImage *image);
|
|
|
|
GFile* gimp_image_get_imported_file (GimpImage *image);
|
|
|
|
GFile* gimp_image_get_exported_file (GimpImage *image);
|
2019-08-13 00:00:44 +08:00
|
|
|
gchar* gimp_image_get_name (GimpImage *image);
|
|
|
|
gboolean gimp_image_get_resolution (GimpImage *image,
|
|
|
|
gdouble *xresolution,
|
|
|
|
gdouble *yresolution);
|
|
|
|
gboolean gimp_image_set_resolution (GimpImage *image,
|
|
|
|
gdouble xresolution,
|
|
|
|
gdouble yresolution);
|
Issue #8900 and #9923: reimplementing GimpUnit as a proper class.
This fixes all our GObject Introspection issues with GimpUnit which was
both an enum and an int-derived type of user-defined units *completing*
the enum values. GIR clearly didn't like this!
Now GimpUnit is a proper class and units are unique objects, allowing to
compare them with an identity test (i.e. `unit == gimp_unit_pixel ()`
tells us if unit is the pixel unit or not), which makes it easy to use,
just like with int, yet adding also methods, making for nicer
introspected API.
As an aside, this also fixes #10738, by having all the built-in units
retrievable even if libgimpbase had not been properly initialized with
gimp_base_init().
I haven't checked in details how GIR works to introspect, but it looks
like it loads the library to inspect and runs functions, hence
triggering some CRITICALS because virtual methods (supposed to be
initialized with gimp_base_init() run by libgimp) are not set. This new
code won't trigger any critical because the vtable method are now not
necessary, at least for all built-in units.
Note that GimpUnit is still in libgimpbase. It could have been moved to
libgimp in order to avoid any virtual method table (since we need to
keep core and libgimp side's units in sync, PDB is required), but too
many libgimpwidgets widgets were already using GimpUnit. And technically
most of GimpUnit logic doesn't require PDB (only the creation/sync
part). This is one of the reasons why user-created GimpUnit list is
handled and stored differently from other types of objects.
Globally this simplifies the code a lot too and we don't need separate
implementations of various utils for core and libgimp, which means less
prone to errors.
2024-07-26 02:55:21 +08:00
|
|
|
GimpUnit* gimp_image_get_unit (GimpImage *image);
|
2019-08-13 00:00:44 +08:00
|
|
|
gboolean gimp_image_set_unit (GimpImage *image,
|
Issue #8900 and #9923: reimplementing GimpUnit as a proper class.
This fixes all our GObject Introspection issues with GimpUnit which was
both an enum and an int-derived type of user-defined units *completing*
the enum values. GIR clearly didn't like this!
Now GimpUnit is a proper class and units are unique objects, allowing to
compare them with an identity test (i.e. `unit == gimp_unit_pixel ()`
tells us if unit is the pixel unit or not), which makes it easy to use,
just like with int, yet adding also methods, making for nicer
introspected API.
As an aside, this also fixes #10738, by having all the built-in units
retrievable even if libgimpbase had not been properly initialized with
gimp_base_init().
I haven't checked in details how GIR works to introspect, but it looks
like it loads the library to inspect and runs functions, hence
triggering some CRITICALS because virtual methods (supposed to be
initialized with gimp_base_init() run by libgimp) are not set. This new
code won't trigger any critical because the vtable method are now not
necessary, at least for all built-in units.
Note that GimpUnit is still in libgimpbase. It could have been moved to
libgimp in order to avoid any virtual method table (since we need to
keep core and libgimp side's units in sync, PDB is required), but too
many libgimpwidgets widgets were already using GimpUnit. And technically
most of GimpUnit logic doesn't require PDB (only the creation/sync
part). This is one of the reasons why user-created GimpUnit list is
handled and stored differently from other types of objects.
Globally this simplifies the code a lot too and we don't need separate
implementations of various utils for core and libgimp, which means less
prone to errors.
2024-07-26 02:55:21 +08:00
|
|
|
GimpUnit *unit);
|
2019-08-13 00:00:44 +08:00
|
|
|
guint gimp_image_get_tattoo_state (GimpImage *image);
|
|
|
|
gboolean gimp_image_set_tattoo_state (GimpImage *image,
|
|
|
|
guint tattoo_state);
|
2019-08-13 19:59:33 +08:00
|
|
|
GimpLayer* gimp_image_get_layer_by_tattoo (GimpImage *image,
|
2019-08-13 00:00:44 +08:00
|
|
|
guint tattoo);
|
2019-08-14 03:36:03 +08:00
|
|
|
GimpChannel* gimp_image_get_channel_by_tattoo (GimpImage *image,
|
2019-08-13 00:00:44 +08:00
|
|
|
guint tattoo);
|
2024-07-12 14:16:25 +08:00
|
|
|
GimpPath* gimp_image_get_path_by_tattoo (GimpImage *image,
|
2019-08-13 00:00:44 +08:00
|
|
|
guint tattoo);
|
2019-08-13 19:59:33 +08:00
|
|
|
GimpLayer* gimp_image_get_layer_by_name (GimpImage *image,
|
2019-08-13 00:00:44 +08:00
|
|
|
const gchar *name);
|
2019-08-14 03:36:03 +08:00
|
|
|
GimpChannel* gimp_image_get_channel_by_name (GimpImage *image,
|
2019-08-13 00:00:44 +08:00
|
|
|
const gchar *name);
|
2024-07-12 14:16:25 +08:00
|
|
|
GimpPath* gimp_image_get_path_by_name (GimpImage *image,
|
2019-08-13 00:00:44 +08:00
|
|
|
const gchar *name);
|
|
|
|
gboolean gimp_image_attach_parasite (GimpImage *image,
|
|
|
|
const GimpParasite *parasite);
|
|
|
|
gboolean gimp_image_detach_parasite (GimpImage *image,
|
|
|
|
const gchar *name);
|
|
|
|
GimpParasite* gimp_image_get_parasite (GimpImage *image,
|
|
|
|
const gchar *name);
|
2021-12-02 05:35:25 +08:00
|
|
|
gchar** gimp_image_get_parasite_list (GimpImage *image);
|
2020-09-24 08:53:24 +08:00
|
|
|
gboolean gimp_image_policy_rotate (GimpImage *image,
|
|
|
|
gboolean interactive);
|
|
|
|
gboolean gimp_image_policy_color_profile (GimpImage *image,
|
|
|
|
gboolean interactive);
|
2019-08-13 00:00:44 +08:00
|
|
|
|
2000-05-31 14:15:06 +08:00
|
|
|
|
2001-11-23 07:46:13 +08:00
|
|
|
G_END_DECLS
|
2000-05-31 14:15:06 +08:00
|
|
|
|
|
|
|
#endif /* __GIMP_IMAGE_PDB_H__ */
|