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
|
|
|
|
*
|
1998-01-25 18:26:47 +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
|
1999-11-18 19:37:35 +08:00
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* 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
|
1998-04-13 13:44:11 +08:00
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
1999-11-18 19:37:35 +08:00
|
|
|
*/
|
|
|
|
|
2000-06-01 20:20:13 +08:00
|
|
|
/* NOTE: This file is autogenerated by pdbgen.pl */
|
|
|
|
|
2002-05-14 07:30:23 +08:00
|
|
|
#include "config.h"
|
|
|
|
|
2001-03-18 20:51:37 +08:00
|
|
|
#include <string.h>
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "gimp.h"
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_list:
|
|
|
|
* @num_images: The number of images currently open.
|
|
|
|
*
|
|
|
|
* Returns the list of images currently open.
|
|
|
|
*
|
|
|
|
* This procedure returns the list of images currently open in the
|
|
|
|
* GIMP.
|
|
|
|
*
|
|
|
|
* Returns: The list of images currently open.
|
|
|
|
*/
|
2000-06-01 20:20:13 +08:00
|
|
|
gint *
|
|
|
|
gimp_image_list (gint *num_images)
|
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-01 20:20:13 +08:00
|
|
|
gint nreturn_vals;
|
|
|
|
gint *image_ids = NULL;
|
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-list",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_END);
|
2000-06-01 20:20:13 +08:00
|
|
|
|
|
|
|
*num_images = 0;
|
|
|
|
|
2000-08-03 09:35:28 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
2000-06-01 20:20:13 +08:00
|
|
|
{
|
|
|
|
*num_images = return_vals[1].data.d_int32;
|
|
|
|
image_ids = g_new (gint32, *num_images);
|
2006-04-12 18:34:30 +08:00
|
|
|
memcpy (image_ids,
|
|
|
|
return_vals[2].data.d_int32array,
|
|
|
|
*num_images * sizeof (gint32));
|
2000-06-01 20:20:13 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return image_ids;
|
|
|
|
}
|
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.
|
|
|
|
*
|
|
|
|
* Creates a new image, undisplayed with the specified extents and
|
|
|
|
* 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
|
|
|
|
* gimp_image_add_layer() command.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* Returns: The ID of the newly created image.
|
|
|
|
*/
|
1997-11-25 06:05:25 +08:00
|
|
|
gint32
|
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
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
2000-06-01 20:20:13 +08:00
|
|
|
gint32 image_ID = -1;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-new",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_INT32, width,
|
|
|
|
GIMP_PDB_INT32, height,
|
|
|
|
GIMP_PDB_INT32, type,
|
|
|
|
GIMP_PDB_END);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-08-03 09:35:28 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
1997-11-25 06:05:25 +08:00
|
|
|
image_ID = return_vals[1].data.d_image;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return image_ID;
|
|
|
|
}
|
|
|
|
|
2003-12-09 01:26:55 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_duplicate:
|
|
|
|
* @image_ID: The image.
|
|
|
|
*
|
|
|
|
* Duplicate the specified image
|
|
|
|
*
|
|
|
|
* This procedure duplicates the specified image, copying all layers,
|
|
|
|
* channels, and image information.
|
|
|
|
*
|
|
|
|
* Returns: The new, duplicated image.
|
|
|
|
*/
|
|
|
|
gint32
|
|
|
|
gimp_image_duplicate (gint32 image_ID)
|
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gint32 new_image_ID = -1;
|
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-duplicate",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_END);
|
2003-12-09 01:26:55 +08:00
|
|
|
|
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
|
|
|
new_image_ID = return_vals[1].data.d_image;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return new_image_ID;
|
|
|
|
}
|
|
|
|
|
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:
|
|
|
|
* @image_ID: The image.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
gboolean
|
|
|
|
gimp_image_delete (gint32 image_ID)
|
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-delete",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_END);
|
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
|
|
|
|
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_image_base_type:
|
|
|
|
* @image_ID: The image.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
GimpImageBaseType
|
|
|
|
gimp_image_base_type (gint32 image_ID)
|
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
GimpImageBaseType base_type = 0;
|
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-base-type",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_END);
|
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
|
|
|
|
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
|
|
|
base_type = return_vals[1].data.d_int32;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return base_type;
|
|
|
|
}
|
|
|
|
|
2003-12-09 01:26:55 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_width:
|
|
|
|
* @image_ID: The image.
|
|
|
|
*
|
|
|
|
* Return the width of the image
|
|
|
|
*
|
|
|
|
* This procedure returns the image's width. This value is independent
|
|
|
|
* of any of the layers in this image. This is the \"canvas\" width.
|
|
|
|
*
|
|
|
|
* Returns: The image's width.
|
|
|
|
*/
|
|
|
|
gint
|
|
|
|
gimp_image_width (gint32 image_ID)
|
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gint width = 0;
|
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-width",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_END);
|
2003-12-09 01:26:55 +08:00
|
|
|
|
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
|
|
|
width = return_vals[1].data.d_int32;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return width;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_image_height:
|
|
|
|
* @image_ID: The image.
|
|
|
|
*
|
|
|
|
* Return the height of the image
|
|
|
|
*
|
|
|
|
* This procedure returns the image's height. This value is independent
|
|
|
|
* of any of the layers in this image. This is the \"canvas\" height.
|
|
|
|
*
|
|
|
|
* Returns: The image's height.
|
|
|
|
*/
|
|
|
|
gint
|
|
|
|
gimp_image_height (gint32 image_ID)
|
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gint height = 0;
|
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-height",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_END);
|
2003-12-09 01:26:55 +08:00
|
|
|
|
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
|
|
|
height = return_vals[1].data.d_int32;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return height;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_image_free_shadow:
|
|
|
|
* @image_ID: The image.
|
|
|
|
*
|
|
|
|
* Free the specified image's shadow data (if it exists).
|
|
|
|
*
|
|
|
|
* This procedure is intended as a memory saving device. If any shadow
|
|
|
|
* memory has been allocated, it will be freed automatically on a call
|
2006-06-14 16:32:08 +08:00
|
|
|
* to gimp_image_delete().
|
2003-12-09 01:26:55 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*/
|
|
|
|
gboolean
|
|
|
|
gimp_image_free_shadow (gint32 image_ID)
|
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-free-shadow",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_END);
|
2003-12-09 01:26:55 +08:00
|
|
|
|
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_resize:
|
|
|
|
* @image_ID: The image.
|
|
|
|
* @new_width: New image width.
|
|
|
|
* @new_height: New image height.
|
|
|
|
* @offx: x offset between upper left corner of old and new images: (new - old).
|
|
|
|
* @offy: y offset between upper left corner of old and new images: (new - old).
|
|
|
|
*
|
|
|
|
* Resize the image to the specified extents.
|
|
|
|
*
|
|
|
|
* This procedure resizes the image so that it's new width and height
|
|
|
|
* are equal to the supplied parameters. Offsets are also provided
|
|
|
|
* which describe the position of the previous image's content. No
|
|
|
|
* bounds checking is currently provided, so don't supply parameters
|
|
|
|
* that are out of bounds. All channels within the image are resized
|
|
|
|
* according to the specified parameters; this includes the image
|
|
|
|
* selection mask. All layers within the image are repositioned
|
|
|
|
* according to the specified offsets.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2000-06-01 20:20:13 +08:00
|
|
|
gimp_image_resize (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
gint new_width,
|
|
|
|
gint new_height,
|
|
|
|
gint offx,
|
|
|
|
gint offy)
|
1999-10-04 02:54:54 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
1999-10-04 02:54:54 +08:00
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-resize",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_INT32, new_width,
|
|
|
|
GIMP_PDB_INT32, new_height,
|
|
|
|
GIMP_PDB_INT32, offx,
|
|
|
|
GIMP_PDB_INT32, offy,
|
|
|
|
GIMP_PDB_END);
|
1999-10-04 02:54:54 +08:00
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
1999-10-04 02:54:54 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
2000-06-01 20:20:13 +08:00
|
|
|
}
|
|
|
|
|
2004-09-05 06:08:43 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_resize_to_layers:
|
|
|
|
* @image_ID: The image.
|
|
|
|
*
|
|
|
|
* Resize the image to fit all layers.
|
|
|
|
*
|
2004-09-05 08:13:22 +08:00
|
|
|
* This procedure resizes the image to the bounding box of all layers
|
2004-09-05 06:08:43 +08:00
|
|
|
* of the image. All channels within the image are resized to the new
|
|
|
|
* size; this includes the image selection mask. All layers within the
|
|
|
|
* image are repositioned to the new image area.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
2004-09-05 08:13:22 +08:00
|
|
|
*
|
|
|
|
* Since: GIMP 2.2
|
2004-09-05 06:08:43 +08:00
|
|
|
*/
|
|
|
|
gboolean
|
|
|
|
gimp_image_resize_to_layers (gint32 image_ID)
|
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-resize-to-layers",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_END);
|
2004-09-05 06:08:43 +08:00
|
|
|
|
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_scale:
|
|
|
|
* @image_ID: The image.
|
|
|
|
* @new_width: New image width.
|
|
|
|
* @new_height: New image height.
|
|
|
|
*
|
|
|
|
* Scale the image to the specified extents.
|
|
|
|
*
|
2005-05-08 00:22:52 +08:00
|
|
|
* This procedure scales the image so that its new width and height are
|
|
|
|
* equal to the supplied parameters. Offsets are also provided which
|
|
|
|
* describe the position of the previous image's content. No bounds
|
|
|
|
* checking is currently provided, so don't supply parameters that are
|
|
|
|
* out of bounds. All channels within the image are scaled according to
|
|
|
|
* the specified parameters; this includes the image selection mask.
|
|
|
|
* All layers within the image are repositioned according to the
|
|
|
|
* specified offsets.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2000-06-01 20:20:13 +08:00
|
|
|
gimp_image_scale (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
gint new_width,
|
|
|
|
gint new_height)
|
2000-06-01 20:20:13 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-01 20:20:13 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
1999-10-04 02:54:54 +08:00
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-scale",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_INT32, new_width,
|
|
|
|
GIMP_PDB_INT32, new_height,
|
|
|
|
GIMP_PDB_END);
|
2000-06-01 20:20:13 +08:00
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
2000-06-01 20:20:13 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
2000-06-01 20:20:13 +08:00
|
|
|
}
|
1999-10-04 02:54:54 +08:00
|
|
|
|
2001-07-07 22:53:42 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_crop:
|
|
|
|
* @image_ID: The image.
|
|
|
|
* @new_width: New image width: (0 < new_width <= width).
|
|
|
|
* @new_height: New image height: (0 < new_height <= height).
|
|
|
|
* @offx: x offset: (0 <= offx <= (width - new_width)).
|
|
|
|
* @offy: y offset: (0 <= offy <= (height - new_height)).
|
|
|
|
*
|
|
|
|
* Crop the image to the specified extents.
|
|
|
|
*
|
|
|
|
* This procedure crops the image so that it's new width and height are
|
|
|
|
* equal to the supplied parameters. Offsets are also provided which
|
|
|
|
* describe the position of the previous image's content. All channels
|
|
|
|
* and layers within the image are cropped to the new image extents;
|
|
|
|
* this includes the image selection mask. If any parameters are out of
|
|
|
|
* range, an error is returned.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*/
|
|
|
|
gboolean
|
|
|
|
gimp_image_crop (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
gint new_width,
|
|
|
|
gint new_height,
|
|
|
|
gint offx,
|
|
|
|
gint offy)
|
2001-07-07 22:53:42 +08:00
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-crop",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_INT32, new_width,
|
|
|
|
GIMP_PDB_INT32, new_height,
|
|
|
|
GIMP_PDB_INT32, offx,
|
|
|
|
GIMP_PDB_INT32, offy,
|
|
|
|
GIMP_PDB_END);
|
2001-07-07 22:53:42 +08:00
|
|
|
|
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
2003-05-20 00:28:35 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_flip:
|
|
|
|
* @image_ID: The image.
|
|
|
|
* @flip_type: Type of flip.
|
|
|
|
*
|
|
|
|
* Flips the image horizontally or vertically.
|
|
|
|
*
|
2003-12-09 17:03:52 +08:00
|
|
|
* This procedure flips (mirrors) the image.
|
2003-05-20 00:28:35 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*/
|
|
|
|
gboolean
|
|
|
|
gimp_image_flip (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
GimpOrientationType flip_type)
|
2003-05-20 00:28:35 +08:00
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-flip",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_INT32, flip_type,
|
|
|
|
GIMP_PDB_END);
|
2003-05-20 00:28:35 +08:00
|
|
|
|
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
2003-12-09 17:03:52 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_rotate:
|
|
|
|
* @image_ID: The image.
|
|
|
|
* @rotate_type: Angle of rotation.
|
|
|
|
*
|
2004-02-08 18:25:30 +08:00
|
|
|
* Rotates the image by the specified degrees.
|
2003-12-09 17:03:52 +08:00
|
|
|
*
|
|
|
|
* This procedure rotates the image.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*/
|
|
|
|
gboolean
|
|
|
|
gimp_image_rotate (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
GimpRotationType rotate_type)
|
2003-12-09 17:03:52 +08:00
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-rotate",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_INT32, rotate_type,
|
|
|
|
GIMP_PDB_END);
|
2003-12-09 17:03:52 +08:00
|
|
|
|
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_get_layers:
|
|
|
|
* @image_ID: The image.
|
|
|
|
* @num_layers: The number of layers contained in the image.
|
|
|
|
*
|
|
|
|
* Returns the list of layers contained in the specified image.
|
|
|
|
*
|
|
|
|
* This procedure returns the list of layers contained in the specified
|
|
|
|
* image. The order of layers is from topmost to bottommost.
|
|
|
|
*
|
|
|
|
* Returns: The list of layers contained in the image.
|
|
|
|
*/
|
2000-06-01 20:20:13 +08:00
|
|
|
gint *
|
|
|
|
gimp_image_get_layers (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
gint *num_layers)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
2000-06-01 20:20:13 +08:00
|
|
|
gint *layer_ids = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-get-layers",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_END);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-06-01 20:20:13 +08:00
|
|
|
*num_layers = 0;
|
|
|
|
|
2000-08-03 09:35:28 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
2000-06-01 20:20:13 +08:00
|
|
|
{
|
|
|
|
*num_layers = return_vals[1].data.d_int32;
|
|
|
|
layer_ids = g_new (gint32, *num_layers);
|
2006-04-12 18:34:30 +08:00
|
|
|
memcpy (layer_ids,
|
|
|
|
return_vals[2].data.d_int32array,
|
|
|
|
*num_layers * sizeof (gint32));
|
2000-06-01 20:20:13 +08:00
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
2000-06-01 20:20:13 +08:00
|
|
|
return layer_ids;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_get_channels:
|
|
|
|
* @image_ID: The image.
|
|
|
|
* @num_channels: The number of channels contained in the image.
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
* masks. The order is from topmost to bottommost.
|
|
|
|
*
|
|
|
|
* Returns: The list of channels contained in the image.
|
|
|
|
*/
|
2000-06-01 20:20:13 +08:00
|
|
|
gint *
|
|
|
|
gimp_image_get_channels (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
gint *num_channels)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
2000-06-01 20:20:13 +08:00
|
|
|
gint *channel_ids = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-get-channels",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_END);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-06-01 20:20:13 +08:00
|
|
|
*num_channels = 0;
|
|
|
|
|
2000-08-03 09:35:28 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
2000-06-01 20:20:13 +08:00
|
|
|
{
|
|
|
|
*num_channels = return_vals[1].data.d_int32;
|
|
|
|
channel_ids = g_new (gint32, *num_channels);
|
2006-04-12 18:34:30 +08:00
|
|
|
memcpy (channel_ids,
|
|
|
|
return_vals[2].data.d_int32array,
|
|
|
|
*num_channels * sizeof (gint32));
|
2000-06-01 20:20:13 +08:00
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
2000-06-01 20:20:13 +08:00
|
|
|
return channel_ids;
|
|
|
|
}
|
|
|
|
|
2005-04-14 10:32:23 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_get_vectors:
|
|
|
|
* @image_ID: The image.
|
|
|
|
* @num_vectors: The number of vectors contained in the image.
|
|
|
|
*
|
|
|
|
* Returns the list of vectors contained in the specified image.
|
|
|
|
*
|
|
|
|
* This procedure returns the list of vectors contained in the
|
|
|
|
* specified image.
|
|
|
|
*
|
|
|
|
* Returns: The list of vectors contained in the image.
|
|
|
|
*
|
|
|
|
* Since: GIMP 2.4
|
|
|
|
*/
|
|
|
|
gint *
|
|
|
|
gimp_image_get_vectors (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
gint *num_vectors)
|
2005-04-14 10:32:23 +08:00
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gint *vector_ids = NULL;
|
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-get-vectors",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_END);
|
2005-04-14 10:32:23 +08:00
|
|
|
|
|
|
|
*num_vectors = 0;
|
|
|
|
|
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
|
|
|
{
|
|
|
|
*num_vectors = return_vals[1].data.d_int32;
|
|
|
|
vector_ids = g_new (gint32, *num_vectors);
|
2006-04-12 18:34:30 +08:00
|
|
|
memcpy (vector_ids,
|
|
|
|
return_vals[2].data.d_int32array,
|
|
|
|
*num_vectors * sizeof (gint32));
|
2005-04-14 10:32:23 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return vector_ids;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
/**
|
2003-12-09 02:30:54 +08:00
|
|
|
* gimp_image_get_active_drawable:
|
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
|
|
|
* @image_ID: The image.
|
|
|
|
*
|
|
|
|
* Get the image's active drawable
|
|
|
|
*
|
|
|
|
* This procedure returns the ID of the image's active drawable. This
|
|
|
|
* can be either a layer, a channel, or a layer mask. The active
|
|
|
|
* drawable is specified by the active image channel. If that is -1,
|
|
|
|
* then by the active image layer. 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: The active drawable.
|
|
|
|
*/
|
|
|
|
gint32
|
2003-12-09 02:30:54 +08:00
|
|
|
gimp_image_get_active_drawable (gint32 image_ID)
|
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
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gint32 drawable_ID = -1;
|
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-get-active-drawable",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_END);
|
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
|
|
|
|
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
|
|
|
drawable_ID = return_vals[1].data.d_drawable;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return drawable_ID;
|
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_unset_active_channel:
|
|
|
|
* @image_ID: The image.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2000-06-01 20:20:13 +08:00
|
|
|
gimp_image_unset_active_channel (gint32 image_ID)
|
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-01 20:20:13 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
2000-06-01 20:20:13 +08:00
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-unset-active-channel",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_END);
|
2000-06-01 20:20:13 +08:00
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
2000-06-01 20:20:13 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2003-12-09 01:26:55 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_get_floating_sel:
|
|
|
|
* @image_ID: The image.
|
|
|
|
*
|
|
|
|
* Return the floating selection of the image.
|
|
|
|
*
|
|
|
|
* This procedure returns the image's floating selection, if it exists.
|
|
|
|
* If it doesn't exist, -1 is returned as the layer ID.
|
|
|
|
*
|
|
|
|
* Returns: The image's floating selection.
|
|
|
|
*/
|
|
|
|
gint32
|
|
|
|
gimp_image_get_floating_sel (gint32 image_ID)
|
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gint32 floating_sel_ID = -1;
|
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-get-floating-sel",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_END);
|
2003-12-09 01:26:55 +08:00
|
|
|
|
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
|
|
|
floating_sel_ID = return_vals[1].data.d_layer;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return floating_sel_ID;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_image_floating_sel_attached_to:
|
|
|
|
* @image_ID: The image.
|
|
|
|
*
|
|
|
|
* Return the drawable the floating selection is attached to.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* Returns: The drawable the floating selection is attached to.
|
|
|
|
*/
|
|
|
|
gint32
|
|
|
|
gimp_image_floating_sel_attached_to (gint32 image_ID)
|
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gint32 drawable_ID = -1;
|
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-floating-sel-attached-to",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_END);
|
2003-12-09 01:26:55 +08:00
|
|
|
|
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
|
|
|
drawable_ID = return_vals[1].data.d_drawable;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return drawable_ID;
|
|
|
|
}
|
|
|
|
|
2004-01-05 22:35:19 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_pick_color:
|
|
|
|
* @image_ID: The image.
|
|
|
|
* @drawable_ID: The drawable to pick from.
|
|
|
|
* @x: x coordinate of upper-left corner of rectangle.
|
|
|
|
* @y: y coordinate of upper-left corner of rectangle.
|
|
|
|
* @sample_merged: Use the composite image, not the drawable.
|
|
|
|
* @sample_average: Average the color of all the pixels in a specified radius.
|
|
|
|
* @average_radius: The radius of pixels to average.
|
|
|
|
* @color: The return color.
|
|
|
|
*
|
|
|
|
* Determine the color at the given drawable coordinates
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
* specified drawable, then an error is returned. If the drawable 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. If the sample_merged
|
2006-03-25 05:57:47 +08:00
|
|
|
* parameter is TRUE, the data of the composite image will be used
|
2004-01-05 22:35:19 +08:00
|
|
|
* instead of that for the specified drawable. This is equivalent to
|
|
|
|
* sampling for colors after merging all visible layers. In the case of
|
2006-03-03 03:30:59 +08:00
|
|
|
* a merged sampling, the supplied drawable is ignored.
|
2004-01-05 22:35:19 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*/
|
|
|
|
gboolean
|
|
|
|
gimp_image_pick_color (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
gint32 drawable_ID,
|
|
|
|
gdouble x,
|
|
|
|
gdouble y,
|
|
|
|
gboolean sample_merged,
|
|
|
|
gboolean sample_average,
|
|
|
|
gdouble average_radius,
|
|
|
|
GimpRGB *color)
|
2004-01-05 22:35:19 +08:00
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-pick-color",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_DRAWABLE, drawable_ID,
|
|
|
|
GIMP_PDB_FLOAT, x,
|
|
|
|
GIMP_PDB_FLOAT, y,
|
|
|
|
GIMP_PDB_INT32, sample_merged,
|
|
|
|
GIMP_PDB_INT32, sample_average,
|
|
|
|
GIMP_PDB_FLOAT, average_radius,
|
|
|
|
GIMP_PDB_END);
|
2004-01-05 22:35:19 +08:00
|
|
|
|
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
if (success)
|
|
|
|
*color = return_vals[1].data.d_color;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_pick_correlate_layer:
|
|
|
|
* @image_ID: 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.
|
|
|
|
*
|
|
|
|
* Returns: The layer found at the specified coordinates.
|
|
|
|
*/
|
1997-11-25 06:05:25 +08:00
|
|
|
gint32
|
2000-06-01 20:20:13 +08:00
|
|
|
gimp_image_pick_correlate_layer (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
gint x,
|
|
|
|
gint y)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
2000-06-01 20:20:13 +08:00
|
|
|
gint32 layer_ID = -1;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-pick-correlate-layer",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_INT32, x,
|
|
|
|
GIMP_PDB_INT32, y,
|
|
|
|
GIMP_PDB_END);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-08-03 09:35:28 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
1997-11-25 06:05:25 +08:00
|
|
|
layer_ID = return_vals[1].data.d_layer;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return layer_ID;
|
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
2003-12-09 01:26:55 +08:00
|
|
|
* gimp_image_add_layer:
|
2000-08-25 07:06:53 +08:00
|
|
|
* @image_ID: The image.
|
2003-12-09 01:26:55 +08:00
|
|
|
* @layer_ID: The layer.
|
|
|
|
* @position: The layer position.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2003-12-09 01:26:55 +08:00
|
|
|
* Add the specified layer to the image.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2006-03-24 05:17:16 +08:00
|
|
|
* This procedure adds the specified layer to the image at the given
|
2003-12-09 01:26:55 +08:00
|
|
|
* position. If the position is specified as -1, then the layer is
|
2006-07-18 15:35:26 +08:00
|
|
|
* inserted above the active layer. The layer type must be compatible
|
|
|
|
* with the image base type.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2003-12-09 01:26:55 +08:00
|
|
|
gimp_image_add_layer (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
gint32 layer_ID,
|
|
|
|
gint position)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-add-layer",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_LAYER, layer_ID,
|
|
|
|
GIMP_PDB_INT32, position,
|
|
|
|
GIMP_PDB_END);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
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
|
|
|
/**
|
2003-12-09 01:26:55 +08:00
|
|
|
* gimp_image_remove_layer:
|
2000-08-25 07:06:53 +08:00
|
|
|
* @image_ID: The image.
|
2003-12-09 01:26:55 +08:00
|
|
|
* @layer_ID: The layer.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2003-12-09 01:26:55 +08:00
|
|
|
* Remove the specified layer from the image.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2003-12-09 01:26:55 +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.
|
|
|
|
*/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2003-12-09 01:26:55 +08:00
|
|
|
gimp_image_remove_layer (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
gint32 layer_ID)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-remove-layer",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_LAYER, layer_ID,
|
|
|
|
GIMP_PDB_END);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2006-11-23 06:36:24 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_get_layer_position:
|
|
|
|
* @image_ID: The image.
|
|
|
|
* @layer_ID: The layer.
|
|
|
|
*
|
|
|
|
* Returns the position of the layer in the layer stack.
|
|
|
|
*
|
|
|
|
* This procedure determines the positioin of the specified layer in
|
|
|
|
* the images layer stack. If the layer doesn't exist in the image, an
|
|
|
|
* error is returned.
|
|
|
|
*
|
|
|
|
* Returns: The position of the layer in the layer stack.
|
|
|
|
*/
|
|
|
|
gint
|
|
|
|
gimp_image_get_layer_position (gint32 image_ID,
|
|
|
|
gint32 layer_ID)
|
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gint position = 0;
|
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp-image-get-layer-position",
|
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_LAYER, layer_ID,
|
|
|
|
GIMP_PDB_END);
|
|
|
|
|
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
|
|
|
position = return_vals[1].data.d_int32;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return position;
|
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
2003-12-09 01:26:55 +08:00
|
|
|
* gimp_image_raise_layer:
|
2000-08-25 07:06:53 +08:00
|
|
|
* @image_ID: The image.
|
2003-12-09 01:26:55 +08:00
|
|
|
* @layer_ID: The layer to raise.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2003-12-09 01:26:55 +08:00
|
|
|
* Raise the specified layer in the image's layer stack
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2003-12-09 01:26:55 +08:00
|
|
|
* This procedure raises the specified layer one step in the existing
|
2000-08-25 07:06:53 +08:00
|
|
|
* layer stack. It will not move the layer if there is no layer above
|
2006-03-02 22:38:50 +08:00
|
|
|
* it.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2003-12-09 01:26:55 +08:00
|
|
|
gimp_image_raise_layer (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
gint32 layer_ID)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-05-31 21:24:14 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-raise-layer",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_LAYER, layer_ID,
|
|
|
|
GIMP_PDB_END);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
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
|
|
|
/**
|
2003-12-09 01:26:55 +08:00
|
|
|
* gimp_image_lower_layer:
|
2000-08-25 07:06:53 +08:00
|
|
|
* @image_ID: The image.
|
2003-12-09 01:26:55 +08:00
|
|
|
* @layer_ID: The layer to lower.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2003-12-09 01:26:55 +08:00
|
|
|
* Lower the specified layer in the image's layer stack
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2003-12-09 01:26:55 +08:00
|
|
|
* This procedure lowers the specified layer one step in the existing
|
2000-08-25 07:06:53 +08:00
|
|
|
* layer stack. It will not move the layer if there is no layer below
|
2006-03-02 22:38:50 +08:00
|
|
|
* it.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2003-12-09 01:26:55 +08:00
|
|
|
gimp_image_lower_layer (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
gint32 layer_ID)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-lower-layer",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_LAYER, layer_ID,
|
|
|
|
GIMP_PDB_END);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_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
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
2003-12-09 01:26:55 +08:00
|
|
|
* gimp_image_raise_layer_to_top:
|
2000-08-25 07:06:53 +08:00
|
|
|
* @image_ID: The image.
|
2003-12-09 01:26:55 +08:00
|
|
|
* @layer_ID: The layer to raise to top.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2003-12-09 01:26:55 +08:00
|
|
|
* Raise the specified layer in the image's layer stack to top of stack
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2003-12-09 01:26:55 +08:00
|
|
|
* This procedure raises the specified layer to top of the existing
|
|
|
|
* layer stack. It will not move the layer if there is no layer above
|
2006-03-02 22:38:50 +08:00
|
|
|
* it.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2003-12-09 01:26:55 +08:00
|
|
|
gimp_image_raise_layer_to_top (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
gint32 layer_ID)
|
2000-06-01 20:20:13 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-01 20:20:13 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
2000-06-01 20:20:13 +08:00
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-raise-layer-to-top",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_LAYER, layer_ID,
|
|
|
|
GIMP_PDB_END);
|
2000-06-01 20:20:13 +08:00
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
2000-06-01 20:20:13 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
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
|
|
|
/**
|
2003-12-09 01:26:55 +08:00
|
|
|
* gimp_image_lower_layer_to_bottom:
|
2000-08-25 07:06:53 +08:00
|
|
|
* @image_ID: The image.
|
2003-12-09 01:26:55 +08:00
|
|
|
* @layer_ID: The layer to lower to bottom.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2003-12-09 01:26:55 +08:00
|
|
|
* Lower the specified layer in the image's layer stack to bottom of
|
|
|
|
* stack
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2003-12-09 01:26:55 +08:00
|
|
|
* This procedure lowers the specified layer to bottom of the existing
|
2000-08-25 07:06:53 +08:00
|
|
|
* layer stack. It will not move the layer if there is no layer below
|
2006-03-02 22:38:50 +08:00
|
|
|
* it.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2003-12-09 01:26:55 +08:00
|
|
|
gimp_image_lower_layer_to_bottom (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
gint32 layer_ID)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-05-31 21:24:14 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-lower-layer-to-bottom",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_LAYER, layer_ID,
|
|
|
|
GIMP_PDB_END);
|
2000-06-01 20:20:13 +08:00
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
2000-06-01 20:20:13 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_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
|
|
|
/**
|
2006-03-22 20:15:06 +08:00
|
|
|
* gimp_image_add_channel:
|
2005-12-29 05:24:12 +08:00
|
|
|
* @image_ID: The image.
|
2006-03-22 20:15:06 +08:00
|
|
|
* @channel_ID: The channel.
|
|
|
|
* @position: The channel position.
|
2005-12-29 05:24:12 +08:00
|
|
|
*
|
2006-03-22 20:15:06 +08:00
|
|
|
* Add the specified channel to the image.
|
2005-12-29 05:24:12 +08:00
|
|
|
*
|
2006-03-22 20:15:06 +08:00
|
|
|
* This procedure adds the specified channel to the image. The position
|
|
|
|
* channel is not currently used, so the channel is always inserted at
|
|
|
|
* the top of the channel stack.
|
2005-12-29 05:24:12 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*/
|
|
|
|
gboolean
|
2006-03-22 20:15:06 +08:00
|
|
|
gimp_image_add_channel (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
gint32 channel_ID,
|
|
|
|
gint position)
|
2005-12-29 05:24:12 +08:00
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2006-03-22 20:15:06 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-add-channel",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_CHANNEL, channel_ID,
|
|
|
|
GIMP_PDB_INT32, position,
|
|
|
|
GIMP_PDB_END);
|
2005-12-29 05:24:12 +08:00
|
|
|
|
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2006-03-22 20:15:06 +08:00
|
|
|
* gimp_image_remove_channel:
|
2005-12-29 05:24:12 +08:00
|
|
|
* @image_ID: The image.
|
2006-03-22 20:15:06 +08:00
|
|
|
* @channel_ID: The channel.
|
2005-12-29 05:24:12 +08:00
|
|
|
*
|
2006-03-22 20:15:06 +08:00
|
|
|
* Remove the specified channel from the image.
|
2005-12-29 05:24:12 +08:00
|
|
|
*
|
2006-03-22 20:15:06 +08:00
|
|
|
* This procedure removes the specified channel from the image. If the
|
|
|
|
* channel doesn't exist, an error is returned.
|
2005-12-29 05:24:12 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*/
|
|
|
|
gboolean
|
2006-03-22 20:15:06 +08:00
|
|
|
gimp_image_remove_channel (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
gint32 channel_ID)
|
2005-12-29 05:24:12 +08:00
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2006-03-22 20:15:06 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-remove-channel",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_CHANNEL, channel_ID,
|
|
|
|
GIMP_PDB_END);
|
2005-12-29 05:24:12 +08:00
|
|
|
|
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
2006-11-23 06:54:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_get_channel_position:
|
|
|
|
* @image_ID: The image.
|
|
|
|
* @channel_ID: The channel.
|
|
|
|
*
|
|
|
|
* Returns the position of the channel in the channel stack.
|
|
|
|
*
|
|
|
|
* This procedure determines the positioin of the specified channel in
|
|
|
|
* the images channel stack. If the channel doesn't exist in the image,
|
|
|
|
* an error is returned.
|
|
|
|
*
|
|
|
|
* Returns: The position of the channel in the channel stack.
|
|
|
|
*/
|
|
|
|
gint
|
|
|
|
gimp_image_get_channel_position (gint32 image_ID,
|
|
|
|
gint32 channel_ID)
|
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gint position = 0;
|
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp-image-get-channel-position",
|
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_CHANNEL, channel_ID,
|
|
|
|
GIMP_PDB_END);
|
|
|
|
|
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
|
|
|
position = return_vals[1].data.d_int32;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return position;
|
|
|
|
}
|
|
|
|
|
2005-12-29 05:24:12 +08:00
|
|
|
/**
|
2006-03-22 20:15:06 +08:00
|
|
|
* gimp_image_raise_channel:
|
2005-12-29 05:24:12 +08:00
|
|
|
* @image_ID: The image.
|
2006-03-22 20:15:06 +08:00
|
|
|
* @channel_ID: The channel to raise.
|
2005-12-29 05:24:12 +08:00
|
|
|
*
|
2006-03-22 20:15:06 +08:00
|
|
|
* Raise the specified channel in the image's channel stack
|
2005-12-29 05:24:12 +08:00
|
|
|
*
|
2006-03-22 20:15:06 +08:00
|
|
|
* This procedure raises the specified channel one step in the existing
|
|
|
|
* channel stack. It will not move the channel if there is no channel
|
2005-12-29 05:24:12 +08:00
|
|
|
* above it.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*/
|
|
|
|
gboolean
|
2006-03-22 20:15:06 +08:00
|
|
|
gimp_image_raise_channel (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
gint32 channel_ID)
|
2005-12-29 05:24:12 +08:00
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2006-03-22 20:15:06 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-raise-channel",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_CHANNEL, channel_ID,
|
|
|
|
GIMP_PDB_END);
|
2005-12-29 05:24:12 +08:00
|
|
|
|
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2006-03-22 20:15:06 +08:00
|
|
|
* gimp_image_lower_channel:
|
2005-12-29 05:24:12 +08:00
|
|
|
* @image_ID: The image.
|
2006-03-22 20:15:06 +08:00
|
|
|
* @channel_ID: The channel to lower.
|
2005-12-29 05:24:12 +08:00
|
|
|
*
|
2006-03-22 20:15:06 +08:00
|
|
|
* Lower the specified channel in the image's channel stack
|
2005-12-29 05:24:12 +08:00
|
|
|
*
|
2006-03-22 20:15:06 +08:00
|
|
|
* This procedure lowers the specified channel one step in the existing
|
|
|
|
* channel stack. It will not move the channel if there is no channel
|
|
|
|
* below it.
|
2005-12-29 05:24:12 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*/
|
|
|
|
gboolean
|
2006-03-22 20:15:06 +08:00
|
|
|
gimp_image_lower_channel (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
gint32 channel_ID)
|
2005-12-29 05:24:12 +08:00
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2006-03-22 20:15:06 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-lower-channel",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_CHANNEL, channel_ID,
|
|
|
|
GIMP_PDB_END);
|
2005-12-29 05:24:12 +08:00
|
|
|
|
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
2006-03-22 20:15:06 +08:00
|
|
|
* gimp_image_add_vectors:
|
2000-08-25 07:06:53 +08:00
|
|
|
* @image_ID: The image.
|
2006-03-22 20:15:06 +08:00
|
|
|
* @vectors_ID: The vectors object.
|
|
|
|
* @position: The vectors objects position.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2006-03-22 20:15:06 +08:00
|
|
|
* Add the specified vectors object to the image.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2006-03-24 05:17:16 +08:00
|
|
|
* This procedure adds the specified vectors object to the image at the
|
|
|
|
* given position. If the position is specified as -1, then the vectors
|
|
|
|
* object is inserted at the top of the vectors stack.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2006-03-22 20:15:06 +08:00
|
|
|
gimp_image_add_vectors (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
gint32 vectors_ID,
|
|
|
|
gint position)
|
2000-06-01 20:20:13 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-01 20:20:13 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
2000-06-01 20:20:13 +08:00
|
|
|
|
2006-03-22 20:15:06 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-add-vectors",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_VECTORS, vectors_ID,
|
|
|
|
GIMP_PDB_INT32, position,
|
|
|
|
GIMP_PDB_END);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
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
|
|
|
/**
|
2006-03-22 20:15:06 +08:00
|
|
|
* gimp_image_remove_vectors:
|
2000-08-25 07:06:53 +08:00
|
|
|
* @image_ID: The image.
|
2006-03-22 20:15:06 +08:00
|
|
|
* @vectors_ID: The vectors object.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2006-03-22 20:15:06 +08:00
|
|
|
* Remove the specified path from the image.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2006-03-22 20:15:06 +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.
|
2006-03-22 20:15:06 +08:00
|
|
|
*
|
|
|
|
* Since: GIMP 2.4
|
2000-08-25 07:06:53 +08:00
|
|
|
*/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2006-03-22 20:15:06 +08:00
|
|
|
gimp_image_remove_vectors (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
gint32 vectors_ID)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2006-03-22 20:15:06 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-remove-vectors",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_VECTORS, vectors_ID,
|
|
|
|
GIMP_PDB_END);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2006-11-23 06:54:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_get_vectors_position:
|
|
|
|
* @image_ID: The image.
|
|
|
|
* @vectors_ID: The vectors object.
|
|
|
|
*
|
|
|
|
* Returns the position of the vectors object in the vectors objects
|
|
|
|
* stack.
|
|
|
|
*
|
|
|
|
* This procedure determines the positioin of the specified vectors
|
|
|
|
* object in the images vectors object stack. If the vectors object
|
|
|
|
* doesn't exist in the image, an error is returned.
|
|
|
|
*
|
|
|
|
* Returns: The position of the vectors object in the vectors stack.
|
|
|
|
*/
|
|
|
|
gint
|
|
|
|
gimp_image_get_vectors_position (gint32 image_ID,
|
|
|
|
gint32 vectors_ID)
|
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gint position = 0;
|
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp-image-get-vectors-position",
|
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_VECTORS, vectors_ID,
|
|
|
|
GIMP_PDB_END);
|
|
|
|
|
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
|
|
|
position = return_vals[1].data.d_int32;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return position;
|
|
|
|
}
|
|
|
|
|
2005-12-30 04:55:07 +08:00
|
|
|
/**
|
2006-03-22 20:15:06 +08:00
|
|
|
* gimp_image_raise_vectors:
|
2005-12-30 04:55:07 +08:00
|
|
|
* @image_ID: The image.
|
2006-03-22 20:15:06 +08:00
|
|
|
* @vectors_ID: The vectors object to raise.
|
2005-12-30 04:55:07 +08:00
|
|
|
*
|
2006-03-22 20:15:06 +08:00
|
|
|
* Raise the specified vectors in the image's vectors stack
|
2005-12-30 04:55:07 +08:00
|
|
|
*
|
2006-03-22 20:15:06 +08:00
|
|
|
* This procedure raises the specified vectors one step in the existing
|
|
|
|
* vectors stack. It will not move the vectors if there is no vectors
|
|
|
|
* above it.
|
2005-12-30 04:55:07 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
2006-03-22 20:15:06 +08:00
|
|
|
*
|
|
|
|
* Since: GIMP 2.4
|
2005-12-30 04:55:07 +08:00
|
|
|
*/
|
|
|
|
gboolean
|
2006-03-22 20:15:06 +08:00
|
|
|
gimp_image_raise_vectors (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
gint32 vectors_ID)
|
2005-12-30 04:55:07 +08:00
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2006-03-22 20:15:06 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-raise-vectors",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_VECTORS, vectors_ID,
|
|
|
|
GIMP_PDB_END);
|
2005-12-30 04:55:07 +08:00
|
|
|
|
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
2005-12-29 05:24:12 +08:00
|
|
|
/**
|
2006-03-22 20:15:06 +08:00
|
|
|
* gimp_image_lower_vectors:
|
2005-12-29 05:24:12 +08:00
|
|
|
* @image_ID: The image.
|
2006-03-22 20:15:06 +08:00
|
|
|
* @vectors_ID: The vectors object to lower.
|
2005-12-29 05:24:12 +08:00
|
|
|
*
|
2006-03-22 20:15:06 +08:00
|
|
|
* Lower the specified vectors in the image's vectors stack
|
2005-12-29 05:24:12 +08:00
|
|
|
*
|
2006-03-22 20:15:06 +08:00
|
|
|
* This procedure lowers the specified vectors one step in the existing
|
|
|
|
* vectors stack. It will not move the vectors if there is no vectors
|
|
|
|
* below it.
|
2005-12-29 05:24:12 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: GIMP 2.4
|
|
|
|
*/
|
|
|
|
gboolean
|
2006-03-22 20:15:06 +08:00
|
|
|
gimp_image_lower_vectors (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
gint32 vectors_ID)
|
2005-12-29 05:24:12 +08:00
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2006-03-22 20:15:06 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-lower-vectors",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_VECTORS, vectors_ID,
|
|
|
|
GIMP_PDB_END);
|
2005-12-29 05:24:12 +08:00
|
|
|
|
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
2006-03-22 20:15:06 +08:00
|
|
|
* gimp_image_raise_vectors_to_top:
|
2000-08-25 07:06:53 +08:00
|
|
|
* @image_ID: The image.
|
2006-03-22 20:15:06 +08:00
|
|
|
* @vectors_ID: The vectors object to raise to top.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2006-03-22 20:15:06 +08:00
|
|
|
* Raise the specified vectors in the image's vectors stack to top of
|
|
|
|
* stack
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2006-03-22 20:15:06 +08:00
|
|
|
* This procedure raises the specified vectors to top of the existing
|
|
|
|
* vectors stack. It will not move the vectors if there is no vectors
|
2003-12-09 01:26:55 +08:00
|
|
|
* above it.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2003-12-09 01:26:55 +08:00
|
|
|
* Returns: TRUE on success.
|
2006-03-22 20:15:06 +08:00
|
|
|
*
|
|
|
|
* Since: GIMP 2.4
|
2000-08-25 07:06:53 +08:00
|
|
|
*/
|
2003-12-09 01:26:55 +08:00
|
|
|
gboolean
|
2006-03-22 20:15:06 +08:00
|
|
|
gimp_image_raise_vectors_to_top (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
gint32 vectors_ID)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
2003-12-09 01:26:55 +08:00
|
|
|
gboolean success = TRUE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2006-03-22 20:15:06 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-raise-vectors-to-top",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_VECTORS, vectors_ID,
|
|
|
|
GIMP_PDB_END);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2003-12-09 01:26:55 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
2000-06-01 20:20:13 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-06-01 20:20:13 +08:00
|
|
|
|
2003-12-09 01:26:55 +08:00
|
|
|
return success;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
2006-03-22 20:15:06 +08:00
|
|
|
* gimp_image_lower_vectors_to_bottom:
|
2000-08-25 07:06:53 +08:00
|
|
|
* @image_ID: The image.
|
2006-03-22 20:15:06 +08:00
|
|
|
* @vectors_ID: The vectors object to lower to bottom.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2006-03-22 20:15:06 +08:00
|
|
|
* Lower the specified vectors in the image's vectors stack to bottom
|
|
|
|
* of stack
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2006-03-22 20:15:06 +08:00
|
|
|
* This procedure lowers the specified vectors to bottom of the
|
|
|
|
* existing vectors stack. It will not move the vectors if there is no
|
|
|
|
* vectors below it.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
2006-03-22 20:15:06 +08:00
|
|
|
*
|
|
|
|
* Since: GIMP 2.4
|
2000-08-25 07:06:53 +08:00
|
|
|
*/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2006-03-22 20:15:06 +08:00
|
|
|
gimp_image_lower_vectors_to_bottom (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
gint32 vectors_ID)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2006-03-22 20:15:06 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-lower-vectors-to-bottom",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_VECTORS, vectors_ID,
|
|
|
|
GIMP_PDB_END);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
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
|
|
|
/**
|
2003-12-09 01:26:55 +08:00
|
|
|
* gimp_image_flatten:
|
2000-08-25 07:06:53 +08:00
|
|
|
* @image_ID: The image.
|
|
|
|
*
|
2003-12-09 01:26:55 +08:00
|
|
|
* Flatten all visible layers into a single layer. Discard all
|
|
|
|
* invisible layers.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2003-12-09 01:26:55 +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.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2003-12-09 01:26:55 +08:00
|
|
|
* Returns: The resulting layer.
|
2000-08-25 07:06:53 +08:00
|
|
|
*/
|
2003-12-09 01:26:55 +08:00
|
|
|
gint32
|
|
|
|
gimp_image_flatten (gint32 image_ID)
|
2000-06-01 20:20:13 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-01 20:20:13 +08:00
|
|
|
gint nreturn_vals;
|
2003-12-09 01:26:55 +08:00
|
|
|
gint32 layer_ID = -1;
|
2000-06-01 20:20:13 +08:00
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-flatten",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_END);
|
2000-06-01 20:20:13 +08:00
|
|
|
|
2003-12-09 01:26:55 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
|
|
|
layer_ID = return_vals[1].data.d_layer;
|
2000-08-23 09:44:59 +08:00
|
|
|
|
2000-06-01 20:20:13 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
2003-12-09 01:26:55 +08:00
|
|
|
return layer_ID;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2002-12-13 21:12:03 +08:00
|
|
|
/**
|
2003-12-09 01:26:55 +08:00
|
|
|
* gimp_image_merge_visible_layers:
|
2002-12-13 21:12:03 +08:00
|
|
|
* @image_ID: The image.
|
2003-12-09 01:26:55 +08:00
|
|
|
* @merge_type: The type of merge.
|
2002-12-13 21:12:03 +08:00
|
|
|
*
|
2003-12-09 01:26:55 +08:00
|
|
|
* Merge the visible image layers into one.
|
2002-12-13 21:12:03 +08:00
|
|
|
*
|
2003-12-09 01:26:55 +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.
|
2002-12-13 21:12:03 +08:00
|
|
|
*
|
2003-12-09 01:26:55 +08:00
|
|
|
* Returns: The resulting layer.
|
2002-12-13 21:12:03 +08:00
|
|
|
*/
|
2003-12-09 01:26:55 +08:00
|
|
|
gint32
|
|
|
|
gimp_image_merge_visible_layers (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
GimpMergeType merge_type)
|
2002-12-13 21:12:03 +08:00
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
2003-12-09 01:26:55 +08:00
|
|
|
gint32 layer_ID = -1;
|
2002-12-13 21:12:03 +08:00
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-merge-visible-layers",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_INT32, merge_type,
|
|
|
|
GIMP_PDB_END);
|
2002-12-13 21:12:03 +08:00
|
|
|
|
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
2003-12-09 01:26:55 +08:00
|
|
|
layer_ID = return_vals[1].data.d_layer;
|
2002-12-13 21:12:03 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
2003-12-09 01:26:55 +08:00
|
|
|
return layer_ID;
|
2002-12-13 21:12:03 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
2003-12-09 01:26:55 +08:00
|
|
|
* gimp_image_merge_down:
|
2000-08-25 07:06:53 +08:00
|
|
|
* @image_ID: The image.
|
2003-12-09 01:26:55 +08:00
|
|
|
* @merge_layer_ID: The layer to merge down from.
|
|
|
|
* @merge_type: The type of merge.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2003-12-09 01:26:55 +08:00
|
|
|
* Merge the layer passed and the first visible layer below.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2003-12-09 01:26:55 +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.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2003-12-09 01:26:55 +08:00
|
|
|
* Returns: The resulting layer.
|
2000-08-25 07:06:53 +08:00
|
|
|
*/
|
1997-11-25 06:05:25 +08:00
|
|
|
gint32
|
2003-12-09 01:26:55 +08:00
|
|
|
gimp_image_merge_down (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
gint32 merge_layer_ID,
|
|
|
|
GimpMergeType merge_type)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
2003-12-09 01:26:55 +08:00
|
|
|
gint32 layer_ID = -1;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-merge-down",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_LAYER, merge_layer_ID,
|
|
|
|
GIMP_PDB_INT32, merge_type,
|
|
|
|
GIMP_PDB_END);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-08-03 09:35:28 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
2003-12-09 01:26:55 +08:00
|
|
|
layer_ID = return_vals[1].data.d_layer;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
2003-12-09 01:26:55 +08:00
|
|
|
return layer_ID;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
2004-11-02 19:30:49 +08:00
|
|
|
* _gimp_image_get_colormap:
|
2000-08-25 07:06:53 +08:00
|
|
|
* @image_ID: The image.
|
2003-12-09 01:26:55 +08:00
|
|
|
* @num_bytes: Number of bytes in the colormap array.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2003-12-09 01:26:55 +08:00
|
|
|
* Returns the image's colormap
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2003-12-09 01:26:55 +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
|
2006-09-14 01:56:40 +08:00
|
|
|
* number of colors in the transmitted colormap will be 'num-bytes' /
|
2006-05-19 21:39:12 +08:00
|
|
|
* 3. If the image is not in Indexed color mode, no colormap is
|
|
|
|
* returned.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2003-12-09 01:26:55 +08:00
|
|
|
* Returns: The image's colormap.
|
2000-08-25 07:06:53 +08:00
|
|
|
*/
|
2003-12-09 01:26:55 +08:00
|
|
|
guint8 *
|
2004-11-02 19:30:49 +08:00
|
|
|
_gimp_image_get_colormap (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
gint *num_bytes)
|
2000-06-01 20:20:13 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-01 20:20:13 +08:00
|
|
|
gint nreturn_vals;
|
2004-11-02 19:30:49 +08:00
|
|
|
guint8 *colormap = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-get-colormap",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_END);
|
2000-06-01 20:20:13 +08:00
|
|
|
|
2003-12-09 01:26:55 +08:00
|
|
|
*num_bytes = 0;
|
|
|
|
|
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
|
|
|
{
|
|
|
|
*num_bytes = return_vals[1].data.d_int32;
|
2004-11-02 19:30:49 +08:00
|
|
|
colormap = g_new (guint8, *num_bytes);
|
2006-04-12 18:34:30 +08:00
|
|
|
memcpy (colormap,
|
|
|
|
return_vals[2].data.d_int8array,
|
|
|
|
*num_bytes * sizeof (guint8));
|
2003-12-09 01:26:55 +08:00
|
|
|
}
|
2000-08-23 09:44:59 +08:00
|
|
|
|
2000-06-01 20:20:13 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
2004-11-02 19:30:49 +08:00
|
|
|
return colormap;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
2004-11-02 19:30:49 +08:00
|
|
|
* _gimp_image_set_colormap:
|
2000-08-25 07:06:53 +08:00
|
|
|
* @image_ID: The image.
|
2003-12-09 01:26:55 +08:00
|
|
|
* @num_bytes: Number of bytes in the colormap array.
|
2004-11-02 19:30:49 +08:00
|
|
|
* @colormap: The new colormap values.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2003-12-09 01:26:55 +08:00
|
|
|
* Sets the entries in the image's colormap.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2003-12-09 01:26:55 +08:00
|
|
|
* This procedure sets the entries in the specified image's colormap.
|
2006-09-14 01:56:40 +08:00
|
|
|
* 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.
|
2000-08-25 07:06:53 +08:00
|
|
|
*/
|
2003-12-09 01:26:55 +08:00
|
|
|
gboolean
|
2004-11-02 19:30:49 +08:00
|
|
|
_gimp_image_set_colormap (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
gint num_bytes,
|
|
|
|
const guint8 *colormap)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
2003-12-09 01:26:55 +08:00
|
|
|
gboolean success = TRUE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-set-colormap",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_INT32, num_bytes,
|
|
|
|
GIMP_PDB_INT8ARRAY, colormap,
|
|
|
|
GIMP_PDB_END);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2003-12-09 01:26:55 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
2003-12-09 01:26:55 +08:00
|
|
|
return success;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2001-04-19 04:41:15 +08:00
|
|
|
/**
|
2003-12-09 01:26:55 +08:00
|
|
|
* gimp_image_clean_all:
|
2001-04-19 04:41:15 +08:00
|
|
|
* @image_ID: The image.
|
|
|
|
*
|
2003-12-09 01:26:55 +08:00
|
|
|
* Set the image dirty count to 0.
|
2001-04-19 04:41:15 +08:00
|
|
|
*
|
2003-12-09 01:26:55 +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,
|
2005-10-29 08:23:14 +08:00
|
|
|
* filled, and installed in the image. Note that save plug-ins must NOT
|
|
|
|
* call this function themselves after saving the image.
|
2001-04-19 04:41:15 +08:00
|
|
|
*
|
2003-12-09 01:26:55 +08:00
|
|
|
* Returns: TRUE on success.
|
2001-04-19 04:41:15 +08:00
|
|
|
*/
|
2003-12-09 01:26:55 +08:00
|
|
|
gboolean
|
|
|
|
gimp_image_clean_all (gint32 image_ID)
|
2001-04-19 04:41:15 +08:00
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
2003-12-09 01:26:55 +08:00
|
|
|
gboolean success = TRUE;
|
2001-04-19 04:41:15 +08:00
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-clean-all",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_END);
|
2001-04-19 04:41:15 +08:00
|
|
|
|
2003-12-09 01:26:55 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
2001-04-19 04:41:15 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
2003-12-09 01:26:55 +08:00
|
|
|
return success;
|
2001-04-19 04:41:15 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
2003-12-09 01:26:55 +08:00
|
|
|
* gimp_image_is_dirty:
|
2000-08-25 07:06:53 +08:00
|
|
|
* @image_ID: The image.
|
|
|
|
*
|
2003-12-09 01:26:55 +08:00
|
|
|
* Checks if the image has unsaved changes.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2003-12-09 01:26:55 +08:00
|
|
|
* This procedure checks the specified image's dirty count to see if it
|
2005-10-29 08:23:14 +08:00
|
|
|
* needs to be saved. Note that saving the image does not automatically
|
2006-06-14 16:32:08 +08:00
|
|
|
* set the dirty count to 0, you need to call gimp_image_clean_all()
|
2005-10-29 08:23:14 +08:00
|
|
|
* after calling a save procedure to make the image clean.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2006-03-25 05:57:47 +08:00
|
|
|
* Returns: TRUE if the image has unsaved changes.
|
2000-08-25 07:06:53 +08:00
|
|
|
*/
|
2003-12-09 01:26:55 +08:00
|
|
|
gboolean
|
|
|
|
gimp_image_is_dirty (gint32 image_ID)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
2003-12-09 01:26:55 +08:00
|
|
|
gboolean dirty = FALSE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-is-dirty",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_END);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-08-03 09:35:28 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
2003-12-09 01:26:55 +08:00
|
|
|
dirty = return_vals[1].data.d_int32;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
2003-12-09 01:26:55 +08:00
|
|
|
return dirty;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
2003-12-09 01:26:55 +08:00
|
|
|
* _gimp_image_thumbnail:
|
2000-08-25 07:06:53 +08:00
|
|
|
* @image_ID: The image.
|
2006-03-15 23:00:01 +08:00
|
|
|
* @width: The requested thumbnail width.
|
|
|
|
* @height: The requested thumbnail height.
|
|
|
|
* @actual_width: The previews width.
|
|
|
|
* @actual_height: The previews height.
|
2003-12-09 01:26:55 +08:00
|
|
|
* @bpp: The previews bpp.
|
|
|
|
* @thumbnail_data_count: The number of bytes in thumbnail data.
|
|
|
|
* @thumbnail_data: The thumbnail data.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2003-12-09 01:26:55 +08:00
|
|
|
* Get a thumbnail of an image.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2003-12-09 01:26:55 +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
|
2004-09-10 17:30:06 +08:00
|
|
|
* 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.
|
2000-08-25 07:06:53 +08:00
|
|
|
*/
|
2003-12-09 01:26:55 +08:00
|
|
|
gboolean
|
|
|
|
_gimp_image_thumbnail (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
gint width,
|
|
|
|
gint height,
|
|
|
|
gint *actual_width,
|
|
|
|
gint *actual_height,
|
|
|
|
gint *bpp,
|
|
|
|
gint *thumbnail_data_count,
|
|
|
|
guint8 **thumbnail_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
2003-12-09 01:26:55 +08:00
|
|
|
gboolean success = TRUE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-thumbnail",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_INT32, width,
|
|
|
|
GIMP_PDB_INT32, height,
|
|
|
|
GIMP_PDB_END);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2006-03-15 23:00:01 +08:00
|
|
|
*actual_width = 0;
|
|
|
|
*actual_height = 0;
|
2003-12-09 01:26:55 +08:00
|
|
|
*bpp = 0;
|
|
|
|
*thumbnail_data_count = 0;
|
|
|
|
*thumbnail_data = NULL;
|
|
|
|
|
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
if (success)
|
|
|
|
{
|
2006-03-15 23:00:01 +08:00
|
|
|
*actual_width = return_vals[1].data.d_int32;
|
|
|
|
*actual_height = return_vals[2].data.d_int32;
|
2003-12-09 01:26:55 +08:00
|
|
|
*bpp = return_vals[3].data.d_int32;
|
|
|
|
*thumbnail_data_count = return_vals[4].data.d_int32;
|
|
|
|
*thumbnail_data = g_new (guint8, *thumbnail_data_count);
|
2006-04-12 18:34:30 +08:00
|
|
|
memcpy (*thumbnail_data,
|
|
|
|
return_vals[5].data.d_int8array,
|
|
|
|
*thumbnail_data_count * sizeof (guint8));
|
2003-12-09 01:26:55 +08:00
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
2003-12-09 01:26:55 +08:00
|
|
|
return success;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_get_active_layer:
|
|
|
|
* @image_ID: The image.
|
|
|
|
*
|
2000-08-25 23:38:38 +08:00
|
|
|
* Returns the specified image's active layer.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* If there is an active layer, its ID will be returned, otherwise, -1.
|
|
|
|
* If a channel is currently active, then no layer will be. If a layer
|
|
|
|
* mask is active, then this will return the associated layer.
|
|
|
|
*
|
|
|
|
* Returns: The active layer.
|
|
|
|
*/
|
2000-06-01 20:20:13 +08:00
|
|
|
gint32
|
|
|
|
gimp_image_get_active_layer (gint32 image_ID)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-05-31 21:24:14 +08:00
|
|
|
gint nreturn_vals;
|
2000-06-01 20:20:13 +08:00
|
|
|
gint32 active_layer_ID = -1;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-get-active-layer",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_END);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-08-03 09:35:28 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
2000-06-01 20:20:13 +08:00
|
|
|
active_layer_ID = return_vals[1].data.d_layer;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
2000-06-01 20:20:13 +08:00
|
|
|
return active_layer_ID;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_set_active_layer:
|
|
|
|
* @image_ID: The image.
|
|
|
|
* @active_layer_ID: The new image active layer.
|
|
|
|
*
|
2000-08-25 23:38:38 +08:00
|
|
|
* Sets the specified image's active layer.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* If the layer exists, it is set as the active layer in the image. Any
|
|
|
|
* previous active layer or channel is set to inactive. An exception is
|
|
|
|
* a previously existing floating selection, in which case this
|
|
|
|
* procedure will return an execution error.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2000-06-01 20:20:13 +08:00
|
|
|
gimp_image_set_active_layer (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
gint32 active_layer_ID)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-set-active-layer",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_LAYER, active_layer_ID,
|
|
|
|
GIMP_PDB_END);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
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
|
|
|
/**
|
|
|
|
* gimp_image_get_active_channel:
|
|
|
|
* @image_ID: The image.
|
|
|
|
*
|
2000-08-25 23:38:38 +08:00
|
|
|
* Returns the specified image's active channel.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* If there is an active channel, this will return the channel ID,
|
|
|
|
* otherwise, -1.
|
|
|
|
*
|
|
|
|
* Returns: The active channel.
|
|
|
|
*/
|
1997-11-25 06:05:25 +08:00
|
|
|
gint32
|
2000-06-01 20:20:13 +08:00
|
|
|
gimp_image_get_active_channel (gint32 image_ID)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
2000-06-01 20:20:13 +08:00
|
|
|
gint32 active_channel_ID = -1;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-get-active-channel",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_END);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-08-03 09:35:28 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
2000-06-01 20:20:13 +08:00
|
|
|
active_channel_ID = return_vals[1].data.d_channel;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
2000-06-01 20:20:13 +08:00
|
|
|
return active_channel_ID;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_set_active_channel:
|
|
|
|
* @image_ID: The image.
|
|
|
|
* @active_channel_ID: The new image active channel.
|
|
|
|
*
|
2000-08-25 23:38:38 +08:00
|
|
|
* Sets the specified image's active channel.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* If the channel exists, it is set as the active channel in the image.
|
|
|
|
* Any previous active channel or channel is set to inactive. An
|
|
|
|
* exception is a previously existing floating selection, in which case
|
|
|
|
* this procedure will return an execution error.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
1997-11-25 06:05:25 +08:00
|
|
|
gimp_image_set_active_channel (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
gint32 active_channel_ID)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-set-active-channel",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_CHANNEL, active_channel_ID,
|
|
|
|
GIMP_PDB_END);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2005-12-29 05:24:12 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_get_active_vectors:
|
|
|
|
* @image_ID: The image.
|
|
|
|
*
|
|
|
|
* Returns the specified image's active vectors.
|
|
|
|
*
|
|
|
|
* If there is an active path, its ID will be returned, otherwise, -1.
|
|
|
|
*
|
|
|
|
* Returns: The active vectors.
|
|
|
|
*/
|
|
|
|
gint32
|
|
|
|
gimp_image_get_active_vectors (gint32 image_ID)
|
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gint32 active_vectors_ID = -1;
|
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp-image-get-active-vectors",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_END);
|
2005-12-29 05:24:12 +08:00
|
|
|
|
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
|
|
|
active_vectors_ID = return_vals[1].data.d_vectors;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return active_vectors_ID;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_image_set_active_vectors:
|
|
|
|
* @image_ID: The image.
|
|
|
|
* @active_vectors_ID: The new image active vectors.
|
|
|
|
*
|
|
|
|
* Sets the specified image's active vectors.
|
|
|
|
*
|
|
|
|
* If the path exists, it is set as the active path in the image.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*/
|
|
|
|
gboolean
|
|
|
|
gimp_image_set_active_vectors (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
gint32 active_vectors_ID)
|
2005-12-29 05:24:12 +08:00
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp-image-set-active-vectors",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_VECTORS, active_vectors_ID,
|
|
|
|
GIMP_PDB_END);
|
2005-12-29 05:24:12 +08:00
|
|
|
|
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_get_selection:
|
|
|
|
* @image_ID: The image.
|
|
|
|
*
|
2000-08-25 23:38:38 +08:00
|
|
|
* Returns the specified image's selection.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2000-08-25 23:38:38 +08:00
|
|
|
* This will always return a valid ID for a selection -- which is
|
2000-08-25 07:06:53 +08:00
|
|
|
* represented as a channel internally.
|
|
|
|
*
|
|
|
|
* Returns: The selection channel.
|
|
|
|
*/
|
2000-06-01 20:20:13 +08:00
|
|
|
gint32
|
|
|
|
gimp_image_get_selection (gint32 image_ID)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
2000-06-01 20:20:13 +08:00
|
|
|
gint32 selection_ID = -1;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-get-selection",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_END);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-08-03 09:35:28 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
2000-06-01 20:20:13 +08:00
|
|
|
selection_ID = return_vals[1].data.d_selection;
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-06-01 20:20:13 +08:00
|
|
|
|
|
|
|
return selection_ID;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_get_component_active:
|
|
|
|
* @image_ID: The image.
|
|
|
|
* @component: The image component.
|
|
|
|
*
|
|
|
|
* Returns if the specified image's image component is active.
|
|
|
|
*
|
|
|
|
* This procedure returns if the specified image's image component
|
|
|
|
* (i.e. Red, Green, Blue intensity channels in an RGB image) is active
|
2000-08-25 23:38:38 +08:00
|
|
|
* or inactive -- whether or not it can be modified. If the specified
|
2000-08-25 07:06:53 +08:00
|
|
|
* component is not valid for the image type, an error is returned.
|
|
|
|
*
|
|
|
|
* Returns: Component is active.
|
|
|
|
*/
|
2000-06-01 20:20:13 +08:00
|
|
|
gboolean
|
|
|
|
gimp_image_get_component_active (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
GimpChannelType component)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
2000-06-23 04:06:02 +08:00
|
|
|
gboolean active = FALSE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-get-component-active",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_INT32, component,
|
|
|
|
GIMP_PDB_END);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-08-03 09:35:28 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
2000-06-01 20:20:13 +08:00
|
|
|
active = return_vals[1].data.d_int32;
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-06-01 20:20:13 +08:00
|
|
|
|
|
|
|
return active;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_set_component_active:
|
|
|
|
* @image_ID: The image.
|
|
|
|
* @component: The image component.
|
|
|
|
* @active: Component is active.
|
|
|
|
*
|
|
|
|
* Sets if the specified image's image component is active.
|
|
|
|
*
|
|
|
|
* This procedure sets if the specified image's image component (i.e.
|
|
|
|
* Red, Green, Blue intensity channels in an RGB image) is active or
|
2000-08-25 23:38:38 +08:00
|
|
|
* inactive -- whether or not it can be modified. If the specified
|
2000-08-25 07:06:53 +08:00
|
|
|
* component is not valid for the image type, an error is returned.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2000-06-01 20:20:13 +08:00
|
|
|
gimp_image_set_component_active (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
GimpChannelType component,
|
|
|
|
gboolean active)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-set-component-active",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_INT32, component,
|
|
|
|
GIMP_PDB_INT32, active,
|
|
|
|
GIMP_PDB_END);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
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
|
|
|
/**
|
|
|
|
* gimp_image_get_component_visible:
|
|
|
|
* @image_ID: The image.
|
|
|
|
* @component: The image component.
|
|
|
|
*
|
|
|
|
* Returns if the specified image's image component is visible.
|
|
|
|
*
|
|
|
|
* This procedure returns if the specified image's image component
|
|
|
|
* (i.e. Red, Green, Blue intensity channels in an RGB image) is
|
2000-08-25 23:38:38 +08:00
|
|
|
* visible or invisible -- whether or not it can be seen. If the
|
2000-08-25 07:06:53 +08:00
|
|
|
* specified component is not valid for the image type, an error is
|
|
|
|
* returned.
|
|
|
|
*
|
|
|
|
* Returns: Component is visible.
|
|
|
|
*/
|
2000-06-01 20:20:13 +08:00
|
|
|
gboolean
|
|
|
|
gimp_image_get_component_visible (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
GimpChannelType component)
|
2000-06-01 20:20:13 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-01 20:20:13 +08:00
|
|
|
gint nreturn_vals;
|
2000-06-23 04:06:02 +08:00
|
|
|
gboolean visible = FALSE;
|
2000-06-01 20:20:13 +08:00
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-get-component-visible",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_INT32, component,
|
|
|
|
GIMP_PDB_END);
|
2000-06-01 20:20:13 +08:00
|
|
|
|
2000-08-03 09:35:28 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
2000-06-01 20:20:13 +08:00
|
|
|
visible = return_vals[1].data.d_int32;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return visible;
|
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_set_component_visible:
|
|
|
|
* @image_ID: The image.
|
|
|
|
* @component: The image component.
|
|
|
|
* @visible: Component is visible.
|
|
|
|
*
|
|
|
|
* Sets if the specified image's image component is visible.
|
|
|
|
*
|
|
|
|
* This procedure sets if the specified image's image component (i.e.
|
|
|
|
* Red, Green, Blue intensity channels in an RGB image) is visible or
|
2000-08-25 23:38:38 +08:00
|
|
|
* 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
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2000-06-01 20:20:13 +08:00
|
|
|
gimp_image_set_component_visible (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
GimpChannelType component,
|
|
|
|
gboolean visible)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-set-component-visible",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_INT32, component,
|
|
|
|
GIMP_PDB_INT32, visible,
|
|
|
|
GIMP_PDB_END);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
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
|
|
|
/**
|
|
|
|
* gimp_image_get_filename:
|
|
|
|
* @image_ID: The image.
|
|
|
|
*
|
2000-08-25 23:38:38 +08:00
|
|
|
* Returns the specified image's filename.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2004-11-14 04:34:43 +08:00
|
|
|
* This procedure returns the specified image's filename in the
|
|
|
|
* filesystem encoding. The image has a filename only if it was loaded
|
|
|
|
* or has since been saved. Otherwise, this function returns %NULL.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* Returns: The filename.
|
|
|
|
*/
|
2000-06-01 20:20:13 +08:00
|
|
|
gchar *
|
|
|
|
gimp_image_get_filename (gint32 image_ID)
|
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-01 20:20:13 +08:00
|
|
|
gint nreturn_vals;
|
|
|
|
gchar *filename = NULL;
|
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-get-filename",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_END);
|
2000-06-01 20:20:13 +08:00
|
|
|
|
2000-08-03 09:35:28 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
2000-06-01 20:20:13 +08:00
|
|
|
filename = g_strdup (return_vals[1].data.d_string);
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return filename;
|
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_set_filename:
|
|
|
|
* @image_ID: The image.
|
|
|
|
* @filename: The new image filename.
|
|
|
|
*
|
2000-08-25 23:38:38 +08:00
|
|
|
* Sets the specified image's filename.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2004-11-14 08:35:24 +08:00
|
|
|
* This procedure sets the specified image's filename. The filename
|
|
|
|
* should be in the filesystem encoding.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2003-07-02 09:20:08 +08:00
|
|
|
gimp_image_set_filename (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
const gchar *filename)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-set-filename",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_STRING, filename,
|
|
|
|
GIMP_PDB_END);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
1998-10-05 18:05:29 +08:00
|
|
|
|
2002-05-08 06:35:29 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_get_name:
|
|
|
|
* @image_ID: The image.
|
|
|
|
*
|
|
|
|
* Returns the specified image's name.
|
|
|
|
*
|
|
|
|
* This procedure returns the specified image's name.
|
|
|
|
*
|
|
|
|
* Returns: The name.
|
|
|
|
*/
|
|
|
|
gchar *
|
|
|
|
gimp_image_get_name (gint32 image_ID)
|
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gchar *name = NULL;
|
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-get-name",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_END);
|
2002-05-08 06:35:29 +08:00
|
|
|
|
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
|
|
|
name = g_strdup (return_vals[1].data.d_string);
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return name;
|
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_get_resolution:
|
|
|
|
* @image_ID: The image.
|
2006-03-17 21:38:06 +08:00
|
|
|
* @xresolution: The resolution in the x-axis, in dots per inch.
|
|
|
|
* @yresolution: The resolution in the y-axis, in dots per inch.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2000-08-25 23:38:38 +08:00
|
|
|
* Returns the specified image's resolution.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2000-08-25 23:38:38 +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.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2000-06-01 20:20:13 +08:00
|
|
|
gimp_image_get_resolution (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
gdouble *xresolution,
|
|
|
|
gdouble *yresolution)
|
1998-10-05 18:05:29 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
1998-11-15 07:28:47 +08:00
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-get-resolution",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_END);
|
1998-10-05 18:05:29 +08:00
|
|
|
|
2000-06-23 04:06:02 +08:00
|
|
|
*xresolution = 0.0;
|
|
|
|
*yresolution = 0.0;
|
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
if (success)
|
2000-06-01 20:20:13 +08:00
|
|
|
{
|
|
|
|
*xresolution = return_vals[1].data.d_float;
|
|
|
|
*yresolution = return_vals[2].data.d_float;
|
|
|
|
}
|
1998-10-05 18:05:29 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
1998-10-05 18:05:29 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_set_resolution:
|
|
|
|
* @image_ID: The image.
|
|
|
|
* @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 23:38:38 +08:00
|
|
|
* Sets the specified image's resolution.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2000-08-25 23:38:38 +08:00
|
|
|
* This procedure sets the specified image's resolution in dots per
|
2000-08-25 07:06:53 +08:00
|
|
|
* inch. This value is independent of any of the layers in this image.
|
|
|
|
* No scaling or resizing is performed.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2000-06-01 20:20:13 +08:00
|
|
|
gimp_image_set_resolution (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
gdouble xresolution,
|
|
|
|
gdouble yresolution)
|
1998-10-05 18:05:29 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
1998-10-05 18:05:29 +08:00
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-set-resolution",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_FLOAT, xresolution,
|
|
|
|
GIMP_PDB_FLOAT, yresolution,
|
|
|
|
GIMP_PDB_END);
|
1998-10-05 18:05:29 +08:00
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
1998-10-05 18:05:29 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
1999-03-17 04:14:07 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_get_unit:
|
|
|
|
* @image_ID: The image.
|
|
|
|
*
|
2000-08-25 23:38:38 +08:00
|
|
|
* Returns the specified image's unit.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2000-08-25 23:38:38 +08:00
|
|
|
* This procedure returns the specified image's unit. This value is
|
2006-06-14 16:32:08 +08:00
|
|
|
* 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
|
|
|
*
|
|
|
|
* Returns: The unit.
|
|
|
|
*/
|
2000-02-08 04:35:13 +08:00
|
|
|
GimpUnit
|
1999-10-04 02:54:54 +08:00
|
|
|
gimp_image_get_unit (gint32 image_ID)
|
1999-03-17 04:14:07 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
2000-06-01 20:20:13 +08:00
|
|
|
GimpUnit unit = 0;
|
1999-03-17 04:14:07 +08:00
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-get-unit",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_END);
|
1999-03-17 04:14:07 +08:00
|
|
|
|
2000-08-03 09:35:28 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
2000-06-01 20:20:13 +08:00
|
|
|
unit = return_vals[1].data.d_unit;
|
1999-03-17 04:14:07 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return unit;
|
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_set_unit:
|
|
|
|
* @image_ID: The image.
|
|
|
|
* @unit: The new image unit.
|
|
|
|
*
|
2000-08-25 23:38:38 +08:00
|
|
|
* Sets the specified image's unit.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2000-08-25 23:38:38 +08:00
|
|
|
* This procedure sets the specified image's unit. No scaling or
|
2000-08-25 07:06:53 +08:00
|
|
|
* resizing is performed. This value is independent of any of the
|
2006-06-14 16:32:08 +08:00
|
|
|
* 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
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2000-02-08 04:35:13 +08:00
|
|
|
gimp_image_set_unit (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
GimpUnit unit)
|
1999-03-17 04:14:07 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
1999-03-17 04:14:07 +08:00
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-set-unit",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_INT32, unit,
|
|
|
|
GIMP_PDB_END);
|
1999-03-17 04:14:07 +08:00
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
1999-03-17 04:14:07 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
1998-10-05 18:05:29 +08:00
|
|
|
}
|
1998-10-08 16:15:21 +08:00
|
|
|
|
2003-12-09 01:26:55 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_get_tattoo_state:
|
|
|
|
* @image_ID: The image.
|
|
|
|
*
|
|
|
|
* Returns the tattoo state associated with the image.
|
|
|
|
*
|
|
|
|
* This procedure returns the tattoo state of the image. Use only by
|
|
|
|
* save/load plugins that wish to preserve an images tattoo state.
|
|
|
|
* Using this function at other times will produce unexpected results.
|
|
|
|
*
|
2006-03-17 21:38:06 +08:00
|
|
|
* Returns: The tattoo state.
|
2003-12-09 01:26:55 +08:00
|
|
|
*/
|
|
|
|
gint
|
|
|
|
gimp_image_get_tattoo_state (gint32 image_ID)
|
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gint tattoo_state = 0;
|
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-get-tattoo-state",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_END);
|
2003-12-09 01:26:55 +08:00
|
|
|
|
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
2006-03-17 21:38:06 +08:00
|
|
|
tattoo_state = return_vals[1].data.d_tattoo;
|
2003-12-09 01:26:55 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return tattoo_state;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_image_set_tattoo_state:
|
|
|
|
* @image_ID: The image.
|
2006-03-17 21:38:06 +08:00
|
|
|
* @tattoo_state: The new image tattoo state.
|
2003-12-09 01:26:55 +08:00
|
|
|
*
|
|
|
|
* Set the tattoo state associated with the image.
|
|
|
|
*
|
|
|
|
* This procedure sets the tattoo state of the image. Use only by
|
|
|
|
* save/load plugins 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.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*/
|
|
|
|
gboolean
|
|
|
|
gimp_image_set_tattoo_state (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
gint tattoo_state)
|
2003-12-09 01:26:55 +08:00
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-set-tattoo-state",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_INT32, tattoo_state,
|
|
|
|
GIMP_PDB_END);
|
2003-12-09 01:26:55 +08:00
|
|
|
|
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_get_layer_by_tattoo:
|
|
|
|
* @image_ID: The image.
|
|
|
|
* @tattoo: The tattoo of the layer to find.
|
|
|
|
*
|
|
|
|
* Find a layer with a given tattoo in an image.
|
|
|
|
*
|
|
|
|
* This procedure returns the layer with the given tattoo in the
|
|
|
|
* specified image.
|
|
|
|
*
|
|
|
|
* Returns: The layer with the specified tattoo.
|
|
|
|
*/
|
1998-10-30 18:21:33 +08:00
|
|
|
gint32
|
2000-06-01 20:20:13 +08:00
|
|
|
gimp_image_get_layer_by_tattoo (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
gint tattoo)
|
1998-10-30 18:21:33 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
2000-06-01 20:20:13 +08:00
|
|
|
gint32 layer_ID = -1;
|
1998-10-30 18:21:33 +08:00
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-get-layer-by-tattoo",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_INT32, tattoo,
|
|
|
|
GIMP_PDB_END);
|
1998-10-30 18:21:33 +08:00
|
|
|
|
2000-08-03 09:35:28 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
2000-06-01 20:20:13 +08:00
|
|
|
layer_ID = return_vals[1].data.d_layer;
|
1998-10-30 18:21:33 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
2000-06-01 20:20:13 +08:00
|
|
|
return layer_ID;
|
1998-10-30 18:21:33 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_get_channel_by_tattoo:
|
|
|
|
* @image_ID: The image.
|
|
|
|
* @tattoo: The tattoo of the channel to find.
|
|
|
|
*
|
|
|
|
* Find a channel with a given tattoo in an image.
|
|
|
|
*
|
|
|
|
* This procedure returns the channel with the given tattoo in the
|
|
|
|
* specified image.
|
|
|
|
*
|
|
|
|
* Returns: The channel with the specified tattoo.
|
|
|
|
*/
|
1998-10-30 18:21:33 +08:00
|
|
|
gint32
|
2000-06-01 20:20:13 +08:00
|
|
|
gimp_image_get_channel_by_tattoo (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
gint tattoo)
|
1998-10-30 18:21:33 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
2000-06-01 20:20:13 +08:00
|
|
|
gint32 channel_ID = -1;
|
1998-10-30 18:21:33 +08:00
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-image-get-channel-by-tattoo",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_INT32, tattoo,
|
|
|
|
GIMP_PDB_END);
|
1998-10-30 18:21:33 +08:00
|
|
|
|
2000-08-03 09:35:28 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
2000-06-01 20:20:13 +08:00
|
|
|
channel_ID = return_vals[1].data.d_channel;
|
2000-05-31 21:24:14 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
2000-06-01 20:20:13 +08:00
|
|
|
return channel_ID;
|
2000-05-31 21:24:14 +08:00
|
|
|
}
|