mirror of https://github.com/GNOME/gimp.git
AUTHORS app/authors.h app/pdb/channel_cmds.c app/pdb/internal_procs.c
2001-01-29 Sven Neumann <sven@gimp.org> * AUTHORS * app/authors.h * app/pdb/channel_cmds.c * app/pdb/internal_procs.c * app/pdb/selection_cmds.c * libgimp/gimpchannel_pdb.c * libgimp/gimpchannel_pdb.h * libgimp/gimpselection_pdb.c * libgimp/gimpselection_pdb.h * tools/authorsgen/contributors * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/selection.pdb: applied a patch from Adam Spiers <adam@spiers.net> which adds two new PDB functions: selection_combine and channel_combine_masks.
This commit is contained in:
parent
a2ae989ff3
commit
fe53c66c7c
1
AUTHORS
1
AUTHORS
|
@ -157,6 +157,7 @@ Craig Setera
|
|||
Aaron Sherman
|
||||
Manish Singh
|
||||
Daniel Skarda
|
||||
Adam Spiers
|
||||
Nathan Summers
|
||||
Mike Sweet
|
||||
Yuri Syrota
|
||||
|
|
17
ChangeLog
17
ChangeLog
|
@ -1,3 +1,20 @@
|
|||
2001-01-29 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* AUTHORS
|
||||
* app/authors.h
|
||||
* app/pdb/channel_cmds.c
|
||||
* app/pdb/internal_procs.c
|
||||
* app/pdb/selection_cmds.c
|
||||
* libgimp/gimpchannel_pdb.c
|
||||
* libgimp/gimpchannel_pdb.h
|
||||
* libgimp/gimpselection_pdb.c
|
||||
* libgimp/gimpselection_pdb.h
|
||||
* tools/authorsgen/contributors
|
||||
* tools/pdbgen/pdb/channel.pdb
|
||||
* tools/pdbgen/pdb/selection.pdb: applied a patch from Adam Spiers
|
||||
<adam@spiers.net> which adds two new PDB functions: selection_combine
|
||||
and channel_combine_masks.
|
||||
|
||||
2001-01-29 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/apptypes.h: removed the "Layer" typedef.
|
||||
|
|
|
@ -156,6 +156,7 @@ static gchar *authors[] =
|
|||
"Aaron Sherman",
|
||||
"Manish Singh",
|
||||
"Daniel Skarda",
|
||||
"Adam Spiers",
|
||||
"Nathan Summers",
|
||||
"Mike Sweet",
|
||||
"Yuri Syrota",
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
static ProcRecord channel_new_proc;
|
||||
static ProcRecord channel_copy_proc;
|
||||
static ProcRecord channel_delete_proc;
|
||||
static ProcRecord channel_combine_masks_proc;
|
||||
static ProcRecord channel_get_name_proc;
|
||||
static ProcRecord channel_set_name_proc;
|
||||
static ProcRecord channel_get_visible_proc;
|
||||
|
@ -54,6 +55,7 @@ register_channel_procs (void)
|
|||
procedural_db_register (&channel_new_proc);
|
||||
procedural_db_register (&channel_copy_proc);
|
||||
procedural_db_register (&channel_delete_proc);
|
||||
procedural_db_register (&channel_combine_masks_proc);
|
||||
procedural_db_register (&channel_get_name_proc);
|
||||
procedural_db_register (&channel_set_name_proc);
|
||||
procedural_db_register (&channel_get_visible_proc);
|
||||
|
@ -277,6 +279,85 @@ static ProcRecord channel_delete_proc =
|
|||
{ { channel_delete_invoker } }
|
||||
};
|
||||
|
||||
static Argument *
|
||||
channel_combine_masks_invoker (Argument *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
Channel *channel1;
|
||||
Channel *channel2;
|
||||
gint32 operation;
|
||||
gint32 offx;
|
||||
gint32 offy;
|
||||
|
||||
channel1 = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int);
|
||||
if (channel1 == NULL)
|
||||
success = FALSE;
|
||||
|
||||
channel2 = (GimpChannel *) gimp_drawable_get_by_ID (args[1].value.pdb_int);
|
||||
if (channel2 == NULL)
|
||||
success = FALSE;
|
||||
|
||||
operation = args[2].value.pdb_int;
|
||||
if (operation < CHANNEL_OP_ADD || operation > CHANNEL_OP_INTERSECT)
|
||||
success = FALSE;
|
||||
|
||||
offx = args[3].value.pdb_int;
|
||||
|
||||
offy = args[4].value.pdb_int;
|
||||
|
||||
if (success)
|
||||
{
|
||||
channel_combine_mask (channel1, channel2, operation, offx, offy);
|
||||
}
|
||||
|
||||
return procedural_db_return_args (&channel_combine_masks_proc, success);
|
||||
}
|
||||
|
||||
static ProcArg channel_combine_masks_inargs[] =
|
||||
{
|
||||
{
|
||||
PDB_CHANNEL,
|
||||
"channel1",
|
||||
"The channel1"
|
||||
},
|
||||
{
|
||||
PDB_CHANNEL,
|
||||
"channel2",
|
||||
"The channel2"
|
||||
},
|
||||
{
|
||||
PDB_INT32,
|
||||
"operation",
|
||||
"The selection operation: { ADD (0), SUB (1), REPLACE (2), INTERSECT (3) }"
|
||||
},
|
||||
{
|
||||
PDB_INT32,
|
||||
"offx",
|
||||
"x offset between upper left corner of channels: (second - first)"
|
||||
},
|
||||
{
|
||||
PDB_INT32,
|
||||
"offy",
|
||||
"y offset between upper left corner of channels: (second - first)"
|
||||
}
|
||||
};
|
||||
|
||||
static ProcRecord channel_combine_masks_proc =
|
||||
{
|
||||
"gimp_channel_combine_masks",
|
||||
"Combine two channel masks.",
|
||||
"This procedure combines two channel masks. The result is stored in the first channel.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
PDB_INTERNAL,
|
||||
5,
|
||||
channel_combine_masks_inargs,
|
||||
0,
|
||||
NULL,
|
||||
{ { channel_combine_masks_invoker } }
|
||||
};
|
||||
|
||||
static Argument *
|
||||
channel_get_name_invoker (Argument *args)
|
||||
{
|
||||
|
|
|
@ -60,7 +60,7 @@ void register_tools_procs (void);
|
|||
void register_undo_procs (void);
|
||||
void register_unit_procs (void);
|
||||
|
||||
/* 323 procedures registered total */
|
||||
/* 325 procedures registered total */
|
||||
|
||||
void
|
||||
internal_procs_init (void)
|
||||
|
@ -74,85 +74,85 @@ internal_procs_init (void)
|
|||
app_init_update_status (NULL, _("Channel"), 0.043);
|
||||
register_channel_procs ();
|
||||
|
||||
app_init_update_status (NULL, _("Channel Ops"), 0.09);
|
||||
app_init_update_status (NULL, _("Channel Ops"), 0.092);
|
||||
register_channel_ops_procs ();
|
||||
|
||||
app_init_update_status (NULL, _("Color"), 0.096);
|
||||
app_init_update_status (NULL, _("Color"), 0.098);
|
||||
register_color_procs ();
|
||||
|
||||
app_init_update_status (NULL, _("Convert"), 0.133);
|
||||
app_init_update_status (NULL, _("Convert"), 0.135);
|
||||
register_convert_procs ();
|
||||
|
||||
app_init_update_status (NULL, _("GDisplay procedures"), 0.142);
|
||||
app_init_update_status (NULL, _("GDisplay procedures"), 0.145);
|
||||
register_display_procs ();
|
||||
|
||||
app_init_update_status (NULL, _("Drawable procedures"), 0.152);
|
||||
app_init_update_status (NULL, _("Drawable procedures"), 0.154);
|
||||
register_drawable_procs ();
|
||||
|
||||
app_init_update_status (NULL, _("Edit procedures"), 0.22);
|
||||
app_init_update_status (NULL, _("Edit procedures"), 0.222);
|
||||
register_edit_procs ();
|
||||
|
||||
app_init_update_status (NULL, _("File Operations"), 0.238);
|
||||
app_init_update_status (NULL, _("File Operations"), 0.24);
|
||||
register_fileops_procs ();
|
||||
|
||||
app_init_update_status (NULL, _("Floating selections"), 0.263);
|
||||
app_init_update_status (NULL, _("Floating selections"), 0.265);
|
||||
register_floating_sel_procs ();
|
||||
|
||||
app_init_update_status (NULL, _("Gimprc procedures"), 0.282);
|
||||
app_init_update_status (NULL, _("Gimprc procedures"), 0.283);
|
||||
register_gimprc_procs ();
|
||||
|
||||
app_init_update_status (NULL, _("Gradients"), 0.291);
|
||||
app_init_update_status (NULL, _("Gradients"), 0.292);
|
||||
register_gradients_procs ();
|
||||
|
||||
app_init_update_status (NULL, _("Gradient UI"), 0.307);
|
||||
app_init_update_status (NULL, _("Gradient UI"), 0.308);
|
||||
register_gradient_select_procs ();
|
||||
|
||||
app_init_update_status (NULL, _("Guide procedures"), 0.319);
|
||||
app_init_update_status (NULL, _("Guide procedures"), 0.32);
|
||||
register_guides_procs ();
|
||||
|
||||
app_init_update_status (NULL, _("Help procedures"), 0.337);
|
||||
app_init_update_status (NULL, _("Help procedures"), 0.338);
|
||||
register_help_procs ();
|
||||
|
||||
app_init_update_status (NULL, _("Image"), 0.341);
|
||||
app_init_update_status (NULL, _("Image"), 0.342);
|
||||
register_image_procs ();
|
||||
|
||||
app_init_update_status (NULL, _("Layer"), 0.523);
|
||||
register_layer_procs ();
|
||||
|
||||
app_init_update_status (NULL, _("Interface"), 0.619);
|
||||
app_init_update_status (NULL, _("Interface"), 0.618);
|
||||
register_message_procs ();
|
||||
|
||||
app_init_update_status (NULL, _("Miscellaneous"), 0.628);
|
||||
register_misc_procs ();
|
||||
|
||||
app_init_update_status (NULL, _("Palette"), 0.635);
|
||||
app_init_update_status (NULL, _("Palette"), 0.634);
|
||||
register_palette_procs ();
|
||||
|
||||
app_init_update_status (NULL, _("Parasite procedures"), 0.656);
|
||||
app_init_update_status (NULL, _("Parasite procedures"), 0.655);
|
||||
register_parasite_procs ();
|
||||
|
||||
app_init_update_status (NULL, _("Paths"), 0.693);
|
||||
app_init_update_status (NULL, _("Paths"), 0.692);
|
||||
register_paths_procs ();
|
||||
|
||||
app_init_update_status (NULL, _("Pattern UI"), 0.734);
|
||||
app_init_update_status (NULL, _("Pattern UI"), 0.732);
|
||||
register_pattern_select_procs ();
|
||||
|
||||
app_init_update_status (NULL, _("Patterns"), 0.743);
|
||||
app_init_update_status (NULL, _("Patterns"), 0.742);
|
||||
register_patterns_procs ();
|
||||
|
||||
app_init_update_status (NULL, _("Plug-in"), 0.755);
|
||||
app_init_update_status (NULL, _("Plug-in"), 0.754);
|
||||
register_plug_in_procs ();
|
||||
|
||||
app_init_update_status (NULL, _("Procedural database"), 0.774);
|
||||
app_init_update_status (NULL, _("Procedural database"), 0.772);
|
||||
register_procedural_db_procs ();
|
||||
|
||||
app_init_update_status (NULL, _("Image mask"), 0.799);
|
||||
app_init_update_status (NULL, _("Image mask"), 0.797);
|
||||
register_selection_procs ();
|
||||
|
||||
app_init_update_status (NULL, _("Text procedures"), 0.851);
|
||||
app_init_update_status (NULL, _("Text procedures"), 0.852);
|
||||
register_text_tool_procs ();
|
||||
|
||||
app_init_update_status (NULL, _("Tool procedures"), 0.864);
|
||||
app_init_update_status (NULL, _("Tool procedures"), 0.865);
|
||||
register_tools_procs ();
|
||||
|
||||
app_init_update_status (NULL, _("Undo"), 0.957);
|
||||
|
|
|
@ -49,6 +49,7 @@ static ProcRecord selection_shrink_proc;
|
|||
static ProcRecord selection_layer_alpha_proc;
|
||||
static ProcRecord selection_load_proc;
|
||||
static ProcRecord selection_save_proc;
|
||||
static ProcRecord selection_combine_proc;
|
||||
|
||||
void
|
||||
register_selection_procs (void)
|
||||
|
@ -70,6 +71,7 @@ register_selection_procs (void)
|
|||
procedural_db_register (&selection_layer_alpha_proc);
|
||||
procedural_db_register (&selection_load_proc);
|
||||
procedural_db_register (&selection_save_proc);
|
||||
procedural_db_register (&selection_combine_proc);
|
||||
}
|
||||
|
||||
static Argument *
|
||||
|
@ -976,3 +978,72 @@ static ProcRecord selection_save_proc =
|
|||
selection_save_outargs,
|
||||
{ { selection_save_invoker } }
|
||||
};
|
||||
|
||||
static Argument *
|
||||
selection_combine_invoker (Argument *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
Channel *channel;
|
||||
gint32 operation;
|
||||
GimpImage *gimage;
|
||||
Channel *new_channel;
|
||||
|
||||
channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int);
|
||||
if (channel == NULL)
|
||||
success = FALSE;
|
||||
|
||||
operation = args[1].value.pdb_int;
|
||||
if (operation < CHANNEL_OP_ADD || operation > CHANNEL_OP_INTERSECT)
|
||||
success = FALSE;
|
||||
|
||||
if (success)
|
||||
{
|
||||
gimage = gimp_drawable_gimage (GIMP_DRAWABLE (channel));
|
||||
|
||||
if (gimp_drawable_width (GIMP_DRAWABLE (channel)) == gimage->width &&
|
||||
gimp_drawable_height (GIMP_DRAWABLE (channel)) == gimage->height)
|
||||
{
|
||||
new_channel = channel_copy (gimp_image_get_mask (gimage));
|
||||
channel_combine_mask (new_channel,
|
||||
channel,
|
||||
operation,
|
||||
0, 0); /* off x/y */
|
||||
gimage_mask_load (gimage, new_channel);
|
||||
channel_delete (new_channel);
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return procedural_db_return_args (&selection_combine_proc, success);
|
||||
}
|
||||
|
||||
static ProcArg selection_combine_inargs[] =
|
||||
{
|
||||
{
|
||||
PDB_CHANNEL,
|
||||
"channel",
|
||||
"The channel"
|
||||
},
|
||||
{
|
||||
PDB_INT32,
|
||||
"operation",
|
||||
"The selection operation: { ADD (0), SUB (1), REPLACE (2), INTERSECT (3) }"
|
||||
}
|
||||
};
|
||||
|
||||
static ProcRecord selection_combine_proc =
|
||||
{
|
||||
"gimp_selection_combine",
|
||||
"Combines the specified channel with the selection mask.",
|
||||
"This procedure combines the specified channel into the selection mask. It essentially involves a transfer of the channel's content into the selection mask. Therefore, the channel must have the same width and height of the image, or an error is returned.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
PDB_INTERNAL,
|
||||
2,
|
||||
selection_combine_inargs,
|
||||
0,
|
||||
NULL,
|
||||
{ { selection_combine_invoker } }
|
||||
};
|
||||
|
|
|
@ -137,6 +137,48 @@ gimp_channel_delete (gint32 channel_ID)
|
|||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_channel_combine_masks:
|
||||
* @channel1_ID: The channel1.
|
||||
* @channel2_ID: The channel2.
|
||||
* @operation: The selection operation.
|
||||
* @offx: x offset between upper left corner of channels: (second - first).
|
||||
* @offy: y offset between upper left corner of channels: (second - first).
|
||||
*
|
||||
* Combine two channel masks.
|
||||
*
|
||||
* This procedure combines two channel masks. The result is stored in
|
||||
* the first channel.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
*/
|
||||
gboolean
|
||||
gimp_channel_combine_masks (gint32 channel1_ID,
|
||||
gint32 channel2_ID,
|
||||
GimpChannelOps operation,
|
||||
gint offx,
|
||||
gint offy)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_channel_combine_masks",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_CHANNEL, channel1_ID,
|
||||
GIMP_PDB_CHANNEL, channel2_ID,
|
||||
GIMP_PDB_INT32, operation,
|
||||
GIMP_PDB_INT32, offx,
|
||||
GIMP_PDB_INT32, offy,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_channel_get_name:
|
||||
* @channel_ID: The channel.
|
||||
|
|
|
@ -31,33 +31,38 @@ extern "C" {
|
|||
/* For information look into the C source or the html documentation */
|
||||
|
||||
|
||||
gint32 _gimp_channel_new (gint32 image_ID,
|
||||
gint width,
|
||||
gint height,
|
||||
gchar *name,
|
||||
gdouble opacity,
|
||||
GimpRGB *color);
|
||||
gint32 gimp_channel_copy (gint32 channel_ID);
|
||||
gboolean gimp_channel_delete (gint32 channel_ID);
|
||||
gchar* gimp_channel_get_name (gint32 channel_ID);
|
||||
gboolean gimp_channel_set_name (gint32 channel_ID,
|
||||
gchar *name);
|
||||
gboolean gimp_channel_get_visible (gint32 channel_ID);
|
||||
gboolean gimp_channel_set_visible (gint32 channel_ID,
|
||||
gboolean visible);
|
||||
gboolean gimp_channel_get_show_masked (gint32 channel_ID);
|
||||
gboolean gimp_channel_set_show_masked (gint32 channel_ID,
|
||||
gboolean show_masked);
|
||||
gdouble gimp_channel_get_opacity (gint32 channel_ID);
|
||||
gboolean gimp_channel_set_opacity (gint32 channel_ID,
|
||||
gdouble opacity);
|
||||
gboolean gimp_channel_get_color (gint32 channel_ID,
|
||||
GimpRGB *color);
|
||||
gboolean gimp_channel_set_color (gint32 channel_ID,
|
||||
GimpRGB *color);
|
||||
gint gimp_channel_get_tattoo (gint32 channel_ID);
|
||||
gboolean gimp_channel_set_tattoo (gint32 channel_ID,
|
||||
gint tattoo);
|
||||
gint32 _gimp_channel_new (gint32 image_ID,
|
||||
gint width,
|
||||
gint height,
|
||||
gchar *name,
|
||||
gdouble opacity,
|
||||
GimpRGB *color);
|
||||
gint32 gimp_channel_copy (gint32 channel_ID);
|
||||
gboolean gimp_channel_delete (gint32 channel_ID);
|
||||
gboolean gimp_channel_combine_masks (gint32 channel1_ID,
|
||||
gint32 channel2_ID,
|
||||
GimpChannelOps operation,
|
||||
gint offx,
|
||||
gint offy);
|
||||
gchar* gimp_channel_get_name (gint32 channel_ID);
|
||||
gboolean gimp_channel_set_name (gint32 channel_ID,
|
||||
gchar *name);
|
||||
gboolean gimp_channel_get_visible (gint32 channel_ID);
|
||||
gboolean gimp_channel_set_visible (gint32 channel_ID,
|
||||
gboolean visible);
|
||||
gboolean gimp_channel_get_show_masked (gint32 channel_ID);
|
||||
gboolean gimp_channel_set_show_masked (gint32 channel_ID,
|
||||
gboolean show_masked);
|
||||
gdouble gimp_channel_get_opacity (gint32 channel_ID);
|
||||
gboolean gimp_channel_set_opacity (gint32 channel_ID,
|
||||
gdouble opacity);
|
||||
gboolean gimp_channel_get_color (gint32 channel_ID,
|
||||
GimpRGB *color);
|
||||
gboolean gimp_channel_set_color (gint32 channel_ID,
|
||||
GimpRGB *color);
|
||||
gint gimp_channel_get_tattoo (gint32 channel_ID);
|
||||
gboolean gimp_channel_set_tattoo (gint32 channel_ID,
|
||||
gint tattoo);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -611,3 +611,38 @@ gimp_selection_save (gint32 image_ID)
|
|||
|
||||
return channel_ID;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_selection_combine:
|
||||
* @channel_ID: The channel.
|
||||
* @operation: The selection operation.
|
||||
*
|
||||
* Combines the specified channel with the selection mask.
|
||||
*
|
||||
* This procedure combines the specified channel into the selection
|
||||
* mask. It essentially involves a transfer of the channel's content
|
||||
* into the selection mask. Therefore, the channel must have the same
|
||||
* width and height of the image, or an error is returned.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
*/
|
||||
gboolean
|
||||
gimp_selection_combine (gint32 channel_ID,
|
||||
GimpChannelOps operation)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_selection_combine",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_CHANNEL, channel_ID,
|
||||
GIMP_PDB_INT32, operation,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
|
|
@ -31,38 +31,40 @@ extern "C" {
|
|||
/* For information look into the C source or the html documentation */
|
||||
|
||||
|
||||
gboolean gimp_selection_bounds (gint32 image_ID,
|
||||
gboolean *non_empty,
|
||||
gint *x1,
|
||||
gint *y1,
|
||||
gint *x2,
|
||||
gint *y2);
|
||||
gint gimp_selection_value (gint32 image_ID,
|
||||
gint x,
|
||||
gint y);
|
||||
gboolean gimp_selection_is_empty (gint32 image_ID);
|
||||
gboolean gimp_selection_translate (gint32 image_ID,
|
||||
gint offx,
|
||||
gint offy);
|
||||
gint32 _gimp_selection_float (gint32 drawable_ID,
|
||||
gint offx,
|
||||
gint offy);
|
||||
gboolean gimp_selection_clear (gint32 image_ID);
|
||||
gboolean gimp_selection_invert (gint32 image_ID);
|
||||
gboolean gimp_selection_sharpen (gint32 image_ID);
|
||||
gboolean gimp_selection_all (gint32 image_ID);
|
||||
gboolean gimp_selection_none (gint32 image_ID);
|
||||
gboolean gimp_selection_feather (gint32 image_ID,
|
||||
gdouble radius);
|
||||
gboolean gimp_selection_border (gint32 image_ID,
|
||||
gint radius);
|
||||
gboolean gimp_selection_grow (gint32 image_ID,
|
||||
gint steps);
|
||||
gboolean gimp_selection_shrink (gint32 image_ID,
|
||||
gint radius);
|
||||
gboolean gimp_selection_layer_alpha (gint32 layer_ID);
|
||||
gboolean gimp_selection_load (gint32 channel_ID);
|
||||
gint32 gimp_selection_save (gint32 image_ID);
|
||||
gboolean gimp_selection_bounds (gint32 image_ID,
|
||||
gboolean *non_empty,
|
||||
gint *x1,
|
||||
gint *y1,
|
||||
gint *x2,
|
||||
gint *y2);
|
||||
gint gimp_selection_value (gint32 image_ID,
|
||||
gint x,
|
||||
gint y);
|
||||
gboolean gimp_selection_is_empty (gint32 image_ID);
|
||||
gboolean gimp_selection_translate (gint32 image_ID,
|
||||
gint offx,
|
||||
gint offy);
|
||||
gint32 _gimp_selection_float (gint32 drawable_ID,
|
||||
gint offx,
|
||||
gint offy);
|
||||
gboolean gimp_selection_clear (gint32 image_ID);
|
||||
gboolean gimp_selection_invert (gint32 image_ID);
|
||||
gboolean gimp_selection_sharpen (gint32 image_ID);
|
||||
gboolean gimp_selection_all (gint32 image_ID);
|
||||
gboolean gimp_selection_none (gint32 image_ID);
|
||||
gboolean gimp_selection_feather (gint32 image_ID,
|
||||
gdouble radius);
|
||||
gboolean gimp_selection_border (gint32 image_ID,
|
||||
gint radius);
|
||||
gboolean gimp_selection_grow (gint32 image_ID,
|
||||
gint steps);
|
||||
gboolean gimp_selection_shrink (gint32 image_ID,
|
||||
gint radius);
|
||||
gboolean gimp_selection_layer_alpha (gint32 layer_ID);
|
||||
gboolean gimp_selection_load (gint32 channel_ID);
|
||||
gint32 gimp_selection_save (gint32 image_ID);
|
||||
gboolean gimp_selection_combine (gint32 channel_ID,
|
||||
GimpChannelOps operation);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -154,6 +154,7 @@ Craig Setera
|
|||
Aaron Sherman
|
||||
Manish Singh
|
||||
Daniel Skarda
|
||||
Adam Spiers
|
||||
Nathan Summers
|
||||
Mike Sweet
|
||||
Yuri Syrota
|
||||
|
|
|
@ -23,6 +23,12 @@ sub channel_arg () {{
|
|||
desc => 'The channel'
|
||||
}}
|
||||
|
||||
sub operation_arg () {{
|
||||
name => 'operation',
|
||||
type => 'enum ChannelOps',
|
||||
desc => 'The selection operation: { %%desc%% }'
|
||||
}}
|
||||
|
||||
sub channel_get_prop_proc {
|
||||
my ($prop, $type, $desc, $func) = @_;
|
||||
|
||||
|
@ -207,6 +213,35 @@ HELP
|
|||
%invoke = ( code => 'channel_delete (channel);' );
|
||||
}
|
||||
|
||||
sub channel_combine_masks {
|
||||
$blurb = 'Combine two channel masks.';
|
||||
|
||||
$help = <<'HELP';
|
||||
This procedure combines two channel masks. The result is stored
|
||||
in the first channel.
|
||||
HELP
|
||||
|
||||
&std_pdb_misc;
|
||||
|
||||
@inargs = ( &channel_arg, &channel_arg, &operation_arg );
|
||||
|
||||
foreach my $i (0 .. 1) {
|
||||
$inargs[$i]{$_} .= $i + 1 for qw(name desc);
|
||||
}
|
||||
|
||||
foreach (qw(x y)) {
|
||||
push @inargs, { name => "off$_", type => 'int32',
|
||||
desc => "$_ offset between upper left corner of
|
||||
channels: (second - first)" }
|
||||
}
|
||||
|
||||
%invoke = ( code => <<'CODE' );
|
||||
{
|
||||
channel_combine_mask (channel1, channel2, operation, offx, offy);
|
||||
}
|
||||
CODE
|
||||
}
|
||||
|
||||
&channel_accessors('name', 'string', 'name', 1);
|
||||
|
||||
&channel_accessors('visible', 'boolean', 'visibility', 0,
|
||||
|
@ -245,7 +280,8 @@ CODE
|
|||
|
||||
@headers = qw("channel.h");
|
||||
|
||||
unshift @procs, qw(channel_new channel_copy channel_delete);
|
||||
unshift @procs, qw(channel_new channel_copy channel_delete
|
||||
channel_combine_masks);
|
||||
%exports = (app => [@procs], lib => [@procs]);
|
||||
|
||||
$desc = 'Channel';
|
||||
|
|
|
@ -17,6 +17,18 @@
|
|||
|
||||
# "Perlized" from C source by Manish Singh <yosh@gimp.org>
|
||||
|
||||
sub channel_arg () {{
|
||||
name => 'channel',
|
||||
type => 'channel',
|
||||
desc => 'The channel'
|
||||
}}
|
||||
|
||||
sub operation_arg () {{
|
||||
name => 'operation',
|
||||
type => 'enum ChannelOps',
|
||||
desc => 'The selection operation: { %%desc%% }'
|
||||
}}
|
||||
|
||||
sub coord_args {
|
||||
my ($name, $desc, $args) = @_;
|
||||
foreach (qw(x y)) {
|
||||
|
@ -313,10 +325,7 @@ HELP
|
|||
|
||||
&std_pdb_misc;
|
||||
|
||||
@inargs = (
|
||||
{ name => 'channel', type => 'channel',
|
||||
desc => 'The channel' }
|
||||
);
|
||||
@inargs = ( &channel_arg );
|
||||
|
||||
%invoke = (
|
||||
vars => [ 'GimpImage *gimage' ],
|
||||
|
@ -334,6 +343,44 @@ CODE
|
|||
);
|
||||
}
|
||||
|
||||
sub selection_combine {
|
||||
$blurb = 'Combines the specified channel with the selection mask.';
|
||||
|
||||
$help = <<'HELP';
|
||||
This procedure combines the specified channel into the selection
|
||||
mask. It essentially involves a transfer of the channel's content into
|
||||
the selection mask. Therefore, the channel must have the same width
|
||||
and height of the image, or an error is returned.
|
||||
HELP
|
||||
|
||||
&std_pdb_misc;
|
||||
|
||||
@inargs = ( &channel_arg, &operation_arg );
|
||||
|
||||
%invoke = (
|
||||
vars => [ 'GimpImage *gimage', 'Channel *new_channel' ],
|
||||
code => <<'CODE'
|
||||
{
|
||||
gimage = gimp_drawable_gimage (GIMP_DRAWABLE (channel));
|
||||
|
||||
if (gimp_drawable_width (GIMP_DRAWABLE (channel)) == gimage->width &&
|
||||
gimp_drawable_height (GIMP_DRAWABLE (channel)) == gimage->height)
|
||||
{
|
||||
new_channel = channel_copy (gimp_image_get_mask (gimage));
|
||||
channel_combine_mask (new_channel,
|
||||
channel,
|
||||
operation,
|
||||
0, 0); /* off x/y */
|
||||
gimage_mask_load (gimage, new_channel);
|
||||
channel_delete (new_channel);
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub selection_save {
|
||||
$blurb = 'Copy the selection mask to a new channel.';
|
||||
|
||||
|
@ -363,7 +410,8 @@ HELP
|
|||
selection_translate selection_float selection_clear
|
||||
selection_invert selection_sharpen selection_all selection_none
|
||||
selection_feather selection_border selection_grow selection_shrink
|
||||
selection_layer_alpha selection_load selection_save);
|
||||
selection_layer_alpha selection_load selection_save
|
||||
selection_combine);
|
||||
%exports = (app => [@procs], lib => [@procs]);
|
||||
|
||||
$desc = 'Image mask';
|
||||
|
|
Loading…
Reference in New Issue