Commit 4db8cda2 authored by Jehan's avatar Jehan

app, pdb, libgimp: add a new GimpImage class for plug-ins.

This means that all functions which were returning or taking as
parameter an image id (as gint32) are now taking a GimpImage object
instead.
The PDB is still passing around an id only over the wire. But we create
an object for plug-ins to work on.

This is quite a huge API break, but is probably the best bet for the
future quality. It will make nicer API instrospection (and nicer API in
binding), will fix the issues with pspec on GimpImageID in Python
bindings (which makes the current Python API unusable as soon as we need
to work on images, which is most of our plug-ins!), etc.
Also it will allow to use signals on images, which will be a great asset
when we will finally have bi-directionnal communications (i.e. plug-ins
would be able to connect to image changes, destructions, and whatnot).
parent 699b3c5c
......@@ -2771,7 +2771,7 @@ register_image_procs (GimpPDB *pdb)
"gimp-image-is-valid");
gimp_procedure_set_static_strings (procedure,
"Returns TRUE if the image is valid.",
"This procedure checks if the given image ID is valid and refers to an existing image.",
"This procedure checks if the given image is valid and refers to an existing image.",
"Sven Neumann <sven@gimp.org>",
"Sven Neumann",
"2007",
......@@ -2785,7 +2785,7 @@ register_image_procs (GimpPDB *pdb)
gimp_procedure_add_return_value (procedure,
g_param_spec_boolean ("valid",
"valid",
"Whether the image ID is valid",
"Whether the image is valid",
FALSE,
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);
......@@ -2855,7 +2855,7 @@ register_image_procs (GimpPDB *pdb)
gimp_procedure_add_return_value (procedure,
gimp_param_spec_image_id ("image",
"image",
"The ID of the newly created image",
"The newly created image",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);
......@@ -2903,7 +2903,7 @@ register_image_procs (GimpPDB *pdb)
gimp_procedure_add_return_value (procedure,
gimp_param_spec_image_id ("image",
"image",
"The ID of the newly created image",
"The newly created image",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);
......
......@@ -383,6 +383,7 @@ EXPORTS
gimp_image_get_floating_sel
gimp_image_get_guide_orientation
gimp_image_get_guide_position
gimp_image_get_id
gimp_image_get_imported_uri
gimp_image_get_item_position
gimp_image_get_layer_by_name
......@@ -399,6 +400,7 @@ EXPORTS
gimp_image_get_tattoo_state
gimp_image_get_thumbnail
gimp_image_get_thumbnail_data
gimp_image_get_type
gimp_image_get_unit
gimp_image_get_uri
gimp_image_get_vectors
......
......@@ -36,7 +36,7 @@
/**
* _gimp_channel_new:
* @image_ID: The image to which to add the channel.
* @image: The image to which to add the channel.
* @width: The channel width.
* @height: The channel height.
* @name: The channel name.
......@@ -56,7 +56,7 @@
* Returns: The newly created channel.
**/
gint32
_gimp_channel_new (gint32 image_ID,
_gimp_channel_new (GimpImage *image,
gint width,
gint height,
const gchar *name,
......@@ -69,7 +69,7 @@ _gimp_channel_new (gint32 image_ID,
gint32 channel_ID = -1;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
G_TYPE_INT, width,
G_TYPE_INT, height,
G_TYPE_STRING, name,
......@@ -96,7 +96,7 @@ _gimp_channel_new (gint32 image_ID,
/**
* gimp_channel_new_from_component:
* @image_ID: The image to which to add the channel.
* @image: The image to which to add the channel.
* @component: The image component.
* @name: The channel name.
*
......@@ -113,7 +113,7 @@ _gimp_channel_new (gint32 image_ID,
* Since: 2.4
**/
gint32
gimp_channel_new_from_component (gint32 image_ID,
gimp_channel_new_from_component (GimpImage *image,
GimpChannelType component,
const gchar *name)
{
......@@ -123,7 +123,7 @@ gimp_channel_new_from_component (gint32 image_ID,
gint32 channel_ID = -1;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
GIMP_TYPE_CHANNEL_TYPE, component,
G_TYPE_STRING, name,
G_TYPE_NONE);
......
......@@ -32,13 +32,13 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
G_GNUC_INTERNAL gint32 _gimp_channel_new (gint32 image_ID,
G_GNUC_INTERNAL gint32 _gimp_channel_new (GimpImage *image,
gint width,
gint height,
const gchar *name,
gdouble opacity,
const GimpRGB *color);
gint32 gimp_channel_new_from_component (gint32 image_ID,
gint32 gimp_channel_new_from_component (GimpImage *image,
GimpChannelType component,
const gchar *name);
gint32 gimp_channel_copy (gint32 channel_ID);
......
......@@ -78,7 +78,7 @@ gimp_display_is_valid (gint32 display_ID)
/**
* gimp_display_new:
* @image_ID: The image.
* @image: The image.
*
* Create a new display for the specified image.
*
......@@ -92,7 +92,7 @@ gimp_display_is_valid (gint32 display_ID)
* Returns: The new display.
**/
gint32
gimp_display_new (gint32 image_ID)
gimp_display_new (GimpImage *image)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
......@@ -100,7 +100,7 @@ gimp_display_new (gint32 image_ID)
gint32 display_ID = -1;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
G_TYPE_NONE);
if (pdb)
......@@ -248,8 +248,8 @@ gimp_displays_flush (void)
/**
* gimp_displays_reconnect:
* @old_image_ID: The old image (must have at least one display).
* @new_image_ID: The new image (must not have a display).
* @old_image: The old image (must have at least one display).
* @new_image: The new image (must not have a display).
*
* Reconnect displays from one image to another image.
*
......@@ -261,8 +261,8 @@ gimp_displays_flush (void)
* Returns: TRUE on success.
**/
gboolean
gimp_displays_reconnect (gint32 old_image_ID,
gint32 new_image_ID)
gimp_displays_reconnect (GimpImage *old_image,
GimpImage *new_image)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
......@@ -270,8 +270,8 @@ gimp_displays_reconnect (gint32 old_image_ID,
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, old_image_ID,
GIMP_TYPE_IMAGE_ID, new_image_ID,
GIMP_TYPE_IMAGE_ID, gimp_image_get_id (old_image),
GIMP_TYPE_IMAGE_ID, gimp_image_get_id (new_image),
G_TYPE_NONE);
if (pdb)
......
......@@ -32,13 +32,13 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
gboolean gimp_display_is_valid (gint32 display_ID);
gint32 gimp_display_new (gint32 image_ID);
gboolean gimp_display_delete (gint32 display_ID);
gint gimp_display_get_window_handle (gint32 display_ID);
gboolean gimp_display_is_valid (gint32 display_ID);
gint32 gimp_display_new (GimpImage *image);
gboolean gimp_display_delete (gint32 display_ID);
gint gimp_display_get_window_handle (gint32 display_ID);
gboolean gimp_displays_flush (void);
gboolean gimp_displays_reconnect (gint32 old_image_ID,
gint32 new_image_ID);
gboolean gimp_displays_reconnect (GimpImage *old_image,
GimpImage *new_image);
G_END_DECLS
......
......@@ -128,7 +128,7 @@ gimp_edit_copy (gint32 drawable_ID)
/**
* gimp_edit_copy_visible:
* @image_ID: The image to copy from.
* @image: The image to copy from.
*
* Copy from the projection.
*
......@@ -144,7 +144,7 @@ gimp_edit_copy (gint32 drawable_ID)
* Since: 2.2
**/
gboolean
gimp_edit_copy_visible (gint32 image_ID)
gimp_edit_copy_visible (GimpImage *image)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
......@@ -152,7 +152,7 @@ gimp_edit_copy_visible (gint32 image_ID)
gboolean non_empty = FALSE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
G_TYPE_NONE);
if (pdb)
......@@ -238,17 +238,17 @@ gimp_edit_paste (gint32 drawable_ID,
* previously made to either gimp_edit_cut() or gimp_edit_copy(). This
* procedure returns the new image or -1 if the edit buffer was empty.
*
* Returns: The new image.
* Returns: (transfer full): The new image.
*
* Since: 2.10
**/
gint32
GimpImage *
gimp_edit_paste_as_new_image (void)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gint32 image_ID = -1;
GimpImage *image = NULL;
args = gimp_value_array_new_from_types (NULL,
G_TYPE_NONE);
......@@ -263,11 +263,11 @@ gimp_edit_paste_as_new_image (void)
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
image_ID = gimp_value_get_image_id (gimp_value_array_index (return_vals, 1));
image = g_object_new (GIMP_TYPE_IMAGE, "id", gimp_value_array_index (return_vals, 1), NULL);
gimp_value_array_unref (return_vals);
return image_ID;
return image;
}
/**
......@@ -370,7 +370,7 @@ gimp_edit_named_copy (gint32 drawable_ID,
/**
* gimp_edit_named_copy_visible:
* @image_ID: The image to copy from.
* @image: The image to copy from.
* @buffer_name: The name of the buffer to create.
*
* Copy from the projection into a named buffer.
......@@ -387,7 +387,7 @@ gimp_edit_named_copy (gint32 drawable_ID,
* Since: 2.4
**/
gchar *
gimp_edit_named_copy_visible (gint32 image_ID,
gimp_edit_named_copy_visible (GimpImage *image,
const gchar *buffer_name)
{
GimpPDB *pdb = gimp_get_pdb ();
......@@ -396,7 +396,7 @@ gimp_edit_named_copy_visible (gint32 image_ID,
gchar *real_name = NULL;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
G_TYPE_STRING, buffer_name,
G_TYPE_NONE);
......@@ -474,17 +474,17 @@ gimp_edit_named_paste (gint32 drawable_ID,
* This procedure works like gimp_edit_paste_as_new_image() but pastes
* a named buffer instead of the global buffer.
*
* Returns: The new image.
* Returns: (transfer full): The new image.
*
* Since: 2.10
**/
gint32
GimpImage *
gimp_edit_named_paste_as_new_image (const gchar *buffer_name)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gint32 image_ID = -1;
GimpImage *image = NULL;
args = gimp_value_array_new_from_types (NULL,
G_TYPE_STRING, buffer_name,
......@@ -500,9 +500,9 @@ gimp_edit_named_paste_as_new_image (const gchar *buffer_name)
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
image_ID = gimp_value_get_image_id (gimp_value_array_index (return_vals, 1));
image = g_object_new (GIMP_TYPE_IMAGE, "id", gimp_value_array_index (return_vals, 1), NULL);
gimp_value_array_unref (return_vals);
return image_ID;
return image;
}
......@@ -32,22 +32,22 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
gboolean gimp_edit_cut (gint32 drawable_ID);
gboolean gimp_edit_copy (gint32 drawable_ID);
gboolean gimp_edit_copy_visible (gint32 image_ID);
gint32 gimp_edit_paste (gint32 drawable_ID,
gboolean paste_into);
gint32 gimp_edit_paste_as_new_image (void);
gchar* gimp_edit_named_cut (gint32 drawable_ID,
const gchar *buffer_name);
gchar* gimp_edit_named_copy (gint32 drawable_ID,
const gchar *buffer_name);
gchar* gimp_edit_named_copy_visible (gint32 image_ID,
const gchar *buffer_name);
gint32 gimp_edit_named_paste (gint32 drawable_ID,
const gchar *buffer_name,
gboolean paste_into);
gint32 gimp_edit_named_paste_as_new_image (const gchar *buffer_name);
gboolean gimp_edit_cut (gint32 drawable_ID);
gboolean gimp_edit_copy (gint32 drawable_ID);
gboolean gimp_edit_copy_visible (GimpImage *image);
gint32 gimp_edit_paste (gint32 drawable_ID,
gboolean paste_into);
GimpImage* gimp_edit_paste_as_new_image (void);
gchar* gimp_edit_named_cut (gint32 drawable_ID,
const gchar *buffer_name);
gchar* gimp_edit_named_copy (gint32 drawable_ID,
const gchar *buffer_name);
gchar* gimp_edit_named_copy_visible (GimpImage *image,
const gchar *buffer_name);
gint32 gimp_edit_named_paste (gint32 drawable_ID,
const gchar *buffer_name,
gboolean paste_into);
GimpImage* gimp_edit_named_paste_as_new_image (const gchar *buffer_name);
G_END_DECLS
......
......@@ -50,9 +50,9 @@
* https://www.gimp.org/foo.png he wants to fetch a URL, and the full
* pathname will not look like a URL.
*
* Returns: The output image.
* Returns: (transfer full): The output image.
**/
gint32
GimpImage *
gimp_file_load (GimpRunMode run_mode,
const gchar *filename,
const gchar *raw_filename)
......@@ -60,7 +60,7 @@ gimp_file_load (GimpRunMode run_mode,
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
gint32 image_ID = -1;
GimpImage *image = NULL;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_RUN_MODE, run_mode,
......@@ -78,17 +78,17 @@ gimp_file_load (GimpRunMode run_mode,
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
image_ID = gimp_value_get_image_id (gimp_value_array_index (return_vals, 1));
image = g_object_new (GIMP_TYPE_IMAGE, "id", gimp_value_array_index (return_vals, 1), NULL);
gimp_value_array_unref (return_vals);
return image_ID;
return image;
}
/**
* gimp_file_load_layer:
* @run_mode: The run mode.
* @image_ID: Destination image.
* @image: Destination image.
* @filename: The name of the file to load.
*
* Loads an image file as a layer for an existing image.
......@@ -104,7 +104,7 @@ gimp_file_load (GimpRunMode run_mode,
**/
gint32
gimp_file_load_layer (GimpRunMode run_mode,
gint32 image_ID,
GimpImage *image,
const gchar *filename)
{
GimpPDB *pdb = gimp_get_pdb ();
......@@ -114,7 +114,7 @@ gimp_file_load_layer (GimpRunMode run_mode,
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_RUN_MODE, run_mode,
GIMP_TYPE_IMAGE_ID, image_ID,
GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
G_TYPE_STRING, filename,
G_TYPE_NONE);
......@@ -138,7 +138,7 @@ gimp_file_load_layer (GimpRunMode run_mode,
/**
* gimp_file_load_layers:
* @run_mode: The run mode.
* @image_ID: Destination image.
* @image: Destination image.
* @filename: The name of the file to load.
* @num_layers: (out): The number of loaded layers.
*
......@@ -157,7 +157,7 @@ gimp_file_load_layer (GimpRunMode run_mode,
**/
gint *
gimp_file_load_layers (GimpRunMode run_mode,
gint32 image_ID,
GimpImage *image,
const gchar *filename,
gint *num_layers)
{
......@@ -168,7 +168,7 @@ gimp_file_load_layers (GimpRunMode run_mode,
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_RUN_MODE, run_mode,
GIMP_TYPE_IMAGE_ID, image_ID,
GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
G_TYPE_STRING, filename,
G_TYPE_NONE);
......@@ -197,7 +197,7 @@ gimp_file_load_layers (GimpRunMode run_mode,
/**
* gimp_file_save:
* @run_mode: The run mode.
* @image_ID: Input image.
* @image: Input image.
* @drawable_ID: Drawable to save.
* @filename: The name of the file to save the image in.
* @raw_filename: The name as entered by the user.
......@@ -216,7 +216,7 @@ gimp_file_load_layers (GimpRunMode run_mode,
**/
gboolean
gimp_file_save (GimpRunMode run_mode,
gint32 image_ID,
GimpImage *image,
gint32 drawable_ID,
const gchar *filename,
const gchar *raw_filename)
......@@ -228,7 +228,7 @@ gimp_file_save (GimpRunMode run_mode,
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_RUN_MODE, run_mode,
GIMP_TYPE_IMAGE_ID, image_ID,
GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
GIMP_TYPE_DRAWABLE_ID, drawable_ID,
G_TYPE_STRING, filename,
G_TYPE_STRING, raw_filename,
......@@ -252,7 +252,7 @@ gimp_file_save (GimpRunMode run_mode,
/**
* gimp_file_save_thumbnail:
* @image_ID: The image.
* @image: The image.
* @filename: The name of the file the thumbnail belongs to.
*
* Saves a thumbnail for the given image
......@@ -267,7 +267,7 @@ gimp_file_save (GimpRunMode run_mode,
* Returns: TRUE on success.
**/
gboolean
gimp_file_save_thumbnail (gint32 image_ID,
gimp_file_save_thumbnail (GimpImage *image,
const gchar *filename)
{
GimpPDB *pdb = gimp_get_pdb ();
......@@ -276,7 +276,7 @@ gimp_file_save_thumbnail (gint32 image_ID,
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
G_TYPE_STRING, filename,
G_TYPE_NONE);
......
......@@ -32,22 +32,22 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
gint32 gimp_file_load (GimpRunMode run_mode,
GimpImage* gimp_file_load (GimpRunMode run_mode,
const gchar *filename,
const gchar *raw_filename);
gint32 gimp_file_load_layer (GimpRunMode run_mode,
gint32 image_ID,
GimpImage *image,
const gchar *filename);
gint* gimp_file_load_layers (GimpRunMode run_mode,
gint32 image_ID,
GimpImage *image,
const gchar *filename,
gint *num_layers);
gboolean gimp_file_save (GimpRunMode run_mode,
gint32 image_ID,
GimpImage *image,
gint32 drawable_ID,
const gchar *filename,
const gchar *raw_filename);
gboolean gimp_file_save_thumbnail (gint32 image_ID,
gboolean gimp_file_save_thumbnail (GimpImage *image,
const gchar *filename);
G_GNUC_INTERNAL gboolean _gimp_register_magic_load_handler (const gchar *procedure_name,
const gchar *extensions,
......
......@@ -24,6 +24,115 @@
#include "gimppixbuf.h"
enum
{
PROP_0,
PROP_ID,
N_PROPS
};
struct _GimpImagePrivate
{
gint id;
};
static void gimp_image_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_image_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
G_DEFINE_TYPE_WITH_PRIVATE (GimpImage, gimp_image, G_TYPE_OBJECT)
#define parent_class gimp_image_parent_class
static GParamSpec *props[N_PROPS] = { NULL, };
static void
gimp_image_class_init (GimpImageClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->set_property = gimp_image_set_property;
object_class->get_property = gimp_image_get_property;
props[PROP_ID] =
g_param_spec_int ("id",
"The image id",
"The image id for internal use",
0, G_MAXINT32, 0,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY);
g_object_class_install_properties (object_class, N_PROPS, props);
}
static void
gimp_image_init (GimpImage *image)
{
image->priv = gimp_image_get_instance_private (image);
}
static void
gimp_image_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec)
{
GimpImage *image = GIMP_IMAGE (object);
switch (property_id)
{
case PROP_ID:
image->priv->id = g_value_get_int (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
}
}
static void
gimp_image_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec)
{
GimpImage *image = GIMP_IMAGE (object);
switch (property_id)
{
case PROP_ID:
g_value_set_int (value, image->priv->id);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
}
}
/* Public API. */
/**
* gimp_image_get_id:
* @image: The image.
*
* Returns: the image ID.
*
* Since: 3.0
**/
gint32
gimp_image_get_id (GimpImage *image)
{
return image->priv->id;
}
/**
* gimp_image_get_colormap:
......
......@@ -29,6 +29,43 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
#define GIMP_TYPE_IMAGE (gimp_image_get_type ())
#define GIMP_IMAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_IMAGE, GimpImage))
#define GIMP_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_IMAGE, GimpImageClass))
#define GIMP_IS_IMAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_IMAGE))
#define GIMP_IS_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_IMAGE))
#define GIMP_IMAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_IMAGE, GimpImageClass))
typedef struct _GimpImageClass GimpImageClass;
typedef struct _GimpImagePrivate GimpImagePrivate;
struct _GimpImage
{
GObject parent_instance;
GimpImagePrivate *priv;
};
struct _GimpImageClass
{
GObjectClass parent_class;
/* Padding for future expansion */
void (*_gimp_reserved1) (void);
void (*_gimp_reserved2) (void);
void (*_gimp_reserved3) (void);
void (*_gimp_reserved4) (void);
void (*_gimp_reserved5) (void);
void (*_gimp_reserved6) (void);
void (*_gimp_reserved7) (void);
void (*_gimp_reserved8) (void);
void (*_gimp_reserved9) (void);
};
GType gimp_image_get_type (void) G_GNUC_CONST;
gint32 gimp_image_get_id (GimpImage *image);
guchar * gimp_image_get_colormap (gint32 image_ID,
gint *num_colors);
......
This diff is collapsed.
This diff is collapsed.
......@@ -36,7 +36,7 @@
/**
* _gimp_image_get_color_profile:
* @image_ID: The image.
* @image: The image.
* @num_bytes: (out): Number of bytes in the color_profile array.
*
* Returns the image's color profile
......@@ -51,8 +51,8 @@
* Since: 2.10
**/
guint8 *
_gimp_image_get_color_profile (gint32 image_ID,
gint *num_bytes)
_gimp_image_get_color_profile (GimpImage *image,
gint *num_bytes)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
......@@ -60,7 +60,7 @@ _gimp_image_get_color_profile (gint32 image_ID,
guint8 *profile_data = NULL;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE_ID, image_ID,
GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
G_TYPE_NONE);
if (pdb)
......@@ -87,7 +87,7 @@ _gimp_image_get_color_profile (gint32 image_ID,
/**
* _gimp_image_get_effective_color_profile:
* @image_ID: The image.
* @image: The image.
* @num_bytes: (out): Number of bytes in the color_profile array.
*
* Returns the color profile that is used for the image
...