2006-12-10 05:33:38 +08:00
/* GIMP - The GNU Image Manipulation Program
2003-07-03 08:47:26 +08:00
* Copyright ( C ) 1995 - 2003 Spencer Kimball and Peter Mattis
1997-11-25 06:05:25 +08:00
*
2009-01-18 06:28:01 +08:00
* This program is free software : you can redistribute it and / or modify
1997-11-25 06:05:25 +08:00
* it under the terms of the GNU General Public License as published by
2009-01-18 06:28:01 +08:00
* the Free Software Foundation ; either version 3 of the License , or
1997-11-25 06:05:25 +08:00
* ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
2018-07-12 05:27:07 +08:00
* along with this program . If not , see < https : //www.gnu.org/licenses/>.
1997-11-25 06:05:25 +08:00
*/
2007-01-09 18:52:47 +08:00
/* NOTE: This file is auto-generated by pdbgen.pl. */
1998-01-22 15:02:57 +08:00
2000-12-29 23:22:01 +08:00
# include "config.h"
2015-08-16 19:14:56 +08:00
# include <cairo.h>
2008-10-10 04:24:04 +08:00
# include <gegl.h>
1997-11-25 06:05:25 +08:00
2012-05-03 09:36:22 +08:00
# include <gdk-pixbuf/gdk-pixbuf.h>
2007-07-05 22:31:42 +08:00
# include "libgimpbase/gimpbase.h"
2015-08-16 19:14:56 +08:00
# include "libgimpcolor/gimpcolor.h"
2007-07-05 22:31:42 +08:00
2012-05-04 06:50:23 +08:00
# include "libgimpbase/gimpbase.h"
2001-08-17 22:27:31 +08:00
# include "pdb-types.h"
2000-12-29 23:22:01 +08:00
2002-02-12 10:31:45 +08:00
# include "core/gimp.h"
2002-12-03 20:10:21 +08:00
# include "core/gimpdrawable.h"
2010-09-17 02:36:14 +08:00
# include "core/gimpgrouplayer.h"
2015-08-03 04:18:43 +08:00
# include "core/gimpimage-color-profile.h"
2003-02-13 19:23:50 +08:00
# include "core/gimpimage-undo.h"
2001-05-09 10:32:03 +08:00
# include "core/gimpimage.h"
2003-05-12 23:56:36 +08:00
# include "core/gimpitem-linked.h"
2015-06-17 19:21:01 +08:00
# include "core/gimplayer-new.h"
2001-05-09 10:32:03 +08:00
# include "core/gimplayer.h"
# include "core/gimplayermask.h"
2008-02-08 01:08:54 +08:00
# include "core/gimpparamspecs.h"
2008-11-04 20:07:17 +08:00
# include "core/gimppickable.h"
2008-09-24 16:28:16 +08:00
# include "core/gimpprogress.h"
2017-02-17 16:49:29 +08:00
# include "operations/layer-modes/gimp-layer-modes.h"
2003-02-13 19:23:50 +08:00
2008-02-08 01:08:54 +08:00
# include "gimppdb.h"
# include "gimppdb-utils.h"
2010-09-17 02:33:56 +08:00
# include "gimppdbcontext.h"
2008-02-08 01:08:54 +08:00
# include "gimpprocedure.h"
2008-04-04 19:15:55 +08:00
# include "internal-procs.h"
2006-11-01 03:02:56 +08:00
2008-02-08 01:08:54 +08:00
# include "gimp-intl.h"
1997-11-25 06:05:25 +08:00
2012-05-04 06:50:23 +08:00
static GimpValueArray *
2012-05-29 01:55:28 +08:00
layer_new_invoker ( GimpProcedure * procedure ,
2012-05-04 06:50:23 +08:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
1997-11-25 06:05:25 +08:00
{
1999-04-25 04:33:31 +08:00
gboolean success = TRUE ;
2012-05-04 06:50:23 +08:00
GimpValueArray * return_vals ;
2006-03-24 05:17:16 +08:00
GimpImage * image ;
2019-08-15 20:04:56 +08:00
gint width ;
gint height ;
gint type ;
2006-04-03 00:03:32 +08:00
const gchar * name ;
2002-03-04 22:52:54 +08:00
gdouble opacity ;
2019-08-15 20:04:56 +08:00
gint mode ;
1999-04-25 04:33:31 +08:00
GimpLayer * layer = NULL ;
1997-11-25 06:05:25 +08:00
2019-08-29 17:25:35 +08:00
image = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2012-05-04 06:50:23 +08:00
width = g_value_get_int ( gimp_value_array_index ( args , 1 ) ) ;
height = g_value_get_int ( gimp_value_array_index ( args , 2 ) ) ;
type = g_value_get_enum ( gimp_value_array_index ( args , 3 ) ) ;
name = g_value_get_string ( gimp_value_array_index ( args , 4 ) ) ;
opacity = g_value_get_double ( gimp_value_array_index ( args , 5 ) ) ;
mode = g_value_get_enum ( gimp_value_array_index ( args , 6 ) ) ;
1997-11-25 06:05:25 +08:00
if ( success )
{
2012-05-11 20:30:38 +08:00
GimpImageBaseType base_type = GIMP_RGB ;
gboolean has_alpha = FALSE ;
const Babl * format ;
2017-01-09 08:27:20 +08:00
if ( mode = = GIMP_LAYER_MODE_OVERLAY_LEGACY )
mode = GIMP_LAYER_MODE_SOFTLIGHT_LEGACY ;
2015-04-28 05:48:00 +08:00
2012-05-11 20:30:38 +08:00
switch ( type )
{
case GIMP_RGB_IMAGE :
base_type = GIMP_RGB ;
has_alpha = FALSE ;
break ;
case GIMP_RGBA_IMAGE :
base_type = GIMP_RGB ;
has_alpha = TRUE ;
break ;
case GIMP_GRAY_IMAGE :
base_type = GIMP_GRAY ;
has_alpha = FALSE ;
break ;
case GIMP_GRAYA_IMAGE :
base_type = GIMP_GRAY ;
has_alpha = TRUE ;
break ;
case GIMP_INDEXED_IMAGE :
base_type = GIMP_INDEXED ;
has_alpha = FALSE ;
break ;
case GIMP_INDEXEDA_IMAGE :
base_type = GIMP_INDEXED ;
has_alpha = TRUE ;
break ;
}
Initial space invasion commit in GIMP
All babl formats now have a space equivalent to a color profile,
determining the format's primaries and TRCs. This commit makes GIMP
aware of this.
libgimp:
- enum GimpPrecision: rename GAMMA values to NON_LINEAR and keep GAMMA
as deprecated aliases, add PERCEPTUAL values so we now have LINEAR,
NON_LINEAR and PERCPTUAL for each encoding, matching the babl
encoding variants RGB, R'G'B' and R~G~B~.
- gimp_color_transform_can_gegl_copy() now returns TRUE if both
profiles can return a babl space, increasing the amount of fast babl
color conversions significantly.
- TODO: no solution yet for getting libgimp drawable proxy buffers in
the right format with space.
plug-ins:
- follow the GimpPrecision change.
- TODO: everything else unchanged and partly broken or sub-optimal,
like setting a new image's color profile too late.
app:
- add enum GimpTRCType { LINEAR, NON_LINEAR, PERCEPTUAL } as
replacement for all "linear" booleans.
- change gimp-babl functions to take babl spaces and GimpTRCType
parameters and support all sorts of new perceptual ~ formats.
- a lot of places changed in the early days of goat invasion didn't
take advantage of gimp-babl utility functions and constructed
formats manually. They all needed revisiting and many now use much
simpler code calling gimp-babl API.
- change gimp_babl_format_get_color_profile() to really extract a
newly allocated color profile from the format, and add
gimp_babl_get_builtin_color_profile() which does the same as
gimp_babl_format_get_color_profile() did before. Visited all callers
to decide whether they are looking for the format's actual profile,
or for one of the builtin profiles, simplifying code that only needs
builtin profiles.
- drawables have a new get_space_api(), get_linear() is now get_trc().
- images now have a "layer space" and an API to get it,
gimp_image_get_layer_format() returns formats in that space.
- an image's layer space is created from the image's color profile,
change gimpimage-color-profile to deal with that correctly
- change many babl_format() calls to babl_format_with_space() and take
the space from passed formats or drawables
- add function gimp_layer_fix_format_space() which replaces the
layer's buffer with one that has the image's layer format, but
doesn't change pixel values
- use gimp_layer_fix_format_space() to make sure layers loaded from
XCF and created by plug-ins have the right space when added to the
image, because it's impossible to always assign the right space upon
layer creation
- "assign color profile" and "discard color profile" now require use
of gimp_layer_fix_format_space() too because the profile is now
embedded in all formats via the space. Add
gimp_image_assign_color_profile() which does all that and call it
instead of a simple gimp_image_set_color_profile(), also from the
PDB set-color-profile functions, which are essentially "assign" and
"discard" calls.
- generally, make sure a new image's color profile is set before
adding layers to it, gimp_image_set_color_profile() is more than
before considered know-what-you-are-doing API.
- take special precaution in all places that call
gimp_drawable_convert_type(), we now must pass a new_profile from
all callers that convert layers within the same image (such as
image_convert_type, image_convert_precision), because the layer's
new space can't be determined from the image's layer format during
the call.
- change all "linear" properties to "trc", in all config objects like
for levels and curves, in the histogram, in the widgets. This results
in some GUI that now has three choices instead of two.
TODO: we might want to reduce that back to two later.
- keep "linear" boolean properties around as compat if needed for file
pasring, but always convert the parsed parsed boolean to
GimpTRCType.
- TODO: the image's "enable color management" switch is currently
broken, will fix that in another commit.
2018-07-21 20:23:01 +08:00
if ( base_type = = GIMP_GRAY )
{
/* do not use gimp_image_get_layer_format() because it might
* be the floating selection of a channel or mask , we will
* fix the format in image - add - layer and floating - sel - attach
*/
format = gimp_image_get_format ( image , base_type ,
gimp_image_get_precision ( image ) ,
has_alpha ,
NULL /* will fix later */ ) ;
}
else
{
format = gimp_image_get_layer_format ( image , has_alpha ) ;
}
2012-04-12 00:40:30 +08:00
2012-03-22 03:21:11 +08:00
layer = gimp_layer_new ( image , width , height ,
2012-05-11 20:30:38 +08:00
format , name , opacity / 100.0 , mode ) ;
2006-03-24 05:17:16 +08:00
if ( ! layer )
success = FALSE ;
1997-11-25 06:05:25 +08:00
}
2008-08-16 21:57:57 +08:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
1997-11-25 06:05:25 +08:00
if ( success )
2019-08-29 17:25:35 +08:00
g_value_set_object ( gimp_value_array_index ( return_vals , 1 ) , layer ) ;
1997-11-25 06:05:25 +08:00
2006-03-28 05:09:32 +08:00
return return_vals ;
1997-11-25 06:05:25 +08:00
}
2012-05-04 06:50:23 +08:00
static GimpValueArray *
2012-05-29 01:55:28 +08:00
layer_new_from_visible_invoker ( GimpProcedure * procedure ,
2012-05-04 06:50:23 +08:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2008-08-08 00:09:39 +08:00
{
gboolean success = TRUE ;
2012-05-04 06:50:23 +08:00
GimpValueArray * return_vals ;
2008-08-08 00:09:39 +08:00
GimpImage * image ;
GimpImage * dest_image ;
const gchar * name ;
GimpLayer * layer = NULL ;
2019-08-29 17:25:35 +08:00
image = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
dest_image = g_value_get_object ( gimp_value_array_index ( args , 1 ) ) ;
2012-05-04 06:50:23 +08:00
name = g_value_get_string ( gimp_value_array_index ( args , 2 ) ) ;
2008-08-08 00:09:39 +08:00
if ( success )
{
2015-08-16 19:14:56 +08:00
GimpPickable * pickable = GIMP_PICKABLE ( image ) ;
GimpColorProfile * profile ;
2008-08-08 00:09:39 +08:00
2009-12-14 21:00:01 +08:00
gimp_pickable_flush ( pickable ) ;
2015-08-16 19:14:56 +08:00
profile = gimp_color_managed_get_color_profile ( GIMP_COLOR_MANAGED ( image ) ) ;
2015-06-20 06:33:22 +08:00
2015-06-20 06:02:11 +08:00
layer = gimp_layer_new_from_gegl_buffer ( gimp_pickable_get_buffer ( pickable ) ,
dest_image ,
gimp_image_get_layer_format ( dest_image ,
TRUE ) ,
name ,
GIMP_OPACITY_OPAQUE ,
2017-08-22 02:04:25 +08:00
gimp_image_get_default_new_layer_mode ( dest_image ) ,
2015-08-16 19:14:56 +08:00
profile ) ;
2008-08-08 00:09:39 +08:00
}
2008-08-16 21:57:57 +08:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2008-08-08 00:09:39 +08:00
if ( success )
2019-08-29 17:25:35 +08:00
g_value_set_object ( gimp_value_array_index ( return_vals , 1 ) , layer ) ;
2008-08-08 00:09:39 +08:00
return return_vals ;
}
2012-05-04 06:50:23 +08:00
static GimpValueArray *
2012-05-29 01:55:28 +08:00
layer_new_from_drawable_invoker ( GimpProcedure * procedure ,
2012-05-04 06:50:23 +08:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2003-12-09 01:26:55 +08:00
{
gboolean success = TRUE ;
2012-05-04 06:50:23 +08:00
GimpValueArray * return_vals ;
2003-12-09 01:26:55 +08:00
GimpDrawable * drawable ;
GimpImage * dest_image ;
GimpLayer * layer_copy = NULL ;
2019-08-29 17:25:35 +08:00
drawable = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
dest_image = g_value_get_object ( gimp_value_array_index ( args , 1 ) ) ;
2003-12-09 01:26:55 +08:00
if ( success )
{
GType new_type ;
GimpItem * new_item ;
2004-03-27 00:38:44 +08:00
2003-12-09 01:26:55 +08:00
if ( GIMP_IS_LAYER ( drawable ) )
2004-03-27 00:49:18 +08:00
new_type = G_TYPE_FROM_INSTANCE ( drawable ) ;
2003-12-09 01:26:55 +08:00
else
2004-03-27 00:49:18 +08:00
new_type = GIMP_TYPE_LAYER ;
2004-03-27 00:38:44 +08:00
2013-11-20 04:39:13 +08:00
new_item = gimp_item_convert ( GIMP_ITEM ( drawable ) , dest_image , new_type ) ;
2004-03-27 00:38:44 +08:00
2003-12-09 01:26:55 +08:00
if ( new_item )
2004-03-27 00:49:18 +08:00
layer_copy = GIMP_LAYER ( new_item ) ;
2003-12-09 01:26:55 +08:00
else
2004-03-27 00:49:18 +08:00
success = FALSE ;
2003-12-09 01:26:55 +08:00
}
2008-08-16 21:57:57 +08:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2003-12-09 01:26:55 +08:00
if ( success )
2019-08-29 17:25:35 +08:00
g_value_set_object ( gimp_value_array_index ( return_vals , 1 ) , layer_copy ) ;
2003-12-09 01:26:55 +08:00
2006-03-28 05:09:32 +08:00
return return_vals ;
2003-12-09 01:26:55 +08:00
}
2012-05-04 06:50:23 +08:00
static GimpValueArray *
2012-05-29 01:55:28 +08:00
layer_group_new_invoker ( GimpProcedure * procedure ,
2012-05-04 06:50:23 +08:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2010-09-16 03:18:47 +08:00
{
gboolean success = TRUE ;
2012-05-04 06:50:23 +08:00
GimpValueArray * return_vals ;
2010-09-16 03:18:47 +08:00
GimpImage * image ;
GimpLayer * layer_group = NULL ;
2019-08-29 17:25:35 +08:00
image = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2010-09-16 03:18:47 +08:00
if ( success )
{
layer_group = gimp_group_layer_new ( image ) ;
if ( ! layer_group )
success = FALSE ;
}
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
if ( success )
2019-08-29 17:25:35 +08:00
g_value_set_object ( gimp_value_array_index ( return_vals , 1 ) , layer_group ) ;
2010-09-16 03:18:47 +08:00
return return_vals ;
}
2012-05-04 06:50:23 +08:00
static GimpValueArray *
2012-05-29 01:55:28 +08:00
layer_copy_invoker ( GimpProcedure * procedure ,
2012-05-04 06:50:23 +08:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
1997-11-25 06:05:25 +08:00
{
1999-04-25 04:33:31 +08:00
gboolean success = TRUE ;
2012-05-04 06:50:23 +08:00
GimpValueArray * return_vals ;
1999-04-25 04:33:31 +08:00
GimpLayer * layer ;
gboolean add_alpha ;
2003-08-28 01:21:49 +08:00
GimpLayer * layer_copy = NULL ;
1997-11-25 06:05:25 +08:00
2019-08-29 17:25:35 +08:00
layer = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2012-05-04 06:50:23 +08:00
add_alpha = g_value_get_boolean ( gimp_value_array_index ( args , 1 ) ) ;
1997-11-25 06:05:25 +08:00
if ( success )
2006-03-22 17:58:08 +08:00
{
layer_copy = GIMP_LAYER ( gimp_item_duplicate ( GIMP_ITEM ( layer ) ,
2008-01-08 19:46:15 +08:00
G_TYPE_FROM_INSTANCE ( layer ) ) ) ;
if ( layer_copy )
{
if ( add_alpha )
gimp_layer_add_alpha ( layer_copy ) ;
}
else
{
success = FALSE ;
}
2006-03-22 17:58:08 +08:00
}
1997-11-25 06:05:25 +08:00
2008-08-16 21:57:57 +08:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
1997-11-25 06:05:25 +08:00
if ( success )
2019-08-29 17:25:35 +08:00
g_value_set_object ( gimp_value_array_index ( return_vals , 1 ) , layer_copy ) ;
1997-11-25 06:05:25 +08:00
2006-03-28 05:09:32 +08:00
return return_vals ;
1997-11-25 06:05:25 +08:00
}
2012-05-04 06:50:23 +08:00
static GimpValueArray *
2012-05-29 01:55:28 +08:00
layer_add_alpha_invoker ( GimpProcedure * procedure ,
2012-05-04 06:50:23 +08:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
1997-11-25 06:05:25 +08:00
{
1999-04-25 04:33:31 +08:00
gboolean success = TRUE ;
GimpLayer * layer ;
1997-11-25 06:05:25 +08:00
2019-08-29 17:25:35 +08:00
layer = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
1997-11-25 06:05:25 +08:00
if ( success )
2006-03-16 01:42:12 +08:00
{
2018-04-21 05:32:07 +08:00
if ( gimp_pdb_item_is_modifiable ( GIMP_ITEM ( layer ) ,
2012-11-09 03:46:18 +08:00
GIMP_PDB_ITEM_CONTENT , error ) & &
2009-08-29 15:16:35 +08:00
gimp_pdb_item_is_not_group ( GIMP_ITEM ( layer ) , error ) )
2016-09-21 17:56:25 +08:00
{
gimp_layer_add_alpha ( layer ) ;
}
2009-08-21 02:47:01 +08:00
else
success = FALSE ;
2006-03-16 01:42:12 +08:00
}
1997-11-25 06:05:25 +08:00
2008-08-16 21:57:57 +08:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
1997-11-25 06:05:25 +08:00
}
2012-05-04 06:50:23 +08:00
static GimpValueArray *
2012-05-29 01:55:28 +08:00
layer_flatten_invoker ( GimpProcedure * procedure ,
2012-05-04 06:50:23 +08:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2007-09-16 03:55:35 +08:00
{
gboolean success = TRUE ;
GimpLayer * layer ;
2019-08-29 17:25:35 +08:00
layer = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2007-09-16 03:55:35 +08:00
if ( success )
{
2018-04-21 05:32:07 +08:00
if ( gimp_pdb_item_is_modifiable ( GIMP_ITEM ( layer ) ,
2012-11-09 03:46:18 +08:00
GIMP_PDB_ITEM_CONTENT , error ) & &
2009-08-29 15:16:35 +08:00
gimp_pdb_item_is_not_group ( GIMP_ITEM ( layer ) , error ) )
2016-09-21 17:56:25 +08:00
{
gimp_layer_remove_alpha ( layer , context ) ;
}
2009-08-21 02:47:01 +08:00
else
success = FALSE ;
2007-09-16 03:55:35 +08:00
}
2008-08-16 21:57:57 +08:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2007-09-16 03:55:35 +08:00
}
2012-05-04 06:50:23 +08:00
static GimpValueArray *
2012-05-29 01:55:28 +08:00
layer_scale_invoker ( GimpProcedure * procedure ,
2012-05-04 06:50:23 +08:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
1997-11-25 06:05:25 +08:00
{
1999-04-25 04:33:31 +08:00
gboolean success = TRUE ;
GimpLayer * layer ;
2019-08-15 20:04:56 +08:00
gint new_width ;
gint new_height ;
1999-04-25 04:33:31 +08:00
gboolean local_origin ;
1997-11-25 06:05:25 +08:00
2019-08-29 17:25:35 +08:00
layer = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2012-05-04 06:50:23 +08:00
new_width = g_value_get_int ( gimp_value_array_index ( args , 1 ) ) ;
new_height = g_value_get_int ( gimp_value_array_index ( args , 2 ) ) ;
local_origin = g_value_get_boolean ( gimp_value_array_index ( args , 3 ) ) ;
1997-11-25 06:05:25 +08:00
1999-04-25 04:33:31 +08:00
if ( success )
2004-11-16 21:41:55 +08:00
{
2012-11-09 03:46:18 +08:00
if ( gimp_pdb_item_is_attached ( GIMP_ITEM ( layer ) , NULL ,
2012-11-09 18:17:25 +08:00
GIMP_PDB_ITEM_CONTENT | GIMP_PDB_ITEM_POSITION ,
error ) )
2008-09-24 16:28:16 +08:00
{
2010-09-17 02:33:56 +08:00
GimpPDBContext * pdb_context = GIMP_PDB_CONTEXT ( context ) ;
2008-09-24 16:28:16 +08:00
if ( progress )
2014-07-13 05:45:20 +08:00
gimp_progress_start ( progress , FALSE , _ ( " Scaling " ) ) ;
2008-09-24 16:28:16 +08:00
gimp_item_scale_by_origin ( GIMP_ITEM ( layer ) , new_width , new_height ,
2010-09-17 02:33:56 +08:00
pdb_context - > interpolation , progress ,
2008-09-24 16:28:16 +08:00
local_origin ) ;
if ( progress )
gimp_progress_end ( progress ) ;
}
2006-03-25 05:57:47 +08:00
else
2008-09-24 16:28:16 +08:00
{
success = FALSE ;
}
}
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
}
2012-05-04 06:50:23 +08:00
static GimpValueArray *
2012-05-29 01:55:28 +08:00
layer_resize_invoker ( GimpProcedure * procedure ,
2012-05-04 06:50:23 +08:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
1997-11-25 06:05:25 +08:00
{
1999-04-25 04:33:31 +08:00
gboolean success = TRUE ;
GimpLayer * layer ;
2019-08-15 20:04:56 +08:00
gint new_width ;
gint new_height ;
gint offx ;
gint offy ;
1997-11-25 06:05:25 +08:00
2019-08-29 17:25:35 +08:00
layer = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2012-05-04 06:50:23 +08:00
new_width = g_value_get_int ( gimp_value_array_index ( args , 1 ) ) ;
new_height = g_value_get_int ( gimp_value_array_index ( args , 2 ) ) ;
offx = g_value_get_int ( gimp_value_array_index ( args , 3 ) ) ;
offy = g_value_get_int ( gimp_value_array_index ( args , 4 ) ) ;
1997-11-25 06:05:25 +08:00
1999-04-25 04:33:31 +08:00
if ( success )
2004-11-16 21:41:55 +08:00
{
2012-11-09 03:46:18 +08:00
if ( gimp_pdb_item_is_attached ( GIMP_ITEM ( layer ) , NULL ,
2012-11-09 18:17:25 +08:00
GIMP_PDB_ITEM_CONTENT | GIMP_PDB_ITEM_POSITION ,
error ) )
2016-10-10 06:02:16 +08:00
gimp_item_resize ( GIMP_ITEM ( layer ) , context , GIMP_FILL_TRANSPARENT ,
2006-03-16 01:42:12 +08:00
new_width , new_height , offx , offy ) ;
2006-03-25 05:57:47 +08:00
else
success = FALSE ;
2004-11-16 21:41:55 +08:00
}
1997-11-25 06:05:25 +08:00
2008-08-16 21:57:57 +08:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
1997-11-25 06:05:25 +08:00
}
2012-05-04 06:50:23 +08:00
static GimpValueArray *
2012-05-29 01:55:28 +08:00
layer_resize_to_image_size_invoker ( GimpProcedure * procedure ,
2012-05-04 06:50:23 +08:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2003-10-07 05:22:09 +08:00
{
gboolean success = TRUE ;
GimpLayer * layer ;
2019-08-29 17:25:35 +08:00
layer = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2003-10-07 05:22:09 +08:00
if ( success )
{
2012-11-09 03:46:18 +08:00
if ( gimp_pdb_item_is_attached ( GIMP_ITEM ( layer ) , NULL ,
2012-11-09 18:17:25 +08:00
GIMP_PDB_ITEM_CONTENT | GIMP_PDB_ITEM_POSITION ,
error ) )
2016-10-10 06:02:16 +08:00
gimp_layer_resize_to_image ( layer , context , GIMP_FILL_TRANSPARENT ) ;
2006-03-25 05:57:47 +08:00
else
success = FALSE ;
2003-10-07 05:22:09 +08:00
}
2008-08-16 21:57:57 +08:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2003-10-07 05:22:09 +08:00
}
2012-05-04 06:50:23 +08:00
static GimpValueArray *
2012-05-29 01:55:28 +08:00
layer_set_offsets_invoker ( GimpProcedure * procedure ,
2012-05-04 06:50:23 +08:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
1997-11-25 06:05:25 +08:00
{
1999-04-25 04:33:31 +08:00
gboolean success = TRUE ;
GimpLayer * layer ;
2019-08-15 20:04:56 +08:00
gint offx ;
gint offy ;
1999-04-25 04:33:31 +08:00
2019-08-29 17:25:35 +08:00
layer = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2012-05-04 06:50:23 +08:00
offx = g_value_get_int ( gimp_value_array_index ( args , 1 ) ) ;
offy = g_value_get_int ( gimp_value_array_index ( args , 2 ) ) ;
1997-11-25 06:05:25 +08:00
if ( success )
{
2018-04-21 05:32:07 +08:00
if ( gimp_pdb_item_is_modifiable ( GIMP_ITEM ( layer ) ,
2012-11-09 18:17:25 +08:00
GIMP_PDB_ITEM_POSITION , error ) )
{
2015-06-26 17:56:59 +08:00
gint offset_x ;
gint offset_y ;
2004-03-27 00:38:44 +08:00
2012-11-09 18:17:25 +08:00
gimp_item_get_offset ( GIMP_ITEM ( layer ) , & offset_x , & offset_y ) ;
offx - = offset_x ;
offy - = offset_y ;
2006-03-23 01:19:14 +08:00
2012-11-09 18:17:25 +08:00
if ( gimp_item_get_linked ( GIMP_ITEM ( layer ) ) )
2015-06-26 17:56:59 +08:00
{
gimp_item_linked_translate ( GIMP_ITEM ( layer ) , offx , offy , TRUE ) ;
}
else
{
gimp_item_translate ( GIMP_ITEM ( layer ) , offx , offy , TRUE ) ;
}
2012-11-09 18:17:25 +08:00
}
else
success = FALSE ;
1997-11-25 06:05:25 +08:00
}
2008-08-16 21:57:57 +08:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
1997-11-25 06:05:25 +08:00
}
2012-05-04 06:50:23 +08:00
static GimpValueArray *
2012-05-29 01:55:28 +08:00
layer_create_mask_invoker ( GimpProcedure * procedure ,
2012-05-04 06:50:23 +08:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2003-12-09 01:26:55 +08:00
{
gboolean success = TRUE ;
2012-05-04 06:50:23 +08:00
GimpValueArray * return_vals ;
2003-12-09 01:26:55 +08:00
GimpLayer * layer ;
2019-08-15 20:04:56 +08:00
gint mask_type ;
2003-12-09 01:26:55 +08:00
GimpLayerMask * mask = NULL ;
2019-08-29 17:25:35 +08:00
layer = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2012-05-04 06:50:23 +08:00
mask_type = g_value_get_enum ( gimp_value_array_index ( args , 1 ) ) ;
2003-12-09 01:26:55 +08:00
if ( success )
2006-03-22 17:58:08 +08:00
{
2006-05-15 00:24:31 +08:00
GimpChannel * channel = NULL ;
2006-03-22 17:58:08 +08:00
2014-04-30 02:55:08 +08:00
if ( mask_type = = GIMP_ADD_MASK_CHANNEL )
2006-05-15 00:24:31 +08:00
{
2008-12-28 08:09:33 +08:00
channel = gimp_image_get_active_channel ( gimp_item_get_image ( GIMP_ITEM ( layer ) ) ) ;
2006-05-15 00:24:31 +08:00
if ( ! channel )
success = FALSE ;
}
if ( success )
{
mask = gimp_layer_create_mask ( layer , mask_type , channel ) ;
if ( ! mask )
success = FALSE ;
}
2006-03-22 17:58:08 +08:00
}
2003-12-09 01:26:55 +08:00
2008-08-16 21:57:57 +08:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2003-12-09 01:26:55 +08:00
if ( success )
2019-08-29 17:25:35 +08:00
g_value_set_object ( gimp_value_array_index ( return_vals , 1 ) , mask ) ;
2003-12-09 01:26:55 +08:00
2006-03-28 05:09:32 +08:00
return return_vals ;
2003-12-09 01:26:55 +08:00
}
2012-05-04 06:50:23 +08:00
static GimpValueArray *
2012-05-29 01:55:28 +08:00
layer_get_mask_invoker ( GimpProcedure * procedure ,
2012-05-04 06:50:23 +08:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
1997-11-25 06:05:25 +08:00
{
1999-04-25 04:33:31 +08:00
gboolean success = TRUE ;
2012-05-04 06:50:23 +08:00
GimpValueArray * return_vals ;
1999-04-25 04:33:31 +08:00
GimpLayer * layer ;
2006-03-16 01:42:12 +08:00
GimpLayerMask * mask = NULL ;
1999-04-25 04:33:31 +08:00
2019-08-29 17:25:35 +08:00
layer = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
1997-11-25 06:05:25 +08:00
2006-03-15 23:00:01 +08:00
if ( success )
{
mask = gimp_layer_get_mask ( layer ) ;
}
2008-08-16 21:57:57 +08:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
1999-04-25 04:33:31 +08:00
1997-11-25 06:05:25 +08:00
if ( success )
2019-08-29 17:25:35 +08:00
g_value_set_object ( gimp_value_array_index ( return_vals , 1 ) , mask ) ;
1997-11-25 06:05:25 +08:00
2006-03-28 05:09:32 +08:00
return return_vals ;
1997-11-25 06:05:25 +08:00
}
2012-05-04 06:50:23 +08:00
static GimpValueArray *
2012-05-29 01:55:28 +08:00
layer_from_mask_invoker ( GimpProcedure * procedure ,
2012-05-04 06:50:23 +08:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2004-11-09 00:58:43 +08:00
{
gboolean success = TRUE ;
2012-05-04 06:50:23 +08:00
GimpValueArray * return_vals ;
2004-11-09 00:58:43 +08:00
GimpLayerMask * mask ;
GimpLayer * layer = NULL ;
2019-08-29 17:25:35 +08:00
mask = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2004-11-09 00:58:43 +08:00
if ( success )
{
layer = gimp_layer_mask_get_layer ( mask ) ;
}
2008-08-16 21:57:57 +08:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2004-11-09 00:58:43 +08:00
if ( success )
2019-08-29 17:25:35 +08:00
g_value_set_object ( gimp_value_array_index ( return_vals , 1 ) , layer ) ;
2004-11-09 00:58:43 +08:00
2006-03-28 05:09:32 +08:00
return return_vals ;
2004-11-09 00:58:43 +08:00
}
2012-05-04 06:50:23 +08:00
static GimpValueArray *
2012-05-29 01:55:28 +08:00
layer_add_mask_invoker ( GimpProcedure * procedure ,
2012-05-04 06:50:23 +08:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2003-12-09 06:33:17 +08:00
{
gboolean success = TRUE ;
GimpLayer * layer ;
GimpLayerMask * mask ;
2019-08-29 17:25:35 +08:00
layer = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
mask = g_value_get_object ( gimp_value_array_index ( args , 1 ) ) ;
2003-12-09 06:33:17 +08:00
if ( success )
{
2008-09-17 19:41:54 +08:00
if ( gimp_pdb_item_is_floating ( GIMP_ITEM ( mask ) ,
gimp_item_get_image ( GIMP_ITEM ( layer ) ) ,
2018-02-06 04:32:55 +08:00
error ) )
2008-09-16 05:05:01 +08:00
success = ( gimp_layer_add_mask ( layer , mask , TRUE , error ) = = mask ) ;
2006-03-25 05:57:47 +08:00
else
success = FALSE ;
2003-12-09 06:33:17 +08:00
}
2008-08-16 21:57:57 +08:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2003-12-09 06:33:17 +08:00
}
2012-05-04 06:50:23 +08:00
static GimpValueArray *
2012-05-29 01:55:28 +08:00
layer_remove_mask_invoker ( GimpProcedure * procedure ,
2012-05-04 06:50:23 +08:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2003-12-09 06:33:17 +08:00
{
gboolean success = TRUE ;
GimpLayer * layer ;
2019-08-15 20:04:56 +08:00
gint mode ;
2003-12-09 06:33:17 +08:00
2019-08-29 17:25:35 +08:00
layer = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2012-05-04 06:50:23 +08:00
mode = g_value_get_enum ( gimp_value_array_index ( args , 1 ) ) ;
2003-12-09 06:33:17 +08:00
if ( success )
2004-11-16 21:41:55 +08:00
{
2012-11-09 03:46:18 +08:00
GimpPDBItemModify modify = 0 ;
if ( mode = = GIMP_MASK_APPLY )
modify | = GIMP_PDB_ITEM_CONTENT ;
if ( gimp_pdb_item_is_attached ( GIMP_ITEM ( layer ) , NULL , modify , error ) & &
2018-02-06 04:13:41 +08:00
gimp_layer_get_mask ( layer ) & &
2018-02-06 04:32:55 +08:00
( mode = = GIMP_MASK_DISCARD | |
gimp_pdb_item_is_not_group ( GIMP_ITEM ( layer ) , error ) ) )
2004-11-16 21:41:55 +08:00
gimp_layer_apply_mask ( layer , mode , TRUE ) ;
2006-03-25 05:57:47 +08:00
else
success = FALSE ;
2004-11-16 21:41:55 +08:00
}
2003-12-09 06:33:17 +08:00
2008-08-16 21:57:57 +08:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2003-12-09 06:33:17 +08:00
}
2012-05-04 06:50:23 +08:00
static GimpValueArray *
2012-05-29 01:55:28 +08:00
layer_is_floating_sel_invoker ( GimpProcedure * procedure ,
2012-05-04 06:50:23 +08:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
1997-11-25 06:05:25 +08:00
{
1999-04-25 04:33:31 +08:00
gboolean success = TRUE ;
2012-05-04 06:50:23 +08:00
GimpValueArray * return_vals ;
1999-04-25 04:33:31 +08:00
GimpLayer * layer ;
2006-03-15 23:32:39 +08:00
gboolean is_floating_sel = FALSE ;
1997-11-25 06:05:25 +08:00
2019-08-29 17:25:35 +08:00
layer = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
1997-11-25 06:05:25 +08:00
2006-03-15 23:00:01 +08:00
if ( success )
{
is_floating_sel = gimp_layer_is_floating_sel ( layer ) ;
}
2008-08-16 21:57:57 +08:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2006-04-05 05:11:45 +08:00
if ( success )
2012-05-04 06:50:23 +08:00
g_value_set_boolean ( gimp_value_array_index ( return_vals , 1 ) , is_floating_sel ) ;
2006-04-05 05:11:45 +08:00
return return_vals ;
}
2012-05-04 06:50:23 +08:00
static GimpValueArray *
2012-05-29 01:55:28 +08:00
layer_get_lock_alpha_invoker ( GimpProcedure * procedure ,
2012-05-04 06:50:23 +08:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2006-04-05 05:11:45 +08:00
{
gboolean success = TRUE ;
2012-05-04 06:50:23 +08:00
GimpValueArray * return_vals ;
2006-04-05 05:11:45 +08:00
GimpLayer * layer ;
gboolean lock_alpha = FALSE ;
2019-08-29 17:25:35 +08:00
layer = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2006-04-05 05:11:45 +08:00
if ( success )
{
lock_alpha = gimp_layer_get_lock_alpha ( layer ) ;
}
2008-08-16 21:57:57 +08:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2006-04-05 05:11:45 +08:00
if ( success )
2012-05-04 06:50:23 +08:00
g_value_set_boolean ( gimp_value_array_index ( return_vals , 1 ) , lock_alpha ) ;
2006-04-05 05:11:45 +08:00
return return_vals ;
}
2012-05-04 06:50:23 +08:00
static GimpValueArray *
2012-05-29 01:55:28 +08:00
layer_set_lock_alpha_invoker ( GimpProcedure * procedure ,
2012-05-04 06:50:23 +08:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2006-04-05 05:11:45 +08:00
{
gboolean success = TRUE ;
GimpLayer * layer ;
gboolean lock_alpha ;
2019-08-29 17:25:35 +08:00
layer = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2012-05-04 06:50:23 +08:00
lock_alpha = g_value_get_boolean ( gimp_value_array_index ( args , 1 ) ) ;
2006-04-05 05:11:45 +08:00
if ( success )
{
2009-08-24 01:51:59 +08:00
if ( gimp_layer_can_lock_alpha ( layer ) )
gimp_layer_set_lock_alpha ( layer , lock_alpha , TRUE ) ;
else
success = FALSE ;
2006-04-05 05:11:45 +08:00
}
2008-08-16 21:57:57 +08:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2006-04-05 05:11:45 +08:00
}
2012-05-04 06:50:23 +08:00
static GimpValueArray *
2012-05-29 01:55:28 +08:00
layer_get_apply_mask_invoker ( GimpProcedure * procedure ,
2012-05-04 06:50:23 +08:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2006-04-05 05:11:45 +08:00
{
gboolean success = TRUE ;
2012-05-04 06:50:23 +08:00
GimpValueArray * return_vals ;
2006-04-05 05:11:45 +08:00
GimpLayer * layer ;
gboolean apply_mask = FALSE ;
2019-08-29 17:25:35 +08:00
layer = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2006-04-05 05:11:45 +08:00
if ( success )
{
if ( layer - > mask )
2012-03-18 01:30:13 +08:00
apply_mask = gimp_layer_get_apply_mask ( layer ) ;
2006-04-05 05:11:45 +08:00
else
apply_mask = FALSE ;
}
2008-08-16 21:57:57 +08:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2006-04-05 05:11:45 +08:00
if ( success )
2012-05-04 06:50:23 +08:00
g_value_set_boolean ( gimp_value_array_index ( return_vals , 1 ) , apply_mask ) ;
2006-04-05 05:11:45 +08:00
return return_vals ;
}
2012-05-04 06:50:23 +08:00
static GimpValueArray *
2012-05-29 01:55:28 +08:00
layer_set_apply_mask_invoker ( GimpProcedure * procedure ,
2012-05-04 06:50:23 +08:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2006-04-05 05:11:45 +08:00
{
gboolean success = TRUE ;
GimpLayer * layer ;
gboolean apply_mask ;
2019-08-29 17:25:35 +08:00
layer = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2012-05-04 06:50:23 +08:00
apply_mask = g_value_get_boolean ( gimp_value_array_index ( args , 1 ) ) ;
2006-04-05 05:11:45 +08:00
if ( success )
{
if ( layer - > mask )
2012-03-18 01:30:13 +08:00
gimp_layer_set_apply_mask ( layer , apply_mask , TRUE ) ;
2006-04-05 05:11:45 +08:00
else
success = FALSE ;
}
2008-08-16 21:57:57 +08:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2006-04-05 05:11:45 +08:00
}
2012-05-04 06:50:23 +08:00
static GimpValueArray *
2012-05-29 01:55:28 +08:00
layer_get_show_mask_invoker ( GimpProcedure * procedure ,
2012-05-04 06:50:23 +08:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2006-04-05 05:11:45 +08:00
{
gboolean success = TRUE ;
2012-05-04 06:50:23 +08:00
GimpValueArray * return_vals ;
2006-04-05 05:11:45 +08:00
GimpLayer * layer ;
gboolean show_mask = FALSE ;
2019-08-29 17:25:35 +08:00
layer = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2006-04-05 05:11:45 +08:00
if ( success )
{
if ( layer - > mask )
2012-03-18 01:30:13 +08:00
show_mask = gimp_layer_get_show_mask ( layer ) ;
2006-04-05 05:11:45 +08:00
else
show_mask = FALSE ;
}
2008-08-16 21:57:57 +08:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2006-04-05 05:11:45 +08:00
if ( success )
2012-05-04 06:50:23 +08:00
g_value_set_boolean ( gimp_value_array_index ( return_vals , 1 ) , show_mask ) ;
2006-04-05 05:11:45 +08:00
return return_vals ;
}
2012-05-04 06:50:23 +08:00
static GimpValueArray *
2012-05-29 01:55:28 +08:00
layer_set_show_mask_invoker ( GimpProcedure * procedure ,
2012-05-04 06:50:23 +08:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2006-04-05 05:11:45 +08:00
{
gboolean success = TRUE ;
GimpLayer * layer ;
gboolean show_mask ;
2019-08-29 17:25:35 +08:00
layer = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2012-05-04 06:50:23 +08:00
show_mask = g_value_get_boolean ( gimp_value_array_index ( args , 1 ) ) ;
2006-04-05 05:11:45 +08:00
if ( success )
{
if ( layer - > mask )
2012-03-18 01:30:13 +08:00
gimp_layer_set_show_mask ( layer , show_mask , TRUE ) ;
2006-04-05 05:11:45 +08:00
else
success = FALSE ;
}
2008-08-16 21:57:57 +08:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2006-04-05 05:11:45 +08:00
}
2012-05-04 06:50:23 +08:00
static GimpValueArray *
2012-05-29 01:55:28 +08:00
layer_get_edit_mask_invoker ( GimpProcedure * procedure ,
2012-05-04 06:50:23 +08:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2006-04-05 05:11:45 +08:00
{
gboolean success = TRUE ;
2012-05-04 06:50:23 +08:00
GimpValueArray * return_vals ;
2006-04-05 05:11:45 +08:00
GimpLayer * layer ;
gboolean edit_mask = FALSE ;
2019-08-29 17:25:35 +08:00
layer = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2006-04-05 05:11:45 +08:00
if ( success )
{
if ( layer - > mask )
2012-03-18 01:30:13 +08:00
edit_mask = gimp_layer_get_edit_mask ( layer ) ;
2006-04-05 05:11:45 +08:00
else
edit_mask = FALSE ;
}
2008-08-16 21:57:57 +08:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2006-04-05 05:11:45 +08:00
if ( success )
2012-05-04 06:50:23 +08:00
g_value_set_boolean ( gimp_value_array_index ( return_vals , 1 ) , edit_mask ) ;
2006-04-05 05:11:45 +08:00
return return_vals ;
}
2012-05-04 06:50:23 +08:00
static GimpValueArray *
2012-05-29 01:55:28 +08:00
layer_set_edit_mask_invoker ( GimpProcedure * procedure ,
2012-05-04 06:50:23 +08:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2006-04-05 05:11:45 +08:00
{
gboolean success = TRUE ;
GimpLayer * layer ;
gboolean edit_mask ;
2019-08-29 17:25:35 +08:00
layer = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2012-05-04 06:50:23 +08:00
edit_mask = g_value_get_boolean ( gimp_value_array_index ( args , 1 ) ) ;
2006-04-05 05:11:45 +08:00
if ( success )
{
if ( layer - > mask )
2012-03-18 01:30:13 +08:00
gimp_layer_set_edit_mask ( layer , edit_mask ) ;
2006-04-05 05:11:45 +08:00
else
success = FALSE ;
}
2008-08-16 21:57:57 +08:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
1997-11-25 06:05:25 +08:00
}
2012-05-04 06:50:23 +08:00
static GimpValueArray *
2012-05-29 01:55:28 +08:00
layer_get_opacity_invoker ( GimpProcedure * procedure ,
2012-05-04 06:50:23 +08:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
1997-11-25 06:05:25 +08:00
{
1999-04-25 04:33:31 +08:00
gboolean success = TRUE ;
2012-05-04 06:50:23 +08:00
GimpValueArray * return_vals ;
1999-04-25 04:33:31 +08:00
GimpLayer * layer ;
2006-04-05 05:11:45 +08:00
gdouble opacity = 0.0 ;
1997-11-25 06:05:25 +08:00
2019-08-29 17:25:35 +08:00
layer = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
1997-11-25 06:05:25 +08:00
2006-03-16 01:42:12 +08:00
if ( success )
{
2006-04-05 05:11:45 +08:00
opacity = gimp_layer_get_opacity ( layer ) * 100.0 ;
2006-03-16 01:42:12 +08:00
}
2008-08-16 21:57:57 +08:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
1997-11-25 06:05:25 +08:00
if ( success )
2012-05-04 06:50:23 +08:00
g_value_set_double ( gimp_value_array_index ( return_vals , 1 ) , opacity ) ;
1997-11-25 06:05:25 +08:00
2006-03-28 05:09:32 +08:00
return return_vals ;
1997-11-25 06:05:25 +08:00
}
2012-05-04 06:50:23 +08:00
static GimpValueArray *
2012-05-29 01:55:28 +08:00
layer_set_opacity_invoker ( GimpProcedure * procedure ,
2012-05-04 06:50:23 +08:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
1997-11-25 06:05:25 +08:00
{
1999-04-25 04:33:31 +08:00
gboolean success = TRUE ;
GimpLayer * layer ;
2006-04-05 05:11:45 +08:00
gdouble opacity ;
1999-04-25 04:33:31 +08:00
2019-08-29 17:25:35 +08:00
layer = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2012-05-04 06:50:23 +08:00
opacity = g_value_get_double ( gimp_value_array_index ( args , 1 ) ) ;
1997-11-25 06:05:25 +08:00
if ( success )
2006-03-16 01:42:12 +08:00
{
2006-04-05 05:11:45 +08:00
gimp_layer_set_opacity ( layer , opacity / 100.0 , TRUE ) ;
2006-03-16 01:42:12 +08:00
}
1997-11-25 06:05:25 +08:00
2008-08-16 21:57:57 +08:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
1997-11-25 06:05:25 +08:00
}
2012-05-04 06:50:23 +08:00
static GimpValueArray *
2012-05-29 01:55:28 +08:00
layer_get_mode_invoker ( GimpProcedure * procedure ,
2012-05-04 06:50:23 +08:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2001-05-20 22:15:09 +08:00
{
gboolean success = TRUE ;
2012-05-04 06:50:23 +08:00
GimpValueArray * return_vals ;
2001-05-20 22:15:09 +08:00
GimpLayer * layer ;
2019-08-15 20:04:56 +08:00
gint mode = 0 ;
2001-05-20 22:15:09 +08:00
2019-08-29 17:25:35 +08:00
layer = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2001-05-20 22:15:09 +08:00
2006-03-16 01:42:12 +08:00
if ( success )
{
2006-04-05 05:11:45 +08:00
mode = gimp_layer_get_mode ( layer ) ;
2006-03-16 01:42:12 +08:00
}
2008-08-16 21:57:57 +08:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2001-05-20 22:15:09 +08:00
if ( success )
2012-05-04 06:50:23 +08:00
g_value_set_enum ( gimp_value_array_index ( return_vals , 1 ) , mode ) ;
2001-05-20 22:15:09 +08:00
2006-03-28 05:09:32 +08:00
return return_vals ;
2001-05-20 22:15:09 +08:00
}
2012-05-04 06:50:23 +08:00
static GimpValueArray *
2012-05-29 01:55:28 +08:00
layer_set_mode_invoker ( GimpProcedure * procedure ,
2012-05-04 06:50:23 +08:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2001-05-20 22:15:09 +08:00
{
gboolean success = TRUE ;
GimpLayer * layer ;
2019-08-15 20:04:56 +08:00
gint mode ;
2001-05-20 22:15:09 +08:00
2019-08-29 17:25:35 +08:00
layer = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2012-05-04 06:50:23 +08:00
mode = g_value_get_enum ( gimp_value_array_index ( args , 1 ) ) ;
2001-05-20 22:15:09 +08:00
if ( success )
2006-03-16 01:42:12 +08:00
{
2017-01-09 08:27:20 +08:00
if ( mode = = GIMP_LAYER_MODE_OVERLAY_LEGACY )
mode = GIMP_LAYER_MODE_SOFTLIGHT_LEGACY ;
2015-04-28 05:48:00 +08:00
2017-02-17 16:49:29 +08:00
if ( gimp_viewable_get_children ( GIMP_VIEWABLE ( layer ) ) = = NULL )
{
if ( ! ( gimp_layer_mode_get_context ( mode ) & GIMP_LAYER_MODE_CONTEXT_LAYER ) )
success = FALSE ;
}
else
{
if ( ! ( gimp_layer_mode_get_context ( mode ) & GIMP_LAYER_MODE_CONTEXT_GROUP ) )
success = FALSE ;
}
if ( success )
gimp_layer_set_mode ( layer , mode , TRUE ) ;
2006-03-16 01:42:12 +08:00
}
2001-05-20 22:15:09 +08:00
2008-08-16 21:57:57 +08:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2001-05-20 22:15:09 +08:00
}
2017-02-20 08:17:07 +08:00
static GimpValueArray *
layer_get_blend_space_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
{
gboolean success = TRUE ;
GimpValueArray * return_vals ;
GimpLayer * layer ;
2019-08-15 20:04:56 +08:00
gint blend_space = 0 ;
2017-02-20 08:17:07 +08:00
2019-08-29 17:25:35 +08:00
layer = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2017-02-20 08:17:07 +08:00
if ( success )
{
blend_space = gimp_layer_get_blend_space ( layer ) ;
}
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
if ( success )
g_value_set_enum ( gimp_value_array_index ( return_vals , 1 ) , blend_space ) ;
return return_vals ;
}
static GimpValueArray *
layer_set_blend_space_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
{
gboolean success = TRUE ;
GimpLayer * layer ;
2019-08-15 20:04:56 +08:00
gint blend_space ;
2017-02-20 08:17:07 +08:00
2019-08-29 17:25:35 +08:00
layer = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2017-02-20 08:17:07 +08:00
blend_space = g_value_get_enum ( gimp_value_array_index ( args , 1 ) ) ;
if ( success )
{
gimp_layer_set_blend_space ( layer , blend_space , TRUE ) ;
}
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
}
static GimpValueArray *
layer_get_composite_space_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
{
gboolean success = TRUE ;
GimpValueArray * return_vals ;
GimpLayer * layer ;
2019-08-15 20:04:56 +08:00
gint composite_space = 0 ;
2017-02-20 08:17:07 +08:00
2019-08-29 17:25:35 +08:00
layer = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2017-02-20 08:17:07 +08:00
if ( success )
{
composite_space = gimp_layer_get_composite_space ( layer ) ;
}
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
if ( success )
g_value_set_enum ( gimp_value_array_index ( return_vals , 1 ) , composite_space ) ;
return return_vals ;
}
static GimpValueArray *
layer_set_composite_space_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
{
gboolean success = TRUE ;
GimpLayer * layer ;
2019-08-15 20:04:56 +08:00
gint composite_space ;
2017-02-20 08:17:07 +08:00
2019-08-29 17:25:35 +08:00
layer = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2017-02-20 08:17:07 +08:00
composite_space = g_value_get_enum ( gimp_value_array_index ( args , 1 ) ) ;
if ( success )
{
gimp_layer_set_composite_space ( layer , composite_space , TRUE ) ;
}
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
}
2017-02-02 07:38:25 +08:00
static GimpValueArray *
layer_get_composite_mode_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
{
gboolean success = TRUE ;
GimpValueArray * return_vals ;
GimpLayer * layer ;
2019-08-15 20:04:56 +08:00
gint composite_mode = 0 ;
2017-02-02 07:38:25 +08:00
2019-08-29 17:25:35 +08:00
layer = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2017-02-02 07:38:25 +08:00
if ( success )
{
2017-02-13 06:49:26 +08:00
composite_mode = gimp_layer_get_composite_mode ( layer ) ;
2017-02-02 07:38:25 +08:00
}
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
if ( success )
g_value_set_enum ( gimp_value_array_index ( return_vals , 1 ) , composite_mode ) ;
return return_vals ;
}
static GimpValueArray *
layer_set_composite_mode_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
{
gboolean success = TRUE ;
GimpLayer * layer ;
2019-08-15 20:04:56 +08:00
gint composite_mode ;
2017-02-02 07:38:25 +08:00
2019-08-29 17:25:35 +08:00
layer = g_value_get_object ( gimp_value_array_index ( args , 0 ) ) ;
2017-02-02 07:38:25 +08:00
composite_mode = g_value_get_enum ( gimp_value_array_index ( args , 1 ) ) ;
if ( success )
{
2017-02-13 06:49:26 +08:00
gimp_layer_set_composite_mode ( layer , composite_mode , TRUE ) ;
2017-02-02 07:38:25 +08:00
}
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
}
2006-04-05 05:11:45 +08:00
void
2006-04-26 17:13:47 +08:00
register_layer_procs ( GimpPDB * pdb )
2001-05-20 22:15:09 +08:00
{
2006-04-05 05:11:45 +08:00
GimpProcedure * procedure ;
2001-05-20 22:15:09 +08:00
2006-04-05 05:11:45 +08:00
/*
* gimp - layer - new
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( layer_new_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-layer-new " ) ;
2019-09-09 05:40:34 +08:00
gimp_procedure_set_static_help ( procedure ,
" Create a new layer. " ,
" This procedure creates a new layer with the specified width, height, and type. Name, opacity, and mode are also supplied parameters. The new layer still needs to be added to the image, as this is not automatic. Add the new layer with the 'gimp-image-insert-layer' command. Other attributes such as layer mask modes, and offsets should be set with explicit procedure calls. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 17:25:35 +08:00
gimp_param_spec_image ( " image " ,
" image " ,
" The image to which to add the layer " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-15 20:04:56 +08:00
g_param_spec_int ( " width " ,
" width " ,
" The layer width " ,
1 , GIMP_MAX_IMAGE_SIZE , 1 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-15 20:04:56 +08:00
g_param_spec_int ( " height " ,
" height " ,
" The layer height " ,
1 , GIMP_MAX_IMAGE_SIZE , 1 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
g_param_spec_enum ( " type " ,
" type " ,
2006-05-19 01:25:15 +08:00
" The layer type " ,
2006-04-05 05:11:45 +08:00
GIMP_TYPE_IMAGE_TYPE ,
GIMP_RGB_IMAGE ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_string ( " name " ,
" name " ,
" The layer name " ,
2007-04-25 22:23:05 +08:00
FALSE , TRUE , FALSE ,
2006-04-05 05:11:45 +08:00
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
g_param_spec_double ( " opacity " ,
" opacity " ,
2006-05-19 01:25:15 +08:00
" The layer opacity " ,
2006-04-05 05:11:45 +08:00
0 , 100 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
g_param_spec_enum ( " mode " ,
" mode " ,
2006-05-19 01:25:15 +08:00
" The layer combination mode " ,
2017-01-09 06:00:19 +08:00
GIMP_TYPE_LAYER_MODE ,
2017-08-20 02:33:47 +08:00
GIMP_LAYER_MODE_NORMAL ,
2006-04-05 05:11:45 +08:00
GIMP_PARAM_READWRITE ) ) ;
2008-08-08 00:09:39 +08:00
gimp_procedure_add_return_value ( procedure ,
2019-08-29 17:25:35 +08:00
gimp_param_spec_layer ( " layer " ,
" layer " ,
" The newly created layer " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2008-08-08 00:09:39 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
g_object_unref ( procedure ) ;
/*
* gimp - layer - new - from - visible
*/
procedure = gimp_procedure_new ( layer_new_from_visible_invoker ) ;
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-layer-new-from-visible " ) ;
2019-09-09 05:40:34 +08:00
gimp_procedure_set_static_help ( procedure ,
" Create a new layer from what is visible in an image. " ,
" This procedure creates a new layer from what is visible in the given image. The new layer still needs to be added to the destination image, as this is not automatic. Add the new layer with the 'gimp-image-insert-layer' command. Other attributes such as layer mask modes, and offsets should be set with explicit procedure calls. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Sven Neumann <sven@gimp.org> " ,
" Sven Neumann " ,
" 2008 " ) ;
2008-08-08 00:09:39 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 17:25:35 +08:00
gimp_param_spec_image ( " image " ,
" image " ,
" The source image from where the content is copied " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2008-08-08 00:09:39 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 17:25:35 +08:00
gimp_param_spec_image ( " dest-image " ,
" dest image " ,
" The destination image to which to add the layer " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2008-08-08 00:09:39 +08:00
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_string ( " name " ,
" name " ,
" The layer name " ,
FALSE , TRUE , FALSE ,
NULL ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_return_value ( procedure ,
2019-08-29 17:25:35 +08:00
gimp_param_spec_layer ( " layer " ,
" layer " ,
" The newly created layer " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
2001-05-20 22:15:09 +08:00
2006-04-05 05:11:45 +08:00
/*
* gimp - layer - new - from - drawable
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( layer_new_from_drawable_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-layer-new-from-drawable " ) ;
2019-09-09 05:40:34 +08:00
gimp_procedure_set_static_help ( procedure ,
" Create a new layer by copying an existing drawable. " ,
" This procedure creates a new layer as a copy of the specified drawable. The new layer still needs to be added to the image, as this is not automatic. Add the new layer with the 'gimp-image-insert-layer' command. Other attributes such as layer mask modes, and offsets should be set with explicit procedure calls. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 17:25:35 +08:00
gimp_param_spec_drawable ( " drawable " ,
" drawable " ,
" The source drawable from where the new layer is copied " ,
FALSE ,
2006-04-05 05:11:45 +08:00
GIMP_PARAM_READWRITE ) ) ;
2019-08-29 17:25:35 +08:00
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_image ( " dest-image " ,
" dest image " ,
" The destination image to which to add the layer " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_return_value ( procedure ,
2019-08-29 17:25:35 +08:00
gimp_param_spec_layer ( " layer-copy " ,
" layer copy " ,
" The newly copied layer " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
2006-04-05 05:11:45 +08:00
2010-09-16 03:18:47 +08:00
/*
* gimp - layer - group - new
*/
procedure = gimp_procedure_new ( layer_group_new_invoker ) ;
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-layer-group-new " ) ;
2019-09-09 05:40:34 +08:00
gimp_procedure_set_static_help ( procedure ,
" Create a new layer group. " ,
" This procedure creates a new layer group. Attributes such as layer mode and opacity should be set with explicit procedure calls. Add the new layer group (which is a kind of layer) with the 'gimp-image-insert-layer' command. \n "
2014-05-03 15:38:04 +08:00
" Other procedures useful with layer groups: 'gimp-image-reorder-item', 'gimp-item-get-parent', 'gimp-item-get-children', 'gimp-item-is-group'. " ,
2019-09-09 05:40:34 +08:00
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Barak Itkin <lightningismyname@gmail.com> " ,
" Barak Itkin " ,
" 2010 " ) ;
2010-09-16 03:18:47 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 17:25:35 +08:00
gimp_param_spec_image ( " image " ,
" image " ,
" The image to which to add the layer group " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2010-09-16 03:18:47 +08:00
gimp_procedure_add_return_value ( procedure ,
2019-08-29 17:25:35 +08:00
gimp_param_spec_layer ( " layer-group " ,
" layer group " ,
" The newly created layer group " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2010-09-16 03:18:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
g_object_unref ( procedure ) ;
2006-04-05 05:11:45 +08:00
/*
* gimp - layer - copy
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( layer_copy_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-layer-copy " ) ;
2019-09-09 05:40:34 +08:00
gimp_procedure_set_static_help ( procedure ,
" Copy a layer. " ,
" This procedure copies the specified layer and returns the copy. The newly copied layer is for use within the original layer's image. It should not be subsequently added to any other image. The copied layer can optionally have an added alpha channel. This is useful if the background layer in an image is being copied and added to the same image. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 17:25:35 +08:00
gimp_param_spec_layer ( " layer " ,
" layer " ,
" The layer to copy " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
g_param_spec_boolean ( " add-alpha " ,
" add alpha " ,
" Add an alpha channel to the copied layer " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
2019-08-29 17:25:35 +08:00
gimp_param_spec_layer ( " layer-copy " ,
" layer copy " ,
" The newly copied layer " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
2006-04-05 05:11:45 +08:00
/*
* gimp - layer - add - alpha
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( layer_add_alpha_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-layer-add-alpha " ) ;
2019-09-09 05:40:34 +08:00
gimp_procedure_set_static_help ( procedure ,
" Add an alpha channel to the layer if it doesn't already have one. " ,
" This procedure adds an additional component to the specified layer if it does not already possess an alpha channel. An alpha channel makes it possible to clear and erase to transparency, instead of the background color. This transforms layers of type RGB to RGBA, GRAY to GRAYA, and INDEXED to INDEXEDA. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 17:25:35 +08:00
gimp_param_spec_layer ( " layer " ,
" layer " ,
" The layer " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
2006-04-05 05:11:45 +08:00
2007-09-16 03:55:35 +08:00
/*
* gimp - layer - flatten
*/
procedure = gimp_procedure_new ( layer_flatten_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-layer-flatten " ) ;
2019-09-09 05:40:34 +08:00
gimp_procedure_set_static_help ( procedure ,
" Remove the alpha channel from the layer if it has one. " ,
" This procedure removes the alpha channel from a layer, blending all (partially) transparent pixels in the layer against the background color. This transforms layers of type RGBA to RGB, GRAYA to GRAY, and INDEXEDA to INDEXED. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Michael Natterer <mitch@gimp.org> " ,
" Michael Natterer " ,
" 2007 " ) ;
2007-09-16 03:55:35 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 17:25:35 +08:00
gimp_param_spec_layer ( " layer " ,
" layer " ,
" The layer " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2007-09-16 03:55:35 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
g_object_unref ( procedure ) ;
2006-04-05 05:11:45 +08:00
/*
* gimp - layer - scale
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( layer_scale_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-layer-scale " ) ;
2019-09-09 05:40:34 +08:00
gimp_procedure_set_static_help ( procedure ,
" Scale the layer using the default interpolation method. " ,
" This procedure scales the layer so that its new width and height are equal to the supplied parameters. The 'local-origin' parameter specifies whether to scale from the center of the layer, or from the image origin. This operation only works if the layer has been added to an image. The interpolation method used can be set with 'gimp-context-set-interpolation'. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 17:25:35 +08:00
gimp_param_spec_layer ( " layer " ,
" layer " ,
" The layer " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-15 20:04:56 +08:00
g_param_spec_int ( " new-width " ,
" new width " ,
" New layer width " ,
1 , GIMP_MAX_IMAGE_SIZE , 1 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-15 20:04:56 +08:00
g_param_spec_int ( " new-height " ,
" new height " ,
" New layer height " ,
1 , GIMP_MAX_IMAGE_SIZE , 1 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
g_param_spec_boolean ( " local-origin " ,
" local origin " ,
" Use a local origin (as opposed to the image origin) " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
2006-04-05 05:11:45 +08:00
/*
* gimp - layer - resize
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( layer_resize_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-layer-resize " ) ;
2019-09-09 05:40:34 +08:00
gimp_procedure_set_static_help ( procedure ,
" Resize the layer to the specified extents. " ,
" This procedure resizes the layer so that its new width and height are equal to the supplied parameters. Offsets are also provided which describe the position of the previous layer's content. This operation only works if the layer has been added to an image. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 17:25:35 +08:00
gimp_param_spec_layer ( " layer " ,
" layer " ,
" The layer " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-15 20:04:56 +08:00
g_param_spec_int ( " new-width " ,
" new width " ,
" New layer width " ,
1 , GIMP_MAX_IMAGE_SIZE , 1 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-15 20:04:56 +08:00
g_param_spec_int ( " new-height " ,
" new height " ,
" New layer height " ,
1 , GIMP_MAX_IMAGE_SIZE , 1 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-15 20:04:56 +08:00
g_param_spec_int ( " offx " ,
" offx " ,
" x offset between upper left corner of old and new layers: (old - new) " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-15 20:04:56 +08:00
g_param_spec_int ( " offy " ,
" offy " ,
" y offset between upper left corner of old and new layers: (old - new) " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
2001-05-20 22:15:09 +08:00
2006-04-05 05:11:45 +08:00
/*
* gimp - layer - resize - to - image - size
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( layer_resize_to_image_size_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-layer-resize-to-image-size " ) ;
2019-09-09 05:40:34 +08:00
gimp_procedure_set_static_help ( procedure ,
" Resize a layer to the image size. " ,
" This procedure resizes the layer so that it's new width and height are equal to the width and height of its image container. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Manish Singh " ,
" Manish Singh " ,
" 2003 " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 17:25:35 +08:00
gimp_param_spec_layer ( " layer " ,
" layer " ,
" The layer to resize " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
2001-05-20 22:15:09 +08:00
2006-04-05 05:11:45 +08:00
/*
* gimp - layer - set - offsets
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( layer_set_offsets_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-layer-set-offsets " ) ;
2019-09-09 05:40:34 +08:00
gimp_procedure_set_static_help ( procedure ,
" Set the layer offsets. " ,
" This procedure sets the offsets for the specified layer. The offsets are relative to the image origin and can be any values. This operation is valid only on layers which have been added to an image. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 17:25:35 +08:00
gimp_param_spec_layer ( " layer " ,
" layer " ,
" The layer " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-15 20:04:56 +08:00
g_param_spec_int ( " offx " ,
" offx " ,
" Offset in x direction " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-15 20:04:56 +08:00
g_param_spec_int ( " offy " ,
" offy " ,
" Offset in y direction " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
2001-05-20 22:15:09 +08:00
2006-04-05 05:11:45 +08:00
/*
* gimp - layer - create - mask
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( layer_create_mask_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-layer-create-mask " ) ;
2019-09-09 05:40:34 +08:00
gimp_procedure_set_static_help ( procedure ,
" Create a layer mask for the specified layer. " ,
" This procedure creates a layer mask for the specified layer. \n "
2013-09-30 17:20:49 +08:00
" Layer masks serve as an additional alpha channel for a layer. Different types of masks are allowed for initialisation: \n "
" - white mask (leaves the layer fully visible); \n "
" - black mask (gives the layer complete transparency); \n "
" - the layer's alpha channel (either a copy, or a transfer, which leaves the layer fully visible, but which may be more useful than a white mask); \n "
" - the current selection; \n "
" - a grayscale copy of the layer; \n "
" - or a copy of the active channel. \n "
" \n "
" The layer mask still needs to be added to the layer. This can be done with a call to 'gimp-layer-add-mask'. \n "
" \n "
" 'gimp-layer-create-mask' will fail if there are no active channels on the image, when called with 'ADD-CHANNEL-MASK'. It will return a black mask when called with 'ADD-ALPHA-MASK' or 'ADD-ALPHA-TRANSFER-MASK' on a layer with no alpha channels, or with 'ADD-SELECTION-MASK' when there is no selection on the image. " ,
2019-09-09 05:40:34 +08:00
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 17:25:35 +08:00
gimp_param_spec_layer ( " layer " ,
" layer " ,
" The layer to which to add the mask " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
g_param_spec_enum ( " mask-type " ,
" mask type " ,
2006-05-19 01:25:15 +08:00
" The type of mask " ,
2006-04-05 05:11:45 +08:00
GIMP_TYPE_ADD_MASK_TYPE ,
2014-04-30 02:55:08 +08:00
GIMP_ADD_MASK_WHITE ,
2006-04-05 05:11:45 +08:00
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
2019-08-29 17:25:35 +08:00
gimp_param_spec_layer_mask ( " mask " ,
" mask " ,
" The newly created mask " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
2001-05-20 22:15:09 +08:00
2006-04-05 05:11:45 +08:00
/*
* gimp - layer - get - mask
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( layer_get_mask_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-layer-get-mask " ) ;
2019-09-09 05:40:34 +08:00
gimp_procedure_set_static_help ( procedure ,
" Get the specified layer's mask if it exists. " ,
" This procedure returns the specified layer's mask, or -1 if none exists. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 17:25:35 +08:00
gimp_param_spec_layer ( " layer " ,
" layer " ,
" The layer " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_return_value ( procedure ,
2019-08-29 17:25:35 +08:00
gimp_param_spec_layer_mask ( " mask " ,
" mask " ,
" The layer mask " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
2001-05-20 22:15:09 +08:00
2006-04-05 05:11:45 +08:00
/*
* gimp - layer - from - mask
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( layer_from_mask_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-layer-from-mask " ) ;
2019-09-09 05:40:34 +08:00
gimp_procedure_set_static_help ( procedure ,
" Get the specified mask's layer. " ,
" This procedure returns the specified mask's layer , or -1 if none exists. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Geert Jordaens " ,
" Geert Jordaens " ,
" 2004 " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 17:25:35 +08:00
gimp_param_spec_layer_mask ( " mask " ,
" mask " ,
" Mask for which to return the layer " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_return_value ( procedure ,
2019-08-29 17:25:35 +08:00
gimp_param_spec_layer ( " layer " ,
" layer " ,
" The mask's layer " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
2001-05-20 22:15:09 +08:00
2006-04-05 05:11:45 +08:00
/*
* gimp - layer - add - mask
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( layer_add_mask_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-layer-add-mask " ) ;
2019-09-09 05:40:34 +08:00
gimp_procedure_set_static_help ( procedure ,
" Add a layer mask to the specified layer. " ,
" This procedure adds a layer mask to the specified layer. Layer masks serve as an additional alpha channel for a layer. This procedure will fail if a number of prerequisites aren't met. The layer cannot already have a layer mask. The specified mask must exist and have the same dimensions as the layer. The layer must have been created for use with the specified image and the mask must have been created with the procedure 'gimp-layer-create-mask'. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 17:25:35 +08:00
gimp_param_spec_layer ( " layer " ,
" layer " ,
" The layer to receive the mask " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 17:25:35 +08:00
gimp_param_spec_layer_mask ( " mask " ,
" mask " ,
" The mask to add to the layer " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
2001-05-20 22:15:09 +08:00
2006-04-05 05:11:45 +08:00
/*
* gimp - layer - remove - mask
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( layer_remove_mask_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-layer-remove-mask " ) ;
2019-09-09 05:40:34 +08:00
gimp_procedure_set_static_help ( procedure ,
" Remove the specified layer mask from the layer. " ,
" This procedure removes the specified layer mask from the layer. If the mask doesn't exist, an error is returned. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 17:25:35 +08:00
gimp_param_spec_layer ( " layer " ,
" layer " ,
" The layer from which to remove mask " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
g_param_spec_enum ( " mode " ,
" mode " ,
2006-05-19 01:25:15 +08:00
" Removal mode " ,
2006-04-05 05:11:45 +08:00
GIMP_TYPE_MASK_APPLY_MODE ,
GIMP_MASK_APPLY ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
2001-05-20 22:15:09 +08:00
2006-04-05 05:11:45 +08:00
/*
* gimp - layer - is - floating - sel
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( layer_is_floating_sel_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-layer-is-floating-sel " ) ;
2019-09-09 05:40:34 +08:00
gimp_procedure_set_static_help ( procedure ,
" Is the specified layer a floating selection? " ,
" This procedure returns whether the layer is a floating selection. Floating selections are special cases of layers which are attached to a specific drawable. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 17:25:35 +08:00
gimp_param_spec_layer ( " layer " ,
" layer " ,
" The layer " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_return_value ( procedure ,
g_param_spec_boolean ( " is-floating-sel " ,
" is floating sel " ,
" TRUE if the layer is a floating selection " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
2001-05-20 22:15:09 +08:00
2006-04-05 05:11:45 +08:00
/*
* gimp - layer - get - lock - alpha
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( layer_get_lock_alpha_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-layer-get-lock-alpha " ) ;
2019-09-09 05:40:34 +08:00
gimp_procedure_set_static_help ( procedure ,
" Get the lock alpha channel setting of the specified layer. " ,
" This procedure returns the specified layer's lock alpha channel setting. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 17:25:35 +08:00
gimp_param_spec_layer ( " layer " ,
" layer " ,
" The layer " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_return_value ( procedure ,
g_param_spec_boolean ( " lock-alpha " ,
" lock alpha " ,
" The layer's lock alpha channel setting " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
2001-05-20 22:15:09 +08:00
2006-04-05 05:11:45 +08:00
/*
* gimp - layer - set - lock - alpha
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( layer_set_lock_alpha_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-layer-set-lock-alpha " ) ;
2019-09-09 05:40:34 +08:00
gimp_procedure_set_static_help ( procedure ,
" Set the lock alpha channel setting of the specified layer. " ,
" This procedure sets the specified layer's lock alpha channel setting. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 17:25:35 +08:00
gimp_param_spec_layer ( " layer " ,
" layer " ,
" The layer " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
g_param_spec_boolean ( " lock-alpha " ,
" lock alpha " ,
" The new layer's lock alpha channel setting " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
1997-11-25 06:05:25 +08:00
2006-04-05 05:11:45 +08:00
/*
* gimp - layer - get - apply - mask
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( layer_get_apply_mask_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-layer-get-apply-mask " ) ;
2019-09-09 05:40:34 +08:00
gimp_procedure_set_static_help ( procedure ,
" Get the apply mask setting of the specified layer. " ,
" This procedure returns the specified layer's apply mask setting. If the value is TRUE, then the layer mask for this layer is currently being composited with the layer's alpha channel. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 17:25:35 +08:00
gimp_param_spec_layer ( " layer " ,
" layer " ,
" The layer " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_return_value ( procedure ,
g_param_spec_boolean ( " apply-mask " ,
" apply mask " ,
" The layer's apply mask setting " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
1997-11-25 06:05:25 +08:00
2006-04-05 05:11:45 +08:00
/*
* gimp - layer - set - apply - mask
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( layer_set_apply_mask_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-layer-set-apply-mask " ) ;
2019-09-09 05:40:34 +08:00
gimp_procedure_set_static_help ( procedure ,
" Set the apply mask setting of the specified layer. " ,
" This procedure sets the specified layer's apply mask setting. This controls whether the layer's mask is currently affecting the alpha channel. If there is no layer mask, this function will return an error. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 17:25:35 +08:00
gimp_param_spec_layer ( " layer " ,
" layer " ,
" The layer " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
g_param_spec_boolean ( " apply-mask " ,
" apply mask " ,
" The new layer's apply mask setting " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
1997-11-25 06:05:25 +08:00
2006-04-05 05:11:45 +08:00
/*
* gimp - layer - get - show - mask
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( layer_get_show_mask_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-layer-get-show-mask " ) ;
2019-09-09 05:40:34 +08:00
gimp_procedure_set_static_help ( procedure ,
" Get the show mask setting of the specified layer. " ,
" This procedure returns the specified layer's show mask setting. This controls whether the layer or its mask is visible. TRUE indicates that the mask should be visible. If the layer has no mask, then this function returns an error. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 17:25:35 +08:00
gimp_param_spec_layer ( " layer " ,
" layer " ,
" The layer " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_return_value ( procedure ,
g_param_spec_boolean ( " show-mask " ,
" show mask " ,
" The layer's show mask setting " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
1999-04-25 04:33:31 +08:00
2006-04-05 05:11:45 +08:00
/*
* gimp - layer - set - show - mask
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( layer_set_show_mask_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-layer-set-show-mask " ) ;
2019-09-09 05:40:34 +08:00
gimp_procedure_set_static_help ( procedure ,
" Set the show mask setting of the specified layer. " ,
" This procedure sets the specified layer's show mask setting. This controls whether the layer or its mask is visible. TRUE indicates that the mask should be visible. If there is no layer mask, this function will return an error. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 17:25:35 +08:00
gimp_param_spec_layer ( " layer " ,
" layer " ,
" The layer " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
g_param_spec_boolean ( " show-mask " ,
" show mask " ,
" The new layer's show mask setting " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
1997-11-25 06:05:25 +08:00
2006-04-05 05:11:45 +08:00
/*
* gimp - layer - get - edit - mask
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( layer_get_edit_mask_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-layer-get-edit-mask " ) ;
2019-09-09 05:40:34 +08:00
gimp_procedure_set_static_help ( procedure ,
" Get the edit mask setting of the specified layer. " ,
" This procedure returns the specified layer's edit mask setting. If the value is TRUE, then the layer mask for this layer is currently active, and not the layer. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 17:25:35 +08:00
gimp_param_spec_layer ( " layer " ,
" layer " ,
" The layer " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_return_value ( procedure ,
g_param_spec_boolean ( " edit-mask " ,
" edit mask " ,
" The layer's edit mask setting " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
1997-11-25 06:05:25 +08:00
2006-04-05 05:11:45 +08:00
/*
* gimp - layer - set - edit - mask
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( layer_set_edit_mask_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-layer-set-edit-mask " ) ;
2019-09-09 05:40:34 +08:00
gimp_procedure_set_static_help ( procedure ,
" Set the edit mask setting of the specified layer. " ,
" This procedure sets the specified layer's edit mask setting. This controls whether the layer or it's mask is currently active for editing. If the specified layer has no layer mask, then this procedure will return an error. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 17:25:35 +08:00
gimp_param_spec_layer ( " layer " ,
" layer " ,
" The layer " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
g_param_spec_boolean ( " edit-mask " ,
" edit mask " ,
" The new layer's edit mask setting " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
1997-11-25 06:05:25 +08:00
2006-04-05 05:11:45 +08:00
/*
* gimp - layer - get - opacity
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( layer_get_opacity_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-layer-get-opacity " ) ;
2019-09-09 05:40:34 +08:00
gimp_procedure_set_static_help ( procedure ,
" Get the opacity of the specified layer. " ,
" This procedure returns the specified layer's opacity. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 17:25:35 +08:00
gimp_param_spec_layer ( " layer " ,
" layer " ,
" The layer " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_return_value ( procedure ,
g_param_spec_double ( " opacity " ,
" opacity " ,
" The layer opacity " ,
0 , 100 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
1997-11-25 06:05:25 +08:00
2006-04-05 05:11:45 +08:00
/*
* gimp - layer - set - opacity
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( layer_set_opacity_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-layer-set-opacity " ) ;
2019-09-09 05:40:34 +08:00
gimp_procedure_set_static_help ( procedure ,
" Set the opacity of the specified layer. " ,
" This procedure sets the specified layer's opacity. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 17:25:35 +08:00
gimp_param_spec_layer ( " layer " ,
" layer " ,
" The layer " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
g_param_spec_double ( " opacity " ,
" opacity " ,
2006-05-19 01:25:15 +08:00
" The new layer opacity " ,
2006-04-05 05:11:45 +08:00
0 , 100 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
1997-11-25 06:05:25 +08:00
2006-04-05 05:11:45 +08:00
/*
* gimp - layer - get - mode
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( layer_get_mode_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-layer-get-mode " ) ;
2019-09-09 05:40:34 +08:00
gimp_procedure_set_static_help ( procedure ,
" Get the combination mode of the specified layer. " ,
" This procedure returns the specified layer's combination mode. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 17:25:35 +08:00
gimp_param_spec_layer ( " layer " ,
" layer " ,
" The layer " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_return_value ( procedure ,
g_param_spec_enum ( " mode " ,
" mode " ,
2006-05-19 01:25:15 +08:00
" The layer combination mode " ,
2017-01-09 06:00:19 +08:00
GIMP_TYPE_LAYER_MODE ,
2017-08-20 02:33:47 +08:00
GIMP_LAYER_MODE_NORMAL ,
2006-04-05 05:11:45 +08:00
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
1999-04-25 04:33:31 +08:00
2006-04-05 05:11:45 +08:00
/*
* gimp - layer - set - mode
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( layer_set_mode_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-layer-set-mode " ) ;
2019-09-09 05:40:34 +08:00
gimp_procedure_set_static_help ( procedure ,
" Set the combination mode of the specified layer. " ,
" This procedure sets the specified layer's combination mode. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 17:25:35 +08:00
gimp_param_spec_layer ( " layer " ,
" layer " ,
" The layer " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
g_param_spec_enum ( " mode " ,
" mode " ,
2006-05-19 01:25:15 +08:00
" The new layer combination mode " ,
2017-01-09 06:00:19 +08:00
GIMP_TYPE_LAYER_MODE ,
2017-08-20 02:33:47 +08:00
GIMP_LAYER_MODE_NORMAL ,
2006-04-05 05:11:45 +08:00
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
2017-02-02 07:38:25 +08:00
2017-02-20 08:17:07 +08:00
/*
* gimp - layer - get - blend - space
*/
procedure = gimp_procedure_new ( layer_get_blend_space_invoker ) ;
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-layer-get-blend-space " ) ;
2019-09-09 05:40:34 +08:00
gimp_procedure_set_static_help ( procedure ,
" Get the blend space of the specified layer. " ,
" This procedure returns the specified layer's blend space. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Ell " ,
" Ell " ,
" 2017 " ) ;
2017-02-20 08:17:07 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 17:25:35 +08:00
gimp_param_spec_layer ( " layer " ,
" layer " ,
" The layer " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2017-02-20 08:17:07 +08:00
gimp_procedure_add_return_value ( procedure ,
g_param_spec_enum ( " blend-space " ,
" blend space " ,
" The layer blend space " ,
GIMP_TYPE_LAYER_COLOR_SPACE ,
GIMP_LAYER_COLOR_SPACE_AUTO ,
GIMP_PARAM_READWRITE ) ) ;
gimp_pdb_register_procedure ( pdb , procedure ) ;
g_object_unref ( procedure ) ;
/*
* gimp - layer - set - blend - space
*/
procedure = gimp_procedure_new ( layer_set_blend_space_invoker ) ;
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-layer-set-blend-space " ) ;
2019-09-09 05:40:34 +08:00
gimp_procedure_set_static_help ( procedure ,
" Set the blend space of the specified layer. " ,
" This procedure sets the specified layer's blend space. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Ell " ,
" Ell " ,
" 2017 " ) ;
2017-02-20 08:17:07 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 17:25:35 +08:00
gimp_param_spec_layer ( " layer " ,
" layer " ,
" The layer " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2017-02-20 08:17:07 +08:00
gimp_procedure_add_argument ( procedure ,
g_param_spec_enum ( " blend-space " ,
" blend space " ,
" The new layer blend space " ,
GIMP_TYPE_LAYER_COLOR_SPACE ,
GIMP_LAYER_COLOR_SPACE_AUTO ,
GIMP_PARAM_READWRITE ) ) ;
gimp_pdb_register_procedure ( pdb , procedure ) ;
g_object_unref ( procedure ) ;
/*
* gimp - layer - get - composite - space
*/
procedure = gimp_procedure_new ( layer_get_composite_space_invoker ) ;
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-layer-get-composite-space " ) ;
2019-09-09 05:40:34 +08:00
gimp_procedure_set_static_help ( procedure ,
" Get the composite space of the specified layer. " ,
" This procedure returns the specified layer's composite space. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Ell " ,
" Ell " ,
" 2017 " ) ;
2017-02-20 08:17:07 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 17:25:35 +08:00
gimp_param_spec_layer ( " layer " ,
" layer " ,
" The layer " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2017-02-20 08:17:07 +08:00
gimp_procedure_add_return_value ( procedure ,
g_param_spec_enum ( " composite-space " ,
" composite space " ,
" The layer composite space " ,
GIMP_TYPE_LAYER_COLOR_SPACE ,
GIMP_LAYER_COLOR_SPACE_AUTO ,
GIMP_PARAM_READWRITE ) ) ;
gimp_pdb_register_procedure ( pdb , procedure ) ;
g_object_unref ( procedure ) ;
/*
* gimp - layer - set - composite - space
*/
procedure = gimp_procedure_new ( layer_set_composite_space_invoker ) ;
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-layer-set-composite-space " ) ;
2019-09-09 05:40:34 +08:00
gimp_procedure_set_static_help ( procedure ,
" Set the composite space of the specified layer. " ,
" This procedure sets the specified layer's composite space. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Ell " ,
" Ell " ,
" 2017 " ) ;
2017-02-20 08:17:07 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 17:25:35 +08:00
gimp_param_spec_layer ( " layer " ,
" layer " ,
" The layer " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2017-02-20 08:17:07 +08:00
gimp_procedure_add_argument ( procedure ,
g_param_spec_enum ( " composite-space " ,
" composite space " ,
" The new layer composite space " ,
GIMP_TYPE_LAYER_COLOR_SPACE ,
GIMP_LAYER_COLOR_SPACE_AUTO ,
GIMP_PARAM_READWRITE ) ) ;
gimp_pdb_register_procedure ( pdb , procedure ) ;
g_object_unref ( procedure ) ;
2017-02-02 07:38:25 +08:00
/*
* gimp - layer - get - composite - mode
*/
procedure = gimp_procedure_new ( layer_get_composite_mode_invoker ) ;
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-layer-get-composite-mode " ) ;
2019-09-09 05:40:34 +08:00
gimp_procedure_set_static_help ( procedure ,
" Get the composite mode of the specified layer. " ,
" This procedure returns the specified layer's composite mode. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Ell " ,
" Ell " ,
" 2017 " ) ;
2017-02-02 07:38:25 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 17:25:35 +08:00
gimp_param_spec_layer ( " layer " ,
" layer " ,
" The layer " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2017-02-02 07:38:25 +08:00
gimp_procedure_add_return_value ( procedure ,
g_param_spec_enum ( " composite-mode " ,
" composite mode " ,
" The layer composite mode " ,
GIMP_TYPE_LAYER_COMPOSITE_MODE ,
GIMP_LAYER_COMPOSITE_AUTO ,
GIMP_PARAM_READWRITE ) ) ;
gimp_pdb_register_procedure ( pdb , procedure ) ;
g_object_unref ( procedure ) ;
/*
* gimp - layer - set - composite - mode
*/
procedure = gimp_procedure_new ( layer_set_composite_mode_invoker ) ;
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-layer-set-composite-mode " ) ;
2019-09-09 05:40:34 +08:00
gimp_procedure_set_static_help ( procedure ,
" Set the composite mode of the specified layer. " ,
" This procedure sets the specified layer's composite mode. " ,
NULL ) ;
gimp_procedure_set_static_attribution ( procedure ,
" Ell " ,
" Ell " ,
" 2017 " ) ;
2017-02-02 07:38:25 +08:00
gimp_procedure_add_argument ( procedure ,
2019-08-29 17:25:35 +08:00
gimp_param_spec_layer ( " layer " ,
" layer " ,
" The layer " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2017-02-02 07:38:25 +08:00
gimp_procedure_add_argument ( procedure ,
g_param_spec_enum ( " composite-mode " ,
" composite mode " ,
" The new layer composite mode " ,
GIMP_TYPE_LAYER_COMPOSITE_MODE ,
GIMP_LAYER_COMPOSITE_AUTO ,
GIMP_PARAM_READWRITE ) ) ;
gimp_pdb_register_procedure ( pdb , procedure ) ;
g_object_unref ( procedure ) ;
1997-11-25 06:05:25 +08:00
}