mirror of https://github.com/GNOME/gimp.git
pdb: remove all deprecated procedures
This commit is contained in:
parent
9525c646e1
commit
f180a171cd
|
@ -39,14 +39,12 @@ libappinternal_procs_a_SOURCES = \
|
|||
brushes-cmds.c \
|
||||
buffer-cmds.c \
|
||||
channel-cmds.c \
|
||||
color-cmds.c \
|
||||
context-cmds.c \
|
||||
debug-cmds.c \
|
||||
display-cmds.c \
|
||||
drawable-cmds.c \
|
||||
drawable-color-cmds.c \
|
||||
drawable-edit-cmds.c \
|
||||
drawable-transform-cmds.c \
|
||||
dynamics-cmds.c \
|
||||
edit-cmds.c \
|
||||
fileops-cmds.c \
|
||||
|
@ -76,7 +74,6 @@ libappinternal_procs_a_SOURCES = \
|
|||
palette-cmds.c \
|
||||
palette-select-cmds.c \
|
||||
palettes-cmds.c \
|
||||
paths-cmds.c \
|
||||
pattern-cmds.c \
|
||||
pattern-select-cmds.c \
|
||||
patterns-cmds.c \
|
||||
|
@ -85,9 +82,7 @@ libappinternal_procs_a_SOURCES = \
|
|||
procedural-db-cmds.c \
|
||||
progress-cmds.c \
|
||||
selection-cmds.c \
|
||||
selection-tools-cmds.c \
|
||||
text-layer-cmds.c \
|
||||
text-tool-cmds.c \
|
||||
transform-tools-cmds.c \
|
||||
unit-cmds.c \
|
||||
vectors-cmds.c
|
||||
|
|
|
@ -90,166 +90,6 @@ brushes_get_list_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
brushes_get_brush_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpValueArray *return_vals;
|
||||
gchar *name = NULL;
|
||||
gint32 width = 0;
|
||||
gint32 height = 0;
|
||||
gint32 spacing = 0;
|
||||
|
||||
GimpBrush *brush = gimp_context_get_brush (context);
|
||||
|
||||
if (brush)
|
||||
{
|
||||
name = g_strdup (gimp_object_get_name (brush));
|
||||
width = gimp_brush_get_width (brush);
|
||||
height = gimp_brush_get_height (brush);
|
||||
spacing = gimp_brush_get_spacing (brush);
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
|
||||
if (success)
|
||||
{
|
||||
g_value_take_string (gimp_value_array_index (return_vals, 1), name);
|
||||
g_value_set_int (gimp_value_array_index (return_vals, 2), width);
|
||||
g_value_set_int (gimp_value_array_index (return_vals, 3), height);
|
||||
g_value_set_int (gimp_value_array_index (return_vals, 4), spacing);
|
||||
}
|
||||
|
||||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
brushes_get_spacing_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpValueArray *return_vals;
|
||||
gint32 spacing = 0;
|
||||
|
||||
GimpBrush *brush = gimp_context_get_brush (context);
|
||||
|
||||
if (brush)
|
||||
spacing = gimp_brush_get_spacing (brush);
|
||||
else
|
||||
success = FALSE;
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
|
||||
if (success)
|
||||
g_value_set_int (gimp_value_array_index (return_vals, 1), spacing);
|
||||
|
||||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
brushes_set_spacing_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
gint32 spacing;
|
||||
|
||||
spacing = g_value_get_int (gimp_value_array_index (args, 0));
|
||||
|
||||
if (success)
|
||||
{
|
||||
gimp_brush_set_spacing (gimp_context_get_brush (context), spacing);
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
brushes_get_brush_data_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpValueArray *return_vals;
|
||||
const gchar *name;
|
||||
gchar *actual_name = NULL;
|
||||
gdouble opacity = 0.0;
|
||||
gint32 spacing = 0;
|
||||
gint32 paint_mode = 0;
|
||||
gint32 width = 0;
|
||||
gint32 height = 0;
|
||||
gint32 length = 0;
|
||||
guint8 *mask_data = NULL;
|
||||
|
||||
name = g_value_get_string (gimp_value_array_index (args, 0));
|
||||
|
||||
if (success)
|
||||
{
|
||||
GimpBrush *brush;
|
||||
|
||||
if (paint_mode == GIMP_LAYER_MODE_OVERLAY_LEGACY)
|
||||
paint_mode = GIMP_LAYER_MODE_SOFTLIGHT_LEGACY;
|
||||
|
||||
if (name && strlen (name))
|
||||
brush = gimp_pdb_get_brush (gimp, name, FALSE, error);
|
||||
else
|
||||
brush = gimp_context_get_brush (context);
|
||||
|
||||
if (brush)
|
||||
{
|
||||
GimpTempBuf *mask = gimp_brush_get_mask (brush);
|
||||
|
||||
actual_name = g_strdup (gimp_object_get_name (brush));
|
||||
opacity = 1.0;
|
||||
spacing = gimp_brush_get_spacing (brush);
|
||||
paint_mode = 0;
|
||||
width = gimp_brush_get_width (brush);
|
||||
height = gimp_brush_get_height (brush);
|
||||
length = gimp_temp_buf_get_data_size (mask);
|
||||
mask_data = g_memdup (gimp_temp_buf_get_data (mask), length);
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
|
||||
if (success)
|
||||
{
|
||||
g_value_take_string (gimp_value_array_index (return_vals, 1), actual_name);
|
||||
g_value_set_double (gimp_value_array_index (return_vals, 2), opacity);
|
||||
g_value_set_int (gimp_value_array_index (return_vals, 3), spacing);
|
||||
g_value_set_enum (gimp_value_array_index (return_vals, 4), paint_mode);
|
||||
g_value_set_int (gimp_value_array_index (return_vals, 5), width);
|
||||
g_value_set_int (gimp_value_array_index (return_vals, 6), height);
|
||||
g_value_set_int (gimp_value_array_index (return_vals, 7), length);
|
||||
gimp_value_take_int8array (gimp_value_array_index (return_vals, 8), mask_data, length);
|
||||
}
|
||||
|
||||
return return_vals;
|
||||
}
|
||||
|
||||
void
|
||||
register_brushes_procs (GimpPDB *pdb)
|
||||
{
|
||||
|
@ -306,165 +146,4 @@ register_brushes_procs (GimpPDB *pdb)
|
|||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-brushes-get-brush
|
||||
*/
|
||||
procedure = gimp_procedure_new (brushes_get_brush_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-brushes-get-brush");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-brushes-get-brush",
|
||||
"Deprecated: Use 'gimp-context-get-brush' instead.",
|
||||
"Deprecated: Use 'gimp-context-get-brush' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-context-get-brush");
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("name",
|
||||
"name",
|
||||
"The brush name",
|
||||
FALSE, FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("width",
|
||||
"width",
|
||||
"The brush width",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("height",
|
||||
"height",
|
||||
"The brush height",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("spacing",
|
||||
"spacing",
|
||||
"The brush spacing",
|
||||
0, 1000, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-brushes-get-spacing
|
||||
*/
|
||||
procedure = gimp_procedure_new (brushes_get_spacing_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-brushes-get-spacing");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-brushes-get-spacing",
|
||||
"Deprecated: Use 'gimp-brush-get-spacing' instead.",
|
||||
"Deprecated: Use 'gimp-brush-get-spacing' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-brush-get-spacing");
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("spacing",
|
||||
"spacing",
|
||||
"The brush spacing",
|
||||
0, 1000, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-brushes-set-spacing
|
||||
*/
|
||||
procedure = gimp_procedure_new (brushes_set_spacing_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-brushes-set-spacing");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-brushes-set-spacing",
|
||||
"Deprecated: Use 'gimp-brush-set-spacing' instead.",
|
||||
"Deprecated: Use 'gimp-brush-set-spacing' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-brush-set-spacing");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_int32 ("spacing",
|
||||
"spacing",
|
||||
"The brush spacing",
|
||||
0, 1000, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-brushes-get-brush-data
|
||||
*/
|
||||
procedure = gimp_procedure_new (brushes_get_brush_data_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-brushes-get-brush-data");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-brushes-get-brush-data",
|
||||
"Deprecated: Use 'gimp-brush-get-pixels' instead.",
|
||||
"Deprecated: Use 'gimp-brush-get-pixels' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-brush-get-pixels");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("name",
|
||||
"name",
|
||||
"The brush name (\"\" means current active brush)",
|
||||
FALSE, TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("actual-name",
|
||||
"actual name",
|
||||
"The brush name",
|
||||
FALSE, FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_double ("opacity",
|
||||
"opacity",
|
||||
"The brush opacity",
|
||||
0, 100, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("spacing",
|
||||
"spacing",
|
||||
"The brush spacing",
|
||||
0, 1000, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_enum ("paint-mode",
|
||||
"paint mode",
|
||||
"The paint mode",
|
||||
GIMP_TYPE_LAYER_MODE,
|
||||
GIMP_LAYER_MODE_NORMAL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("width",
|
||||
"width",
|
||||
"The brush width",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("height",
|
||||
"height",
|
||||
"The brush height",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("length",
|
||||
"length",
|
||||
"Length of brush mask data",
|
||||
0, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int8_array ("mask-data",
|
||||
"mask data",
|
||||
"The brush mask data",
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
}
|
||||
|
|
1413
app/pdb/color-cmds.c
1413
app/pdb/color-cmds.c
File diff suppressed because it is too large
Load Diff
|
@ -2514,41 +2514,6 @@ context_set_transform_resize_invoker (GimpProcedure *procedure,
|
|||
error ? *error : NULL);
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
context_get_transform_recursion_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
GimpValueArray *return_vals;
|
||||
gint32 transform_recursion = 0;
|
||||
|
||||
transform_recursion = 3;
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, TRUE, NULL);
|
||||
g_value_set_int (gimp_value_array_index (return_vals, 1), transform_recursion);
|
||||
|
||||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
context_set_transform_recursion_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
if (success)
|
||||
{
|
||||
}
|
||||
return gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
context_get_ink_size_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -5334,52 +5299,6 @@ register_context_procs (GimpPDB *pdb)
|
|||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-context-get-transform-recursion
|
||||
*/
|
||||
procedure = gimp_procedure_new (context_get_transform_recursion_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-context-get-transform-recursion");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-context-get-transform-recursion",
|
||||
"Deprecated: There is no replacement for this procedure.",
|
||||
"Deprecated: There is no replacement for this procedure.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"NONE");
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("transform-recursion",
|
||||
"transform recursion",
|
||||
"This returns always 3 and is meaningless",
|
||||
1, G_MAXINT32, 1,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-context-set-transform-recursion
|
||||
*/
|
||||
procedure = gimp_procedure_new (context_set_transform_recursion_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-context-set-transform-recursion");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-context-set-transform-recursion",
|
||||
"Deprecated: There is no replacement for this procedure.",
|
||||
"Deprecated: There is no replacement for this procedure.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"NONE");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_int32 ("transform-recursion",
|
||||
"transform recursion",
|
||||
"This parameter is ignored",
|
||||
1, G_MAXINT32, 1,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-context-get-ink-size
|
||||
*/
|
||||
|
|
|
@ -390,31 +390,6 @@ drawable_offsets_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
drawable_set_image_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpDrawable *drawable;
|
||||
GimpImage *image;
|
||||
|
||||
drawable = gimp_value_get_drawable (gimp_value_array_index (args, 0), gimp);
|
||||
image = gimp_value_get_image (gimp_value_array_index (args, 1), gimp);
|
||||
|
||||
if (success)
|
||||
{
|
||||
if (image != gimp_item_get_image (GIMP_ITEM (drawable)))
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
drawable_mask_bounds_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -1318,35 +1293,6 @@ register_drawable_procs (GimpPDB *pdb)
|
|||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-drawable-set-image
|
||||
*/
|
||||
procedure = gimp_procedure_new (drawable_set_image_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-drawable-set-image");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-drawable-set-image",
|
||||
"Deprecated: There is no replacement for this procedure.",
|
||||
"Deprecated: There is no replacement for this procedure.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"NONE");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The drawable",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-drawable-mask-bounds
|
||||
*/
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -30,20 +30,14 @@
|
|||
#include "pdb-types.h"
|
||||
|
||||
#include "core/gimp-edit.h"
|
||||
#include "core/gimp-gradients.h"
|
||||
#include "core/gimp.h"
|
||||
#include "core/gimpbuffer.h"
|
||||
#include "core/gimpchannel.h"
|
||||
#include "core/gimpdrawable-bucket-fill.h"
|
||||
#include "core/gimpdrawable-edit.h"
|
||||
#include "core/gimpdrawable-gradient.h"
|
||||
#include "core/gimpdrawable.h"
|
||||
#include "core/gimpimage.h"
|
||||
#include "core/gimplayer.h"
|
||||
#include "core/gimpparamspecs.h"
|
||||
#include "core/gimpprogress.h"
|
||||
#include "core/gimpstrokeoptions.h"
|
||||
#include "vectors/gimpvectors.h"
|
||||
|
||||
#include "gimppdb.h"
|
||||
#include "gimppdb-utils.h"
|
||||
|
@ -506,435 +500,6 @@ edit_named_paste_as_new_image_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
edit_clear_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpDrawable *drawable;
|
||||
|
||||
drawable = gimp_value_get_drawable (gimp_value_array_index (args, 0), gimp);
|
||||
|
||||
if (success)
|
||||
{
|
||||
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
|
||||
GIMP_PDB_ITEM_CONTENT, error) &&
|
||||
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
|
||||
{
|
||||
gimp_drawable_edit_clear (drawable, context);
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
edit_fill_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpDrawable *drawable;
|
||||
gint32 fill_type;
|
||||
|
||||
drawable = gimp_value_get_drawable (gimp_value_array_index (args, 0), gimp);
|
||||
fill_type = g_value_get_enum (gimp_value_array_index (args, 1));
|
||||
|
||||
if (success)
|
||||
{
|
||||
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
|
||||
GIMP_PDB_ITEM_CONTENT, error) &&
|
||||
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
|
||||
{
|
||||
GimpFillOptions *options = gimp_fill_options_new (gimp, NULL, FALSE);
|
||||
|
||||
if (gimp_fill_options_set_by_fill_type (options, context,
|
||||
fill_type, error))
|
||||
{
|
||||
gimp_drawable_edit_fill (drawable, options, NULL);
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
|
||||
g_object_unref (options);
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
edit_bucket_fill_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpDrawable *drawable;
|
||||
gint32 fill_mode;
|
||||
gint32 paint_mode;
|
||||
gdouble opacity;
|
||||
gdouble threshold;
|
||||
gboolean sample_merged;
|
||||
gdouble x;
|
||||
gdouble y;
|
||||
|
||||
drawable = gimp_value_get_drawable (gimp_value_array_index (args, 0), gimp);
|
||||
fill_mode = g_value_get_enum (gimp_value_array_index (args, 1));
|
||||
paint_mode = g_value_get_enum (gimp_value_array_index (args, 2));
|
||||
opacity = g_value_get_double (gimp_value_array_index (args, 3));
|
||||
threshold = g_value_get_double (gimp_value_array_index (args, 4));
|
||||
sample_merged = g_value_get_boolean (gimp_value_array_index (args, 5));
|
||||
x = g_value_get_double (gimp_value_array_index (args, 6));
|
||||
y = g_value_get_double (gimp_value_array_index (args, 7));
|
||||
|
||||
if (success)
|
||||
{
|
||||
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
|
||||
GIMP_PDB_ITEM_CONTENT, error) &&
|
||||
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
|
||||
{
|
||||
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
|
||||
GimpFillOptions *options = gimp_fill_options_new (gimp, NULL, FALSE);
|
||||
|
||||
if (gimp_fill_options_set_by_fill_mode (options, context,
|
||||
fill_mode, error))
|
||||
{
|
||||
if (paint_mode == GIMP_LAYER_MODE_OVERLAY_LEGACY)
|
||||
paint_mode = GIMP_LAYER_MODE_SOFTLIGHT_LEGACY;
|
||||
|
||||
gimp_context_set_opacity (GIMP_CONTEXT (options), opacity / 100.0);
|
||||
gimp_context_set_paint_mode (GIMP_CONTEXT (options), paint_mode);
|
||||
|
||||
if (! gimp_channel_is_empty (gimp_image_get_mask (image)))
|
||||
{
|
||||
gimp_drawable_edit_fill (drawable, options, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
gimp_drawable_bucket_fill (drawable, options,
|
||||
FALSE /* don't fill transparent */,
|
||||
GIMP_SELECT_CRITERION_COMPOSITE,
|
||||
threshold / 255.0,
|
||||
sample_merged,
|
||||
FALSE /* no diagonal neighbors */,
|
||||
x, y);
|
||||
}
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
|
||||
g_object_unref (options);
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
edit_bucket_fill_full_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpDrawable *drawable;
|
||||
gint32 fill_mode;
|
||||
gint32 paint_mode;
|
||||
gdouble opacity;
|
||||
gdouble threshold;
|
||||
gboolean sample_merged;
|
||||
gboolean fill_transparent;
|
||||
gint32 select_criterion;
|
||||
gdouble x;
|
||||
gdouble y;
|
||||
|
||||
drawable = gimp_value_get_drawable (gimp_value_array_index (args, 0), gimp);
|
||||
fill_mode = g_value_get_enum (gimp_value_array_index (args, 1));
|
||||
paint_mode = g_value_get_enum (gimp_value_array_index (args, 2));
|
||||
opacity = g_value_get_double (gimp_value_array_index (args, 3));
|
||||
threshold = g_value_get_double (gimp_value_array_index (args, 4));
|
||||
sample_merged = g_value_get_boolean (gimp_value_array_index (args, 5));
|
||||
fill_transparent = g_value_get_boolean (gimp_value_array_index (args, 6));
|
||||
select_criterion = g_value_get_enum (gimp_value_array_index (args, 7));
|
||||
x = g_value_get_double (gimp_value_array_index (args, 8));
|
||||
y = g_value_get_double (gimp_value_array_index (args, 9));
|
||||
|
||||
if (success)
|
||||
{
|
||||
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
|
||||
GIMP_PDB_ITEM_CONTENT, error) &&
|
||||
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
|
||||
{
|
||||
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
|
||||
GimpFillOptions *options = gimp_fill_options_new (gimp, NULL, FALSE);
|
||||
|
||||
if (gimp_fill_options_set_by_fill_mode (options, context,
|
||||
fill_mode, error))
|
||||
{
|
||||
if (paint_mode == GIMP_LAYER_MODE_OVERLAY_LEGACY)
|
||||
paint_mode = GIMP_LAYER_MODE_SOFTLIGHT_LEGACY;
|
||||
|
||||
gimp_context_set_opacity (GIMP_CONTEXT (options), opacity / 100.0);
|
||||
gimp_context_set_paint_mode (GIMP_CONTEXT (options), paint_mode);
|
||||
|
||||
if (! gimp_channel_is_empty (gimp_image_get_mask (image)))
|
||||
{
|
||||
gimp_drawable_edit_fill (drawable, options, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
gimp_drawable_bucket_fill (drawable, options,
|
||||
fill_transparent,
|
||||
select_criterion,
|
||||
threshold / 255.0,
|
||||
sample_merged,
|
||||
FALSE /* no diagonal neighbors */,
|
||||
x, y);
|
||||
}
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
|
||||
g_object_unref (options);
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
edit_blend_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpDrawable *drawable;
|
||||
gint32 blend_mode;
|
||||
gint32 paint_mode;
|
||||
gint32 gradient_type;
|
||||
gdouble opacity;
|
||||
gdouble offset;
|
||||
gint32 repeat;
|
||||
gboolean reverse;
|
||||
gboolean supersample;
|
||||
gint32 max_depth;
|
||||
gdouble threshold;
|
||||
gboolean dither;
|
||||
gdouble x1;
|
||||
gdouble y1;
|
||||
gdouble x2;
|
||||
gdouble y2;
|
||||
|
||||
drawable = gimp_value_get_drawable (gimp_value_array_index (args, 0), gimp);
|
||||
blend_mode = g_value_get_enum (gimp_value_array_index (args, 1));
|
||||
paint_mode = g_value_get_enum (gimp_value_array_index (args, 2));
|
||||
gradient_type = g_value_get_enum (gimp_value_array_index (args, 3));
|
||||
opacity = g_value_get_double (gimp_value_array_index (args, 4));
|
||||
offset = g_value_get_double (gimp_value_array_index (args, 5));
|
||||
repeat = g_value_get_enum (gimp_value_array_index (args, 6));
|
||||
reverse = g_value_get_boolean (gimp_value_array_index (args, 7));
|
||||
supersample = g_value_get_boolean (gimp_value_array_index (args, 8));
|
||||
max_depth = g_value_get_int (gimp_value_array_index (args, 9));
|
||||
threshold = g_value_get_double (gimp_value_array_index (args, 10));
|
||||
dither = g_value_get_boolean (gimp_value_array_index (args, 11));
|
||||
x1 = g_value_get_double (gimp_value_array_index (args, 12));
|
||||
y1 = g_value_get_double (gimp_value_array_index (args, 13));
|
||||
x2 = g_value_get_double (gimp_value_array_index (args, 14));
|
||||
y2 = g_value_get_double (gimp_value_array_index (args, 15));
|
||||
|
||||
if (success)
|
||||
{
|
||||
success = (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
|
||||
GIMP_PDB_ITEM_CONTENT, error) &&
|
||||
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error));
|
||||
|
||||
if (success)
|
||||
{
|
||||
if (supersample)
|
||||
{
|
||||
if (max_depth < 1 || max_depth > 9)
|
||||
success = FALSE;
|
||||
|
||||
if (threshold < 0.0 || threshold > 4.0)
|
||||
success = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
max_depth = CLAMP (max_depth, 1, 9);
|
||||
threshold = CLAMP (threshold, 0.0, 4.0);
|
||||
}
|
||||
}
|
||||
|
||||
if (success)
|
||||
{
|
||||
GimpGradient *gradient;
|
||||
|
||||
if (paint_mode == GIMP_LAYER_MODE_OVERLAY_LEGACY)
|
||||
paint_mode = GIMP_LAYER_MODE_SOFTLIGHT_LEGACY;
|
||||
|
||||
if (progress)
|
||||
gimp_progress_start (progress, FALSE, _("Gradient"));
|
||||
|
||||
switch (blend_mode)
|
||||
{
|
||||
case GIMP_BLEND_FG_BG_RGB:
|
||||
gradient = gimp_gradients_get_fg_bg_rgb (context->gimp);
|
||||
break;
|
||||
|
||||
case GIMP_BLEND_FG_BG_HSV:
|
||||
gradient = gimp_gradients_get_fg_bg_hsv_cw (context->gimp);
|
||||
break;
|
||||
|
||||
case GIMP_BLEND_FG_TRANSPARENT:
|
||||
gradient = gimp_gradients_get_fg_transparent (context->gimp);
|
||||
break;
|
||||
|
||||
case GIMP_BLEND_CUSTOM:
|
||||
default:
|
||||
gradient = gimp_context_get_gradient (context);
|
||||
break;
|
||||
}
|
||||
|
||||
gimp_drawable_gradient (drawable,
|
||||
context,
|
||||
gradient,
|
||||
GIMP_PDB_CONTEXT (context)->distance_metric,
|
||||
paint_mode,
|
||||
gradient_type,
|
||||
opacity / 100.0,
|
||||
offset, repeat, reverse,
|
||||
GIMP_GRADIENT_BLEND_RGB_PERCEPTUAL,
|
||||
supersample, max_depth,
|
||||
threshold, dither,
|
||||
x1, y1, x2, y2,
|
||||
progress);
|
||||
|
||||
if (progress)
|
||||
gimp_progress_end (progress);
|
||||
}
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
edit_stroke_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpDrawable *drawable;
|
||||
|
||||
drawable = gimp_value_get_drawable (gimp_value_array_index (args, 0), gimp);
|
||||
|
||||
if (success)
|
||||
{
|
||||
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
|
||||
GIMP_PDB_ITEM_CONTENT, error) &&
|
||||
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
|
||||
{
|
||||
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
|
||||
GimpStrokeOptions *options;
|
||||
GimpPaintOptions *paint_options;
|
||||
|
||||
options = gimp_pdb_context_get_stroke_options (GIMP_PDB_CONTEXT (context));
|
||||
|
||||
paint_options =
|
||||
gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context), NULL);
|
||||
paint_options = gimp_config_duplicate (GIMP_CONFIG (paint_options));
|
||||
|
||||
success = gimp_item_stroke (GIMP_ITEM (gimp_image_get_mask (image)),
|
||||
drawable, context, options, paint_options,
|
||||
TRUE, progress, error);
|
||||
|
||||
g_object_unref (paint_options);
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
edit_stroke_vectors_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpDrawable *drawable;
|
||||
GimpVectors *vectors;
|
||||
|
||||
drawable = gimp_value_get_drawable (gimp_value_array_index (args, 0), gimp);
|
||||
vectors = gimp_value_get_vectors (gimp_value_array_index (args, 1), gimp);
|
||||
|
||||
if (success)
|
||||
{
|
||||
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
|
||||
GIMP_PDB_ITEM_CONTENT, error) &&
|
||||
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) &&
|
||||
gimp_pdb_item_is_attached (GIMP_ITEM (vectors),
|
||||
gimp_item_get_image (GIMP_ITEM (drawable)),
|
||||
0, error))
|
||||
{
|
||||
GimpStrokeOptions *options;
|
||||
GimpPaintOptions *paint_options;
|
||||
|
||||
options = gimp_pdb_context_get_stroke_options (GIMP_PDB_CONTEXT (context));
|
||||
|
||||
paint_options =
|
||||
gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context), NULL);
|
||||
paint_options = gimp_config_duplicate (GIMP_CONFIG (paint_options));
|
||||
|
||||
success = gimp_item_stroke (GIMP_ITEM (vectors),
|
||||
drawable, context, options, paint_options,
|
||||
TRUE, progress, error);
|
||||
|
||||
g_object_unref (paint_options);
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
}
|
||||
|
||||
void
|
||||
register_edit_procs (GimpPDB *pdb)
|
||||
{
|
||||
|
@ -1267,387 +832,4 @@ register_edit_procs (GimpPDB *pdb)
|
|||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-edit-clear
|
||||
*/
|
||||
procedure = gimp_procedure_new (edit_clear_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-edit-clear");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-edit-clear",
|
||||
"Clear selected area of drawable.",
|
||||
"This procedure clears the specified drawable. If the drawable has an alpha channel, the cleared pixels will become transparent. If the drawable does not have an alpha channel, cleared pixels will be set to the background color. This procedure only affects regions within a selection if there is a selection active.\n"
|
||||
"\n"
|
||||
"Deprecated: Use 'gimp-drawable-edit-clear' instead.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
"gimp-drawable-edit-clear");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The drawable to clear from",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-edit-fill
|
||||
*/
|
||||
procedure = gimp_procedure_new (edit_fill_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-edit-fill");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-edit-fill",
|
||||
"Fill selected area of drawable.",
|
||||
"This procedure fills the specified drawable with the fill mode. If the fill mode is foreground, the current foreground color is used. If the fill mode is background, the current background color is used. Other fill modes should not be used. This procedure only affects regions within a selection if there is a selection active. If you want to fill the whole drawable, regardless of the selection, use 'gimp-drawable-fill'.\n"
|
||||
"\n"
|
||||
"Deprecated: Use 'gimp-drawable-edit-fill' instead.",
|
||||
"Spencer Kimball & Peter Mattis & Raphael Quinet",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-2000",
|
||||
"gimp-drawable-edit-fill");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The drawable to fill to",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_enum ("fill-type",
|
||||
"fill type",
|
||||
"The type of fill",
|
||||
GIMP_TYPE_FILL_TYPE,
|
||||
GIMP_FILL_FOREGROUND,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-edit-bucket-fill
|
||||
*/
|
||||
procedure = gimp_procedure_new (edit_bucket_fill_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-edit-bucket-fill");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-edit-bucket-fill",
|
||||
"Fill the area specified either by the current selection if there is one, or by a seed fill starting at the specified coordinates.",
|
||||
"This tool requires information on the paint application mode, and the fill mode, which can either be in the foreground color, or in the currently active pattern. If there is no selection, a seed fill is executed at the specified coordinates and extends outward in keeping with the threshold parameter. If there is a selection in the target image, the threshold, sample merged, x, and y arguments are unused. If the sample_merged parameter is TRUE, the data of the composite image will be used instead of that for the specified drawable. This is equivalent to sampling for colors after merging all visible layers. In the case of merged sampling, the x and y coordinates are relative to the image's origin; otherwise, they are relative to the drawable's origin.\n"
|
||||
"\n"
|
||||
"Deprecated: Use 'gimp-drawable-edit-bucket-fill' instead.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
"gimp-drawable-edit-bucket-fill");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The affected drawable",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_enum ("fill-mode",
|
||||
"fill mode",
|
||||
"The type of fill",
|
||||
GIMP_TYPE_BUCKET_FILL_MODE,
|
||||
GIMP_BUCKET_FILL_FG,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_enum ("paint-mode",
|
||||
"paint mode",
|
||||
"The paint application mode",
|
||||
GIMP_TYPE_LAYER_MODE,
|
||||
GIMP_LAYER_MODE_NORMAL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("opacity",
|
||||
"opacity",
|
||||
"The opacity of the final bucket fill",
|
||||
0, 100, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("threshold",
|
||||
"threshold",
|
||||
"The threshold determines how extensive the seed fill will be. It's value is specified in terms of intensity levels. This parameter is only valid when there is no selection in the specified image.",
|
||||
0, 255, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("sample-merged",
|
||||
"sample merged",
|
||||
"Use the composite image, not the drawable",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("x",
|
||||
"x",
|
||||
"The x coordinate of this bucket fill's application. This parameter is only valid when there is no selection in the specified image.",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("y",
|
||||
"y",
|
||||
"The y coordinate of this bucket fill's application. This parameter is only valid when there is no selection in the specified image.",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-edit-bucket-fill-full
|
||||
*/
|
||||
procedure = gimp_procedure_new (edit_bucket_fill_full_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-edit-bucket-fill-full");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-edit-bucket-fill-full",
|
||||
"Fill the area specified either by the current selection if there is one, or by a seed fill starting at the specified coordinates.",
|
||||
"This tool requires information on the paint application mode, and the fill mode, which can either be in the foreground color, or in the currently active pattern. If there is no selection, a seed fill is executed at the specified coordinates and extends outward in keeping with the threshold parameter. If there is a selection in the target image, the threshold, sample merged, x, and y arguments are unused. If the sample_merged parameter is TRUE, the data of the composite image will be used instead of that for the specified drawable. This is equivalent to sampling for colors after merging all visible layers. In the case of merged sampling, the x and y coordinates are relative to the image's origin; otherwise, they are relative to the drawable's origin.\n"
|
||||
"\n"
|
||||
"Deprecated: Use 'gimp-drawable-edit-bucket-fill' instead.",
|
||||
"David Gowers",
|
||||
"David Gowers",
|
||||
"2006",
|
||||
"gimp-drawable-edit-bucket-fill");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The affected drawable",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_enum ("fill-mode",
|
||||
"fill mode",
|
||||
"The type of fill",
|
||||
GIMP_TYPE_BUCKET_FILL_MODE,
|
||||
GIMP_BUCKET_FILL_FG,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_enum ("paint-mode",
|
||||
"paint mode",
|
||||
"The paint application mode",
|
||||
GIMP_TYPE_LAYER_MODE,
|
||||
GIMP_LAYER_MODE_NORMAL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("opacity",
|
||||
"opacity",
|
||||
"The opacity of the final bucket fill",
|
||||
0, 100, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("threshold",
|
||||
"threshold",
|
||||
"The threshold determines how extensive the seed fill will be. It's value is specified in terms of intensity levels. This parameter is only valid when there is no selection in the specified image.",
|
||||
0, 255, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("sample-merged",
|
||||
"sample merged",
|
||||
"Use the composite image, not the drawable",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("fill-transparent",
|
||||
"fill transparent",
|
||||
"Whether to consider transparent pixels for filling. If TRUE, transparency is considered as a unique fillable color.",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_enum ("select-criterion",
|
||||
"select criterion",
|
||||
"The criterion used to determine color similarity. SELECT_CRITERION_COMPOSITE is the standard choice.",
|
||||
GIMP_TYPE_SELECT_CRITERION,
|
||||
GIMP_SELECT_CRITERION_COMPOSITE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("x",
|
||||
"x",
|
||||
"The x coordinate of this bucket fill's application. This parameter is only valid when there is no selection in the specified image.",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("y",
|
||||
"y",
|
||||
"The y coordinate of this bucket fill's application. This parameter is only valid when there is no selection in the specified image.",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-edit-blend
|
||||
*/
|
||||
procedure = gimp_procedure_new (edit_blend_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-edit-blend");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-edit-blend",
|
||||
"Blend between the starting and ending coordinates with the specified blend mode and gradient type.",
|
||||
"This tool requires information on the paint application mode, the blend mode, and the gradient type. It creates the specified variety of blend using the starting and ending coordinates as defined for each gradient type. For shapeburst gradient types, the context's distance metric is also relevant and can be updated with 'gimp-context-set-distance-metric'.\n"
|
||||
"\n"
|
||||
"Deprecated: Use 'gimp-drawable-edit-gradient-fill' instead.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
"gimp-drawable-edit-gradient-fill");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The affected drawable",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_enum ("blend-mode",
|
||||
"blend mode",
|
||||
"The type of blend",
|
||||
GIMP_TYPE_BLEND_MODE,
|
||||
GIMP_BLEND_FG_BG_RGB,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_enum ("paint-mode",
|
||||
"paint mode",
|
||||
"The paint application mode",
|
||||
GIMP_TYPE_LAYER_MODE,
|
||||
GIMP_LAYER_MODE_NORMAL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_enum ("gradient-type",
|
||||
"gradient type",
|
||||
"The type of gradient",
|
||||
GIMP_TYPE_GRADIENT_TYPE,
|
||||
GIMP_GRADIENT_LINEAR,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("opacity",
|
||||
"opacity",
|
||||
"The opacity of the final blend",
|
||||
0, 100, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("offset",
|
||||
"offset",
|
||||
"Offset relates to the starting and ending coordinates specified for the blend. This parameter is mode dependent.",
|
||||
0, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_enum ("repeat",
|
||||
"repeat",
|
||||
"Repeat mode",
|
||||
GIMP_TYPE_REPEAT_MODE,
|
||||
GIMP_REPEAT_NONE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("reverse",
|
||||
"reverse",
|
||||
"Use the reverse gradient",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("supersample",
|
||||
"supersample",
|
||||
"Do adaptive supersampling",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_int32 ("max-depth",
|
||||
"max depth",
|
||||
"Maximum recursion levels for supersampling",
|
||||
1, 9, 1,
|
||||
GIMP_PARAM_READWRITE | GIMP_PARAM_NO_VALIDATE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("threshold",
|
||||
"threshold",
|
||||
"Supersampling threshold",
|
||||
0, 4, 0,
|
||||
GIMP_PARAM_READWRITE | GIMP_PARAM_NO_VALIDATE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("dither",
|
||||
"dither",
|
||||
"Use dithering to reduce banding",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("x1",
|
||||
"x1",
|
||||
"The x coordinate of this blend's starting point",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("y1",
|
||||
"y1",
|
||||
"The y coordinate of this blend's starting point",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("x2",
|
||||
"x2",
|
||||
"The x coordinate of this blend's ending point",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("y2",
|
||||
"y2",
|
||||
"The y coordinate of this blend's ending point",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-edit-stroke
|
||||
*/
|
||||
procedure = gimp_procedure_new (edit_stroke_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-edit-stroke");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-edit-stroke",
|
||||
"Stroke the current selection",
|
||||
"This procedure strokes the current selection, painting along the selection boundary with the active brush and foreground color. The paint is applied to the specified drawable regardless of the active selection.\n"
|
||||
"\n"
|
||||
"Deprecated: Use 'gimp-drawable-edit-stroke-selection' instead.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
"gimp-drawable-edit-stroke-selection");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The drawable to stroke to",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-edit-stroke-vectors
|
||||
*/
|
||||
procedure = gimp_procedure_new (edit_stroke_vectors_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-edit-stroke-vectors");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-edit-stroke-vectors",
|
||||
"Stroke the specified vectors object",
|
||||
"This procedure strokes the specified vectors object, painting along the path with the active brush and foreground color.\n"
|
||||
"\n"
|
||||
"Deprecated: Use 'gimp-drawable-edit-stroke-item' instead.",
|
||||
"Simon Budig",
|
||||
"Simon Budig",
|
||||
"2006",
|
||||
"gimp-drawable-edit-stroke-item");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The drawable to stroke to",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_vectors_id ("vectors",
|
||||
"vectors",
|
||||
"The vectors object",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
}
|
||||
|
|
|
@ -171,38 +171,6 @@ floating_sel_attach_invoker (GimpProcedure *procedure,
|
|||
error ? *error : NULL);
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
floating_sel_rigor_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
if (success)
|
||||
{
|
||||
}
|
||||
return gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
floating_sel_relax_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
if (success)
|
||||
{
|
||||
}
|
||||
return gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
}
|
||||
|
||||
void
|
||||
register_floating_sel_procs (GimpPDB *pdb)
|
||||
{
|
||||
|
@ -305,62 +273,4 @@ register_floating_sel_procs (GimpPDB *pdb)
|
|||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-floating-sel-rigor
|
||||
*/
|
||||
procedure = gimp_procedure_new (floating_sel_rigor_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-floating-sel-rigor");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-floating-sel-rigor",
|
||||
"Deprecated: There is no replacement for this procedure.",
|
||||
"Deprecated: There is no replacement for this procedure.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"NONE");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_layer_id ("floating-sel",
|
||||
"floating sel",
|
||||
"The floating selection",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("undo",
|
||||
"undo",
|
||||
"",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-floating-sel-relax
|
||||
*/
|
||||
procedure = gimp_procedure_new (floating_sel_relax_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-floating-sel-relax");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-floating-sel-relax",
|
||||
"Deprecated: There is no replacement for this procedure.",
|
||||
"Deprecated: There is no replacement for this procedure.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"NONE");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_layer_id ("floating-sel",
|
||||
"floating sel",
|
||||
"The floating selection",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("undo",
|
||||
"undo",
|
||||
"",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
}
|
||||
|
|
|
@ -89,211 +89,6 @@ gradients_get_list_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
gradients_sample_uniform_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpValueArray *return_vals;
|
||||
gint32 num_samples;
|
||||
gboolean reverse;
|
||||
gint32 array_length = 0;
|
||||
gdouble *color_samples = NULL;
|
||||
|
||||
num_samples = g_value_get_int (gimp_value_array_index (args, 0));
|
||||
reverse = g_value_get_boolean (gimp_value_array_index (args, 1));
|
||||
|
||||
if (success)
|
||||
{
|
||||
GimpGradient *gradient;
|
||||
GimpGradientSegment *seg = NULL;
|
||||
gdouble pos, delta;
|
||||
GimpRGB color;
|
||||
gdouble *pv;
|
||||
|
||||
pos = 0.0;
|
||||
delta = 1.0 / (num_samples - 1);
|
||||
|
||||
array_length = num_samples * 4;
|
||||
|
||||
pv = color_samples = g_new (gdouble, array_length);
|
||||
|
||||
gradient = gimp_context_get_gradient (context);
|
||||
|
||||
while (num_samples--)
|
||||
{
|
||||
seg = gimp_gradient_get_color_at (gradient, context, seg,
|
||||
pos, reverse,
|
||||
GIMP_GRADIENT_BLEND_RGB_PERCEPTUAL,
|
||||
&color);
|
||||
|
||||
*pv++ = color.r;
|
||||
*pv++ = color.g;
|
||||
*pv++ = color.b;
|
||||
*pv++ = color.a;
|
||||
|
||||
pos += delta;
|
||||
}
|
||||
}
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
|
||||
if (success)
|
||||
{
|
||||
g_value_set_int (gimp_value_array_index (return_vals, 1), array_length);
|
||||
gimp_value_take_floatarray (gimp_value_array_index (return_vals, 2), color_samples, array_length);
|
||||
}
|
||||
|
||||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
gradients_sample_custom_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpValueArray *return_vals;
|
||||
gint32 num_samples;
|
||||
const gdouble *positions;
|
||||
gboolean reverse;
|
||||
gint32 array_length = 0;
|
||||
gdouble *color_samples = NULL;
|
||||
|
||||
num_samples = g_value_get_int (gimp_value_array_index (args, 0));
|
||||
positions = gimp_value_get_floatarray (gimp_value_array_index (args, 1));
|
||||
reverse = g_value_get_boolean (gimp_value_array_index (args, 2));
|
||||
|
||||
if (success)
|
||||
{
|
||||
GimpGradient *gradient;
|
||||
GimpGradientSegment *seg = NULL;
|
||||
GimpRGB color;
|
||||
gdouble *pv;
|
||||
|
||||
array_length = num_samples * 4;
|
||||
|
||||
pv = color_samples = g_new (gdouble, array_length);
|
||||
|
||||
gradient = gimp_context_get_gradient (context);
|
||||
|
||||
while (num_samples--)
|
||||
{
|
||||
seg = gimp_gradient_get_color_at (gradient, context, seg,
|
||||
*positions, reverse,
|
||||
GIMP_GRADIENT_BLEND_RGB_PERCEPTUAL,
|
||||
&color);
|
||||
|
||||
*pv++ = color.r;
|
||||
*pv++ = color.g;
|
||||
*pv++ = color.b;
|
||||
*pv++ = color.a;
|
||||
|
||||
positions++;
|
||||
}
|
||||
}
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
|
||||
if (success)
|
||||
{
|
||||
g_value_set_int (gimp_value_array_index (return_vals, 1), array_length);
|
||||
gimp_value_take_floatarray (gimp_value_array_index (return_vals, 2), color_samples, array_length);
|
||||
}
|
||||
|
||||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
gradients_get_gradient_data_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpValueArray *return_vals;
|
||||
const gchar *name;
|
||||
gint32 sample_size;
|
||||
gboolean reverse;
|
||||
gchar *actual_name = NULL;
|
||||
gint32 width = 0;
|
||||
gdouble *grad_data = NULL;
|
||||
|
||||
name = g_value_get_string (gimp_value_array_index (args, 0));
|
||||
sample_size = g_value_get_int (gimp_value_array_index (args, 1));
|
||||
reverse = g_value_get_boolean (gimp_value_array_index (args, 2));
|
||||
|
||||
if (success)
|
||||
{
|
||||
GimpGradient *gradient;
|
||||
|
||||
if (sample_size < 1 || sample_size > 10000)
|
||||
sample_size = GIMP_GRADIENT_DEFAULT_SAMPLE_SIZE;
|
||||
|
||||
if (name && strlen (name))
|
||||
gradient = gimp_pdb_get_gradient (gimp, name, FALSE, error);
|
||||
else
|
||||
gradient = gimp_context_get_gradient (context);
|
||||
|
||||
if (gradient)
|
||||
{
|
||||
GimpGradientSegment *seg = NULL;
|
||||
gdouble *pv;
|
||||
gdouble pos, delta;
|
||||
GimpRGB color;
|
||||
|
||||
pos = 0.0;
|
||||
delta = 1.0 / (sample_size - 1);
|
||||
|
||||
actual_name = g_strdup (gimp_object_get_name (gradient));
|
||||
grad_data = g_new (gdouble, sample_size * 4);
|
||||
width = sample_size * 4;
|
||||
|
||||
pv = grad_data;
|
||||
|
||||
while (sample_size--)
|
||||
{
|
||||
seg = gimp_gradient_get_color_at (gradient, context, seg,
|
||||
pos, reverse,
|
||||
GIMP_GRADIENT_BLEND_RGB_PERCEPTUAL,
|
||||
&color);
|
||||
|
||||
*pv++ = color.r;
|
||||
*pv++ = color.g;
|
||||
*pv++ = color.b;
|
||||
*pv++ = color.a;
|
||||
|
||||
pos += delta;
|
||||
}
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
|
||||
if (success)
|
||||
{
|
||||
g_value_take_string (gimp_value_array_index (return_vals, 1), actual_name);
|
||||
g_value_set_int (gimp_value_array_index (return_vals, 2), width);
|
||||
gimp_value_take_floatarray (gimp_value_array_index (return_vals, 3), grad_data, width);
|
||||
}
|
||||
|
||||
return return_vals;
|
||||
}
|
||||
|
||||
void
|
||||
register_gradients_procs (GimpPDB *pdb)
|
||||
{
|
||||
|
@ -350,143 +145,4 @@ register_gradients_procs (GimpPDB *pdb)
|
|||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-gradients-sample-uniform
|
||||
*/
|
||||
procedure = gimp_procedure_new (gradients_sample_uniform_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-gradients-sample-uniform");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-gradients-sample-uniform",
|
||||
"Deprecated: Use 'gimp-gradient-get-uniform-samples' instead.",
|
||||
"Deprecated: Use 'gimp-gradient-get-uniform-samples' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-gradient-get-uniform-samples");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_int32 ("num-samples",
|
||||
"num samples",
|
||||
"The number of samples to take",
|
||||
2, G_MAXINT32, 2,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("reverse",
|
||||
"reverse",
|
||||
"Use the reverse gradient",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("array-length",
|
||||
"array length",
|
||||
"Length of the color_samples array (4 * num_samples)",
|
||||
0, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_float_array ("color-samples",
|
||||
"color samples",
|
||||
"Color samples: { R1, G1, B1, A1, ..., Rn, Gn, Bn, An }",
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-gradients-sample-custom
|
||||
*/
|
||||
procedure = gimp_procedure_new (gradients_sample_custom_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-gradients-sample-custom");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-gradients-sample-custom",
|
||||
"Deprecated: Use 'gimp-gradient-get-custom-samples' instead.",
|
||||
"Deprecated: Use 'gimp-gradient-get-custom-samples' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-gradient-get-custom-samples");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_int32 ("num-samples",
|
||||
"num samples",
|
||||
"The number of samples to take",
|
||||
0, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_float_array ("positions",
|
||||
"positions",
|
||||
"The list of positions to sample along the gradient",
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("reverse",
|
||||
"reverse",
|
||||
"Use the reverse gradient",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("array-length",
|
||||
"array length",
|
||||
"Length of the color_samples array (4 * num_samples)",
|
||||
0, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_float_array ("color-samples",
|
||||
"color samples",
|
||||
"Color samples: { R1, G1, B1, A1, ..., Rn, Gn, Bn, An }",
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-gradients-get-gradient-data
|
||||
*/
|
||||
procedure = gimp_procedure_new (gradients_get_gradient_data_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-gradients-get-gradient-data");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-gradients-get-gradient-data",
|
||||
"Deprecated: Use 'gimp-gradient-get-uniform-samples' instead.",
|
||||
"Deprecated: Use 'gimp-gradient-get-uniform-samples' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-gradient-get-uniform-samples");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("name",
|
||||
"name",
|
||||
"The gradient name (\"\" means current active gradient)",
|
||||
FALSE, TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_int32 ("sample-size",
|
||||
"sample size",
|
||||
"Size of the sample to return when the gradient is changed",
|
||||
1, 10000, 1,
|
||||
GIMP_PARAM_READWRITE | GIMP_PARAM_NO_VALIDATE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("reverse",
|
||||
"reverse",
|
||||
"Use the reverse gradient",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("actual-name",
|
||||
"actual name",
|
||||
"The gradient name",
|
||||
FALSE, FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("width",
|
||||
"width",
|
||||
"The gradient sample width (r,g,b,a)",
|
||||
0, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_float_array ("grad-data",
|
||||
"grad data",
|
||||
"The gradient sample data",
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
}
|
||||
|
|
|
@ -46,7 +46,6 @@
|
|||
#include "core/gimpimage.h"
|
||||
#include "core/gimpitem.h"
|
||||
#include "core/gimplayer.h"
|
||||
#include "core/gimplayermask.h"
|
||||
#include "core/gimpparamspecs.h"
|
||||
#include "core/gimppickable.h"
|
||||
#include "core/gimpprogress.h"
|
||||
|
@ -422,22 +421,6 @@ image_height_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
image_free_shadow_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
if (success)
|
||||
{
|
||||
}
|
||||
return gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
image_get_layers_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -787,43 +770,6 @@ image_pick_correlate_layer_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
image_add_layer_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpImage *image;
|
||||
GimpLayer *layer;
|
||||
gint32 position;
|
||||
|
||||
image = gimp_value_get_image (gimp_value_array_index (args, 0), gimp);
|
||||
layer = gimp_value_get_layer (gimp_value_array_index (args, 1), gimp);
|
||||
position = g_value_get_int (gimp_value_array_index (args, 2));
|
||||
|
||||
if (success)
|
||||
{
|
||||
if (gimp_pdb_item_is_floating (GIMP_ITEM (layer), image, error) &&
|
||||
gimp_pdb_image_is_base_type (image,
|
||||
gimp_drawable_get_base_type (GIMP_DRAWABLE (layer)),
|
||||
error))
|
||||
{
|
||||
success = gimp_image_add_layer (image, layer,
|
||||
NULL, MAX (position, -1), TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
success = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
image_insert_layer_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -957,40 +903,6 @@ image_thaw_layers_invoker (GimpProcedure *procedure,
|
|||
error ? *error : NULL);
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
image_add_channel_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpImage *image;
|
||||
GimpChannel *channel;
|
||||
gint32 position;
|
||||
|
||||
image = gimp_value_get_image (gimp_value_array_index (args, 0), gimp);
|
||||
channel = gimp_value_get_channel (gimp_value_array_index (args, 1), gimp);
|
||||
position = g_value_get_int (gimp_value_array_index (args, 2));
|
||||
|
||||
if (success)
|
||||
{
|
||||
if (gimp_pdb_item_is_floating (GIMP_ITEM (channel), image, error))
|
||||
{
|
||||
success = gimp_image_add_channel (image, channel,
|
||||
NULL, MAX (position, -1), TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
success = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
image_insert_channel_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -1121,40 +1033,6 @@ image_thaw_channels_invoker (GimpProcedure *procedure,
|
|||
error ? *error : NULL);
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
image_add_vectors_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpImage *image;
|
||||
GimpVectors *vectors;
|
||||
gint32 position;
|
||||
|
||||
image = gimp_value_get_image (gimp_value_array_index (args, 0), gimp);
|
||||
vectors = gimp_value_get_vectors (gimp_value_array_index (args, 1), gimp);
|
||||
position = g_value_get_int (gimp_value_array_index (args, 2));
|
||||
|
||||
if (success)
|
||||
{
|
||||
if (gimp_pdb_item_is_floating (GIMP_ITEM (vectors), image, error))
|
||||
{
|
||||
success = gimp_image_add_vectors (image, vectors,
|
||||
NULL, MAX (position, -1), TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
success = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
image_insert_vectors_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -1574,71 +1452,6 @@ image_merge_down_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
image_add_layer_mask_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpImage *image;
|
||||
GimpLayer *layer;
|
||||
GimpLayerMask *mask;
|
||||
|
||||
image = gimp_value_get_image (gimp_value_array_index (args, 0), gimp);
|
||||
layer = gimp_value_get_layer (gimp_value_array_index (args, 1), gimp);
|
||||
mask = gimp_value_get_layer_mask (gimp_value_array_index (args, 2), gimp);
|
||||
|
||||
if (success)
|
||||
{
|
||||
if (gimp_pdb_item_is_floating (GIMP_ITEM (mask), image, error) &&
|
||||
gimp_pdb_item_is_not_group (GIMP_ITEM (layer), error))
|
||||
success = (gimp_layer_add_mask (layer, mask, TRUE, error) == mask);
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
image_remove_layer_mask_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpImage *image;
|
||||
GimpLayer *layer;
|
||||
gint32 mode;
|
||||
|
||||
image = gimp_value_get_image (gimp_value_array_index (args, 0), gimp);
|
||||
layer = gimp_value_get_layer (gimp_value_array_index (args, 1), gimp);
|
||||
mode = g_value_get_enum (gimp_value_array_index (args, 2));
|
||||
|
||||
if (success)
|
||||
{
|
||||
GimpPDBItemModify modify = 0;
|
||||
|
||||
if (mode == GIMP_MASK_APPLY)
|
||||
modify |= GIMP_PDB_ITEM_CONTENT;
|
||||
|
||||
if (gimp_pdb_item_is_attached (GIMP_ITEM (layer), image, modify, error) &&
|
||||
gimp_layer_get_mask (layer))
|
||||
gimp_layer_apply_mask (layer, mode, TRUE);
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
image_get_colormap_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -3299,29 +3112,6 @@ register_image_procs (GimpPDB *pdb)
|
|||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-image-free-shadow
|
||||
*/
|
||||
procedure = gimp_procedure_new (image_free_shadow_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-image-free-shadow");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-image-free-shadow",
|
||||
"Deprecated: Use 'gimp-drawable-free-shadow' instead.",
|
||||
"Deprecated: Use 'gimp-drawable-free-shadow' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-drawable-free-shadow");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-image-get-layers
|
||||
*/
|
||||
|
@ -3641,41 +3431,6 @@ register_image_procs (GimpPDB *pdb)
|
|||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-image-add-layer
|
||||
*/
|
||||
procedure = gimp_procedure_new (image_add_layer_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-image-add-layer");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-image-add-layer",
|
||||
"Deprecated: Use 'gimp-image-insert-layer' instead.",
|
||||
"Deprecated: Use 'gimp-image-insert-layer' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-image-insert-layer");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_layer_id ("layer",
|
||||
"layer",
|
||||
"The layer",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_int32 ("position",
|
||||
"position",
|
||||
"The layer position",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-image-insert-layer
|
||||
*/
|
||||
|
@ -3796,41 +3551,6 @@ register_image_procs (GimpPDB *pdb)
|
|||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-image-add-channel
|
||||
*/
|
||||
procedure = gimp_procedure_new (image_add_channel_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-image-add-channel");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-image-add-channel",
|
||||
"Deprecated: Use 'gimp-image-insert-channel' instead.",
|
||||
"Deprecated: Use 'gimp-image-insert-channel' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-image-insert-channel");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_channel_id ("channel",
|
||||
"channel",
|
||||
"The channel",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_int32 ("position",
|
||||
"position",
|
||||
"The channel position",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-image-insert-channel
|
||||
*/
|
||||
|
@ -3951,41 +3671,6 @@ register_image_procs (GimpPDB *pdb)
|
|||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-image-add-vectors
|
||||
*/
|
||||
procedure = gimp_procedure_new (image_add_vectors_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-image-add-vectors");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-image-add-vectors",
|
||||
"Deprecated: Use 'gimp-image-insert-vectors' instead.",
|
||||
"Deprecated: Use 'gimp-image-insert-vectors' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-image-insert-vectors");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_vectors_id ("vectors",
|
||||
"vectors",
|
||||
"The vectors object",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_int32 ("position",
|
||||
"position",
|
||||
"The vectors objects position",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-image-insert-vectors
|
||||
*/
|
||||
|
@ -4409,77 +4094,6 @@ register_image_procs (GimpPDB *pdb)
|
|||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-image-add-layer-mask
|
||||
*/
|
||||
procedure = gimp_procedure_new (image_add_layer_mask_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-image-add-layer-mask");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-image-add-layer-mask",
|
||||
"Deprecated: Use 'gimp-layer-add-mask' instead.",
|
||||
"Deprecated: Use 'gimp-layer-add-mask' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-layer-add-mask");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_layer_id ("layer",
|
||||
"layer",
|
||||
"The layer to receive the mask",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_layer_mask_id ("mask",
|
||||
"mask",
|
||||
"The mask to add to the layer",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-image-remove-layer-mask
|
||||
*/
|
||||
procedure = gimp_procedure_new (image_remove_layer_mask_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-image-remove-layer-mask");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-image-remove-layer-mask",
|
||||
"Deprecated: Use 'gimp-layer-remove-mask' instead.",
|
||||
"Deprecated: Use 'gimp-layer-remove-mask' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-layer-remove-mask");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_layer_id ("layer",
|
||||
"layer",
|
||||
"The layer from which to remove mask",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_enum ("mode",
|
||||
"mode",
|
||||
"Removal mode",
|
||||
GIMP_TYPE_MASK_APPLY_MODE,
|
||||
GIMP_MASK_APPLY,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-image-get-colormap
|
||||
*/
|
||||
|
|
|
@ -133,40 +133,6 @@ image_scale_invoker (GimpProcedure *procedure,
|
|||
error ? *error : NULL);
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
image_scale_full_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpImage *image;
|
||||
gint32 new_width;
|
||||
gint32 new_height;
|
||||
gint32 interpolation;
|
||||
|
||||
image = gimp_value_get_image (gimp_value_array_index (args, 0), gimp);
|
||||
new_width = g_value_get_int (gimp_value_array_index (args, 1));
|
||||
new_height = g_value_get_int (gimp_value_array_index (args, 2));
|
||||
interpolation = g_value_get_enum (gimp_value_array_index (args, 3));
|
||||
|
||||
if (success)
|
||||
{
|
||||
if (progress)
|
||||
gimp_progress_start (progress, FALSE, _("Scaling"));
|
||||
|
||||
gimp_image_scale (image, new_width, new_height, interpolation, progress);
|
||||
|
||||
if (progress)
|
||||
gimp_progress_end (progress);
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
image_crop_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -369,48 +335,6 @@ register_image_transform_procs (GimpPDB *pdb)
|
|||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-image-scale-full
|
||||
*/
|
||||
procedure = gimp_procedure_new (image_scale_full_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-image-scale-full");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-image-scale-full",
|
||||
"Deprecated: Use 'gimp-image-scale' instead.",
|
||||
"Deprecated: Use 'gimp-image-scale' instead.",
|
||||
"Sven Neumann <sven@gimp.org>",
|
||||
"Sven Neumann",
|
||||
"2008",
|
||||
"gimp-image-scale");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_int32 ("new-width",
|
||||
"new width",
|
||||
"New image width",
|
||||
1, GIMP_MAX_IMAGE_SIZE, 1,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_int32 ("new-height",
|
||||
"new height",
|
||||
"New image height",
|
||||
1, GIMP_MAX_IMAGE_SIZE, 1,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_enum ("interpolation",
|
||||
"interpolation",
|
||||
"Type of interpolation",
|
||||
GIMP_TYPE_INTERPOLATION_TYPE,
|
||||
GIMP_INTERPOLATION_NONE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-image-crop
|
||||
*/
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#include "internal-procs.h"
|
||||
|
||||
|
||||
/* 840 procedures registered total */
|
||||
/* 739 procedures registered total */
|
||||
|
||||
void
|
||||
internal_procs_init (GimpPDB *pdb)
|
||||
|
@ -40,14 +40,12 @@ internal_procs_init (GimpPDB *pdb)
|
|||
register_brushes_procs (pdb);
|
||||
register_buffer_procs (pdb);
|
||||
register_channel_procs (pdb);
|
||||
register_color_procs (pdb);
|
||||
register_context_procs (pdb);
|
||||
register_debug_procs (pdb);
|
||||
register_display_procs (pdb);
|
||||
register_drawable_procs (pdb);
|
||||
register_drawable_color_procs (pdb);
|
||||
register_drawable_edit_procs (pdb);
|
||||
register_drawable_transform_procs (pdb);
|
||||
register_dynamics_procs (pdb);
|
||||
register_edit_procs (pdb);
|
||||
register_fileops_procs (pdb);
|
||||
|
@ -77,7 +75,6 @@ internal_procs_init (GimpPDB *pdb)
|
|||
register_palette_procs (pdb);
|
||||
register_palette_select_procs (pdb);
|
||||
register_palettes_procs (pdb);
|
||||
register_paths_procs (pdb);
|
||||
register_pattern_procs (pdb);
|
||||
register_pattern_select_procs (pdb);
|
||||
register_patterns_procs (pdb);
|
||||
|
@ -86,10 +83,8 @@ internal_procs_init (GimpPDB *pdb)
|
|||
register_procedural_db_procs (pdb);
|
||||
register_progress_procs (pdb);
|
||||
register_selection_procs (pdb);
|
||||
register_selection_tools_procs (pdb);
|
||||
register_text_layer_procs (pdb);
|
||||
register_text_tool_procs (pdb);
|
||||
register_transform_tools_procs (pdb);
|
||||
register_unit_procs (pdb);
|
||||
register_vectors_procs (pdb);
|
||||
}
|
||||
|
|
|
@ -29,14 +29,12 @@ void register_brush_select_procs (GimpPDB *pdb);
|
|||
void register_brushes_procs (GimpPDB *pdb);
|
||||
void register_buffer_procs (GimpPDB *pdb);
|
||||
void register_channel_procs (GimpPDB *pdb);
|
||||
void register_color_procs (GimpPDB *pdb);
|
||||
void register_context_procs (GimpPDB *pdb);
|
||||
void register_debug_procs (GimpPDB *pdb);
|
||||
void register_display_procs (GimpPDB *pdb);
|
||||
void register_drawable_procs (GimpPDB *pdb);
|
||||
void register_drawable_color_procs (GimpPDB *pdb);
|
||||
void register_drawable_edit_procs (GimpPDB *pdb);
|
||||
void register_drawable_transform_procs (GimpPDB *pdb);
|
||||
void register_dynamics_procs (GimpPDB *pdb);
|
||||
void register_edit_procs (GimpPDB *pdb);
|
||||
void register_fileops_procs (GimpPDB *pdb);
|
||||
|
@ -66,7 +64,6 @@ void register_paint_tools_procs (GimpPDB *pdb);
|
|||
void register_palette_procs (GimpPDB *pdb);
|
||||
void register_palette_select_procs (GimpPDB *pdb);
|
||||
void register_palettes_procs (GimpPDB *pdb);
|
||||
void register_paths_procs (GimpPDB *pdb);
|
||||
void register_pattern_procs (GimpPDB *pdb);
|
||||
void register_pattern_select_procs (GimpPDB *pdb);
|
||||
void register_patterns_procs (GimpPDB *pdb);
|
||||
|
@ -75,10 +72,8 @@ void register_plug_in_compat_procs (GimpPDB *pdb);
|
|||
void register_procedural_db_procs (GimpPDB *pdb);
|
||||
void register_progress_procs (GimpPDB *pdb);
|
||||
void register_selection_procs (GimpPDB *pdb);
|
||||
void register_selection_tools_procs (GimpPDB *pdb);
|
||||
void register_text_layer_procs (GimpPDB *pdb);
|
||||
void register_text_tool_procs (GimpPDB *pdb);
|
||||
void register_transform_tools_procs (GimpPDB *pdb);
|
||||
void register_unit_procs (GimpPDB *pdb);
|
||||
void register_vectors_procs (GimpPDB *pdb);
|
||||
|
||||
|
|
|
@ -417,53 +417,6 @@ layer_scale_invoker (GimpProcedure *procedure,
|
|||
error ? *error : NULL);
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
layer_scale_full_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpLayer *layer;
|
||||
gint32 new_width;
|
||||
gint32 new_height;
|
||||
gboolean local_origin;
|
||||
gint32 interpolation;
|
||||
|
||||
layer = gimp_value_get_layer (gimp_value_array_index (args, 0), gimp);
|
||||
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));
|
||||
interpolation = g_value_get_enum (gimp_value_array_index (args, 4));
|
||||
|
||||
if (success)
|
||||
{
|
||||
if (gimp_pdb_item_is_attached (GIMP_ITEM (layer), NULL,
|
||||
GIMP_PDB_ITEM_CONTENT | GIMP_PDB_ITEM_POSITION,
|
||||
error))
|
||||
{
|
||||
if (progress)
|
||||
gimp_progress_start (progress, FALSE, _("Scaling"));
|
||||
|
||||
gimp_item_scale_by_origin (GIMP_ITEM (layer), new_width, new_height,
|
||||
interpolation, progress,
|
||||
local_origin);
|
||||
|
||||
if (progress)
|
||||
gimp_progress_end (progress);
|
||||
}
|
||||
else
|
||||
{
|
||||
success = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
layer_resize_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -527,45 +480,6 @@ layer_resize_to_image_size_invoker (GimpProcedure *procedure,
|
|||
error ? *error : NULL);
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
layer_translate_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpLayer *layer;
|
||||
gint32 offx;
|
||||
gint32 offy;
|
||||
|
||||
layer = gimp_value_get_layer (gimp_value_array_index (args, 0), gimp);
|
||||
offx = g_value_get_int (gimp_value_array_index (args, 1));
|
||||
offy = g_value_get_int (gimp_value_array_index (args, 2));
|
||||
|
||||
if (success)
|
||||
{
|
||||
if (gimp_pdb_item_is_modifiable (GIMP_ITEM (layer),
|
||||
GIMP_PDB_ITEM_POSITION, error))
|
||||
{
|
||||
if (gimp_item_get_linked (GIMP_ITEM (layer)))
|
||||
{
|
||||
gimp_item_linked_translate (GIMP_ITEM (layer), offx, offy, TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
gimp_item_translate (GIMP_ITEM (layer), offx, offy, TRUE);
|
||||
}
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
layer_set_offsets_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -1625,54 +1539,6 @@ register_layer_procs (GimpPDB *pdb)
|
|||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-layer-scale-full
|
||||
*/
|
||||
procedure = gimp_procedure_new (layer_scale_full_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-layer-scale-full");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-layer-scale-full",
|
||||
"Deprecated: Use 'gimp-layer-scale' instead.",
|
||||
"Deprecated: Use 'gimp-layer-scale' instead.",
|
||||
"Sven Neumann <sven@gimp.org>",
|
||||
"Sven Neumann",
|
||||
"2008",
|
||||
"gimp-layer-scale");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_layer_id ("layer",
|
||||
"layer",
|
||||
"The layer",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_int32 ("new-width",
|
||||
"new width",
|
||||
"New layer width",
|
||||
1, GIMP_MAX_IMAGE_SIZE, 1,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_int32 ("new-height",
|
||||
"new height",
|
||||
"New layer height",
|
||||
1, GIMP_MAX_IMAGE_SIZE, 1,
|
||||
GIMP_PARAM_READWRITE));
|
||||
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));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_enum ("interpolation",
|
||||
"interpolation",
|
||||
"Type of interpolation",
|
||||
GIMP_TYPE_INTERPOLATION_TYPE,
|
||||
GIMP_INTERPOLATION_NONE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-layer-resize
|
||||
*/
|
||||
|
@ -1743,43 +1609,6 @@ register_layer_procs (GimpPDB *pdb)
|
|||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-layer-translate
|
||||
*/
|
||||
procedure = gimp_procedure_new (layer_translate_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-layer-translate");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-layer-translate",
|
||||
"Translate the layer by the specified offsets.",
|
||||
"This procedure translates the layer by the amounts specified in the x and y arguments. These can be negative, and are considered offsets from the current position. This command only works if the layer has been added to an image. All additional layers contained in the image which have the linked flag set to TRUE w ill also be translated by the specified offsets.\n"
|
||||
"\n"
|
||||
"Deprecated: Use 'gimp-item-transform-translate' instead.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
"gimp-item-transform-translate");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_layer_id ("layer",
|
||||
"layer",
|
||||
"The layer",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_int32 ("offx",
|
||||
"offx",
|
||||
"Offset in x direction",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_int32 ("offy",
|
||||
"offy",
|
||||
"Offset in y direction",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-layer-set-offsets
|
||||
*/
|
||||
|
|
|
@ -19,15 +19,12 @@
|
|||
|
||||
#include "config.h"
|
||||
|
||||
#include <cairo.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <gegl.h>
|
||||
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
|
||||
#include "libgimpcolor/gimpcolor.h"
|
||||
|
||||
#include "libgimpbase/gimpbase.h"
|
||||
|
||||
#include "pdb-types.h"
|
||||
|
@ -92,99 +89,6 @@ palettes_get_list_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
palettes_get_palette_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpValueArray *return_vals;
|
||||
gchar *name = NULL;
|
||||
gint32 num_colors = 0;
|
||||
|
||||
GimpPalette *palette = gimp_context_get_palette (context);
|
||||
|
||||
if (palette)
|
||||
{
|
||||
name = g_strdup (gimp_object_get_name (palette));
|
||||
num_colors = gimp_palette_get_n_colors (palette);
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
|
||||
if (success)
|
||||
{
|
||||
g_value_take_string (gimp_value_array_index (return_vals, 1), name);
|
||||
g_value_set_int (gimp_value_array_index (return_vals, 2), num_colors);
|
||||
}
|
||||
|
||||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
palettes_get_palette_entry_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpValueArray *return_vals;
|
||||
const gchar *name;
|
||||
gint32 entry_num;
|
||||
gchar *actual_name = NULL;
|
||||
gint32 num_colors = 0;
|
||||
GimpRGB color = { 0.0, 0.0, 0.0, 1.0 };
|
||||
|
||||
name = g_value_get_string (gimp_value_array_index (args, 0));
|
||||
entry_num = g_value_get_int (gimp_value_array_index (args, 1));
|
||||
|
||||
if (success)
|
||||
{
|
||||
GimpPalette *palette;
|
||||
|
||||
if (name && strlen (name))
|
||||
palette = gimp_pdb_get_palette (gimp, name, FALSE, error);
|
||||
else
|
||||
palette = gimp_context_get_palette (context);
|
||||
|
||||
if (palette)
|
||||
{
|
||||
GimpPaletteEntry *entry = gimp_palette_get_entry (palette, entry_num);
|
||||
|
||||
if (entry)
|
||||
{
|
||||
actual_name = g_strdup (gimp_object_get_name (palette));
|
||||
num_colors = gimp_palette_get_n_colors (palette);
|
||||
color = entry->color;
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
|
||||
if (success)
|
||||
{
|
||||
g_value_take_string (gimp_value_array_index (return_vals, 1), actual_name);
|
||||
g_value_set_int (gimp_value_array_index (return_vals, 2), num_colors);
|
||||
gimp_value_set_rgb (gimp_value_array_index (return_vals, 3), &color);
|
||||
}
|
||||
|
||||
return return_vals;
|
||||
}
|
||||
|
||||
void
|
||||
register_palettes_procs (GimpPDB *pdb)
|
||||
{
|
||||
|
@ -241,84 +145,4 @@ register_palettes_procs (GimpPDB *pdb)
|
|||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-palettes-get-palette
|
||||
*/
|
||||
procedure = gimp_procedure_new (palettes_get_palette_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-palettes-get-palette");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-palettes-get-palette",
|
||||
"Deprecated: Use 'gimp-context-get-palette' instead.",
|
||||
"Deprecated: Use 'gimp-context-get-palette' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-context-get-palette");
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("name",
|
||||
"name",
|
||||
"The palette name",
|
||||
FALSE, TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("num-colors",
|
||||
"num colors",
|
||||
"The palette num_colors",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-palettes-get-palette-entry
|
||||
*/
|
||||
procedure = gimp_procedure_new (palettes_get_palette_entry_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-palettes-get-palette-entry");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-palettes-get-palette-entry",
|
||||
"Deprecated: Use 'gimp-palette-entry-get-color' instead.",
|
||||
"Deprecated: Use 'gimp-palette-entry-get-color' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-palette-entry-get-color");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("name",
|
||||
"name",
|
||||
"The palette name (\"\" means currently active palette)",
|
||||
FALSE, TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_int32 ("entry-num",
|
||||
"entry num",
|
||||
"The entry to retrieve",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("actual-name",
|
||||
"actual name",
|
||||
"The palette name",
|
||||
FALSE, FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("num-colors",
|
||||
"num colors",
|
||||
"The palette num_colors",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_rgb ("color",
|
||||
"color",
|
||||
"The color requested",
|
||||
FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
}
|
||||
|
|
1283
app/pdb/paths-cmds.c
1283
app/pdb/paths-cmds.c
File diff suppressed because it is too large
Load Diff
|
@ -90,102 +90,6 @@ patterns_get_list_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
patterns_get_pattern_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpValueArray *return_vals;
|
||||
gchar *name = NULL;
|
||||
gint32 width = 0;
|
||||
gint32 height = 0;
|
||||
|
||||
GimpPattern *pattern = gimp_context_get_pattern (context);
|
||||
|
||||
if (pattern)
|
||||
{
|
||||
name = g_strdup (gimp_object_get_name (pattern));
|
||||
width = gimp_temp_buf_get_width (pattern->mask);
|
||||
height = gimp_temp_buf_get_height (pattern->mask);
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
|
||||
if (success)
|
||||
{
|
||||
g_value_take_string (gimp_value_array_index (return_vals, 1), name);
|
||||
g_value_set_int (gimp_value_array_index (return_vals, 2), width);
|
||||
g_value_set_int (gimp_value_array_index (return_vals, 3), height);
|
||||
}
|
||||
|
||||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
patterns_get_pattern_data_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpValueArray *return_vals;
|
||||
const gchar *name;
|
||||
gchar *actual_name = NULL;
|
||||
gint32 width = 0;
|
||||
gint32 height = 0;
|
||||
gint32 mask_bpp = 0;
|
||||
gint32 length = 0;
|
||||
guint8 *mask_data = NULL;
|
||||
|
||||
name = g_value_get_string (gimp_value_array_index (args, 0));
|
||||
|
||||
if (success)
|
||||
{
|
||||
GimpPattern *pattern;
|
||||
|
||||
if (name && strlen (name))
|
||||
pattern = gimp_pdb_get_pattern (gimp, name, error);
|
||||
else
|
||||
pattern = gimp_context_get_pattern (context);
|
||||
|
||||
if (pattern)
|
||||
{
|
||||
actual_name = g_strdup (gimp_object_get_name (pattern));
|
||||
width = gimp_temp_buf_get_width (pattern->mask);
|
||||
height = gimp_temp_buf_get_height (pattern->mask);
|
||||
mask_bpp = babl_format_get_bytes_per_pixel (gimp_temp_buf_get_format (pattern->mask));
|
||||
length = gimp_temp_buf_get_data_size (pattern->mask);
|
||||
mask_data = g_memdup (gimp_temp_buf_get_data (pattern->mask), length);
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
|
||||
if (success)
|
||||
{
|
||||
g_value_take_string (gimp_value_array_index (return_vals, 1), actual_name);
|
||||
g_value_set_int (gimp_value_array_index (return_vals, 2), width);
|
||||
g_value_set_int (gimp_value_array_index (return_vals, 3), height);
|
||||
g_value_set_int (gimp_value_array_index (return_vals, 4), mask_bpp);
|
||||
g_value_set_int (gimp_value_array_index (return_vals, 5), length);
|
||||
gimp_value_take_int8array (gimp_value_array_index (return_vals, 6), mask_data, length);
|
||||
}
|
||||
|
||||
return return_vals;
|
||||
}
|
||||
|
||||
void
|
||||
register_patterns_procs (GimpPDB *pdb)
|
||||
{
|
||||
|
@ -242,100 +146,4 @@ register_patterns_procs (GimpPDB *pdb)
|
|||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-patterns-get-pattern
|
||||
*/
|
||||
procedure = gimp_procedure_new (patterns_get_pattern_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-patterns-get-pattern");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-patterns-get-pattern",
|
||||
"Deprecated: Use 'gimp-context-get-pattern' instead.",
|
||||
"Deprecated: Use 'gimp-context-get-pattern' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-context-get-pattern");
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("name",
|
||||
"name",
|
||||
"The pattern name",
|
||||
FALSE, FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("width",
|
||||
"width",
|
||||
"The pattern width",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("height",
|
||||
"height",
|
||||
"The pattern height",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-patterns-get-pattern-data
|
||||
*/
|
||||
procedure = gimp_procedure_new (patterns_get_pattern_data_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-patterns-get-pattern-data");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-patterns-get-pattern-data",
|
||||
"Deprecated: Use 'gimp-pattern-get-pixels' instead.",
|
||||
"Deprecated: Use 'gimp-pattern-get-pixels' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-pattern-get-pixels");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("name",
|
||||
"name",
|
||||
"The pattern name (\"\" means currently active pattern)",
|
||||
FALSE, TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("actual-name",
|
||||
"actual name",
|
||||
"The pattern name",
|
||||
FALSE, FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("width",
|
||||
"width",
|
||||
"The pattern width",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("height",
|
||||
"height",
|
||||
"The pattern height",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("mask-bpp",
|
||||
"mask bpp",
|
||||
"Pattern bytes per pixel",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("length",
|
||||
"length",
|
||||
"Length of pattern mask data",
|
||||
0, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int8_array ("mask-data",
|
||||
"mask data",
|
||||
"The pattern mask data",
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
}
|
||||
|
|
|
@ -445,60 +445,6 @@ selection_flood_invoker (GimpProcedure *procedure,
|
|||
error ? *error : NULL);
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
selection_layer_alpha_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpLayer *layer;
|
||||
|
||||
layer = gimp_value_get_layer (gimp_value_array_index (args, 0), gimp);
|
||||
|
||||
if (success)
|
||||
{
|
||||
if (gimp_pdb_item_is_attached (GIMP_ITEM (layer), NULL, 0, error))
|
||||
gimp_item_to_selection (GIMP_ITEM (layer),
|
||||
GIMP_CHANNEL_OP_REPLACE,
|
||||
TRUE, FALSE, 0.0, 0.0);
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
selection_load_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpChannel *channel;
|
||||
|
||||
channel = gimp_value_get_channel (gimp_value_array_index (args, 0), gimp);
|
||||
|
||||
if (success)
|
||||
{
|
||||
if (gimp_pdb_item_is_attached (GIMP_ITEM (channel), NULL, 0, error))
|
||||
gimp_item_to_selection (GIMP_ITEM (channel),
|
||||
GIMP_CHANNEL_OP_REPLACE,
|
||||
TRUE, FALSE, 0.0, 0.0);
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
selection_save_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -540,35 +486,6 @@ selection_save_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
selection_combine_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpChannel *channel;
|
||||
gint32 operation;
|
||||
|
||||
channel = gimp_value_get_channel (gimp_value_array_index (args, 0), gimp);
|
||||
operation = g_value_get_enum (gimp_value_array_index (args, 1));
|
||||
|
||||
if (success)
|
||||
{
|
||||
if (gimp_pdb_item_is_attached (GIMP_ITEM (channel), NULL, 0, error))
|
||||
gimp_item_to_selection (GIMP_ITEM (channel),
|
||||
operation,
|
||||
TRUE, FALSE, 0.0, 0.0);
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
}
|
||||
|
||||
void
|
||||
register_selection_procs (GimpPDB *pdb)
|
||||
{
|
||||
|
@ -1004,52 +921,6 @@ register_selection_procs (GimpPDB *pdb)
|
|||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-selection-layer-alpha
|
||||
*/
|
||||
procedure = gimp_procedure_new (selection_layer_alpha_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-selection-layer-alpha");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-selection-layer-alpha",
|
||||
"Deprecated: Use 'gimp-image-select-item' instead.",
|
||||
"Deprecated: Use 'gimp-image-select-item' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-image-select-item");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_layer_id ("layer",
|
||||
"layer",
|
||||
"Layer with alpha",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-selection-load
|
||||
*/
|
||||
procedure = gimp_procedure_new (selection_load_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-selection-load");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-selection-load",
|
||||
"Deprecated: Use 'gimp-image-select-item' instead.",
|
||||
"Deprecated: Use 'gimp-image-select-item' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-image-select-item");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_channel_id ("channel",
|
||||
"channel",
|
||||
"The channel",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-selection-save
|
||||
*/
|
||||
|
@ -1078,34 +949,4 @@ register_selection_procs (GimpPDB *pdb)
|
|||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-selection-combine
|
||||
*/
|
||||
procedure = gimp_procedure_new (selection_combine_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-selection-combine");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-selection-combine",
|
||||
"Deprecated: Use 'gimp-image-select-item' instead.",
|
||||
"Deprecated: Use 'gimp-image-select-item' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-image-select-item");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_channel_id ("channel",
|
||||
"channel",
|
||||
"The channel",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_enum ("operation",
|
||||
"operation",
|
||||
"The selection operation",
|
||||
GIMP_TYPE_CHANNEL_OPS,
|
||||
GIMP_CHANNEL_OP_ADD,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1135,82 +1135,6 @@ text_layer_resize_invoker (GimpProcedure *procedure,
|
|||
error ? *error : NULL);
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
text_layer_get_hinting_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpValueArray *return_vals;
|
||||
GimpLayer *layer;
|
||||
gboolean hinting = FALSE;
|
||||
gboolean autohint = FALSE;
|
||||
|
||||
layer = gimp_value_get_layer (gimp_value_array_index (args, 0), gimp);
|
||||
|
||||
if (success)
|
||||
{
|
||||
if (gimp_pdb_layer_is_text_layer (layer, 0, error))
|
||||
{
|
||||
g_object_get (gimp_text_layer_get_text (GIMP_TEXT_LAYER (layer)),
|
||||
"hinting", &hinting,
|
||||
NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
success = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
|
||||
if (success)
|
||||
{
|
||||
g_value_set_boolean (gimp_value_array_index (return_vals, 1), hinting);
|
||||
g_value_set_boolean (gimp_value_array_index (return_vals, 2), autohint);
|
||||
}
|
||||
|
||||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
text_layer_set_hinting_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpLayer *layer;
|
||||
gboolean hinting;
|
||||
|
||||
layer = gimp_value_get_layer (gimp_value_array_index (args, 0), gimp);
|
||||
hinting = g_value_get_boolean (gimp_value_array_index (args, 1));
|
||||
|
||||
if (success)
|
||||
{
|
||||
if (gimp_pdb_layer_is_text_layer (layer, GIMP_PDB_ITEM_CONTENT, error))
|
||||
{
|
||||
gimp_text_layer_set (GIMP_TEXT_LAYER (layer),
|
||||
_("Set text layer attribute"),
|
||||
"hinting", hinting,
|
||||
NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
success = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
}
|
||||
|
||||
void
|
||||
register_text_layer_procs (GimpPDB *pdb)
|
||||
{
|
||||
|
@ -2121,76 +2045,4 @@ register_text_layer_procs (GimpPDB *pdb)
|
|||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-text-layer-get-hinting
|
||||
*/
|
||||
procedure = gimp_procedure_new (text_layer_get_hinting_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-text-layer-get-hinting");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-text-layer-get-hinting",
|
||||
"Deprecated: Use 'gimp-text-layer-get-hint-style' instead.",
|
||||
"Deprecated: Use 'gimp-text-layer-get-hint-style' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-text-layer-get-hint-style");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_layer_id ("layer",
|
||||
"layer",
|
||||
"The text layer",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_boolean ("hinting",
|
||||
"hinting",
|
||||
"A flag which is true if hinting is used on the font.",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_boolean ("autohint",
|
||||
"autohint",
|
||||
"A flag which is true if the text layer is forced to use the autohinter from FreeType.",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-text-layer-set-hinting
|
||||
*/
|
||||
procedure = gimp_procedure_new (text_layer_set_hinting_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-text-layer-set-hinting");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-text-layer-set-hinting",
|
||||
"Enable/disable the use of hinting in a text layer.",
|
||||
"This procedure enables or disables hinting on the text of a text layer. If you enable 'auto-hint', FreeType\'s automatic hinter will be used and hinting information from the font will be ignored.\n"
|
||||
"\n"
|
||||
"Deprecated: Use 'gimp-text-layer-set-hint-style' instead.",
|
||||
"Marcus Heese <heese@cip.ifi.lmu.de>",
|
||||
"Marcus Heese",
|
||||
"2008",
|
||||
"gimp-text-layer-set-hint-style");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_layer_id ("layer",
|
||||
"layer",
|
||||
"The text layer",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("hinting",
|
||||
"hinting",
|
||||
"Enable/disable the use of hinting on the text",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("autohint",
|
||||
"autohint",
|
||||
"Force the use of the autohinter provided through FreeType",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
}
|
||||
|
|
|
@ -148,113 +148,6 @@ text_get_extents_fontname_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
text_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpValueArray *return_vals;
|
||||
GimpImage *image;
|
||||
GimpDrawable *drawable;
|
||||
gdouble x;
|
||||
gdouble y;
|
||||
const gchar *text;
|
||||
gint32 border;
|
||||
gboolean antialias;
|
||||
gdouble size;
|
||||
const gchar *family;
|
||||
GimpLayer *text_layer = NULL;
|
||||
|
||||
image = gimp_value_get_image (gimp_value_array_index (args, 0), gimp);
|
||||
drawable = gimp_value_get_drawable (gimp_value_array_index (args, 1), gimp);
|
||||
x = g_value_get_double (gimp_value_array_index (args, 2));
|
||||
y = g_value_get_double (gimp_value_array_index (args, 3));
|
||||
text = g_value_get_string (gimp_value_array_index (args, 4));
|
||||
border = g_value_get_int (gimp_value_array_index (args, 5));
|
||||
antialias = g_value_get_boolean (gimp_value_array_index (args, 6));
|
||||
size = g_value_get_double (gimp_value_array_index (args, 7));
|
||||
family = g_value_get_string (gimp_value_array_index (args, 10));
|
||||
|
||||
if (success)
|
||||
{
|
||||
if (drawable &&
|
||||
(! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), image,
|
||||
GIMP_PDB_ITEM_CONTENT, error) ||
|
||||
! gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)))
|
||||
success = FALSE;
|
||||
|
||||
if (success)
|
||||
{
|
||||
gchar *real_fontname = g_strdup_printf ("%s %d", family, (gint) size);
|
||||
|
||||
text_layer = text_render (image, drawable, context,
|
||||
x, y, real_fontname, text,
|
||||
border, antialias);
|
||||
|
||||
g_free (real_fontname);
|
||||
}
|
||||
}
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
|
||||
if (success)
|
||||
gimp_value_set_layer (gimp_value_array_index (return_vals, 1), text_layer);
|
||||
|
||||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
text_get_extents_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpValueArray *return_vals;
|
||||
const gchar *text;
|
||||
gdouble size;
|
||||
const gchar *family;
|
||||
gint32 width = 0;
|
||||
gint32 height = 0;
|
||||
gint32 ascent = 0;
|
||||
gint32 descent = 0;
|
||||
|
||||
text = g_value_get_string (gimp_value_array_index (args, 0));
|
||||
size = g_value_get_double (gimp_value_array_index (args, 1));
|
||||
family = g_value_get_string (gimp_value_array_index (args, 4));
|
||||
|
||||
if (success)
|
||||
{
|
||||
gchar *real_fontname = g_strdup_printf ("%s %d", family, (gint) size);
|
||||
|
||||
success = text_get_extents (real_fontname, text,
|
||||
&width, &height,
|
||||
&ascent, &descent);
|
||||
|
||||
g_free (real_fontname);
|
||||
}
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
|
||||
if (success)
|
||||
{
|
||||
g_value_set_int (gimp_value_array_index (return_vals, 1), width);
|
||||
g_value_set_int (gimp_value_array_index (return_vals, 2), height);
|
||||
g_value_set_int (gimp_value_array_index (return_vals, 3), ascent);
|
||||
g_value_set_int (gimp_value_array_index (return_vals, 4), descent);
|
||||
}
|
||||
|
||||
return return_vals;
|
||||
}
|
||||
|
||||
void
|
||||
register_text_tool_procs (GimpPDB *pdb)
|
||||
{
|
||||
|
@ -413,256 +306,4 @@ register_text_tool_procs (GimpPDB *pdb)
|
|||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-text
|
||||
*/
|
||||
procedure = gimp_procedure_new (text_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-text");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-text",
|
||||
"Deprecated: Use 'gimp-text-fontname' instead.",
|
||||
"Deprecated: Use 'gimp-text-fontname' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-text-fontname");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The affected drawable: (-1 for a new text layer)",
|
||||
pdb->gimp, TRUE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("x",
|
||||
"x",
|
||||
"The x coordinate for the left of the text bounding box",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("y",
|
||||
"y",
|
||||
"The y coordinate for the top of the text bounding box",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("text",
|
||||
"text",
|
||||
"The text to generate (in UTF-8 encoding)",
|
||||
FALSE, FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_int32 ("border",
|
||||
"border",
|
||||
"The size of the border",
|
||||
-1, G_MAXINT32, -1,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("antialias",
|
||||
"antialias",
|
||||
"Antialiasing",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("size",
|
||||
"size",
|
||||
"The size of text in either pixels or points",
|
||||
0, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_enum ("size-type",
|
||||
"size type",
|
||||
"The units of specified size",
|
||||
GIMP_TYPE_SIZE_TYPE,
|
||||
GIMP_PIXELS,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("foundry",
|
||||
"foundry",
|
||||
"The font foundry",
|
||||
TRUE, FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("family",
|
||||
"family",
|
||||
"The font family",
|
||||
TRUE, FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("weight",
|
||||
"weight",
|
||||
"The font weight",
|
||||
TRUE, FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("slant",
|
||||
"slant",
|
||||
"The font slant",
|
||||
TRUE, FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("set-width",
|
||||
"set width",
|
||||
"The font set-width",
|
||||
TRUE, FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("spacing",
|
||||
"spacing",
|
||||
"The font spacing",
|
||||
TRUE, FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("registry",
|
||||
"registry",
|
||||
"The font registry",
|
||||
TRUE, FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("encoding",
|
||||
"encoding",
|
||||
"The font encoding",
|
||||
TRUE, FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_layer_id ("text-layer",
|
||||
"text layer",
|
||||
"The new text layer or -1 if no layer was created.",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-text-get-extents
|
||||
*/
|
||||
procedure = gimp_procedure_new (text_get_extents_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-text-get-extents");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-text-get-extents",
|
||||
"Deprecated: Use 'gimp-text-get-extents-fontname' instead.",
|
||||
"Deprecated: Use 'gimp-text-get-extents-fontname' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-text-get-extents-fontname");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("text",
|
||||
"text",
|
||||
"The text to generate (in UTF-8 encoding)",
|
||||
FALSE, FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("size",
|
||||
"size",
|
||||
"The size of text in either pixels or points",
|
||||
0, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_enum ("size-type",
|
||||
"size type",
|
||||
"The units of specified size",
|
||||
GIMP_TYPE_SIZE_TYPE,
|
||||
GIMP_PIXELS,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("foundry",
|
||||
"foundry",
|
||||
"The font foundry",
|
||||
TRUE, FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("family",
|
||||
"family",
|
||||
"The font family",
|
||||
TRUE, FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("weight",
|
||||
"weight",
|
||||
"The font weight",
|
||||
TRUE, FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("slant",
|
||||
"slant",
|
||||
"The font slant",
|
||||
TRUE, FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("set-width",
|
||||
"set width",
|
||||
"The font set-width",
|
||||
TRUE, FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("spacing",
|
||||
"spacing",
|
||||
"The font spacing",
|
||||
TRUE, FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("registry",
|
||||
"registry",
|
||||
"The font registry",
|
||||
TRUE, FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("encoding",
|
||||
"encoding",
|
||||
"The font encoding",
|
||||
TRUE, FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("width",
|
||||
"width",
|
||||
"The width of the specified font",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("height",
|
||||
"height",
|
||||
"The height of the specified font",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("ascent",
|
||||
"ascent",
|
||||
"The ascent of the specified font",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("descent",
|
||||
"descent",
|
||||
"The descent of the specified font",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
}
|
||||
|
|
|
@ -1,910 +0,0 @@
|
|||
/* GIMP - The GNU Image Manipulation Program
|
||||
* Copyright (C) 1995-2003 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (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
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* NOTE: This file is auto-generated by pdbgen.pl. */
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <gegl.h>
|
||||
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
|
||||
#include "libgimpmath/gimpmath.h"
|
||||
|
||||
#include "libgimpbase/gimpbase.h"
|
||||
|
||||
#include "pdb-types.h"
|
||||
|
||||
#include "config/gimpcoreconfig.h"
|
||||
#include "core/gimp-transform-utils.h"
|
||||
#include "core/gimp.h"
|
||||
#include "core/gimpchannel.h"
|
||||
#include "core/gimpdrawable-transform.h"
|
||||
#include "core/gimpdrawable.h"
|
||||
#include "core/gimpimage.h"
|
||||
#include "core/gimpparamspecs.h"
|
||||
#include "core/gimpprogress.h"
|
||||
|
||||
#include "gimppdb.h"
|
||||
#include "gimppdb-utils.h"
|
||||
#include "gimpprocedure.h"
|
||||
#include "internal-procs.h"
|
||||
|
||||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
static GimpValueArray *
|
||||
flip_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpValueArray *return_vals;
|
||||
GimpDrawable *drawable;
|
||||
gint32 flip_type;
|
||||
|
||||
drawable = gimp_value_get_drawable (gimp_value_array_index (args, 0), gimp);
|
||||
flip_type = g_value_get_enum (gimp_value_array_index (args, 1));
|
||||
|
||||
if (success)
|
||||
{
|
||||
gint x, y, width, height;
|
||||
|
||||
success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
|
||||
GIMP_PDB_ITEM_CONTENT |
|
||||
GIMP_PDB_ITEM_POSITION, error);
|
||||
|
||||
if (success &&
|
||||
gimp_item_mask_intersect (GIMP_ITEM (drawable), &x, &y, &width, &height))
|
||||
{
|
||||
gdouble axis;
|
||||
|
||||
gimp_transform_get_flip_axis (x, y, width, height,
|
||||
flip_type, TRUE, &axis);
|
||||
|
||||
if (! gimp_viewable_get_children (GIMP_VIEWABLE (drawable)) &&
|
||||
! gimp_channel_is_empty (gimp_image_get_mask (gimp_item_get_image (GIMP_ITEM (drawable)))))
|
||||
{
|
||||
if (! gimp_drawable_transform_flip (drawable, context,
|
||||
flip_type, axis, FALSE))
|
||||
{
|
||||
success = FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gimp_item_flip (GIMP_ITEM (drawable), context,
|
||||
flip_type, axis, FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
|
||||
if (success)
|
||||
gimp_value_set_drawable (gimp_value_array_index (return_vals, 1), drawable);
|
||||
|
||||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
perspective_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpValueArray *return_vals;
|
||||
GimpDrawable *drawable;
|
||||
gboolean interpolation;
|
||||
gdouble x0;
|
||||
gdouble y0;
|
||||
gdouble x1;
|
||||
gdouble y1;
|
||||
gdouble x2;
|
||||
gdouble y2;
|
||||
gdouble x3;
|
||||
gdouble y3;
|
||||
|
||||
drawable = gimp_value_get_drawable (gimp_value_array_index (args, 0), gimp);
|
||||
interpolation = g_value_get_boolean (gimp_value_array_index (args, 1));
|
||||
x0 = g_value_get_double (gimp_value_array_index (args, 2));
|
||||
y0 = g_value_get_double (gimp_value_array_index (args, 3));
|
||||
x1 = g_value_get_double (gimp_value_array_index (args, 4));
|
||||
y1 = g_value_get_double (gimp_value_array_index (args, 5));
|
||||
x2 = g_value_get_double (gimp_value_array_index (args, 6));
|
||||
y2 = g_value_get_double (gimp_value_array_index (args, 7));
|
||||
x3 = g_value_get_double (gimp_value_array_index (args, 8));
|
||||
y3 = g_value_get_double (gimp_value_array_index (args, 9));
|
||||
|
||||
if (success)
|
||||
{
|
||||
gint x, y, width, height;
|
||||
|
||||
success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
|
||||
GIMP_PDB_ITEM_CONTENT |
|
||||
GIMP_PDB_ITEM_POSITION, error);
|
||||
|
||||
if (success &&
|
||||
gimp_item_mask_intersect (GIMP_ITEM (drawable), &x, &y, &width, &height))
|
||||
{
|
||||
GimpMatrix3 matrix;
|
||||
GimpInterpolationType interpolation_type = GIMP_INTERPOLATION_NONE;
|
||||
gint off_x, off_y;
|
||||
|
||||
gimp_item_get_offset (GIMP_ITEM (drawable), &off_x, &off_y);
|
||||
|
||||
x += off_x;
|
||||
y += off_y;
|
||||
|
||||
/* Assemble the transformation matrix */
|
||||
gimp_matrix3_identity (&matrix);
|
||||
gimp_transform_matrix_perspective (&matrix,
|
||||
x, y, width, height,
|
||||
x0, y0, x1, y1,
|
||||
x2, y2, x3, y3);
|
||||
|
||||
if (interpolation)
|
||||
interpolation_type = gimp->config->interpolation_type;
|
||||
|
||||
if (progress)
|
||||
gimp_progress_start (progress, FALSE, _("Perspective"));
|
||||
|
||||
if (! gimp_viewable_get_children (GIMP_VIEWABLE (drawable)) &&
|
||||
! gimp_channel_is_empty (gimp_image_get_mask (gimp_item_get_image (GIMP_ITEM (drawable)))))
|
||||
{
|
||||
if (! gimp_drawable_transform_affine (drawable, context,
|
||||
&matrix,
|
||||
GIMP_TRANSFORM_FORWARD,
|
||||
interpolation_type,
|
||||
FALSE, progress))
|
||||
{
|
||||
success = FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gimp_item_transform (GIMP_ITEM (drawable), context, &matrix,
|
||||
GIMP_TRANSFORM_FORWARD,
|
||||
interpolation,
|
||||
FALSE, progress);
|
||||
}
|
||||
|
||||
if (progress)
|
||||
gimp_progress_end (progress);
|
||||
}
|
||||
}
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
|
||||
if (success)
|
||||
gimp_value_set_drawable (gimp_value_array_index (return_vals, 1), drawable);
|
||||
|
||||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
rotate_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpValueArray *return_vals;
|
||||
GimpDrawable *drawable;
|
||||
gboolean interpolation;
|
||||
gdouble angle;
|
||||
|
||||
drawable = gimp_value_get_drawable (gimp_value_array_index (args, 0), gimp);
|
||||
interpolation = g_value_get_boolean (gimp_value_array_index (args, 1));
|
||||
angle = g_value_get_double (gimp_value_array_index (args, 2));
|
||||
|
||||
if (success)
|
||||
{
|
||||
gint x, y, width, height;
|
||||
|
||||
success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
|
||||
GIMP_PDB_ITEM_CONTENT |
|
||||
GIMP_PDB_ITEM_POSITION, error);
|
||||
|
||||
if (success &&
|
||||
gimp_item_mask_intersect (GIMP_ITEM (drawable), &x, &y, &width, &height))
|
||||
{
|
||||
GimpMatrix3 matrix;
|
||||
GimpInterpolationType interpolation_type = GIMP_INTERPOLATION_NONE;
|
||||
gint off_x, off_y;
|
||||
|
||||
gimp_item_get_offset (GIMP_ITEM (drawable), &off_x, &off_y);
|
||||
|
||||
x += off_x;
|
||||
y += off_y;
|
||||
|
||||
/* Assemble the transformation matrix */
|
||||
gimp_matrix3_identity (&matrix);
|
||||
gimp_transform_matrix_rotate_rect (&matrix,
|
||||
x, y, width, height,
|
||||
angle);
|
||||
|
||||
if (interpolation)
|
||||
interpolation_type = gimp->config->interpolation_type;
|
||||
|
||||
if (progress)
|
||||
gimp_progress_start (progress, FALSE, _("Rotating"));
|
||||
|
||||
if (! gimp_viewable_get_children (GIMP_VIEWABLE (drawable)) &&
|
||||
! gimp_channel_is_empty (gimp_image_get_mask (gimp_item_get_image (GIMP_ITEM (drawable)))))
|
||||
{
|
||||
if (! gimp_drawable_transform_affine (drawable, context,
|
||||
&matrix,
|
||||
GIMP_TRANSFORM_FORWARD,
|
||||
interpolation_type,
|
||||
FALSE, progress))
|
||||
{
|
||||
success = FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gimp_item_transform (GIMP_ITEM (drawable), context, &matrix,
|
||||
GIMP_TRANSFORM_FORWARD,
|
||||
interpolation,
|
||||
FALSE, progress);
|
||||
}
|
||||
|
||||
if (progress)
|
||||
gimp_progress_end (progress);
|
||||
}
|
||||
}
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
|
||||
if (success)
|
||||
gimp_value_set_drawable (gimp_value_array_index (return_vals, 1), drawable);
|
||||
|
||||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
scale_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpValueArray *return_vals;
|
||||
GimpDrawable *drawable;
|
||||
gboolean interpolation;
|
||||
gdouble x0;
|
||||
gdouble y0;
|
||||
gdouble x1;
|
||||
gdouble y1;
|
||||
|
||||
drawable = gimp_value_get_drawable (gimp_value_array_index (args, 0), gimp);
|
||||
interpolation = g_value_get_boolean (gimp_value_array_index (args, 1));
|
||||
x0 = g_value_get_double (gimp_value_array_index (args, 2));
|
||||
y0 = g_value_get_double (gimp_value_array_index (args, 3));
|
||||
x1 = g_value_get_double (gimp_value_array_index (args, 4));
|
||||
y1 = g_value_get_double (gimp_value_array_index (args, 5));
|
||||
|
||||
if (success)
|
||||
{
|
||||
gint x, y, width, height;
|
||||
|
||||
success = (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
|
||||
GIMP_PDB_ITEM_CONTENT |
|
||||
GIMP_PDB_ITEM_POSITION, error) &&
|
||||
x0 < x1 && y0 < y1);
|
||||
|
||||
if (success &&
|
||||
gimp_item_mask_intersect (GIMP_ITEM (drawable), &x, &y, &width, &height))
|
||||
{
|
||||
GimpMatrix3 matrix;
|
||||
GimpInterpolationType interpolation_type = GIMP_INTERPOLATION_NONE;
|
||||
gint off_x, off_y;
|
||||
|
||||
gimp_item_get_offset (GIMP_ITEM (drawable), &off_x, &off_y);
|
||||
|
||||
x += off_x;
|
||||
y += off_y;
|
||||
|
||||
/* Assemble the transformation matrix */
|
||||
gimp_matrix3_identity (&matrix);
|
||||
gimp_transform_matrix_scale (&matrix,
|
||||
x, y, width, height,
|
||||
x0, y0, x1 - x0, y1 - y0);
|
||||
|
||||
if (interpolation)
|
||||
interpolation_type = gimp->config->interpolation_type;
|
||||
|
||||
if (progress)
|
||||
gimp_progress_start (progress, FALSE, _("Scaling"));
|
||||
|
||||
if (! gimp_viewable_get_children (GIMP_VIEWABLE (drawable)) &&
|
||||
! gimp_channel_is_empty (gimp_image_get_mask (gimp_item_get_image (GIMP_ITEM (drawable)))))
|
||||
{
|
||||
if (! gimp_drawable_transform_affine (drawable, context,
|
||||
&matrix,
|
||||
GIMP_TRANSFORM_FORWARD,
|
||||
interpolation_type,
|
||||
FALSE, progress))
|
||||
{
|
||||
success = FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gimp_item_transform (GIMP_ITEM (drawable), context, &matrix,
|
||||
GIMP_TRANSFORM_FORWARD,
|
||||
interpolation,
|
||||
FALSE, progress);
|
||||
}
|
||||
|
||||
if (progress)
|
||||
gimp_progress_end (progress);
|
||||
}
|
||||
}
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
|
||||
if (success)
|
||||
gimp_value_set_drawable (gimp_value_array_index (return_vals, 1), drawable);
|
||||
|
||||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
shear_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpValueArray *return_vals;
|
||||
GimpDrawable *drawable;
|
||||
gboolean interpolation;
|
||||
gint32 shear_type;
|
||||
gdouble magnitude;
|
||||
|
||||
drawable = gimp_value_get_drawable (gimp_value_array_index (args, 0), gimp);
|
||||
interpolation = g_value_get_boolean (gimp_value_array_index (args, 1));
|
||||
shear_type = g_value_get_enum (gimp_value_array_index (args, 2));
|
||||
magnitude = g_value_get_double (gimp_value_array_index (args, 3));
|
||||
|
||||
if (success)
|
||||
{
|
||||
gint x, y, width, height;
|
||||
|
||||
success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
|
||||
GIMP_PDB_ITEM_CONTENT |
|
||||
GIMP_PDB_ITEM_POSITION, error);
|
||||
|
||||
if (success &&
|
||||
gimp_item_mask_intersect (GIMP_ITEM (drawable), &x, &y, &width, &height))
|
||||
{
|
||||
GimpMatrix3 matrix;
|
||||
GimpInterpolationType interpolation_type = GIMP_INTERPOLATION_NONE;
|
||||
gint off_x, off_y;
|
||||
|
||||
gimp_item_get_offset (GIMP_ITEM (drawable), &off_x, &off_y);
|
||||
|
||||
x += off_x;
|
||||
y += off_y;
|
||||
|
||||
/* Assemble the transformation matrix */
|
||||
gimp_matrix3_identity (&matrix);
|
||||
gimp_transform_matrix_shear (&matrix,
|
||||
x, y, width, height,
|
||||
shear_type, magnitude);
|
||||
|
||||
if (interpolation)
|
||||
interpolation_type = gimp->config->interpolation_type;
|
||||
|
||||
if (progress)
|
||||
gimp_progress_start (progress, FALSE, _("Shearing"));
|
||||
|
||||
if (! gimp_viewable_get_children (GIMP_VIEWABLE (drawable)) &&
|
||||
! gimp_channel_is_empty (gimp_image_get_mask (gimp_item_get_image (GIMP_ITEM (drawable)))))
|
||||
{
|
||||
if (! gimp_drawable_transform_affine (drawable, context,
|
||||
&matrix,
|
||||
GIMP_TRANSFORM_FORWARD,
|
||||
interpolation_type,
|
||||
FALSE, progress))
|
||||
{
|
||||
success = FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gimp_item_transform (GIMP_ITEM (drawable), context, &matrix,
|
||||
GIMP_TRANSFORM_FORWARD,
|
||||
interpolation,
|
||||
FALSE, progress);
|
||||
}
|
||||
|
||||
if (progress)
|
||||
gimp_progress_end (progress);
|
||||
}
|
||||
}
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
|
||||
if (success)
|
||||
gimp_value_set_drawable (gimp_value_array_index (return_vals, 1), drawable);
|
||||
|
||||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
transform_2d_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpValueArray *return_vals;
|
||||
GimpDrawable *drawable;
|
||||
gboolean interpolation;
|
||||
gdouble source_x;
|
||||
gdouble source_y;
|
||||
gdouble scale_x;
|
||||
gdouble scale_y;
|
||||
gdouble angle;
|
||||
gdouble dest_x;
|
||||
gdouble dest_y;
|
||||
|
||||
drawable = gimp_value_get_drawable (gimp_value_array_index (args, 0), gimp);
|
||||
interpolation = g_value_get_boolean (gimp_value_array_index (args, 1));
|
||||
source_x = g_value_get_double (gimp_value_array_index (args, 2));
|
||||
source_y = g_value_get_double (gimp_value_array_index (args, 3));
|
||||
scale_x = g_value_get_double (gimp_value_array_index (args, 4));
|
||||
scale_y = g_value_get_double (gimp_value_array_index (args, 5));
|
||||
angle = g_value_get_double (gimp_value_array_index (args, 6));
|
||||
dest_x = g_value_get_double (gimp_value_array_index (args, 7));
|
||||
dest_y = g_value_get_double (gimp_value_array_index (args, 8));
|
||||
|
||||
if (success)
|
||||
{
|
||||
gint x, y, width, height;
|
||||
|
||||
success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
|
||||
GIMP_PDB_ITEM_CONTENT |
|
||||
GIMP_PDB_ITEM_POSITION, error);
|
||||
|
||||
if (success &&
|
||||
gimp_item_mask_intersect (GIMP_ITEM (drawable), &x, &y, &width, &height))
|
||||
{
|
||||
GimpMatrix3 matrix;
|
||||
GimpInterpolationType interpolation_type = GIMP_INTERPOLATION_NONE;
|
||||
|
||||
/* Assemble the transformation matrix */
|
||||
gimp_matrix3_identity (&matrix);
|
||||
gimp_matrix3_translate (&matrix, -source_x, -source_y);
|
||||
gimp_matrix3_scale (&matrix, scale_x, scale_y);
|
||||
gimp_matrix3_rotate (&matrix, angle);
|
||||
gimp_matrix3_translate (&matrix, dest_x, dest_y);
|
||||
|
||||
if (interpolation)
|
||||
interpolation_type = gimp->config->interpolation_type;
|
||||
|
||||
if (progress)
|
||||
gimp_progress_start (progress, FALSE, _("2D Transform"));
|
||||
|
||||
if (! gimp_viewable_get_children (GIMP_VIEWABLE (drawable)) &&
|
||||
! gimp_channel_is_empty (gimp_image_get_mask (gimp_item_get_image (GIMP_ITEM (drawable)))))
|
||||
{
|
||||
if (! gimp_drawable_transform_affine (drawable, context,
|
||||
&matrix, GIMP_TRANSFORM_FORWARD,
|
||||
interpolation_type,
|
||||
FALSE, progress))
|
||||
{
|
||||
success = FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gimp_item_transform (GIMP_ITEM (drawable), context, &matrix,
|
||||
GIMP_TRANSFORM_FORWARD,
|
||||
interpolation,
|
||||
FALSE, progress);
|
||||
}
|
||||
|
||||
if (progress)
|
||||
gimp_progress_end (progress);
|
||||
}
|
||||
}
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
|
||||
if (success)
|
||||
gimp_value_set_drawable (gimp_value_array_index (return_vals, 1), drawable);
|
||||
|
||||
return return_vals;
|
||||
}
|
||||
|
||||
void
|
||||
register_transform_tools_procs (GimpPDB *pdb)
|
||||
{
|
||||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* gimp-flip
|
||||
*/
|
||||
procedure = gimp_procedure_new (flip_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-flip");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-flip",
|
||||
"Deprecated: Use 'gimp-item-transform-flip-simple' instead.",
|
||||
"Deprecated: Use 'gimp-item-transform-flip-simple' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-item-transform-flip-simple");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The affected drawable",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_enum ("flip-type",
|
||||
"flip type",
|
||||
"Type of flip",
|
||||
GIMP_TYPE_ORIENTATION_TYPE,
|
||||
GIMP_ORIENTATION_HORIZONTAL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_param_spec_enum_exclude_value (GIMP_PARAM_SPEC_ENUM (procedure->args[1]),
|
||||
GIMP_ORIENTATION_UNKNOWN);
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The flipped drawable",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-perspective
|
||||
*/
|
||||
procedure = gimp_procedure_new (perspective_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-perspective");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-perspective",
|
||||
"Deprecated: Use 'gimp-item-transform-perspective' instead.",
|
||||
"Deprecated: Use 'gimp-item-transform-perspective' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-item-transform-perspective");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The affected drawable",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("interpolation",
|
||||
"interpolation",
|
||||
"Whether to use interpolation",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("x0",
|
||||
"x0",
|
||||
"The new x coordinate of upper-left corner of original bounding box",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("y0",
|
||||
"y0",
|
||||
"The new y coordinate of upper-left corner of original bounding box",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("x1",
|
||||
"x1",
|
||||
"The new x coordinate of upper-right corner of original bounding box",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("y1",
|
||||
"y1",
|
||||
"The new y coordinate of upper-right corner of original bounding box",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("x2",
|
||||
"x2",
|
||||
"The new x coordinate of lower-left corner of original bounding box",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("y2",
|
||||
"y2",
|
||||
"The new y coordinate of lower-left corner of original bounding box",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("x3",
|
||||
"x3",
|
||||
"The new x coordinate of lower-right corner of original bounding box",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("y3",
|
||||
"y3",
|
||||
"The new y coordinate of lower-right corner of original bounding box",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The newly mapped drawable",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-rotate
|
||||
*/
|
||||
procedure = gimp_procedure_new (rotate_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-rotate");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-rotate",
|
||||
"Deprecated: Use 'gimp-item-transform-rotate' instead.",
|
||||
"Deprecated: Use 'gimp-item-transform-rotate' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-item-transform-rotate");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The affected drawable",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("interpolation",
|
||||
"interpolation",
|
||||
"Whether to use interpolation",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("angle",
|
||||
"angle",
|
||||
"The angle of rotation (radians)",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The rotated drawable",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-scale
|
||||
*/
|
||||
procedure = gimp_procedure_new (scale_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-scale");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-scale",
|
||||
"Deprecated: Use 'gimp-item-transform-scale' instead.",
|
||||
"Deprecated: Use 'gimp-item-transform-scale' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-item-transform-scale");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The affected drawable",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("interpolation",
|
||||
"interpolation",
|
||||
"Whether to use interpolation",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("x0",
|
||||
"x0",
|
||||
"The new x coordinate of the upper-left corner of the scaled region",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("y0",
|
||||
"y0",
|
||||
"The new y coordinate of the upper-left corner of the scaled region",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("x1",
|
||||
"x1",
|
||||
"The new x coordinate of the lower-right corner of the scaled region",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("y1",
|
||||
"y1",
|
||||
"The new y coordinate of the lower-right corner of the scaled region",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The scaled drawable",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-shear
|
||||
*/
|
||||
procedure = gimp_procedure_new (shear_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-shear");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-shear",
|
||||
"Deprecated: Use 'gimp-item-transform-shear' instead.",
|
||||
"Deprecated: Use 'gimp-item-transform-shear' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-item-transform-shear");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The affected drawable",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("interpolation",
|
||||
"interpolation",
|
||||
"Whether to use interpolation",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_enum ("shear-type",
|
||||
"shear type",
|
||||
"Type of shear",
|
||||
GIMP_TYPE_ORIENTATION_TYPE,
|
||||
GIMP_ORIENTATION_HORIZONTAL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_param_spec_enum_exclude_value (GIMP_PARAM_SPEC_ENUM (procedure->args[2]),
|
||||
GIMP_ORIENTATION_UNKNOWN);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("magnitude",
|
||||
"magnitude",
|
||||
"The magnitude of the shear",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The sheared drawable",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-transform-2d
|
||||
*/
|
||||
procedure = gimp_procedure_new (transform_2d_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-transform-2d");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-transform-2d",
|
||||
"Deprecated: Use 'gimp-item-transform-2d' instead.",
|
||||
"Deprecated: Use 'gimp-item-transform-2d' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-item-transform-2d");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The affected drawable",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("interpolation",
|
||||
"interpolation",
|
||||
"Whether to use interpolation",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("source-x",
|
||||
"source x",
|
||||
"X coordinate of the transformation center",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("source-y",
|
||||
"source y",
|
||||
"Y coordinate of the transformation center",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("scale-x",
|
||||
"scale x",
|
||||
"Amount to scale in x direction",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("scale-y",
|
||||
"scale y",
|
||||
"Amount to scale in y direction",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("angle",
|
||||
"angle",
|
||||
"The angle of rotation (radians)",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("dest-x",
|
||||
"dest x",
|
||||
"X coordinate of where the centre goes",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("dest-y",
|
||||
"dest y",
|
||||
"Y coordinate of where the centre goes",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The transformed drawable",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
}
|
|
@ -1099,46 +1099,6 @@ vectors_bezier_stroke_new_ellipse_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
vectors_to_selection_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GimpValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpVectors *vectors;
|
||||
gint32 operation;
|
||||
gboolean antialias;
|
||||
gboolean feather;
|
||||
gdouble feather_radius_x;
|
||||
gdouble feather_radius_y;
|
||||
|
||||
vectors = gimp_value_get_vectors (gimp_value_array_index (args, 0), gimp);
|
||||
operation = g_value_get_enum (gimp_value_array_index (args, 1));
|
||||
antialias = g_value_get_boolean (gimp_value_array_index (args, 2));
|
||||
feather = g_value_get_boolean (gimp_value_array_index (args, 3));
|
||||
feather_radius_x = g_value_get_double (gimp_value_array_index (args, 4));
|
||||
feather_radius_y = g_value_get_double (gimp_value_array_index (args, 5));
|
||||
|
||||
if (success)
|
||||
{
|
||||
if (gimp_pdb_item_is_attached (GIMP_ITEM (vectors), NULL, 0, error))
|
||||
gimp_item_to_selection (GIMP_ITEM (vectors),
|
||||
operation,
|
||||
antialias,
|
||||
feather,
|
||||
feather_radius_x,
|
||||
feather_radius_y);
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
}
|
||||
|
||||
static GimpValueArray *
|
||||
vectors_import_from_file_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -2278,60 +2238,6 @@ register_vectors_procs (GimpPDB *pdb)
|
|||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-vectors-to-selection
|
||||
*/
|
||||
procedure = gimp_procedure_new (vectors_to_selection_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-vectors-to-selection");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-vectors-to-selection",
|
||||
"Deprecated: Use 'gimp-image-select-item' instead.",
|
||||
"Deprecated: Use 'gimp-image-select-item' instead.",
|
||||
"Simon Budig",
|
||||
"Simon Budig",
|
||||
"2006",
|
||||
"gimp-image-select-item");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_vectors_id ("vectors",
|
||||
"vectors",
|
||||
"The vectors object to render to the selection",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_enum ("operation",
|
||||
"operation",
|
||||
"The desired operation with current selection",
|
||||
GIMP_TYPE_CHANNEL_OPS,
|
||||
GIMP_CHANNEL_OP_ADD,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("antialias",
|
||||
"antialias",
|
||||
"Antialias selection.",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("feather",
|
||||
"feather",
|
||||
"Feather selection.",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("feather-radius-x",
|
||||
"feather radius x",
|
||||
"Feather radius x.",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("feather-radius-y",
|
||||
"feather radius y",
|
||||
"Feather radius y.",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-vectors-import-from-file
|
||||
*/
|
||||
|
|
|
@ -97,14 +97,12 @@ PDB_WRAPPERS_C = \
|
|||
gimpbrushselect_pdb.c \
|
||||
gimpbuffer_pdb.c \
|
||||
gimpchannel_pdb.c \
|
||||
gimpcolor_pdb.c \
|
||||
gimpcontext_pdb.c \
|
||||
gimpdebug_pdb.c \
|
||||
gimpdisplay_pdb.c \
|
||||
gimpdrawable_pdb.c \
|
||||
gimpdrawablecolor_pdb.c \
|
||||
gimpdrawableedit_pdb.c \
|
||||
gimpdrawabletransform_pdb.c \
|
||||
gimpdynamics_pdb.c \
|
||||
gimpedit_pdb.c \
|
||||
gimpfileops_pdb.c \
|
||||
|
@ -133,7 +131,6 @@ PDB_WRAPPERS_C = \
|
|||
gimppalette_pdb.c \
|
||||
gimppalettes_pdb.c \
|
||||
gimppaletteselect_pdb.c \
|
||||
gimppaths_pdb.c \
|
||||
gimppattern_pdb.c \
|
||||
gimppatterns_pdb.c \
|
||||
gimppatternselect_pdb.c \
|
||||
|
@ -141,10 +138,8 @@ PDB_WRAPPERS_C = \
|
|||
gimpproceduraldb_pdb.c \
|
||||
gimpprogress_pdb.c \
|
||||
gimpselection_pdb.c \
|
||||
gimpselectiontools_pdb.c \
|
||||
gimptextlayer_pdb.c \
|
||||
gimptexttool_pdb.c \
|
||||
gimptransformtools_pdb.c \
|
||||
gimpunit_pdb.c \
|
||||
gimpvectors_pdb.c
|
||||
|
||||
|
@ -156,14 +151,12 @@ PDB_WRAPPERS_H = \
|
|||
gimpbrushselect_pdb.h \
|
||||
gimpbuffer_pdb.h \
|
||||
gimpchannel_pdb.h \
|
||||
gimpcolor_pdb.h \
|
||||
gimpcontext_pdb.h \
|
||||
gimpdebug_pdb.h \
|
||||
gimpdisplay_pdb.h \
|
||||
gimpdrawable_pdb.h \
|
||||
gimpdrawablecolor_pdb.h \
|
||||
gimpdrawableedit_pdb.h \
|
||||
gimpdrawabletransform_pdb.h \
|
||||
gimpdynamics_pdb.h \
|
||||
gimpedit_pdb.h \
|
||||
gimpfileops_pdb.h \
|
||||
|
@ -192,7 +185,6 @@ PDB_WRAPPERS_H = \
|
|||
gimppalette_pdb.h \
|
||||
gimppalettes_pdb.h \
|
||||
gimppaletteselect_pdb.h \
|
||||
gimppaths_pdb.h \
|
||||
gimppattern_pdb.h \
|
||||
gimppatterns_pdb.h \
|
||||
gimppatternselect_pdb.h \
|
||||
|
@ -200,10 +192,8 @@ PDB_WRAPPERS_H = \
|
|||
gimpproceduraldb_pdb.h \
|
||||
gimpprogress_pdb.h \
|
||||
gimpselection_pdb.h \
|
||||
gimpselectiontools_pdb.h \
|
||||
gimptextlayer_pdb.h \
|
||||
gimptexttool_pdb.h \
|
||||
gimptransformtools_pdb.h \
|
||||
gimpunit_pdb.h \
|
||||
gimpvectors_pdb.h
|
||||
|
||||
|
|
|
@ -29,14 +29,10 @@ EXPORTS
|
|||
gimp_brush_set_spacing
|
||||
gimp_brush_set_spikes
|
||||
gimp_brushes_close_popup
|
||||
gimp_brushes_get_brush
|
||||
gimp_brushes_get_brush_data
|
||||
gimp_brushes_get_list
|
||||
gimp_brushes_get_spacing
|
||||
gimp_brushes_popup
|
||||
gimp_brushes_refresh
|
||||
gimp_brushes_set_popup
|
||||
gimp_brushes_set_spacing
|
||||
gimp_buffer_delete
|
||||
gimp_buffer_get_bytes
|
||||
gimp_buffer_get_height
|
||||
|
@ -44,8 +40,6 @@ EXPORTS
|
|||
gimp_buffer_get_width
|
||||
gimp_buffer_rename
|
||||
gimp_buffers_get_list
|
||||
gimp_by_color_select
|
||||
gimp_by_color_select_full
|
||||
gimp_channel_combine_masks
|
||||
gimp_channel_copy
|
||||
gimp_channel_get_color
|
||||
|
@ -111,7 +105,6 @@ EXPORTS
|
|||
gimp_context_get_sample_transparent
|
||||
gimp_context_get_stroke_method
|
||||
gimp_context_get_transform_direction
|
||||
gimp_context_get_transform_recursion
|
||||
gimp_context_get_transform_resize
|
||||
gimp_context_list_paint_methods
|
||||
gimp_context_pop
|
||||
|
@ -174,7 +167,6 @@ EXPORTS
|
|||
gimp_context_set_sample_transparent
|
||||
gimp_context_set_stroke_method
|
||||
gimp_context_set_transform_direction
|
||||
gimp_context_set_transform_recursion
|
||||
gimp_context_set_transform_resize
|
||||
gimp_context_swap_colors
|
||||
gimp_convert_dither_type_get_type
|
||||
|
@ -246,39 +238,17 @@ EXPORTS
|
|||
gimp_drawable_offset
|
||||
gimp_drawable_offsets
|
||||
gimp_drawable_posterize
|
||||
gimp_drawable_set_image
|
||||
gimp_drawable_set_pixel
|
||||
gimp_drawable_threshold
|
||||
gimp_drawable_transform_2d
|
||||
gimp_drawable_transform_2d_default
|
||||
gimp_drawable_transform_flip
|
||||
gimp_drawable_transform_flip_default
|
||||
gimp_drawable_transform_flip_simple
|
||||
gimp_drawable_transform_matrix
|
||||
gimp_drawable_transform_matrix_default
|
||||
gimp_drawable_transform_perspective
|
||||
gimp_drawable_transform_perspective_default
|
||||
gimp_drawable_transform_rotate
|
||||
gimp_drawable_transform_rotate_default
|
||||
gimp_drawable_transform_rotate_simple
|
||||
gimp_drawable_transform_scale
|
||||
gimp_drawable_transform_scale_default
|
||||
gimp_drawable_transform_shear
|
||||
gimp_drawable_transform_shear_default
|
||||
gimp_drawable_type
|
||||
gimp_drawable_type_with_alpha
|
||||
gimp_drawable_update
|
||||
gimp_drawable_width
|
||||
gimp_dynamics_get_list
|
||||
gimp_dynamics_refresh
|
||||
gimp_edit_blend
|
||||
gimp_edit_bucket_fill
|
||||
gimp_edit_bucket_fill_full
|
||||
gimp_edit_clear
|
||||
gimp_edit_copy
|
||||
gimp_edit_copy_visible
|
||||
gimp_edit_cut
|
||||
gimp_edit_fill
|
||||
gimp_edit_named_copy
|
||||
gimp_edit_named_copy_visible
|
||||
gimp_edit_named_cut
|
||||
|
@ -286,9 +256,6 @@ EXPORTS
|
|||
gimp_edit_named_paste_as_new_image
|
||||
gimp_edit_paste
|
||||
gimp_edit_paste_as_new_image
|
||||
gimp_edit_stroke
|
||||
gimp_edit_stroke_vectors
|
||||
gimp_ellipse_select
|
||||
gimp_enums_get_type_names
|
||||
gimp_enums_init
|
||||
gimp_equalize
|
||||
|
@ -308,9 +275,7 @@ EXPORTS
|
|||
gimp_flip
|
||||
gimp_floating_sel_anchor
|
||||
gimp_floating_sel_attach
|
||||
gimp_floating_sel_relax
|
||||
gimp_floating_sel_remove
|
||||
gimp_floating_sel_rigor
|
||||
gimp_floating_sel_to_layer
|
||||
gimp_font_select_destroy
|
||||
gimp_font_select_new
|
||||
|
@ -319,9 +284,6 @@ EXPORTS
|
|||
gimp_fonts_popup
|
||||
gimp_fonts_refresh
|
||||
gimp_fonts_set_popup
|
||||
gimp_free_select
|
||||
gimp_fuzzy_select
|
||||
gimp_fuzzy_select_full
|
||||
gimp_gamma
|
||||
gimp_get_color_configuration
|
||||
gimp_get_default_comment
|
||||
|
@ -373,12 +335,9 @@ EXPORTS
|
|||
gimp_gradient_select_destroy
|
||||
gimp_gradient_select_new
|
||||
gimp_gradients_close_popup
|
||||
gimp_gradients_get_gradient_data
|
||||
gimp_gradients_get_list
|
||||
gimp_gradients_popup
|
||||
gimp_gradients_refresh
|
||||
gimp_gradients_sample_custom
|
||||
gimp_gradients_sample_uniform
|
||||
gimp_gradients_set_popup
|
||||
gimp_heal
|
||||
gimp_heal_default
|
||||
|
@ -386,11 +345,8 @@ EXPORTS
|
|||
gimp_histogram
|
||||
gimp_histogram_channel_get_type
|
||||
gimp_hue_saturation
|
||||
gimp_image_add_channel
|
||||
gimp_image_add_hguide
|
||||
gimp_image_add_layer
|
||||
gimp_image_add_sample_point
|
||||
gimp_image_add_vectors
|
||||
gimp_image_add_vguide
|
||||
gimp_image_attach_parasite
|
||||
gimp_image_base_type
|
||||
|
@ -413,7 +369,6 @@ EXPORTS
|
|||
gimp_image_flatten
|
||||
gimp_image_flip
|
||||
gimp_image_floating_sel_attached_to
|
||||
gimp_image_free_shadow
|
||||
gimp_image_freeze_channels
|
||||
gimp_image_freeze_layers
|
||||
gimp_image_freeze_vectors
|
||||
|
@ -494,7 +449,6 @@ EXPORTS
|
|||
gimp_image_resize_to_layers
|
||||
gimp_image_rotate
|
||||
gimp_image_scale
|
||||
gimp_image_scale_full
|
||||
gimp_image_select_color
|
||||
gimp_image_select_contiguous_color
|
||||
gimp_image_select_ellipse
|
||||
|
@ -603,7 +557,6 @@ EXPORTS
|
|||
gimp_layer_resize
|
||||
gimp_layer_resize_to_image_size
|
||||
gimp_layer_scale
|
||||
gimp_layer_scale_full
|
||||
gimp_layer_set_apply_mask
|
||||
gimp_layer_set_blend_space
|
||||
gimp_layer_set_composite_mode
|
||||
|
@ -614,7 +567,6 @@ EXPORTS
|
|||
gimp_layer_set_offsets
|
||||
gimp_layer_set_opacity
|
||||
gimp_layer_set_show_mask
|
||||
gimp_layer_translate
|
||||
gimp_levels
|
||||
gimp_levels_auto
|
||||
gimp_levels_stretch
|
||||
|
@ -644,33 +596,15 @@ EXPORTS
|
|||
gimp_palette_set_columns
|
||||
gimp_palettes_close_popup
|
||||
gimp_palettes_get_list
|
||||
gimp_palettes_get_palette
|
||||
gimp_palettes_get_palette_entry
|
||||
gimp_palettes_popup
|
||||
gimp_palettes_refresh
|
||||
gimp_palettes_set_popup
|
||||
gimp_path_delete
|
||||
gimp_path_get_current
|
||||
gimp_path_get_locked
|
||||
gimp_path_get_point_at_dist
|
||||
gimp_path_get_points
|
||||
gimp_path_get_tattoo
|
||||
gimp_path_import
|
||||
gimp_path_list
|
||||
gimp_path_set_current
|
||||
gimp_path_set_locked
|
||||
gimp_path_set_points
|
||||
gimp_path_set_tattoo
|
||||
gimp_path_stroke_current
|
||||
gimp_path_to_selection
|
||||
gimp_pattern_get_info
|
||||
gimp_pattern_get_pixels
|
||||
gimp_pattern_select_destroy
|
||||
gimp_pattern_select_new
|
||||
gimp_patterns_close_popup
|
||||
gimp_patterns_get_list
|
||||
gimp_patterns_get_pattern
|
||||
gimp_patterns_get_pattern_data
|
||||
gimp_patterns_popup
|
||||
gimp_patterns_refresh
|
||||
gimp_patterns_set_popup
|
||||
|
@ -729,7 +663,6 @@ EXPORTS
|
|||
gimp_progress_update
|
||||
gimp_quit
|
||||
gimp_read_expect_msg
|
||||
gimp_rect_select
|
||||
gimp_register_file_handler_mime
|
||||
gimp_register_file_handler_raw
|
||||
gimp_register_file_handler_uri
|
||||
|
@ -745,22 +678,18 @@ EXPORTS
|
|||
gimp_rgn_iterator_src
|
||||
gimp_rgn_iterator_src_dest
|
||||
gimp_rotate
|
||||
gimp_round_rect_select
|
||||
gimp_run_procedure
|
||||
gimp_run_procedure2
|
||||
gimp_scale
|
||||
gimp_selection_all
|
||||
gimp_selection_border
|
||||
gimp_selection_bounds
|
||||
gimp_selection_combine
|
||||
gimp_selection_feather
|
||||
gimp_selection_float
|
||||
gimp_selection_flood
|
||||
gimp_selection_grow
|
||||
gimp_selection_invert
|
||||
gimp_selection_is_empty
|
||||
gimp_selection_layer_alpha
|
||||
gimp_selection_load
|
||||
gimp_selection_none
|
||||
gimp_selection_save
|
||||
gimp_selection_sharpen
|
||||
|
@ -775,9 +704,7 @@ EXPORTS
|
|||
gimp_smudge
|
||||
gimp_smudge_default
|
||||
gimp_temp_name
|
||||
gimp_text
|
||||
gimp_text_fontname
|
||||
gimp_text_get_extents
|
||||
gimp_text_get_extents_fontname
|
||||
gimp_text_layer_get_antialias
|
||||
gimp_text_layer_get_base_direction
|
||||
|
@ -785,7 +712,6 @@ EXPORTS
|
|||
gimp_text_layer_get_font
|
||||
gimp_text_layer_get_font_size
|
||||
gimp_text_layer_get_hint_style
|
||||
gimp_text_layer_get_hinting
|
||||
gimp_text_layer_get_indent
|
||||
gimp_text_layer_get_justification
|
||||
gimp_text_layer_get_kerning
|
||||
|
@ -802,7 +728,6 @@ EXPORTS
|
|||
gimp_text_layer_set_font
|
||||
gimp_text_layer_set_font_size
|
||||
gimp_text_layer_set_hint_style
|
||||
gimp_text_layer_set_hinting
|
||||
gimp_text_layer_set_indent
|
||||
gimp_text_layer_set_justification
|
||||
gimp_text_layer_set_kerning
|
||||
|
@ -847,6 +772,5 @@ EXPORTS
|
|||
gimp_vectors_stroke_rotate
|
||||
gimp_vectors_stroke_scale
|
||||
gimp_vectors_stroke_translate
|
||||
gimp_vectors_to_selection
|
||||
gimp_version
|
||||
gimp_wm_class
|
||||
|
|
|
@ -33,14 +33,12 @@
|
|||
#include <libgimp/gimpbrushselect_pdb.h>
|
||||
#include <libgimp/gimpbuffer_pdb.h>
|
||||
#include <libgimp/gimpchannel_pdb.h>
|
||||
#include <libgimp/gimpcolor_pdb.h>
|
||||
#include <libgimp/gimpcontext_pdb.h>
|
||||
#include <libgimp/gimpdebug_pdb.h>
|
||||
#include <libgimp/gimpdisplay_pdb.h>
|
||||
#include <libgimp/gimpdrawable_pdb.h>
|
||||
#include <libgimp/gimpdrawablecolor_pdb.h>
|
||||
#include <libgimp/gimpdrawableedit_pdb.h>
|
||||
#include <libgimp/gimpdrawabletransform_pdb.h>
|
||||
#include <libgimp/gimpdynamics_pdb.h>
|
||||
#include <libgimp/gimpedit_pdb.h>
|
||||
#include <libgimp/gimpfileops_pdb.h>
|
||||
|
@ -69,7 +67,6 @@
|
|||
#include <libgimp/gimppalette_pdb.h>
|
||||
#include <libgimp/gimppalettes_pdb.h>
|
||||
#include <libgimp/gimppaletteselect_pdb.h>
|
||||
#include <libgimp/gimppaths_pdb.h>
|
||||
#include <libgimp/gimppattern_pdb.h>
|
||||
#include <libgimp/gimppatterns_pdb.h>
|
||||
#include <libgimp/gimppatternselect_pdb.h>
|
||||
|
@ -77,10 +74,8 @@
|
|||
#include <libgimp/gimpproceduraldb_pdb.h>
|
||||
#include <libgimp/gimpprogress_pdb.h>
|
||||
#include <libgimp/gimpselection_pdb.h>
|
||||
#include <libgimp/gimpselectiontools_pdb.h>
|
||||
#include <libgimp/gimptextlayer_pdb.h>
|
||||
#include <libgimp/gimptexttool_pdb.h>
|
||||
#include <libgimp/gimptransformtools_pdb.h>
|
||||
#include <libgimp/gimpunit_pdb.h>
|
||||
#include <libgimp/gimpvectors_pdb.h>
|
||||
|
||||
|
|
|
@ -22,8 +22,6 @@
|
|||
|
||||
#include "config.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "gimp.h"
|
||||
|
||||
|
||||
|
@ -109,148 +107,3 @@ gimp_brushes_get_list (const gchar *filter,
|
|||
|
||||
return brush_list;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_brushes_get_brush:
|
||||
* @width: The brush width.
|
||||
* @height: The brush height.
|
||||
* @spacing: The brush spacing.
|
||||
*
|
||||
* Deprecated: Use gimp_context_get_brush() instead.
|
||||
*
|
||||
* Returns: The brush name.
|
||||
**/
|
||||
gchar *
|
||||
gimp_brushes_get_brush (gint *width,
|
||||
gint *height,
|
||||
gint *spacing)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gchar *name = NULL;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-brushes-get-brush",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
{
|
||||
name = g_strdup (return_vals[1].data.d_string);
|
||||
*width = return_vals[2].data.d_int32;
|
||||
*height = return_vals[3].data.d_int32;
|
||||
*spacing = return_vals[4].data.d_int32;
|
||||
}
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_brushes_get_spacing:
|
||||
*
|
||||
* Deprecated: Use gimp_brush_get_spacing() instead.
|
||||
*
|
||||
* Returns: The brush spacing.
|
||||
**/
|
||||
gint
|
||||
gimp_brushes_get_spacing (void)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gint spacing = 0;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-brushes-get-spacing",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
spacing = return_vals[1].data.d_int32;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return spacing;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_brushes_set_spacing:
|
||||
* @spacing: The brush spacing.
|
||||
*
|
||||
* Deprecated: Use gimp_brush_set_spacing() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
**/
|
||||
gboolean
|
||||
gimp_brushes_set_spacing (gint spacing)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-brushes-set-spacing",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_INT32, spacing,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_brushes_get_brush_data:
|
||||
* @name: The brush name (\"\" means current active brush).
|
||||
* @opacity: The brush opacity.
|
||||
* @spacing: The brush spacing.
|
||||
* @paint_mode: The paint mode.
|
||||
* @width: The brush width.
|
||||
* @height: The brush height.
|
||||
* @length: Length of brush mask data.
|
||||
* @mask_data: The brush mask data.
|
||||
*
|
||||
* Deprecated: Use gimp_brush_get_pixels() instead.
|
||||
*
|
||||
* Returns: The brush name.
|
||||
**/
|
||||
gchar *
|
||||
gimp_brushes_get_brush_data (const gchar *name,
|
||||
gdouble *opacity,
|
||||
gint *spacing,
|
||||
GimpLayerMode *paint_mode,
|
||||
gint *width,
|
||||
gint *height,
|
||||
gint *length,
|
||||
guint8 **mask_data)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gchar *actual_name = NULL;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-brushes-get-brush-data",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_STRING, name,
|
||||
GIMP_PDB_END);
|
||||
|
||||
*length = 0;
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
{
|
||||
actual_name = g_strdup (return_vals[1].data.d_string);
|
||||
*opacity = return_vals[2].data.d_float;
|
||||
*spacing = return_vals[3].data.d_int32;
|
||||
*paint_mode = return_vals[4].data.d_int32;
|
||||
*width = return_vals[5].data.d_int32;
|
||||
*height = return_vals[6].data.d_int32;
|
||||
*length = return_vals[7].data.d_int32;
|
||||
*mask_data = g_new (guint8, *length);
|
||||
memcpy (*mask_data,
|
||||
return_vals[8].data.d_int8array,
|
||||
*length * sizeof (guint8));
|
||||
}
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return actual_name;
|
||||
}
|
||||
|
|
|
@ -35,23 +35,6 @@ G_BEGIN_DECLS
|
|||
gboolean gimp_brushes_refresh (void);
|
||||
gchar** gimp_brushes_get_list (const gchar *filter,
|
||||
gint *num_brushes);
|
||||
GIMP_DEPRECATED_FOR(gimp_context_get_brush)
|
||||
gchar* gimp_brushes_get_brush (gint *width,
|
||||
gint *height,
|
||||
gint *spacing);
|
||||
GIMP_DEPRECATED_FOR(gimp_brush_get_spacing)
|
||||
gint gimp_brushes_get_spacing (void);
|
||||
GIMP_DEPRECATED_FOR(gimp_brush_set_spacing)
|
||||
gboolean gimp_brushes_set_spacing (gint spacing);
|
||||
GIMP_DEPRECATED_FOR(gimp_brush_get_pixels)
|
||||
gchar* gimp_brushes_get_brush_data (const gchar *name,
|
||||
gdouble *opacity,
|
||||
gint *spacing,
|
||||
GimpLayerMode *paint_mode,
|
||||
gint *width,
|
||||
gint *height,
|
||||
gint *length,
|
||||
guint8 **mask_data);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
|
|
@ -1,611 +0,0 @@
|
|||
/* LIBGIMP - The GIMP Library
|
||||
* Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
|
||||
*
|
||||
* gimpcolor_pdb.c
|
||||
*
|
||||
* This library is free software: you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see
|
||||
* <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* NOTE: This file is auto-generated by pdbgen.pl */
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "gimp.h"
|
||||
|
||||
|
||||
/**
|
||||
* SECTION: gimpcolor
|
||||
* @title: gimpcolor
|
||||
* @short_description: Functions for manipulating color.
|
||||
*
|
||||
* Functions for manipulating color, including curves and histograms.
|
||||
**/
|
||||
|
||||
|
||||
/**
|
||||
* gimp_brightness_contrast:
|
||||
* @drawable_ID: The drawable.
|
||||
* @brightness: Brightness adjustment.
|
||||
* @contrast: Contrast adjustment.
|
||||
*
|
||||
* Deprecated: Use gimp_drawable_brightness_contrast() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
**/
|
||||
gboolean
|
||||
gimp_brightness_contrast (gint32 drawable_ID,
|
||||
gint brightness,
|
||||
gint contrast)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-brightness-contrast",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_INT32, brightness,
|
||||
GIMP_PDB_INT32, contrast,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_levels:
|
||||
* @drawable_ID: The drawable.
|
||||
* @channel: The channel to modify.
|
||||
* @low_input: Intensity of lowest input.
|
||||
* @high_input: Intensity of highest input.
|
||||
* @gamma: Gamma adjustment factor.
|
||||
* @low_output: Intensity of lowest output.
|
||||
* @high_output: Intensity of highest output.
|
||||
*
|
||||
* Deprecated: Use gimp_drawable_levels() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
**/
|
||||
gboolean
|
||||
gimp_levels (gint32 drawable_ID,
|
||||
GimpHistogramChannel channel,
|
||||
gint low_input,
|
||||
gint high_input,
|
||||
gdouble gamma,
|
||||
gint low_output,
|
||||
gint high_output)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-levels",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_INT32, channel,
|
||||
GIMP_PDB_INT32, low_input,
|
||||
GIMP_PDB_INT32, high_input,
|
||||
GIMP_PDB_FLOAT, gamma,
|
||||
GIMP_PDB_INT32, low_output,
|
||||
GIMP_PDB_INT32, high_output,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_levels_auto:
|
||||
* @drawable_ID: The drawable.
|
||||
*
|
||||
* Deprecated: Use gimp_drawable_levels_stretch() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
**/
|
||||
gboolean
|
||||
gimp_levels_auto (gint32 drawable_ID)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-levels-auto",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_levels_stretch:
|
||||
* @drawable_ID: The drawable.
|
||||
*
|
||||
* Deprecated: Use gimp_drawable_levels_stretch() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
**/
|
||||
gboolean
|
||||
gimp_levels_stretch (gint32 drawable_ID)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-levels-stretch",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_posterize:
|
||||
* @drawable_ID: The drawable.
|
||||
* @levels: Levels of posterization.
|
||||
*
|
||||
* Deprecated: Use gimp_drawable_posterize() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
**/
|
||||
gboolean
|
||||
gimp_posterize (gint32 drawable_ID,
|
||||
gint levels)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-posterize",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_INT32, levels,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_desaturate:
|
||||
* @drawable_ID: The drawable.
|
||||
*
|
||||
* Deprecated: Use gimp_drawable_desaturate() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
**/
|
||||
gboolean
|
||||
gimp_desaturate (gint32 drawable_ID)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-desaturate",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_desaturate_full:
|
||||
* @drawable_ID: The drawable.
|
||||
* @desaturate_mode: The formula to use to desaturate.
|
||||
*
|
||||
* Deprecated: Use gimp_drawable_desaturate() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
*
|
||||
* Since: 2.4
|
||||
**/
|
||||
gboolean
|
||||
gimp_desaturate_full (gint32 drawable_ID,
|
||||
GimpDesaturateMode desaturate_mode)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-desaturate-full",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_INT32, desaturate_mode,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_equalize:
|
||||
* @drawable_ID: The drawable.
|
||||
* @mask_only: Equalization option.
|
||||
*
|
||||
* Deprecated: Use gimp_drawable_equalize() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
**/
|
||||
gboolean
|
||||
gimp_equalize (gint32 drawable_ID,
|
||||
gboolean mask_only)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-equalize",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_INT32, mask_only,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_invert:
|
||||
* @drawable_ID: The drawable.
|
||||
*
|
||||
* Deprecated: Use gimp_drawable_invert() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
**/
|
||||
gboolean
|
||||
gimp_invert (gint32 drawable_ID)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-invert",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_curves_spline:
|
||||
* @drawable_ID: The drawable.
|
||||
* @channel: The channel to modify.
|
||||
* @num_points: The number of values in the control point array.
|
||||
* @control_pts: The spline control points: { cp1.x, cp1.y, cp2.x, cp2.y, ... }.
|
||||
*
|
||||
* Deprecated: Use gimp_drawable_curves_spline() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
**/
|
||||
gboolean
|
||||
gimp_curves_spline (gint32 drawable_ID,
|
||||
GimpHistogramChannel channel,
|
||||
gint num_points,
|
||||
const guint8 *control_pts)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-curves-spline",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_INT32, channel,
|
||||
GIMP_PDB_INT32, num_points,
|
||||
GIMP_PDB_INT8ARRAY, control_pts,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_curves_explicit:
|
||||
* @drawable_ID: The drawable.
|
||||
* @channel: The channel to modify.
|
||||
* @num_bytes: The number of bytes in the new curve (always 256).
|
||||
* @curve: The explicit curve.
|
||||
*
|
||||
* Deprecated: Use gimp_drawable_curves_explicit() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
**/
|
||||
gboolean
|
||||
gimp_curves_explicit (gint32 drawable_ID,
|
||||
GimpHistogramChannel channel,
|
||||
gint num_bytes,
|
||||
const guint8 *curve)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-curves-explicit",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_INT32, channel,
|
||||
GIMP_PDB_INT32, num_bytes,
|
||||
GIMP_PDB_INT8ARRAY, curve,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_color_balance:
|
||||
* @drawable_ID: The drawable.
|
||||
* @transfer_mode: Transfer mode.
|
||||
* @preserve_lum: Preserve luminosity values at each pixel.
|
||||
* @cyan_red: Cyan-Red color balance.
|
||||
* @magenta_green: Magenta-Green color balance.
|
||||
* @yellow_blue: Yellow-Blue color balance.
|
||||
*
|
||||
* Modify the color balance of the specified drawable.
|
||||
*
|
||||
* Modify the color balance of the specified drawable. There are three
|
||||
* axis which can be modified: cyan-red, magenta-green, and
|
||||
* yellow-blue. Negative values increase the amount of the former,
|
||||
* positive values increase the amount of the latter. Color balance can
|
||||
* be controlled with the 'transfer_mode' setting, which allows
|
||||
* shadows, mid-tones, and highlights in an image to be affected
|
||||
* differently. The 'preserve-lum' parameter, if TRUE, ensures that the
|
||||
* luminosity of each pixel remains fixed.
|
||||
*
|
||||
* Deprecated: Use gimp_drawable_color_color_balance() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
**/
|
||||
gboolean
|
||||
gimp_color_balance (gint32 drawable_ID,
|
||||
GimpTransferMode transfer_mode,
|
||||
gboolean preserve_lum,
|
||||
gdouble cyan_red,
|
||||
gdouble magenta_green,
|
||||
gdouble yellow_blue)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-color-balance",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_INT32, transfer_mode,
|
||||
GIMP_PDB_INT32, preserve_lum,
|
||||
GIMP_PDB_FLOAT, cyan_red,
|
||||
GIMP_PDB_FLOAT, magenta_green,
|
||||
GIMP_PDB_FLOAT, yellow_blue,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_colorize:
|
||||
* @drawable_ID: The drawable.
|
||||
* @hue: Hue in degrees.
|
||||
* @saturation: Saturation in percent.
|
||||
* @lightness: Lightness in percent.
|
||||
*
|
||||
* Deprecated: Use gimp_drawable_colorize_hsl() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
**/
|
||||
gboolean
|
||||
gimp_colorize (gint32 drawable_ID,
|
||||
gdouble hue,
|
||||
gdouble saturation,
|
||||
gdouble lightness)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-colorize",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_FLOAT, hue,
|
||||
GIMP_PDB_FLOAT, saturation,
|
||||
GIMP_PDB_FLOAT, lightness,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_histogram:
|
||||
* @drawable_ID: The drawable.
|
||||
* @channel: The channel to modify.
|
||||
* @start_range: Start of the intensity measurement range.
|
||||
* @end_range: End of the intensity measurement range.
|
||||
* @mean: Mean intensity value.
|
||||
* @std_dev: Standard deviation of intensity values.
|
||||
* @median: Median intensity value.
|
||||
* @pixels: Alpha-weighted pixel count for entire image.
|
||||
* @count: Alpha-weighted pixel count for range.
|
||||
* @percentile: Percentile that range falls under.
|
||||
*
|
||||
* Deprecated: Use gimp_drawable_histogram() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
**/
|
||||
gboolean
|
||||
gimp_histogram (gint32 drawable_ID,
|
||||
GimpHistogramChannel channel,
|
||||
gint start_range,
|
||||
gint end_range,
|
||||
gdouble *mean,
|
||||
gdouble *std_dev,
|
||||
gdouble *median,
|
||||
gdouble *pixels,
|
||||
gdouble *count,
|
||||
gdouble *percentile)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-histogram",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_INT32, channel,
|
||||
GIMP_PDB_INT32, start_range,
|
||||
GIMP_PDB_INT32, end_range,
|
||||
GIMP_PDB_END);
|
||||
|
||||
*mean = 0.0;
|
||||
*std_dev = 0.0;
|
||||
*median = 0.0;
|
||||
*pixels = 0.0;
|
||||
*count = 0.0;
|
||||
*percentile = 0.0;
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
if (success)
|
||||
{
|
||||
*mean = return_vals[1].data.d_float;
|
||||
*std_dev = return_vals[2].data.d_float;
|
||||
*median = return_vals[3].data.d_float;
|
||||
*pixels = return_vals[4].data.d_float;
|
||||
*count = return_vals[5].data.d_float;
|
||||
*percentile = return_vals[6].data.d_float;
|
||||
}
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_hue_saturation:
|
||||
* @drawable_ID: The drawable.
|
||||
* @hue_range: Range of affected hues.
|
||||
* @hue_offset: Hue offset in degrees.
|
||||
* @lightness: Lightness modification.
|
||||
* @saturation: Saturation modification.
|
||||
*
|
||||
* Deprecated: Use gimp_drawable_hue_saturation() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
**/
|
||||
gboolean
|
||||
gimp_hue_saturation (gint32 drawable_ID,
|
||||
GimpHueRange hue_range,
|
||||
gdouble hue_offset,
|
||||
gdouble lightness,
|
||||
gdouble saturation)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-hue-saturation",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_INT32, hue_range,
|
||||
GIMP_PDB_FLOAT, hue_offset,
|
||||
GIMP_PDB_FLOAT, lightness,
|
||||
GIMP_PDB_FLOAT, saturation,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_threshold:
|
||||
* @drawable_ID: The drawable.
|
||||
* @low_threshold: The low threshold value.
|
||||
* @high_threshold: The high threshold value.
|
||||
*
|
||||
* Deprecated: Use gimp_drawable_threshold() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
**/
|
||||
gboolean
|
||||
gimp_threshold (gint32 drawable_ID,
|
||||
gint low_threshold,
|
||||
gint high_threshold)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-threshold",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_INT32, low_threshold,
|
||||
GIMP_PDB_INT32, high_threshold,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
|
@ -1,111 +0,0 @@
|
|||
/* LIBGIMP - The GIMP Library
|
||||
* Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
|
||||
*
|
||||
* gimpcolor_pdb.h
|
||||
*
|
||||
* This library is free software: you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see
|
||||
* <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* NOTE: This file is auto-generated by pdbgen.pl */
|
||||
|
||||
#if !defined (__GIMP_H_INSIDE__) && !defined (GIMP_COMPILATION)
|
||||
#error "Only <libgimp/gimp.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#ifndef __GIMP_COLOR_PDB_H__
|
||||
#define __GIMP_COLOR_PDB_H__
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/* For information look into the C source or the html documentation */
|
||||
|
||||
|
||||
GIMP_DEPRECATED_FOR(gimp_drawable_brightness_contrast)
|
||||
gboolean gimp_brightness_contrast (gint32 drawable_ID,
|
||||
gint brightness,
|
||||
gint contrast);
|
||||
GIMP_DEPRECATED_FOR(gimp_drawable_levels)
|
||||
gboolean gimp_levels (gint32 drawable_ID,
|
||||
GimpHistogramChannel channel,
|
||||
gint low_input,
|
||||
gint high_input,
|
||||
gdouble gamma,
|
||||
gint low_output,
|
||||
gint high_output);
|
||||
GIMP_DEPRECATED_FOR(gimp_drawable_levels_stretch)
|
||||
gboolean gimp_levels_auto (gint32 drawable_ID);
|
||||
GIMP_DEPRECATED_FOR(gimp_drawable_levels_stretch)
|
||||
gboolean gimp_levels_stretch (gint32 drawable_ID);
|
||||
GIMP_DEPRECATED_FOR(gimp_drawable_posterize)
|
||||
gboolean gimp_posterize (gint32 drawable_ID,
|
||||
gint levels);
|
||||
GIMP_DEPRECATED_FOR(gimp_drawable_desaturate)
|
||||
gboolean gimp_desaturate (gint32 drawable_ID);
|
||||
GIMP_DEPRECATED_FOR(gimp_drawable_desaturate)
|
||||
gboolean gimp_desaturate_full (gint32 drawable_ID,
|
||||
GimpDesaturateMode desaturate_mode);
|
||||
GIMP_DEPRECATED_FOR(gimp_drawable_equalize)
|
||||
gboolean gimp_equalize (gint32 drawable_ID,
|
||||
gboolean mask_only);
|
||||
GIMP_DEPRECATED_FOR(gimp_drawable_invert)
|
||||
gboolean gimp_invert (gint32 drawable_ID);
|
||||
GIMP_DEPRECATED_FOR(gimp_drawable_curves_spline)
|
||||
gboolean gimp_curves_spline (gint32 drawable_ID,
|
||||
GimpHistogramChannel channel,
|
||||
gint num_points,
|
||||
const guint8 *control_pts);
|
||||
GIMP_DEPRECATED_FOR(gimp_drawable_curves_explicit)
|
||||
gboolean gimp_curves_explicit (gint32 drawable_ID,
|
||||
GimpHistogramChannel channel,
|
||||
gint num_bytes,
|
||||
const guint8 *curve);
|
||||
GIMP_DEPRECATED_FOR(gimp_drawable_color_color_balance)
|
||||
gboolean gimp_color_balance (gint32 drawable_ID,
|
||||
GimpTransferMode transfer_mode,
|
||||
gboolean preserve_lum,
|
||||
gdouble cyan_red,
|
||||
gdouble magenta_green,
|
||||
gdouble yellow_blue);
|
||||
GIMP_DEPRECATED_FOR(gimp_drawable_colorize_hsl)
|
||||
gboolean gimp_colorize (gint32 drawable_ID,
|
||||
gdouble hue,
|
||||
gdouble saturation,
|
||||
gdouble lightness);
|
||||
GIMP_DEPRECATED_FOR(gimp_drawable_histogram)
|
||||
gboolean gimp_histogram (gint32 drawable_ID,
|
||||
GimpHistogramChannel channel,
|
||||
gint start_range,
|
||||
gint end_range,
|
||||
gdouble *mean,
|
||||
gdouble *std_dev,
|
||||
gdouble *median,
|
||||
gdouble *pixels,
|
||||
gdouble *count,
|
||||
gdouble *percentile);
|
||||
GIMP_DEPRECATED_FOR(gimp_drawable_hue_saturation)
|
||||
gboolean gimp_hue_saturation (gint32 drawable_ID,
|
||||
GimpHueRange hue_range,
|
||||
gdouble hue_offset,
|
||||
gdouble lightness,
|
||||
gdouble saturation);
|
||||
GIMP_DEPRECATED_FOR(gimp_drawable_threshold)
|
||||
gboolean gimp_threshold (gint32 drawable_ID,
|
||||
gint low_threshold,
|
||||
gint high_threshold);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GIMP_COLOR_PDB_H__ */
|
|
@ -3269,59 +3269,6 @@ gimp_context_set_transform_resize (GimpTransformResize transform_resize)
|
|||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_context_get_transform_recursion:
|
||||
*
|
||||
* Deprecated: There is no replacement for this procedure.
|
||||
*
|
||||
* Returns: This returns always 3 and is meaningless.
|
||||
**/
|
||||
gint
|
||||
gimp_context_get_transform_recursion (void)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gint transform_recursion = 0;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-context-get-transform-recursion",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
transform_recursion = return_vals[1].data.d_int32;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return transform_recursion;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_context_set_transform_recursion:
|
||||
* @transform_recursion: This parameter is ignored.
|
||||
*
|
||||
* Deprecated: There is no replacement for this procedure.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
**/
|
||||
gboolean
|
||||
gimp_context_set_transform_recursion (gint transform_recursion)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-context-set-transform-recursion",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_INT32, transform_recursion,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_context_get_ink_size:
|
||||
*
|
||||
|
|
|
@ -134,10 +134,6 @@ GimpTransformDirection gimp_context_get_transform_direction (void);
|
|||
gboolean gimp_context_set_transform_direction (GimpTransformDirection transform_direction);
|
||||
GimpTransformResize gimp_context_get_transform_resize (void);
|
||||
gboolean gimp_context_set_transform_resize (GimpTransformResize transform_resize);
|
||||
GIMP_DEPRECATED
|
||||
gint gimp_context_get_transform_recursion (void);
|
||||
GIMP_DEPRECATED
|
||||
gboolean gimp_context_set_transform_recursion (gint transform_recursion);
|
||||
gdouble gimp_context_get_ink_size (void);
|
||||
gboolean gimp_context_set_ink_size (gdouble size);
|
||||
gdouble gimp_context_get_ink_angle (void);
|
||||
|
|
|
@ -392,36 +392,6 @@ gimp_drawable_offsets (gint32 drawable_ID,
|
|||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_drawable_set_image:
|
||||
* @drawable_ID: The drawable.
|
||||
* @image_ID: The image.
|
||||
*
|
||||
* Deprecated: There is no replacement for this procedure.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
**/
|
||||
gboolean
|
||||
gimp_drawable_set_image (gint32 drawable_ID,
|
||||
gint32 image_ID)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-drawable-set-image",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_IMAGE, image_ID,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_drawable_mask_bounds:
|
||||
* @drawable_ID: The drawable.
|
||||
|
|
|
@ -45,9 +45,6 @@ gint gimp_drawable_height (gint32
|
|||
gboolean gimp_drawable_offsets (gint32 drawable_ID,
|
||||
gint *offset_x,
|
||||
gint *offset_y);
|
||||
GIMP_DEPRECATED
|
||||
gboolean gimp_drawable_set_image (gint32 drawable_ID,
|
||||
gint32 image_ID);
|
||||
gboolean gimp_drawable_mask_bounds (gint32 drawable_ID,
|
||||
gint *x1,
|
||||
gint *y1,
|
||||
|
|
|
@ -1,917 +0,0 @@
|
|||
/* LIBGIMP - The GIMP Library
|
||||
* Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
|
||||
*
|
||||
* gimpdrawabletransform_pdb.c
|
||||
*
|
||||
* This library is free software: you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see
|
||||
* <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* NOTE: This file is auto-generated by pdbgen.pl */
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "gimp.h"
|
||||
|
||||
|
||||
/**
|
||||
* SECTION: gimpdrawabletransform
|
||||
* @title: gimpdrawabletransform
|
||||
* @short_description: Functions to perform transformatrions on drawables.
|
||||
*
|
||||
* Functions to perform transformatrions on drawables.
|
||||
**/
|
||||
|
||||
|
||||
/**
|
||||
* gimp_drawable_transform_flip_simple:
|
||||
* @drawable_ID: The affected drawable.
|
||||
* @flip_type: Type of flip.
|
||||
* @auto_center: Whether to automatically position the axis in the selection center.
|
||||
* @axis: coord. of flip axis.
|
||||
* @clip_result: Whether to clip results.
|
||||
*
|
||||
* Deprecated: Use gimp_item_transform_flip_simple() instead.
|
||||
*
|
||||
* Returns: The flipped drawable.
|
||||
*
|
||||
* Since: 2.2
|
||||
**/
|
||||
gint32
|
||||
gimp_drawable_transform_flip_simple (gint32 drawable_ID,
|
||||
GimpOrientationType flip_type,
|
||||
gboolean auto_center,
|
||||
gdouble axis,
|
||||
gboolean clip_result)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gint32 ret_drawable_ID = -1;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-drawable-transform-flip-simple",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_INT32, flip_type,
|
||||
GIMP_PDB_INT32, auto_center,
|
||||
GIMP_PDB_FLOAT, axis,
|
||||
GIMP_PDB_INT32, clip_result,
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
ret_drawable_ID = return_vals[1].data.d_drawable;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return ret_drawable_ID;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_drawable_transform_flip:
|
||||
* @drawable_ID: The affected drawable.
|
||||
* @x0: horz. coord. of one end of axis.
|
||||
* @y0: vert. coord. of one end of axis.
|
||||
* @x1: horz. coord. of other end of axis.
|
||||
* @y1: vert. coord. of other end of axis.
|
||||
* @transform_direction: Direction of transformation.
|
||||
* @interpolation: Type of interpolation.
|
||||
* @supersample: This parameter is ignored.
|
||||
* @recursion_level: This parameter is ignored.
|
||||
* @clip_result: Whether to clip results.
|
||||
*
|
||||
* Deprecated: Use gimp_item_transform_flip() instead.
|
||||
*
|
||||
* Returns: The flipped drawable.
|
||||
*
|
||||
* Since: 2.2
|
||||
**/
|
||||
gint32
|
||||
gimp_drawable_transform_flip (gint32 drawable_ID,
|
||||
gdouble x0,
|
||||
gdouble y0,
|
||||
gdouble x1,
|
||||
gdouble y1,
|
||||
GimpTransformDirection transform_direction,
|
||||
GimpInterpolationType interpolation,
|
||||
gboolean supersample,
|
||||
gint recursion_level,
|
||||
gboolean clip_result)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gint32 ret_drawable_ID = -1;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-drawable-transform-flip",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_FLOAT, x0,
|
||||
GIMP_PDB_FLOAT, y0,
|
||||
GIMP_PDB_FLOAT, x1,
|
||||
GIMP_PDB_FLOAT, y1,
|
||||
GIMP_PDB_INT32, transform_direction,
|
||||
GIMP_PDB_INT32, interpolation,
|
||||
GIMP_PDB_INT32, supersample,
|
||||
GIMP_PDB_INT32, recursion_level,
|
||||
GIMP_PDB_INT32, clip_result,
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
ret_drawable_ID = return_vals[1].data.d_drawable;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return ret_drawable_ID;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_drawable_transform_flip_default:
|
||||
* @drawable_ID: The affected drawable.
|
||||
* @x0: horz. coord. of one end of axis.
|
||||
* @y0: vert. coord. of one end of axis.
|
||||
* @x1: horz. coord. of other end of axis.
|
||||
* @y1: vert. coord. of other end of axis.
|
||||
* @interpolate: Whether to use interpolation and supersampling.
|
||||
* @clip_result: Whether to clip results.
|
||||
*
|
||||
* Deprecated: Use gimp_item_transform_flip() instead.
|
||||
*
|
||||
* Returns: The flipped drawable.
|
||||
*
|
||||
* Since: 2.2
|
||||
**/
|
||||
gint32
|
||||
gimp_drawable_transform_flip_default (gint32 drawable_ID,
|
||||
gdouble x0,
|
||||
gdouble y0,
|
||||
gdouble x1,
|
||||
gdouble y1,
|
||||
gboolean interpolate,
|
||||
gboolean clip_result)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gint32 ret_drawable_ID = -1;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-drawable-transform-flip-default",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_FLOAT, x0,
|
||||
GIMP_PDB_FLOAT, y0,
|
||||
GIMP_PDB_FLOAT, x1,
|
||||
GIMP_PDB_FLOAT, y1,
|
||||
GIMP_PDB_INT32, interpolate,
|
||||
GIMP_PDB_INT32, clip_result,
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
ret_drawable_ID = return_vals[1].data.d_drawable;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return ret_drawable_ID;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_drawable_transform_perspective:
|
||||
* @drawable_ID: The affected drawable.
|
||||
* @x0: The new x coordinate of upper-left corner of original bounding box.
|
||||
* @y0: The new y coordinate of upper-left corner of original bounding box.
|
||||
* @x1: The new x coordinate of upper-right corner of original bounding box.
|
||||
* @y1: The new y coordinate of upper-right corner of original bounding box.
|
||||
* @x2: The new x coordinate of lower-left corner of original bounding box.
|
||||
* @y2: The new y coordinate of lower-left corner of original bounding box.
|
||||
* @x3: The new x coordinate of lower-right corner of original bounding box.
|
||||
* @y3: The new y coordinate of lower-right corner of original bounding box.
|
||||
* @transform_direction: Direction of transformation.
|
||||
* @interpolation: Type of interpolation.
|
||||
* @supersample: This parameter is ignored.
|
||||
* @recursion_level: This parameter is ignored.
|
||||
* @clip_result: How to clip results.
|
||||
*
|
||||
* Deprecated: Use gimp_item_transform_perspective() instead.
|
||||
*
|
||||
* Returns: The newly mapped drawable.
|
||||
*
|
||||
* Since: 2.2
|
||||
**/
|
||||
gint32
|
||||
gimp_drawable_transform_perspective (gint32 drawable_ID,
|
||||
gdouble x0,
|
||||
gdouble y0,
|
||||
gdouble x1,
|
||||
gdouble y1,
|
||||
gdouble x2,
|
||||
gdouble y2,
|
||||
gdouble x3,
|
||||
gdouble y3,
|
||||
GimpTransformDirection transform_direction,
|
||||
GimpInterpolationType interpolation,
|
||||
gboolean supersample,
|
||||
gint recursion_level,
|
||||
GimpTransformResize clip_result)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gint32 ret_drawable_ID = -1;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-drawable-transform-perspective",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_FLOAT, x0,
|
||||
GIMP_PDB_FLOAT, y0,
|
||||
GIMP_PDB_FLOAT, x1,
|
||||
GIMP_PDB_FLOAT, y1,
|
||||
GIMP_PDB_FLOAT, x2,
|
||||
GIMP_PDB_FLOAT, y2,
|
||||
GIMP_PDB_FLOAT, x3,
|
||||
GIMP_PDB_FLOAT, y3,
|
||||
GIMP_PDB_INT32, transform_direction,
|
||||
GIMP_PDB_INT32, interpolation,
|
||||
GIMP_PDB_INT32, supersample,
|
||||
GIMP_PDB_INT32, recursion_level,
|
||||
GIMP_PDB_INT32, clip_result,
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
ret_drawable_ID = return_vals[1].data.d_drawable;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return ret_drawable_ID;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_drawable_transform_perspective_default:
|
||||
* @drawable_ID: The affected drawable.
|
||||
* @x0: The new x coordinate of upper-left corner of original bounding box.
|
||||
* @y0: The new y coordinate of upper-left corner of original bounding box.
|
||||
* @x1: The new x coordinate of upper-right corner of original bounding box.
|
||||
* @y1: The new y coordinate of upper-right corner of original bounding box.
|
||||
* @x2: The new x coordinate of lower-left corner of original bounding box.
|
||||
* @y2: The new y coordinate of lower-left corner of original bounding box.
|
||||
* @x3: The new x coordinate of lower-right corner of original bounding box.
|
||||
* @y3: The new y coordinate of lower-right corner of original bounding box.
|
||||
* @interpolate: Whether to use interpolation and supersampling.
|
||||
* @clip_result: How to clip results.
|
||||
*
|
||||
* Deprecated: Use gimp_item_transform_perspective() instead.
|
||||
*
|
||||
* Returns: The newly mapped drawable.
|
||||
*
|
||||
* Since: 2.2
|
||||
**/
|
||||
gint32
|
||||
gimp_drawable_transform_perspective_default (gint32 drawable_ID,
|
||||
gdouble x0,
|
||||
gdouble y0,
|
||||
gdouble x1,
|
||||
gdouble y1,
|
||||
gdouble x2,
|
||||
gdouble y2,
|
||||
gdouble x3,
|
||||
gdouble y3,
|
||||
gboolean interpolate,
|
||||
GimpTransformResize clip_result)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gint32 ret_drawable_ID = -1;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-drawable-transform-perspective-default",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_FLOAT, x0,
|
||||
GIMP_PDB_FLOAT, y0,
|
||||
GIMP_PDB_FLOAT, x1,
|
||||
GIMP_PDB_FLOAT, y1,
|
||||
GIMP_PDB_FLOAT, x2,
|
||||
GIMP_PDB_FLOAT, y2,
|
||||
GIMP_PDB_FLOAT, x3,
|
||||
GIMP_PDB_FLOAT, y3,
|
||||
GIMP_PDB_INT32, interpolate,
|
||||
GIMP_PDB_INT32, clip_result,
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
ret_drawable_ID = return_vals[1].data.d_drawable;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return ret_drawable_ID;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_drawable_transform_rotate_simple:
|
||||
* @drawable_ID: The affected drawable.
|
||||
* @rotate_type: Type of rotation.
|
||||
* @auto_center: Whether to automatically rotate around the selection center.
|
||||
* @center_x: The hor. coordinate of the center of rotation.
|
||||
* @center_y: The vert. coordinate of the center of rotation.
|
||||
* @clip_result: Whether to clip results.
|
||||
*
|
||||
* Deprecated: Use gimp_item_transform_rotate_simple() instead.
|
||||
*
|
||||
* Returns: The rotated drawable.
|
||||
*
|
||||
* Since: 2.2
|
||||
**/
|
||||
gint32
|
||||
gimp_drawable_transform_rotate_simple (gint32 drawable_ID,
|
||||
GimpRotationType rotate_type,
|
||||
gboolean auto_center,
|
||||
gint center_x,
|
||||
gint center_y,
|
||||
gboolean clip_result)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gint32 ret_drawable_ID = -1;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-drawable-transform-rotate-simple",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_INT32, rotate_type,
|
||||
GIMP_PDB_INT32, auto_center,
|
||||
GIMP_PDB_INT32, center_x,
|
||||
GIMP_PDB_INT32, center_y,
|
||||
GIMP_PDB_INT32, clip_result,
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
ret_drawable_ID = return_vals[1].data.d_drawable;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return ret_drawable_ID;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_drawable_transform_rotate:
|
||||
* @drawable_ID: The affected drawable.
|
||||
* @angle: The angle of rotation (radians).
|
||||
* @auto_center: Whether to automatically rotate around the selection center.
|
||||
* @center_x: The hor. coordinate of the center of rotation.
|
||||
* @center_y: The vert. coordinate of the center of rotation.
|
||||
* @transform_direction: Direction of transformation.
|
||||
* @interpolation: Type of interpolation.
|
||||
* @supersample: This parameter is ignored.
|
||||
* @recursion_level: This parameter is ignored.
|
||||
* @clip_result: How to clip results.
|
||||
*
|
||||
* Deprecated: Use gimp_item_transform_rotate() instead.
|
||||
*
|
||||
* Returns: The rotated drawable.
|
||||
*
|
||||
* Since: 2.2
|
||||
**/
|
||||
gint32
|
||||
gimp_drawable_transform_rotate (gint32 drawable_ID,
|
||||
gdouble angle,
|
||||
gboolean auto_center,
|
||||
gint center_x,
|
||||
gint center_y,
|
||||
GimpTransformDirection transform_direction,
|
||||
GimpInterpolationType interpolation,
|
||||
gboolean supersample,
|
||||
gint recursion_level,
|
||||
GimpTransformResize clip_result)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gint32 ret_drawable_ID = -1;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-drawable-transform-rotate",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_FLOAT, angle,
|
||||
GIMP_PDB_INT32, auto_center,
|
||||
GIMP_PDB_INT32, center_x,
|
||||
GIMP_PDB_INT32, center_y,
|
||||
GIMP_PDB_INT32, transform_direction,
|
||||
GIMP_PDB_INT32, interpolation,
|
||||
GIMP_PDB_INT32, supersample,
|
||||
GIMP_PDB_INT32, recursion_level,
|
||||
GIMP_PDB_INT32, clip_result,
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
ret_drawable_ID = return_vals[1].data.d_drawable;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return ret_drawable_ID;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_drawable_transform_rotate_default:
|
||||
* @drawable_ID: The affected drawable.
|
||||
* @angle: The angle of rotation (radians).
|
||||
* @auto_center: Whether to automatically rotate around the selection center.
|
||||
* @center_x: The hor. coordinate of the center of rotation.
|
||||
* @center_y: The vert. coordinate of the center of rotation.
|
||||
* @interpolate: Whether to use interpolation and supersampling.
|
||||
* @clip_result: How to clip results.
|
||||
*
|
||||
* Deprecated: Use gimp_item_transform_rotate() instead.
|
||||
*
|
||||
* Returns: The rotated drawable.
|
||||
*
|
||||
* Since: 2.2
|
||||
**/
|
||||
gint32
|
||||
gimp_drawable_transform_rotate_default (gint32 drawable_ID,
|
||||
gdouble angle,
|
||||
gboolean auto_center,
|
||||
gint center_x,
|
||||
gint center_y,
|
||||
gboolean interpolate,
|
||||
GimpTransformResize clip_result)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gint32 ret_drawable_ID = -1;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-drawable-transform-rotate-default",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_FLOAT, angle,
|
||||
GIMP_PDB_INT32, auto_center,
|
||||
GIMP_PDB_INT32, center_x,
|
||||
GIMP_PDB_INT32, center_y,
|
||||
GIMP_PDB_INT32, interpolate,
|
||||
GIMP_PDB_INT32, clip_result,
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
ret_drawable_ID = return_vals[1].data.d_drawable;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return ret_drawable_ID;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_drawable_transform_scale:
|
||||
* @drawable_ID: The affected drawable.
|
||||
* @x0: The new x coordinate of the upper-left corner of the scaled region.
|
||||
* @y0: The new y coordinate of the upper-left corner of the scaled region.
|
||||
* @x1: The new x coordinate of the lower-right corner of the scaled region.
|
||||
* @y1: The new y coordinate of the lower-right corner of the scaled region.
|
||||
* @transform_direction: Direction of transformation.
|
||||
* @interpolation: Type of interpolation.
|
||||
* @supersample: This parameter is ignored.
|
||||
* @recursion_level: This parameter is ignored.
|
||||
* @clip_result: How to clip results.
|
||||
*
|
||||
* Deprecated: Use gimp_item_transform_scale() instead.
|
||||
*
|
||||
* Returns: The scaled drawable.
|
||||
*
|
||||
* Since: 2.2
|
||||
**/
|
||||
gint32
|
||||
gimp_drawable_transform_scale (gint32 drawable_ID,
|
||||
gdouble x0,
|
||||
gdouble y0,
|
||||
gdouble x1,
|
||||
gdouble y1,
|
||||
GimpTransformDirection transform_direction,
|
||||
GimpInterpolationType interpolation,
|
||||
gboolean supersample,
|
||||
gint recursion_level,
|
||||
GimpTransformResize clip_result)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gint32 ret_drawable_ID = -1;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-drawable-transform-scale",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_FLOAT, x0,
|
||||
GIMP_PDB_FLOAT, y0,
|
||||
GIMP_PDB_FLOAT, x1,
|
||||
GIMP_PDB_FLOAT, y1,
|
||||
GIMP_PDB_INT32, transform_direction,
|
||||
GIMP_PDB_INT32, interpolation,
|
||||
GIMP_PDB_INT32, supersample,
|
||||
GIMP_PDB_INT32, recursion_level,
|
||||
GIMP_PDB_INT32, clip_result,
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
ret_drawable_ID = return_vals[1].data.d_drawable;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return ret_drawable_ID;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_drawable_transform_scale_default:
|
||||
* @drawable_ID: The affected drawable.
|
||||
* @x0: The new x coordinate of the upper-left corner of the scaled region.
|
||||
* @y0: The new y coordinate of the upper-left corner of the scaled region.
|
||||
* @x1: The new x coordinate of the lower-right corner of the scaled region.
|
||||
* @y1: The new y coordinate of the lower-right corner of the scaled region.
|
||||
* @interpolate: Whether to use interpolation and supersampling.
|
||||
* @clip_result: How to clip results.
|
||||
*
|
||||
* Deprecated: Use gimp_item_transform_scale() instead.
|
||||
*
|
||||
* Returns: The scaled drawable.
|
||||
*
|
||||
* Since: 2.2
|
||||
**/
|
||||
gint32
|
||||
gimp_drawable_transform_scale_default (gint32 drawable_ID,
|
||||
gdouble x0,
|
||||
gdouble y0,
|
||||
gdouble x1,
|
||||
gdouble y1,
|
||||
gboolean interpolate,
|
||||
GimpTransformResize clip_result)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gint32 ret_drawable_ID = -1;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-drawable-transform-scale-default",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_FLOAT, x0,
|
||||
GIMP_PDB_FLOAT, y0,
|
||||
GIMP_PDB_FLOAT, x1,
|
||||
GIMP_PDB_FLOAT, y1,
|
||||
GIMP_PDB_INT32, interpolate,
|
||||
GIMP_PDB_INT32, clip_result,
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
ret_drawable_ID = return_vals[1].data.d_drawable;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return ret_drawable_ID;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_drawable_transform_shear:
|
||||
* @drawable_ID: The affected drawable.
|
||||
* @shear_type: Type of shear.
|
||||
* @magnitude: The magnitude of the shear.
|
||||
* @transform_direction: Direction of transformation.
|
||||
* @interpolation: Type of interpolation.
|
||||
* @supersample: This parameter is ignored.
|
||||
* @recursion_level: This parameter is ignored.
|
||||
* @clip_result: How to clip results.
|
||||
*
|
||||
* Deprecated: Use gimp_item_transform_shear() instead.
|
||||
*
|
||||
* Returns: The sheared drawable.
|
||||
*
|
||||
* Since: 2.2
|
||||
**/
|
||||
gint32
|
||||
gimp_drawable_transform_shear (gint32 drawable_ID,
|
||||
GimpOrientationType shear_type,
|
||||
gdouble magnitude,
|
||||
GimpTransformDirection transform_direction,
|
||||
GimpInterpolationType interpolation,
|
||||
gboolean supersample,
|
||||
gint recursion_level,
|
||||
GimpTransformResize clip_result)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gint32 ret_drawable_ID = -1;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-drawable-transform-shear",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_INT32, shear_type,
|
||||
GIMP_PDB_FLOAT, magnitude,
|
||||
GIMP_PDB_INT32, transform_direction,
|
||||
GIMP_PDB_INT32, interpolation,
|
||||
GIMP_PDB_INT32, supersample,
|
||||
GIMP_PDB_INT32, recursion_level,
|
||||
GIMP_PDB_INT32, clip_result,
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
ret_drawable_ID = return_vals[1].data.d_drawable;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return ret_drawable_ID;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_drawable_transform_shear_default:
|
||||
* @drawable_ID: The affected drawable.
|
||||
* @shear_type: Type of shear.
|
||||
* @magnitude: The magnitude of the shear.
|
||||
* @interpolate: Whether to use interpolation and supersampling.
|
||||
* @clip_result: How to clip results.
|
||||
*
|
||||
* Deprecated: Use gimp_item_transform_shear() instead.
|
||||
*
|
||||
* Returns: The sheared drawable.
|
||||
*
|
||||
* Since: 2.2
|
||||
**/
|
||||
gint32
|
||||
gimp_drawable_transform_shear_default (gint32 drawable_ID,
|
||||
GimpOrientationType shear_type,
|
||||
gdouble magnitude,
|
||||
gboolean interpolate,
|
||||
GimpTransformResize clip_result)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gint32 ret_drawable_ID = -1;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-drawable-transform-shear-default",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_INT32, shear_type,
|
||||
GIMP_PDB_FLOAT, magnitude,
|
||||
GIMP_PDB_INT32, interpolate,
|
||||
GIMP_PDB_INT32, clip_result,
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
ret_drawable_ID = return_vals[1].data.d_drawable;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return ret_drawable_ID;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_drawable_transform_2d:
|
||||
* @drawable_ID: The affected drawable.
|
||||
* @source_x: X coordinate of the transformation center.
|
||||
* @source_y: Y coordinate of the transformation center.
|
||||
* @scale_x: Amount to scale in x direction.
|
||||
* @scale_y: Amount to scale in y direction.
|
||||
* @angle: The angle of rotation (radians).
|
||||
* @dest_x: X coordinate of where the center goes.
|
||||
* @dest_y: Y coordinate of where the center goes.
|
||||
* @transform_direction: Direction of transformation.
|
||||
* @interpolation: Type of interpolation.
|
||||
* @supersample: This parameter is ignored.
|
||||
* @recursion_level: This parameter is ignored.
|
||||
* @clip_result: How to clip results.
|
||||
*
|
||||
* Deprecated: Use gimp_item_transform_2d() instead.
|
||||
*
|
||||
* Returns: The transformed drawable.
|
||||
*
|
||||
* Since: 2.2
|
||||
**/
|
||||
gint32
|
||||
gimp_drawable_transform_2d (gint32 drawable_ID,
|
||||
gdouble source_x,
|
||||
gdouble source_y,
|
||||
gdouble scale_x,
|
||||
gdouble scale_y,
|
||||
gdouble angle,
|
||||
gdouble dest_x,
|
||||
gdouble dest_y,
|
||||
GimpTransformDirection transform_direction,
|
||||
GimpInterpolationType interpolation,
|
||||
gboolean supersample,
|
||||
gint recursion_level,
|
||||
GimpTransformResize clip_result)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gint32 ret_drawable_ID = -1;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-drawable-transform-2d",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_FLOAT, source_x,
|
||||
GIMP_PDB_FLOAT, source_y,
|
||||
GIMP_PDB_FLOAT, scale_x,
|
||||
GIMP_PDB_FLOAT, scale_y,
|
||||
GIMP_PDB_FLOAT, angle,
|
||||
GIMP_PDB_FLOAT, dest_x,
|
||||
GIMP_PDB_FLOAT, dest_y,
|
||||
GIMP_PDB_INT32, transform_direction,
|
||||
GIMP_PDB_INT32, interpolation,
|
||||
GIMP_PDB_INT32, supersample,
|
||||
GIMP_PDB_INT32, recursion_level,
|
||||
GIMP_PDB_INT32, clip_result,
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
ret_drawable_ID = return_vals[1].data.d_drawable;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return ret_drawable_ID;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_drawable_transform_2d_default:
|
||||
* @drawable_ID: The affected drawable.
|
||||
* @source_x: X coordinate of the transformation center.
|
||||
* @source_y: Y coordinate of the transformation center.
|
||||
* @scale_x: Amount to scale in x direction.
|
||||
* @scale_y: Amount to scale in y direction.
|
||||
* @angle: The angle of rotation (radians).
|
||||
* @dest_x: X coordinate of where the center goes.
|
||||
* @dest_y: Y coordinate of where the center goes.
|
||||
* @interpolate: Whether to use interpolation and supersampling.
|
||||
* @clip_result: How to clip results.
|
||||
*
|
||||
* Deprecated: Use gimp_item_transform_2d() instead.
|
||||
*
|
||||
* Returns: The transformed drawable.
|
||||
*
|
||||
* Since: 2.2
|
||||
**/
|
||||
gint32
|
||||
gimp_drawable_transform_2d_default (gint32 drawable_ID,
|
||||
gdouble source_x,
|
||||
gdouble source_y,
|
||||
gdouble scale_x,
|
||||
gdouble scale_y,
|
||||
gdouble angle,
|
||||
gdouble dest_x,
|
||||
gdouble dest_y,
|
||||
gboolean interpolate,
|
||||
GimpTransformResize clip_result)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gint32 ret_drawable_ID = -1;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-drawable-transform-2d-default",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_FLOAT, source_x,
|
||||
GIMP_PDB_FLOAT, source_y,
|
||||
GIMP_PDB_FLOAT, scale_x,
|
||||
GIMP_PDB_FLOAT, scale_y,
|
||||
GIMP_PDB_FLOAT, angle,
|
||||
GIMP_PDB_FLOAT, dest_x,
|
||||
GIMP_PDB_FLOAT, dest_y,
|
||||
GIMP_PDB_INT32, interpolate,
|
||||
GIMP_PDB_INT32, clip_result,
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
ret_drawable_ID = return_vals[1].data.d_drawable;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return ret_drawable_ID;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_drawable_transform_matrix:
|
||||
* @drawable_ID: The affected drawable.
|
||||
* @coeff_0_0: coefficient (0,0) of the transformation matrix.
|
||||
* @coeff_0_1: coefficient (0,1) of the transformation matrix.
|
||||
* @coeff_0_2: coefficient (0,2) of the transformation matrix.
|
||||
* @coeff_1_0: coefficient (1,0) of the transformation matrix.
|
||||
* @coeff_1_1: coefficient (1,1) of the transformation matrix.
|
||||
* @coeff_1_2: coefficient (1,2) of the transformation matrix.
|
||||
* @coeff_2_0: coefficient (2,0) of the transformation matrix.
|
||||
* @coeff_2_1: coefficient (2,1) of the transformation matrix.
|
||||
* @coeff_2_2: coefficient (2,2) of the transformation matrix.
|
||||
* @transform_direction: Direction of transformation.
|
||||
* @interpolation: Type of interpolation.
|
||||
* @supersample: This parameter is ignored.
|
||||
* @recursion_level: This parameter is ignored.
|
||||
* @clip_result: How to clip results.
|
||||
*
|
||||
* Deprecated: Use gimp_item_transform_matrix() instead.
|
||||
*
|
||||
* Returns: The transformed drawable.
|
||||
*
|
||||
* Since: 2.2
|
||||
**/
|
||||
gint32
|
||||
gimp_drawable_transform_matrix (gint32 drawable_ID,
|
||||
gdouble coeff_0_0,
|
||||
gdouble coeff_0_1,
|
||||
gdouble coeff_0_2,
|
||||
gdouble coeff_1_0,
|
||||
gdouble coeff_1_1,
|
||||
gdouble coeff_1_2,
|
||||
gdouble coeff_2_0,
|
||||
gdouble coeff_2_1,
|
||||
gdouble coeff_2_2,
|
||||
GimpTransformDirection transform_direction,
|
||||
GimpInterpolationType interpolation,
|
||||
gboolean supersample,
|
||||
gint recursion_level,
|
||||
GimpTransformResize clip_result)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gint32 ret_drawable_ID = -1;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-drawable-transform-matrix",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_FLOAT, coeff_0_0,
|
||||
GIMP_PDB_FLOAT, coeff_0_1,
|
||||
GIMP_PDB_FLOAT, coeff_0_2,
|
||||
GIMP_PDB_FLOAT, coeff_1_0,
|
||||
GIMP_PDB_FLOAT, coeff_1_1,
|
||||
GIMP_PDB_FLOAT, coeff_1_2,
|
||||
GIMP_PDB_FLOAT, coeff_2_0,
|
||||
GIMP_PDB_FLOAT, coeff_2_1,
|
||||
GIMP_PDB_FLOAT, coeff_2_2,
|
||||
GIMP_PDB_INT32, transform_direction,
|
||||
GIMP_PDB_INT32, interpolation,
|
||||
GIMP_PDB_INT32, supersample,
|
||||
GIMP_PDB_INT32, recursion_level,
|
||||
GIMP_PDB_INT32, clip_result,
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
ret_drawable_ID = return_vals[1].data.d_drawable;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return ret_drawable_ID;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_drawable_transform_matrix_default:
|
||||
* @drawable_ID: The affected drawable.
|
||||
* @coeff_0_0: coefficient (0,0) of the transformation matrix.
|
||||
* @coeff_0_1: coefficient (0,1) of the transformation matrix.
|
||||
* @coeff_0_2: coefficient (0,2) of the transformation matrix.
|
||||
* @coeff_1_0: coefficient (1,0) of the transformation matrix.
|
||||
* @coeff_1_1: coefficient (1,1) of the transformation matrix.
|
||||
* @coeff_1_2: coefficient (1,2) of the transformation matrix.
|
||||
* @coeff_2_0: coefficient (2,0) of the transformation matrix.
|
||||
* @coeff_2_1: coefficient (2,1) of the transformation matrix.
|
||||
* @coeff_2_2: coefficient (2,2) of the transformation matrix.
|
||||
* @interpolate: Whether to use interpolation and supersampling.
|
||||
* @clip_result: How to clip results.
|
||||
*
|
||||
* Deprecated: Use gimp_item_transform_matrix() instead.
|
||||
*
|
||||
* Returns: The transformed drawable.
|
||||
*
|
||||
* Since: 2.2
|
||||
**/
|
||||
gint32
|
||||
gimp_drawable_transform_matrix_default (gint32 drawable_ID,
|
||||
gdouble coeff_0_0,
|
||||
gdouble coeff_0_1,
|
||||
gdouble coeff_0_2,
|
||||
gdouble coeff_1_0,
|
||||
gdouble coeff_1_1,
|
||||
gdouble coeff_1_2,
|
||||
gdouble coeff_2_0,
|
||||
gdouble coeff_2_1,
|
||||
gdouble coeff_2_2,
|
||||
gboolean interpolate,
|
||||
GimpTransformResize clip_result)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gint32 ret_drawable_ID = -1;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-drawable-transform-matrix-default",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_FLOAT, coeff_0_0,
|
||||
GIMP_PDB_FLOAT, coeff_0_1,
|
||||
GIMP_PDB_FLOAT, coeff_0_2,
|
||||
GIMP_PDB_FLOAT, coeff_1_0,
|
||||
GIMP_PDB_FLOAT, coeff_1_1,
|
||||
GIMP_PDB_FLOAT, coeff_1_2,
|
||||
GIMP_PDB_FLOAT, coeff_2_0,
|
||||
GIMP_PDB_FLOAT, coeff_2_1,
|
||||
GIMP_PDB_FLOAT, coeff_2_2,
|
||||
GIMP_PDB_INT32, interpolate,
|
||||
GIMP_PDB_INT32, clip_result,
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
ret_drawable_ID = return_vals[1].data.d_drawable;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return ret_drawable_ID;
|
||||
}
|
|
@ -1,205 +0,0 @@
|
|||
/* LIBGIMP - The GIMP Library
|
||||
* Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
|
||||
*
|
||||
* gimpdrawabletransform_pdb.h
|
||||
*
|
||||
* This library is free software: you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see
|
||||
* <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* NOTE: This file is auto-generated by pdbgen.pl */
|
||||
|
||||
#if !defined (__GIMP_H_INSIDE__) && !defined (GIMP_COMPILATION)
|
||||
#error "Only <libgimp/gimp.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#ifndef __GIMP_DRAWABLE_TRANSFORM_PDB_H__
|
||||
#define __GIMP_DRAWABLE_TRANSFORM_PDB_H__
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/* For information look into the C source or the html documentation */
|
||||
|
||||
|
||||
GIMP_DEPRECATED_FOR(gimp_item_transform_flip_simple)
|
||||
gint32 gimp_drawable_transform_flip_simple (gint32 drawable_ID,
|
||||
GimpOrientationType flip_type,
|
||||
gboolean auto_center,
|
||||
gdouble axis,
|
||||
gboolean clip_result);
|
||||
GIMP_DEPRECATED_FOR(gimp_item_transform_flip)
|
||||
gint32 gimp_drawable_transform_flip (gint32 drawable_ID,
|
||||
gdouble x0,
|
||||
gdouble y0,
|
||||
gdouble x1,
|
||||
gdouble y1,
|
||||
GimpTransformDirection transform_direction,
|
||||
GimpInterpolationType interpolation,
|
||||
gboolean supersample,
|
||||
gint recursion_level,
|
||||
gboolean clip_result);
|
||||
GIMP_DEPRECATED_FOR(gimp_item_transform_flip)
|
||||
gint32 gimp_drawable_transform_flip_default (gint32 drawable_ID,
|
||||
gdouble x0,
|
||||
gdouble y0,
|
||||
gdouble x1,
|
||||
gdouble y1,
|
||||
gboolean interpolate,
|
||||
gboolean clip_result);
|
||||
GIMP_DEPRECATED_FOR(gimp_item_transform_perspective)
|
||||
gint32 gimp_drawable_transform_perspective (gint32 drawable_ID,
|
||||
gdouble x0,
|
||||
gdouble y0,
|
||||
gdouble x1,
|
||||
gdouble y1,
|
||||
gdouble x2,
|
||||
gdouble y2,
|
||||
gdouble x3,
|
||||
gdouble y3,
|
||||
GimpTransformDirection transform_direction,
|
||||
GimpInterpolationType interpolation,
|
||||
gboolean supersample,
|
||||
gint recursion_level,
|
||||
GimpTransformResize clip_result);
|
||||
GIMP_DEPRECATED_FOR(gimp_item_transform_perspective)
|
||||
gint32 gimp_drawable_transform_perspective_default (gint32 drawable_ID,
|
||||
gdouble x0,
|
||||
gdouble y0,
|
||||
gdouble x1,
|
||||
gdouble y1,
|
||||
gdouble x2,
|
||||
gdouble y2,
|
||||
gdouble x3,
|
||||
gdouble y3,
|
||||
gboolean interpolate,
|
||||
GimpTransformResize clip_result);
|
||||
GIMP_DEPRECATED_FOR(gimp_item_transform_rotate_simple)
|
||||
gint32 gimp_drawable_transform_rotate_simple (gint32 drawable_ID,
|
||||
GimpRotationType rotate_type,
|
||||
gboolean auto_center,
|
||||
gint center_x,
|
||||
gint center_y,
|
||||
gboolean clip_result);
|
||||
GIMP_DEPRECATED_FOR(gimp_item_transform_rotate)
|
||||
gint32 gimp_drawable_transform_rotate (gint32 drawable_ID,
|
||||
gdouble angle,
|
||||
gboolean auto_center,
|
||||
gint center_x,
|
||||
gint center_y,
|
||||
GimpTransformDirection transform_direction,
|
||||
GimpInterpolationType interpolation,
|
||||
gboolean supersample,
|
||||
gint recursion_level,
|
||||
GimpTransformResize clip_result);
|
||||
GIMP_DEPRECATED_FOR(gimp_item_transform_rotate)
|
||||
gint32 gimp_drawable_transform_rotate_default (gint32 drawable_ID,
|
||||
gdouble angle,
|
||||
gboolean auto_center,
|
||||
gint center_x,
|
||||
gint center_y,
|
||||
gboolean interpolate,
|
||||
GimpTransformResize clip_result);
|
||||
GIMP_DEPRECATED_FOR(gimp_item_transform_scale)
|
||||
gint32 gimp_drawable_transform_scale (gint32 drawable_ID,
|
||||
gdouble x0,
|
||||
gdouble y0,
|
||||
gdouble x1,
|
||||
gdouble y1,
|
||||
GimpTransformDirection transform_direction,
|
||||
GimpInterpolationType interpolation,
|
||||
gboolean supersample,
|
||||
gint recursion_level,
|
||||
GimpTransformResize clip_result);
|
||||
GIMP_DEPRECATED_FOR(gimp_item_transform_scale)
|
||||
gint32 gimp_drawable_transform_scale_default (gint32 drawable_ID,
|
||||
gdouble x0,
|
||||
gdouble y0,
|
||||
gdouble x1,
|
||||
gdouble y1,
|
||||
gboolean interpolate,
|
||||
GimpTransformResize clip_result);
|
||||
GIMP_DEPRECATED_FOR(gimp_item_transform_shear)
|
||||
gint32 gimp_drawable_transform_shear (gint32 drawable_ID,
|
||||
GimpOrientationType shear_type,
|
||||
gdouble magnitude,
|
||||
GimpTransformDirection transform_direction,
|
||||
GimpInterpolationType interpolation,
|
||||
gboolean supersample,
|
||||
gint recursion_level,
|
||||
GimpTransformResize clip_result);
|
||||
GIMP_DEPRECATED_FOR(gimp_item_transform_shear)
|
||||
gint32 gimp_drawable_transform_shear_default (gint32 drawable_ID,
|
||||
GimpOrientationType shear_type,
|
||||
gdouble magnitude,
|
||||
gboolean interpolate,
|
||||
GimpTransformResize clip_result);
|
||||
GIMP_DEPRECATED_FOR(gimp_item_transform_2d)
|
||||
gint32 gimp_drawable_transform_2d (gint32 drawable_ID,
|
||||
gdouble source_x,
|
||||
gdouble source_y,
|
||||
gdouble scale_x,
|
||||
gdouble scale_y,
|
||||
gdouble angle,
|
||||
gdouble dest_x,
|
||||
gdouble dest_y,
|
||||
GimpTransformDirection transform_direction,
|
||||
GimpInterpolationType interpolation,
|
||||
gboolean supersample,
|
||||
gint recursion_level,
|
||||
GimpTransformResize clip_result);
|
||||
GIMP_DEPRECATED_FOR(gimp_item_transform_2d)
|
||||
gint32 gimp_drawable_transform_2d_default (gint32 drawable_ID,
|
||||
gdouble source_x,
|
||||
gdouble source_y,
|
||||
gdouble scale_x,
|
||||
gdouble scale_y,
|
||||
gdouble angle,
|
||||
gdouble dest_x,
|
||||
gdouble dest_y,
|
||||
gboolean interpolate,
|
||||
GimpTransformResize clip_result);
|
||||
GIMP_DEPRECATED_FOR(gimp_item_transform_matrix)
|
||||
gint32 gimp_drawable_transform_matrix (gint32 drawable_ID,
|
||||
gdouble coeff_0_0,
|
||||
gdouble coeff_0_1,
|
||||
gdouble coeff_0_2,
|
||||
gdouble coeff_1_0,
|
||||
gdouble coeff_1_1,
|
||||
gdouble coeff_1_2,
|
||||
gdouble coeff_2_0,
|
||||
gdouble coeff_2_1,
|
||||
gdouble coeff_2_2,
|
||||
GimpTransformDirection transform_direction,
|
||||
GimpInterpolationType interpolation,
|
||||
gboolean supersample,
|
||||
gint recursion_level,
|
||||
GimpTransformResize clip_result);
|
||||
GIMP_DEPRECATED_FOR(gimp_item_transform_matrix)
|
||||
gint32 gimp_drawable_transform_matrix_default (gint32 drawable_ID,
|
||||
gdouble coeff_0_0,
|
||||
gdouble coeff_0_1,
|
||||
gdouble coeff_0_2,
|
||||
gdouble coeff_1_0,
|
||||
gdouble coeff_1_1,
|
||||
gdouble coeff_1_2,
|
||||
gdouble coeff_2_0,
|
||||
gdouble coeff_2_1,
|
||||
gdouble coeff_2_2,
|
||||
gboolean interpolate,
|
||||
GimpTransformResize clip_result);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GIMP_DRAWABLE_TRANSFORM_PDB_H__ */
|
|
@ -415,367 +415,3 @@ gimp_edit_named_paste_as_new_image (const gchar *buffer_name)
|
|||
|
||||
return image_ID;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_edit_clear:
|
||||
* @drawable_ID: The drawable to clear from.
|
||||
*
|
||||
* Clear selected area of drawable.
|
||||
*
|
||||
* This procedure clears the specified drawable. If the drawable has an
|
||||
* alpha channel, the cleared pixels will become transparent. If the
|
||||
* drawable does not have an alpha channel, cleared pixels will be set
|
||||
* to the background color. This procedure only affects regions within
|
||||
* a selection if there is a selection active.
|
||||
*
|
||||
* Deprecated: Use gimp_drawable_edit_clear() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
**/
|
||||
gboolean
|
||||
gimp_edit_clear (gint32 drawable_ID)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-edit-clear",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_edit_fill:
|
||||
* @drawable_ID: The drawable to fill to.
|
||||
* @fill_type: The type of fill.
|
||||
*
|
||||
* Fill selected area of drawable.
|
||||
*
|
||||
* This procedure fills the specified drawable with the fill mode. If
|
||||
* the fill mode is foreground, the current foreground color is used.
|
||||
* If the fill mode is background, the current background color is
|
||||
* used. Other fill modes should not be used. This procedure only
|
||||
* affects regions within a selection if there is a selection active.
|
||||
* If you want to fill the whole drawable, regardless of the selection,
|
||||
* use gimp_drawable_fill().
|
||||
*
|
||||
* Deprecated: Use gimp_drawable_edit_fill() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
**/
|
||||
gboolean
|
||||
gimp_edit_fill (gint32 drawable_ID,
|
||||
GimpFillType fill_type)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-edit-fill",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_INT32, fill_type,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_edit_bucket_fill:
|
||||
* @drawable_ID: The affected drawable.
|
||||
* @fill_mode: The type of fill.
|
||||
* @paint_mode: The paint application mode.
|
||||
* @opacity: The opacity of the final bucket fill.
|
||||
* @threshold: The threshold determines how extensive the seed fill will be. It's value is specified in terms of intensity levels. This parameter is only valid when there is no selection in the specified image.
|
||||
* @sample_merged: Use the composite image, not the drawable.
|
||||
* @x: The x coordinate of this bucket fill's application. This parameter is only valid when there is no selection in the specified image.
|
||||
* @y: The y coordinate of this bucket fill's application. This parameter is only valid when there is no selection in the specified image.
|
||||
*
|
||||
* Fill the area specified either by the current selection if there is
|
||||
* one, or by a seed fill starting at the specified coordinates.
|
||||
*
|
||||
* This tool requires information on the paint application mode, and
|
||||
* the fill mode, which can either be in the foreground color, or in
|
||||
* the currently active pattern. If there is no selection, a seed fill
|
||||
* is executed at the specified coordinates and extends outward in
|
||||
* keeping with the threshold parameter. If there is a selection in the
|
||||
* target image, the threshold, sample merged, x, and y arguments are
|
||||
* unused. If the sample_merged parameter is TRUE, the data of the
|
||||
* composite image will be used instead of that for the specified
|
||||
* drawable. This is equivalent to sampling for colors after merging
|
||||
* all visible layers. In the case of merged sampling, the x and y
|
||||
* coordinates are relative to the image's origin; otherwise, they are
|
||||
* relative to the drawable's origin.
|
||||
*
|
||||
* Deprecated: Use gimp_drawable_edit_bucket_fill() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
**/
|
||||
gboolean
|
||||
gimp_edit_bucket_fill (gint32 drawable_ID,
|
||||
GimpBucketFillMode fill_mode,
|
||||
GimpLayerMode paint_mode,
|
||||
gdouble opacity,
|
||||
gdouble threshold,
|
||||
gboolean sample_merged,
|
||||
gdouble x,
|
||||
gdouble y)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-edit-bucket-fill",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_INT32, fill_mode,
|
||||
GIMP_PDB_INT32, paint_mode,
|
||||
GIMP_PDB_FLOAT, opacity,
|
||||
GIMP_PDB_FLOAT, threshold,
|
||||
GIMP_PDB_INT32, sample_merged,
|
||||
GIMP_PDB_FLOAT, x,
|
||||
GIMP_PDB_FLOAT, y,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_edit_bucket_fill_full:
|
||||
* @drawable_ID: The affected drawable.
|
||||
* @fill_mode: The type of fill.
|
||||
* @paint_mode: The paint application mode.
|
||||
* @opacity: The opacity of the final bucket fill.
|
||||
* @threshold: The threshold determines how extensive the seed fill will be. It's value is specified in terms of intensity levels. This parameter is only valid when there is no selection in the specified image.
|
||||
* @sample_merged: Use the composite image, not the drawable.
|
||||
* @fill_transparent: Whether to consider transparent pixels for filling. If TRUE, transparency is considered as a unique fillable color.
|
||||
* @select_criterion: The criterion used to determine color similarity. SELECT_CRITERION_COMPOSITE is the standard choice.
|
||||
* @x: The x coordinate of this bucket fill's application. This parameter is only valid when there is no selection in the specified image.
|
||||
* @y: The y coordinate of this bucket fill's application. This parameter is only valid when there is no selection in the specified image.
|
||||
*
|
||||
* Fill the area specified either by the current selection if there is
|
||||
* one, or by a seed fill starting at the specified coordinates.
|
||||
*
|
||||
* This tool requires information on the paint application mode, and
|
||||
* the fill mode, which can either be in the foreground color, or in
|
||||
* the currently active pattern. If there is no selection, a seed fill
|
||||
* is executed at the specified coordinates and extends outward in
|
||||
* keeping with the threshold parameter. If there is a selection in the
|
||||
* target image, the threshold, sample merged, x, and y arguments are
|
||||
* unused. If the sample_merged parameter is TRUE, the data of the
|
||||
* composite image will be used instead of that for the specified
|
||||
* drawable. This is equivalent to sampling for colors after merging
|
||||
* all visible layers. In the case of merged sampling, the x and y
|
||||
* coordinates are relative to the image's origin; otherwise, they are
|
||||
* relative to the drawable's origin.
|
||||
*
|
||||
* Deprecated: Use gimp_drawable_edit_bucket_fill() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
*
|
||||
* Since: 2.4
|
||||
**/
|
||||
gboolean
|
||||
gimp_edit_bucket_fill_full (gint32 drawable_ID,
|
||||
GimpBucketFillMode fill_mode,
|
||||
GimpLayerMode paint_mode,
|
||||
gdouble opacity,
|
||||
gdouble threshold,
|
||||
gboolean sample_merged,
|
||||
gboolean fill_transparent,
|
||||
GimpSelectCriterion select_criterion,
|
||||
gdouble x,
|
||||
gdouble y)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-edit-bucket-fill-full",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_INT32, fill_mode,
|
||||
GIMP_PDB_INT32, paint_mode,
|
||||
GIMP_PDB_FLOAT, opacity,
|
||||
GIMP_PDB_FLOAT, threshold,
|
||||
GIMP_PDB_INT32, sample_merged,
|
||||
GIMP_PDB_INT32, fill_transparent,
|
||||
GIMP_PDB_INT32, select_criterion,
|
||||
GIMP_PDB_FLOAT, x,
|
||||
GIMP_PDB_FLOAT, y,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_edit_blend:
|
||||
* @drawable_ID: The affected drawable.
|
||||
* @blend_mode: The type of blend.
|
||||
* @paint_mode: The paint application mode.
|
||||
* @gradient_type: The type of gradient.
|
||||
* @opacity: The opacity of the final blend.
|
||||
* @offset: Offset relates to the starting and ending coordinates specified for the blend. This parameter is mode dependent.
|
||||
* @repeat: Repeat mode.
|
||||
* @reverse: Use the reverse gradient.
|
||||
* @supersample: Do adaptive supersampling.
|
||||
* @max_depth: Maximum recursion levels for supersampling.
|
||||
* @threshold: Supersampling threshold.
|
||||
* @dither: Use dithering to reduce banding.
|
||||
* @x1: The x coordinate of this blend's starting point.
|
||||
* @y1: The y coordinate of this blend's starting point.
|
||||
* @x2: The x coordinate of this blend's ending point.
|
||||
* @y2: The y coordinate of this blend's ending point.
|
||||
*
|
||||
* Blend between the starting and ending coordinates with the specified
|
||||
* blend mode and gradient type.
|
||||
*
|
||||
* This tool requires information on the paint application mode, the
|
||||
* blend mode, and the gradient type. It creates the specified variety
|
||||
* of blend using the starting and ending coordinates as defined for
|
||||
* each gradient type. For shapeburst gradient types, the context's
|
||||
* distance metric is also relevant and can be updated with
|
||||
* gimp_context_set_distance_metric().
|
||||
*
|
||||
* Deprecated: Use gimp_drawable_edit_gradient_fill() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
**/
|
||||
gboolean
|
||||
gimp_edit_blend (gint32 drawable_ID,
|
||||
GimpBlendMode blend_mode,
|
||||
GimpLayerMode paint_mode,
|
||||
GimpGradientType gradient_type,
|
||||
gdouble opacity,
|
||||
gdouble offset,
|
||||
GimpRepeatMode repeat,
|
||||
gboolean reverse,
|
||||
gboolean supersample,
|
||||
gint max_depth,
|
||||
gdouble threshold,
|
||||
gboolean dither,
|
||||
gdouble x1,
|
||||
gdouble y1,
|
||||
gdouble x2,
|
||||
gdouble y2)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-edit-blend",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_INT32, blend_mode,
|
||||
GIMP_PDB_INT32, paint_mode,
|
||||
GIMP_PDB_INT32, gradient_type,
|
||||
GIMP_PDB_FLOAT, opacity,
|
||||
GIMP_PDB_FLOAT, offset,
|
||||
GIMP_PDB_INT32, repeat,
|
||||
GIMP_PDB_INT32, reverse,
|
||||
GIMP_PDB_INT32, supersample,
|
||||
GIMP_PDB_INT32, max_depth,
|
||||
GIMP_PDB_FLOAT, threshold,
|
||||
GIMP_PDB_INT32, dither,
|
||||
GIMP_PDB_FLOAT, x1,
|
||||
GIMP_PDB_FLOAT, y1,
|
||||
GIMP_PDB_FLOAT, x2,
|
||||
GIMP_PDB_FLOAT, y2,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_edit_stroke:
|
||||
* @drawable_ID: The drawable to stroke to.
|
||||
*
|
||||
* Stroke the current selection
|
||||
*
|
||||
* This procedure strokes the current selection, painting along the
|
||||
* selection boundary with the active brush and foreground color. The
|
||||
* paint is applied to the specified drawable regardless of the active
|
||||
* selection.
|
||||
*
|
||||
* Deprecated: Use gimp_drawable_edit_stroke_selection() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
**/
|
||||
gboolean
|
||||
gimp_edit_stroke (gint32 drawable_ID)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-edit-stroke",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_edit_stroke_vectors:
|
||||
* @drawable_ID: The drawable to stroke to.
|
||||
* @vectors_ID: The vectors object.
|
||||
*
|
||||
* Stroke the specified vectors object
|
||||
*
|
||||
* This procedure strokes the specified vectors object, painting along
|
||||
* the path with the active brush and foreground color.
|
||||
*
|
||||
* Deprecated: Use gimp_drawable_edit_stroke_item() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
*
|
||||
* Since: 2.4
|
||||
**/
|
||||
gboolean
|
||||
gimp_edit_stroke_vectors (gint32 drawable_ID,
|
||||
gint32 vectors_ID)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-edit-stroke-vectors",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_VECTORS, vectors_ID,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
|
|
@ -48,53 +48,6 @@ gint32 gimp_edit_named_paste (gint32 drawable_ID,
|
|||
const gchar *buffer_name,
|
||||
gboolean paste_into);
|
||||
gint32 gimp_edit_named_paste_as_new_image (const gchar *buffer_name);
|
||||
GIMP_DEPRECATED_FOR(gimp_drawable_edit_clear)
|
||||
gboolean gimp_edit_clear (gint32 drawable_ID);
|
||||
GIMP_DEPRECATED_FOR(gimp_drawable_edit_fill)
|
||||
gboolean gimp_edit_fill (gint32 drawable_ID,
|
||||
GimpFillType fill_type);
|
||||
GIMP_DEPRECATED_FOR(gimp_drawable_edit_bucket_fill)
|
||||
gboolean gimp_edit_bucket_fill (gint32 drawable_ID,
|
||||
GimpBucketFillMode fill_mode,
|
||||
GimpLayerMode paint_mode,
|
||||
gdouble opacity,
|
||||
gdouble threshold,
|
||||
gboolean sample_merged,
|
||||
gdouble x,
|
||||
gdouble y);
|
||||
GIMP_DEPRECATED_FOR(gimp_drawable_edit_bucket_fill)
|
||||
gboolean gimp_edit_bucket_fill_full (gint32 drawable_ID,
|
||||
GimpBucketFillMode fill_mode,
|
||||
GimpLayerMode paint_mode,
|
||||
gdouble opacity,
|
||||
gdouble threshold,
|
||||
gboolean sample_merged,
|
||||
gboolean fill_transparent,
|
||||
GimpSelectCriterion select_criterion,
|
||||
gdouble x,
|
||||
gdouble y);
|
||||
GIMP_DEPRECATED_FOR(gimp_drawable_edit_gradient_fill)
|
||||
gboolean gimp_edit_blend (gint32 drawable_ID,
|
||||
GimpBlendMode blend_mode,
|
||||
GimpLayerMode paint_mode,
|
||||
GimpGradientType gradient_type,
|
||||
gdouble opacity,
|
||||
gdouble offset,
|
||||
GimpRepeatMode repeat,
|
||||
gboolean reverse,
|
||||
gboolean supersample,
|
||||
gint max_depth,
|
||||
gdouble threshold,
|
||||
gboolean dither,
|
||||
gdouble x1,
|
||||
gdouble y1,
|
||||
gdouble x2,
|
||||
gdouble y2);
|
||||
GIMP_DEPRECATED_FOR(gimp_drawable_edit_stroke_selection)
|
||||
gboolean gimp_edit_stroke (gint32 drawable_ID);
|
||||
GIMP_DEPRECATED_FOR(gimp_drawable_edit_stroke_item)
|
||||
gboolean gimp_edit_stroke_vectors (gint32 drawable_ID,
|
||||
gint32 vectors_ID);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
|
|
@ -165,63 +165,3 @@ gimp_floating_sel_attach (gint32 layer_ID,
|
|||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_floating_sel_rigor:
|
||||
* @floating_sel_ID: The floating selection.
|
||||
* @undo: .
|
||||
*
|
||||
* Deprecated: There is no replacement for this procedure.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
**/
|
||||
gboolean
|
||||
gimp_floating_sel_rigor (gint32 floating_sel_ID,
|
||||
gboolean undo)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-floating-sel-rigor",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_LAYER, floating_sel_ID,
|
||||
GIMP_PDB_INT32, undo,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_floating_sel_relax:
|
||||
* @floating_sel_ID: The floating selection.
|
||||
* @undo: .
|
||||
*
|
||||
* Deprecated: There is no replacement for this procedure.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
**/
|
||||
gboolean
|
||||
gimp_floating_sel_relax (gint32 floating_sel_ID,
|
||||
gboolean undo)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-floating-sel-relax",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_LAYER, floating_sel_ID,
|
||||
GIMP_PDB_INT32, undo,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
|
|
@ -37,12 +37,6 @@ gboolean gimp_floating_sel_anchor (gint32 floating_sel_ID);
|
|||
gboolean gimp_floating_sel_to_layer (gint32 floating_sel_ID);
|
||||
gboolean gimp_floating_sel_attach (gint32 layer_ID,
|
||||
gint32 drawable_ID);
|
||||
GIMP_DEPRECATED
|
||||
gboolean gimp_floating_sel_rigor (gint32 floating_sel_ID,
|
||||
gboolean undo);
|
||||
GIMP_DEPRECATED
|
||||
gboolean gimp_floating_sel_relax (gint32 floating_sel_ID,
|
||||
gboolean undo);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
|
|
@ -22,8 +22,6 @@
|
|||
|
||||
#include "config.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "gimp.h"
|
||||
|
||||
|
||||
|
@ -109,129 +107,3 @@ gimp_gradients_get_list (const gchar *filter,
|
|||
|
||||
return gradient_list;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_gradients_sample_uniform:
|
||||
* @num_samples: The number of samples to take.
|
||||
* @reverse: Use the reverse gradient.
|
||||
*
|
||||
* Deprecated: Use gimp_gradient_get_uniform_samples() instead.
|
||||
*
|
||||
* Returns: Color samples: { R1, G1, B1, A1, ..., Rn, Gn, Bn, An }.
|
||||
**/
|
||||
gdouble *
|
||||
gimp_gradients_sample_uniform (gint num_samples,
|
||||
gboolean reverse)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gdouble *color_samples = NULL;
|
||||
gint num_color_samples;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-gradients-sample-uniform",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_INT32, num_samples,
|
||||
GIMP_PDB_INT32, reverse,
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
{
|
||||
num_color_samples = return_vals[1].data.d_int32;
|
||||
color_samples = g_new (gdouble, num_color_samples);
|
||||
memcpy (color_samples,
|
||||
return_vals[2].data.d_floatarray,
|
||||
num_color_samples * sizeof (gdouble));
|
||||
}
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return color_samples;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_gradients_sample_custom:
|
||||
* @num_samples: The number of samples to take.
|
||||
* @positions: The list of positions to sample along the gradient.
|
||||
* @reverse: Use the reverse gradient.
|
||||
*
|
||||
* Deprecated: Use gimp_gradient_get_custom_samples() instead.
|
||||
*
|
||||
* Returns: Color samples: { R1, G1, B1, A1, ..., Rn, Gn, Bn, An }.
|
||||
**/
|
||||
gdouble *
|
||||
gimp_gradients_sample_custom (gint num_samples,
|
||||
const gdouble *positions,
|
||||
gboolean reverse)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gdouble *color_samples = NULL;
|
||||
gint num_color_samples;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-gradients-sample-custom",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_INT32, num_samples,
|
||||
GIMP_PDB_FLOATARRAY, positions,
|
||||
GIMP_PDB_INT32, reverse,
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
{
|
||||
num_color_samples = return_vals[1].data.d_int32;
|
||||
color_samples = g_new (gdouble, num_color_samples);
|
||||
memcpy (color_samples,
|
||||
return_vals[2].data.d_floatarray,
|
||||
num_color_samples * sizeof (gdouble));
|
||||
}
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return color_samples;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_gradients_get_gradient_data:
|
||||
* @name: The gradient name (\"\" means current active gradient).
|
||||
* @sample_size: Size of the sample to return when the gradient is changed.
|
||||
* @reverse: Use the reverse gradient.
|
||||
* @width: The gradient sample width (r,g,b,a).
|
||||
* @grad_data: The gradient sample data.
|
||||
*
|
||||
* Deprecated: Use gimp_gradient_get_uniform_samples() instead.
|
||||
*
|
||||
* Returns: The gradient name.
|
||||
**/
|
||||
gchar *
|
||||
gimp_gradients_get_gradient_data (const gchar *name,
|
||||
gint sample_size,
|
||||
gboolean reverse,
|
||||
gint *width,
|
||||
gdouble **grad_data)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gchar *actual_name = NULL;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-gradients-get-gradient-data",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_STRING, name,
|
||||
GIMP_PDB_INT32, sample_size,
|
||||
GIMP_PDB_INT32, reverse,
|
||||
GIMP_PDB_END);
|
||||
|
||||
*width = 0;
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
{
|
||||
actual_name = g_strdup (return_vals[1].data.d_string);
|
||||
*width = return_vals[2].data.d_int32;
|
||||
*grad_data = g_new (gdouble, *width);
|
||||
memcpy (*grad_data,
|
||||
return_vals[3].data.d_floatarray,
|
||||
*width * sizeof (gdouble));
|
||||
}
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return actual_name;
|
||||
}
|
||||
|
|
|
@ -35,19 +35,6 @@ G_BEGIN_DECLS
|
|||
gboolean gimp_gradients_refresh (void);
|
||||
gchar** gimp_gradients_get_list (const gchar *filter,
|
||||
gint *num_gradients);
|
||||
GIMP_DEPRECATED_FOR(gimp_gradient_get_uniform_samples)
|
||||
gdouble* gimp_gradients_sample_uniform (gint num_samples,
|
||||
gboolean reverse);
|
||||
GIMP_DEPRECATED_FOR(gimp_gradient_get_custom_samples)
|
||||
gdouble* gimp_gradients_sample_custom (gint num_samples,
|
||||
const gdouble *positions,
|
||||
gboolean reverse);
|
||||
GIMP_DEPRECATED_FOR(gimp_gradient_get_uniform_samples)
|
||||
gchar* gimp_gradients_get_gradient_data (const gchar *name,
|
||||
gint sample_size,
|
||||
gboolean reverse,
|
||||
gint *width,
|
||||
gdouble **grad_data);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
|
|
@ -420,33 +420,6 @@ gimp_image_height (gint32 image_ID)
|
|||
return height;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_image_free_shadow:
|
||||
* @image_ID: The image.
|
||||
*
|
||||
* Deprecated: Use gimp_drawable_free_shadow() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
**/
|
||||
gboolean
|
||||
gimp_image_free_shadow (gint32 image_ID)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-image-free-shadow",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_IMAGE, image_ID,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_image_get_layers:
|
||||
* @image_ID: The image.
|
||||
|
@ -810,39 +783,6 @@ gimp_image_pick_correlate_layer (gint32 image_ID,
|
|||
return layer_ID;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_image_add_layer:
|
||||
* @image_ID: The image.
|
||||
* @layer_ID: The layer.
|
||||
* @position: The layer position.
|
||||
*
|
||||
* Deprecated: Use gimp_image_insert_layer() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
**/
|
||||
gboolean
|
||||
gimp_image_add_layer (gint32 image_ID,
|
||||
gint32 layer_ID,
|
||||
gint position)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-image-add-layer",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_IMAGE, image_ID,
|
||||
GIMP_PDB_LAYER, layer_ID,
|
||||
GIMP_PDB_INT32, position,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_image_insert_layer:
|
||||
* @image_ID: The image.
|
||||
|
@ -999,39 +939,6 @@ gimp_image_thaw_layers (gint32 image_ID)
|
|||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_image_add_channel:
|
||||
* @image_ID: The image.
|
||||
* @channel_ID: The channel.
|
||||
* @position: The channel position.
|
||||
*
|
||||
* Deprecated: Use gimp_image_insert_channel() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
**/
|
||||
gboolean
|
||||
gimp_image_add_channel (gint32 image_ID,
|
||||
gint32 channel_ID,
|
||||
gint position)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-image-add-channel",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_IMAGE, image_ID,
|
||||
GIMP_PDB_CHANNEL, channel_ID,
|
||||
GIMP_PDB_INT32, position,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_image_insert_channel:
|
||||
* @image_ID: The image.
|
||||
|
@ -1181,39 +1088,6 @@ gimp_image_thaw_channels (gint32 image_ID)
|
|||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_image_add_vectors:
|
||||
* @image_ID: The image.
|
||||
* @vectors_ID: The vectors object.
|
||||
* @position: The vectors objects position.
|
||||
*
|
||||
* Deprecated: Use gimp_image_insert_vectors() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
**/
|
||||
gboolean
|
||||
gimp_image_add_vectors (gint32 image_ID,
|
||||
gint32 vectors_ID,
|
||||
gint position)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-image-add-vectors",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_IMAGE, image_ID,
|
||||
GIMP_PDB_VECTORS, vectors_ID,
|
||||
GIMP_PDB_INT32, position,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_image_insert_vectors:
|
||||
* @image_ID: The image.
|
||||
|
|
|
@ -48,8 +48,6 @@ GimpPrecision gimp_image_get_precision (gint32
|
|||
GimpLayerMode gimp_image_get_default_new_layer_mode (gint32 image_ID);
|
||||
gint gimp_image_width (gint32 image_ID);
|
||||
gint gimp_image_height (gint32 image_ID);
|
||||
GIMP_DEPRECATED_FOR(gimp_drawable_free_shadow)
|
||||
gboolean gimp_image_free_shadow (gint32 image_ID);
|
||||
gint* gimp_image_get_layers (gint32 image_ID,
|
||||
gint *num_layers);
|
||||
gint* gimp_image_get_channels (gint32 image_ID,
|
||||
|
@ -71,10 +69,6 @@ gboolean gimp_image_pick_color (gint32
|
|||
gint32 gimp_image_pick_correlate_layer (gint32 image_ID,
|
||||
gint x,
|
||||
gint y);
|
||||
GIMP_DEPRECATED_FOR(gimp_image_insert_layer)
|
||||
gboolean gimp_image_add_layer (gint32 image_ID,
|
||||
gint32 layer_ID,
|
||||
gint position);
|
||||
gboolean gimp_image_insert_layer (gint32 image_ID,
|
||||
gint32 layer_ID,
|
||||
gint32 parent_ID,
|
||||
|
@ -83,10 +77,6 @@ gboolean gimp_image_remove_layer (gint32
|
|||
gint32 layer_ID);
|
||||
gboolean gimp_image_freeze_layers (gint32 image_ID);
|
||||
gboolean gimp_image_thaw_layers (gint32 image_ID);
|
||||
GIMP_DEPRECATED_FOR(gimp_image_insert_channel)
|
||||
gboolean gimp_image_add_channel (gint32 image_ID,
|
||||
gint32 channel_ID,
|
||||
gint position);
|
||||
gboolean gimp_image_insert_channel (gint32 image_ID,
|
||||
gint32 channel_ID,
|
||||
gint32 parent_ID,
|
||||
|
@ -95,10 +85,6 @@ gboolean gimp_image_remove_channel (gint32
|
|||
gint32 channel_ID);
|
||||
gboolean gimp_image_freeze_channels (gint32 image_ID);
|
||||
gboolean gimp_image_thaw_channels (gint32 image_ID);
|
||||
GIMP_DEPRECATED_FOR(gimp_image_insert_vectors)
|
||||
gboolean gimp_image_add_vectors (gint32 image_ID,
|
||||
gint32 vectors_ID,
|
||||
gint position);
|
||||
gboolean gimp_image_insert_vectors (gint32 image_ID,
|
||||
gint32 vectors_ID,
|
||||
gint32 parent_ID,
|
||||
|
|
|
@ -154,44 +154,6 @@ gimp_image_scale (gint32 image_ID,
|
|||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_image_scale_full:
|
||||
* @image_ID: The image.
|
||||
* @new_width: New image width.
|
||||
* @new_height: New image height.
|
||||
* @interpolation: Type of interpolation.
|
||||
*
|
||||
* Deprecated: Use gimp_image_scale() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
*
|
||||
* Since: 2.6
|
||||
**/
|
||||
gboolean
|
||||
gimp_image_scale_full (gint32 image_ID,
|
||||
gint new_width,
|
||||
gint new_height,
|
||||
GimpInterpolationType interpolation)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-image-scale-full",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_IMAGE, image_ID,
|
||||
GIMP_PDB_INT32, new_width,
|
||||
GIMP_PDB_INT32, new_height,
|
||||
GIMP_PDB_INT32, interpolation,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_image_crop:
|
||||
* @image_ID: The image.
|
||||
|
|
|
@ -41,11 +41,6 @@ gboolean gimp_image_resize_to_layers (gint32 image_ID);
|
|||
gboolean gimp_image_scale (gint32 image_ID,
|
||||
gint new_width,
|
||||
gint new_height);
|
||||
GIMP_DEPRECATED_FOR(gimp_image_scale)
|
||||
gboolean gimp_image_scale_full (gint32 image_ID,
|
||||
gint new_width,
|
||||
gint new_height,
|
||||
GimpInterpolationType interpolation);
|
||||
gboolean gimp_image_crop (gint32 image_ID,
|
||||
gint new_width,
|
||||
gint new_height,
|
||||
|
|
|
@ -352,47 +352,6 @@ gimp_layer_scale (gint32 layer_ID,
|
|||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_layer_scale_full:
|
||||
* @layer_ID: The layer.
|
||||
* @new_width: New layer width.
|
||||
* @new_height: New layer height.
|
||||
* @local_origin: Use a local origin (as opposed to the image origin).
|
||||
* @interpolation: Type of interpolation.
|
||||
*
|
||||
* Deprecated: Use gimp_layer_scale() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
*
|
||||
* Since: 2.6
|
||||
**/
|
||||
gboolean
|
||||
gimp_layer_scale_full (gint32 layer_ID,
|
||||
gint new_width,
|
||||
gint new_height,
|
||||
gboolean local_origin,
|
||||
GimpInterpolationType interpolation)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-layer-scale-full",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_LAYER, layer_ID,
|
||||
GIMP_PDB_INT32, new_width,
|
||||
GIMP_PDB_INT32, new_height,
|
||||
GIMP_PDB_INT32, local_origin,
|
||||
GIMP_PDB_INT32, interpolation,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_layer_resize:
|
||||
* @layer_ID: The layer.
|
||||
|
@ -467,48 +426,6 @@ gimp_layer_resize_to_image_size (gint32 layer_ID)
|
|||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_layer_translate:
|
||||
* @layer_ID: The layer.
|
||||
* @offx: Offset in x direction.
|
||||
* @offy: Offset in y direction.
|
||||
*
|
||||
* Translate the layer by the specified offsets.
|
||||
*
|
||||
* This procedure translates the layer by the amounts specified in the
|
||||
* x and y arguments. These can be negative, and are considered offsets
|
||||
* from the current position. This command only works if the layer has
|
||||
* been added to an image. All additional layers contained in the image
|
||||
* which have the linked flag set to TRUE w ill also be translated by
|
||||
* the specified offsets.
|
||||
*
|
||||
* Deprecated: Use gimp_item_transform_translate() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
**/
|
||||
gboolean
|
||||
gimp_layer_translate (gint32 layer_ID,
|
||||
gint offx,
|
||||
gint offy)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-layer-translate",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_LAYER, layer_ID,
|
||||
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_layer_set_offsets:
|
||||
* @layer_ID: The layer.
|
||||
|
|
|
@ -53,22 +53,12 @@ gboolean gimp_layer_scale (gint32
|
|||
gint new_width,
|
||||
gint new_height,
|
||||
gboolean local_origin);
|
||||
GIMP_DEPRECATED_FOR(gimp_layer_scale)
|
||||
gboolean gimp_layer_scale_full (gint32 layer_ID,
|
||||
gint new_width,
|
||||
gint new_height,
|
||||
gboolean local_origin,
|
||||
GimpInterpolationType interpolation);
|
||||
gboolean gimp_layer_resize (gint32 layer_ID,
|
||||
gint new_width,
|
||||
gint new_height,
|
||||
gint offx,
|
||||
gint offy);
|
||||
gboolean gimp_layer_resize_to_image_size (gint32 layer_ID);
|
||||
GIMP_DEPRECATED_FOR(gimp_item_transform_translate)
|
||||
gboolean gimp_layer_translate (gint32 layer_ID,
|
||||
gint offx,
|
||||
gint offy);
|
||||
gboolean gimp_layer_set_offsets (gint32 layer_ID,
|
||||
gint offx,
|
||||
gint offy);
|
||||
|
|
|
@ -107,72 +107,3 @@ gimp_palettes_get_list (const gchar *filter,
|
|||
|
||||
return palette_list;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_palettes_get_palette:
|
||||
* @num_colors: The palette num_colors.
|
||||
*
|
||||
* Deprecated: Use gimp_context_get_palette() instead.
|
||||
*
|
||||
* Returns: The palette name.
|
||||
**/
|
||||
gchar *
|
||||
gimp_palettes_get_palette (gint *num_colors)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gchar *name = NULL;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-palettes-get-palette",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
{
|
||||
name = g_strdup (return_vals[1].data.d_string);
|
||||
*num_colors = return_vals[2].data.d_int32;
|
||||
}
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_palettes_get_palette_entry:
|
||||
* @name: The palette name (\"\" means currently active palette).
|
||||
* @entry_num: The entry to retrieve.
|
||||
* @num_colors: The palette num_colors.
|
||||
* @color: The color requested.
|
||||
*
|
||||
* Deprecated: Use gimp_palette_entry_get_color() instead.
|
||||
*
|
||||
* Returns: The palette name.
|
||||
**/
|
||||
gchar *
|
||||
gimp_palettes_get_palette_entry (const gchar *name,
|
||||
gint entry_num,
|
||||
gint *num_colors,
|
||||
GimpRGB *color)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gchar *actual_name = NULL;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-palettes-get-palette-entry",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_STRING, name,
|
||||
GIMP_PDB_INT32, entry_num,
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
{
|
||||
actual_name = g_strdup (return_vals[1].data.d_string);
|
||||
*num_colors = return_vals[2].data.d_int32;
|
||||
*color = return_vals[3].data.d_color;
|
||||
}
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return actual_name;
|
||||
}
|
||||
|
|
|
@ -35,13 +35,6 @@ G_BEGIN_DECLS
|
|||
gboolean gimp_palettes_refresh (void);
|
||||
gchar** gimp_palettes_get_list (const gchar *filter,
|
||||
gint *num_palettes);
|
||||
GIMP_DEPRECATED_FOR(gimp_context_get_palette)
|
||||
gchar* gimp_palettes_get_palette (gint *num_colors);
|
||||
GIMP_DEPRECATED_FOR(gimp_palette_entry_get_color)
|
||||
gchar* gimp_palettes_get_palette_entry (const gchar *name,
|
||||
gint entry_num,
|
||||
gint *num_colors,
|
||||
GimpRGB *color);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
|
|
@ -1,560 +0,0 @@
|
|||
/* LIBGIMP - The GIMP Library
|
||||
* Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
|
||||
*
|
||||
* gimppaths_pdb.c
|
||||
*
|
||||
* This library is free software: you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see
|
||||
* <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* NOTE: This file is auto-generated by pdbgen.pl */
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "gimp.h"
|
||||
|
||||
|
||||
/**
|
||||
* SECTION: gimppaths
|
||||
* @title: gimppaths
|
||||
* @short_description: Deprecated operations related to paths.
|
||||
*
|
||||
* Deprecated operations related to paths.
|
||||
**/
|
||||
|
||||
|
||||
/**
|
||||
* gimp_path_list:
|
||||
* @image_ID: The image to list the paths from.
|
||||
* @num_paths: The number of paths returned.
|
||||
*
|
||||
* Deprecated: Use gimp_image_get_vectors() instead.
|
||||
*
|
||||
* Returns: List of the paths belonging to this image. The returned
|
||||
* value must be freed with g_strfreev().
|
||||
**/
|
||||
gchar **
|
||||
gimp_path_list (gint32 image_ID,
|
||||
gint *num_paths)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gchar **path_list = NULL;
|
||||
gint i;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-path-list",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_IMAGE, image_ID,
|
||||
GIMP_PDB_END);
|
||||
|
||||
*num_paths = 0;
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
{
|
||||
*num_paths = return_vals[1].data.d_int32;
|
||||
if (*num_paths > 0)
|
||||
{
|
||||
path_list = g_new0 (gchar *, *num_paths + 1);
|
||||
for (i = 0; i < *num_paths; i++)
|
||||
path_list[i] = g_strdup (return_vals[2].data.d_stringarray[i]);
|
||||
}
|
||||
}
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return path_list;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_path_get_current:
|
||||
* @image_ID: The image to get the current path from.
|
||||
*
|
||||
* Deprecated: Use gimp_image_get_active_vectors() instead.
|
||||
*
|
||||
* Returns: The name of the current path.
|
||||
**/
|
||||
gchar *
|
||||
gimp_path_get_current (gint32 image_ID)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gchar *name = NULL;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-path-get-current",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_IMAGE, image_ID,
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
name = g_strdup (return_vals[1].data.d_string);
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_path_set_current:
|
||||
* @image_ID: The image in which a path will become current.
|
||||
* @name: The name of the path to make current.
|
||||
*
|
||||
* Deprecated: Use gimp_image_set_active_vectors() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
**/
|
||||
gboolean
|
||||
gimp_path_set_current (gint32 image_ID,
|
||||
const gchar *name)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-path-set-current",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_IMAGE, image_ID,
|
||||
GIMP_PDB_STRING, name,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_path_delete:
|
||||
* @image_ID: The image to delete the path from.
|
||||
* @name: The name of the path to delete.
|
||||
*
|
||||
* Deprecated: Use gimp_image_remove_vectors() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
**/
|
||||
gboolean
|
||||
gimp_path_delete (gint32 image_ID,
|
||||
const gchar *name)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-path-delete",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_IMAGE, image_ID,
|
||||
GIMP_PDB_STRING, name,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_path_get_points:
|
||||
* @image_ID: The image to list the paths from.
|
||||
* @name: The name of the path whose points should be listed.
|
||||
* @path_closed: Return if the path is closed. (0 = path open, 1 = path closed).
|
||||
* @num_path_point_details: The number of points returned. Each point is made up of (x, y, pnt_type) of floats.
|
||||
* @points_pairs: The points in the path represented as 3 floats. The first is the x pos, next is the y pos, last is the type of the pnt. The type field is dependent on the path type. For beziers (type 1 paths) the type can either be (1.0 = BEZIER_ANCHOR, 2.0 = BEZIER_CONTROL, 3.0 = BEZIER_MOVE). Note all points are returned in pixel resolution.
|
||||
*
|
||||
* Deprecated: Use gimp_vectors_stroke_get_points() instead.
|
||||
*
|
||||
* Returns: The type of the path. Currently only one type (1 = Bezier)
|
||||
* is supported.
|
||||
**/
|
||||
gint
|
||||
gimp_path_get_points (gint32 image_ID,
|
||||
const gchar *name,
|
||||
gint *path_closed,
|
||||
gint *num_path_point_details,
|
||||
gdouble **points_pairs)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gint path_type = 0;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-path-get-points",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_IMAGE, image_ID,
|
||||
GIMP_PDB_STRING, name,
|
||||
GIMP_PDB_END);
|
||||
|
||||
*num_path_point_details = 0;
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
{
|
||||
path_type = return_vals[1].data.d_int32;
|
||||
*path_closed = return_vals[2].data.d_int32;
|
||||
*num_path_point_details = return_vals[3].data.d_int32;
|
||||
*points_pairs = g_new (gdouble, *num_path_point_details);
|
||||
memcpy (*points_pairs,
|
||||
return_vals[4].data.d_floatarray,
|
||||
*num_path_point_details * sizeof (gdouble));
|
||||
}
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return path_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_path_set_points:
|
||||
* @image_ID: The image to set the paths in.
|
||||
* @name: The name of the path to create. If it exists then a unique name will be created - query the list of paths if you want to make sure that the name of the path you create is unique. This will be set as the current path.
|
||||
* @ptype: The type of the path. Currently only one type (1 = Bezier) is supported.
|
||||
* @num_path_points: The number of elements in the array, i.e. the number of points in the path * 3. Each point is made up of (x, y, type) of floats. Currently only the creation of bezier curves is allowed. The type parameter must be set to (1) to indicate a BEZIER type curve. Note that for BEZIER curves, points must be given in the following order: ACCACCAC... If the path is not closed the last control point is missed off. Points consist of three control points (control/anchor/control) so for a curve that is not closed there must be at least two points passed (2 x,y pairs). If (num_path_points/3) % 3 = 0 then the path is assumed to be closed and the points are ACCACCACCACC.
|
||||
* @points_pairs: The points in the path represented as 3 floats. The first is the x pos, next is the y pos, last is the type of the pnt. The type field is dependent on the path type. For beziers (type 1 paths) the type can either be (1.0 = BEZIER_ANCHOR, 2.0 = BEZIER_CONTROL, 3.0= BEZIER_MOVE). Note all points are returned in pixel resolution.
|
||||
*
|
||||
* Deprecated: Use gimp_vectors_stroke_new_from_points() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
**/
|
||||
gboolean
|
||||
gimp_path_set_points (gint32 image_ID,
|
||||
const gchar *name,
|
||||
gint ptype,
|
||||
gint num_path_points,
|
||||
const gdouble *points_pairs)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-path-set-points",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_IMAGE, image_ID,
|
||||
GIMP_PDB_STRING, name,
|
||||
GIMP_PDB_INT32, ptype,
|
||||
GIMP_PDB_INT32, num_path_points,
|
||||
GIMP_PDB_FLOATARRAY, points_pairs,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_path_stroke_current:
|
||||
* @image_ID: The image which contains the path to stroke.
|
||||
*
|
||||
* Deprecated: Use gimp_edit_stroke_vectors() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
**/
|
||||
gboolean
|
||||
gimp_path_stroke_current (gint32 image_ID)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-path-stroke-current",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_IMAGE, image_ID,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_path_get_point_at_dist:
|
||||
* @image_ID: The image the paths belongs to.
|
||||
* @distance: The distance along the path.
|
||||
* @y_point: The y position of the point.
|
||||
* @slope: The slope (dy / dx) at the specified point.
|
||||
*
|
||||
* Deprecated: Use gimp_vectors_stroke_get_point_at_dist() instead.
|
||||
*
|
||||
* Returns: The x position of the point.
|
||||
**/
|
||||
gint
|
||||
gimp_path_get_point_at_dist (gint32 image_ID,
|
||||
gdouble distance,
|
||||
gint *y_point,
|
||||
gdouble *slope)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gint x_point = 0;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-path-get-point-at-dist",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_IMAGE, image_ID,
|
||||
GIMP_PDB_FLOAT, distance,
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
{
|
||||
x_point = return_vals[1].data.d_int32;
|
||||
*y_point = return_vals[2].data.d_int32;
|
||||
*slope = return_vals[3].data.d_float;
|
||||
}
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return x_point;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_path_get_tattoo:
|
||||
* @image_ID: The image.
|
||||
* @name: The name of the path whose tattoo should be obtained.
|
||||
*
|
||||
* Deprecated: Use gimp_vectors_get_tattoo() instead.
|
||||
*
|
||||
* Returns: The tattoo associated with the named path.
|
||||
**/
|
||||
gint
|
||||
gimp_path_get_tattoo (gint32 image_ID,
|
||||
const gchar *name)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gint tattoo = 0;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-path-get-tattoo",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_IMAGE, image_ID,
|
||||
GIMP_PDB_STRING, name,
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
tattoo = return_vals[1].data.d_int32;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return tattoo;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_path_set_tattoo:
|
||||
* @image_ID: The image.
|
||||
* @name: the name of the path whose tattoo should be set.
|
||||
* @tattovalue: The tattoo associated with the name path. Only values returned from 'path_get_tattoo' should be used here.
|
||||
*
|
||||
* Deprecated: Use gimp_vectors_set_tattoo() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
**/
|
||||
gboolean
|
||||
gimp_path_set_tattoo (gint32 image_ID,
|
||||
const gchar *name,
|
||||
gint tattovalue)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-path-set-tattoo",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_IMAGE, image_ID,
|
||||
GIMP_PDB_STRING, name,
|
||||
GIMP_PDB_INT32, tattovalue,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_get_path_by_tattoo:
|
||||
* @image_ID: The image.
|
||||
* @tattoo: The tattoo of the required path.
|
||||
*
|
||||
* Deprecated: Use gimp_image_get_vectors_by_tattoo() instead.
|
||||
*
|
||||
* Returns: The name of the path with the specified tattoo.
|
||||
**/
|
||||
gchar *
|
||||
gimp_get_path_by_tattoo (gint32 image_ID,
|
||||
gint tattoo)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gchar *name = NULL;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-get-path-by-tattoo",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_IMAGE, image_ID,
|
||||
GIMP_PDB_INT32, tattoo,
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
name = g_strdup (return_vals[1].data.d_string);
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_path_get_locked:
|
||||
* @image_ID: The image.
|
||||
* @name: The name of the path whose locked status should be obtained.
|
||||
*
|
||||
* Deprecated: Use gimp_vectors_get_linked() instead.
|
||||
*
|
||||
* Returns: TRUE if the path is locked, FALSE otherwise.
|
||||
**/
|
||||
gboolean
|
||||
gimp_path_get_locked (gint32 image_ID,
|
||||
const gchar *name)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean locked = FALSE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-path-get-locked",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_IMAGE, image_ID,
|
||||
GIMP_PDB_STRING, name,
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
locked = return_vals[1].data.d_int32;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return locked;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_path_set_locked:
|
||||
* @image_ID: The image.
|
||||
* @name: the name of the path whose locked status should be set.
|
||||
* @locked: Whether the path is locked.
|
||||
*
|
||||
* Deprecated: Use gimp_vectors_set_linked() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
**/
|
||||
gboolean
|
||||
gimp_path_set_locked (gint32 image_ID,
|
||||
const gchar *name,
|
||||
gboolean locked)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-path-set-locked",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_IMAGE, image_ID,
|
||||
GIMP_PDB_STRING, name,
|
||||
GIMP_PDB_INT32, locked,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_path_to_selection:
|
||||
* @image_ID: The image.
|
||||
* @name: The name of the path which should be made into selection.
|
||||
* @op: The desired operation with current selection.
|
||||
* @antialias: Antialias selection.
|
||||
* @feather: Feather selection.
|
||||
* @feather_radius_x: Feather radius x.
|
||||
* @feather_radius_y: Feather radius y.
|
||||
*
|
||||
* Deprecated: Use gimp_vectors_to_selection() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
**/
|
||||
gboolean
|
||||
gimp_path_to_selection (gint32 image_ID,
|
||||
const gchar *name,
|
||||
GimpChannelOps op,
|
||||
gboolean antialias,
|
||||
gboolean feather,
|
||||
gdouble feather_radius_x,
|
||||
gdouble feather_radius_y)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-path-to-selection",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_IMAGE, image_ID,
|
||||
GIMP_PDB_STRING, name,
|
||||
GIMP_PDB_INT32, op,
|
||||
GIMP_PDB_INT32, antialias,
|
||||
GIMP_PDB_INT32, feather,
|
||||
GIMP_PDB_FLOAT, feather_radius_x,
|
||||
GIMP_PDB_FLOAT, feather_radius_y,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_path_import:
|
||||
* @image_ID: The image.
|
||||
* @filename: The name of the SVG file to import.
|
||||
* @merge: Merge paths into a single vectors object.
|
||||
* @scale: Scale the SVG to image dimensions.
|
||||
*
|
||||
* Deprecated: Use gimp_vectors_import_from_file() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
**/
|
||||
gboolean
|
||||
gimp_path_import (gint32 image_ID,
|
||||
const gchar *filename,
|
||||
gboolean merge,
|
||||
gboolean scale)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-path-import",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_IMAGE, image_ID,
|
||||
GIMP_PDB_STRING, filename,
|
||||
GIMP_PDB_INT32, merge,
|
||||
GIMP_PDB_INT32, scale,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
|
@ -1,99 +0,0 @@
|
|||
/* LIBGIMP - The GIMP Library
|
||||
* Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
|
||||
*
|
||||
* gimppaths_pdb.h
|
||||
*
|
||||
* This library is free software: you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see
|
||||
* <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* NOTE: This file is auto-generated by pdbgen.pl */
|
||||
|
||||
#if !defined (__GIMP_H_INSIDE__) && !defined (GIMP_COMPILATION)
|
||||
#error "Only <libgimp/gimp.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#ifndef __GIMP_PATHS_PDB_H__
|
||||
#define __GIMP_PATHS_PDB_H__
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/* For information look into the C source or the html documentation */
|
||||
|
||||
|
||||
GIMP_DEPRECATED_FOR(gimp_image_get_vectors)
|
||||
gchar** gimp_path_list (gint32 image_ID,
|
||||
gint *num_paths);
|
||||
GIMP_DEPRECATED_FOR(gimp_image_get_active_vectors)
|
||||
gchar* gimp_path_get_current (gint32 image_ID);
|
||||
GIMP_DEPRECATED_FOR(gimp_image_set_active_vectors)
|
||||
gboolean gimp_path_set_current (gint32 image_ID,
|
||||
const gchar *name);
|
||||
GIMP_DEPRECATED_FOR(gimp_image_remove_vectors)
|
||||
gboolean gimp_path_delete (gint32 image_ID,
|
||||
const gchar *name);
|
||||
GIMP_DEPRECATED_FOR(gimp_vectors_stroke_get_points)
|
||||
gint gimp_path_get_points (gint32 image_ID,
|
||||
const gchar *name,
|
||||
gint *path_closed,
|
||||
gint *num_path_point_details,
|
||||
gdouble **points_pairs);
|
||||
GIMP_DEPRECATED_FOR(gimp_vectors_stroke_new_from_points)
|
||||
gboolean gimp_path_set_points (gint32 image_ID,
|
||||
const gchar *name,
|
||||
gint ptype,
|
||||
gint num_path_points,
|
||||
const gdouble *points_pairs);
|
||||
GIMP_DEPRECATED_FOR(gimp_edit_stroke_vectors)
|
||||
gboolean gimp_path_stroke_current (gint32 image_ID);
|
||||
GIMP_DEPRECATED_FOR(gimp_vectors_stroke_get_point_at_dist)
|
||||
gint gimp_path_get_point_at_dist (gint32 image_ID,
|
||||
gdouble distance,
|
||||
gint *y_point,
|
||||
gdouble *slope);
|
||||
GIMP_DEPRECATED_FOR(gimp_vectors_get_tattoo)
|
||||
gint gimp_path_get_tattoo (gint32 image_ID,
|
||||
const gchar *name);
|
||||
GIMP_DEPRECATED_FOR(gimp_vectors_set_tattoo)
|
||||
gboolean gimp_path_set_tattoo (gint32 image_ID,
|
||||
const gchar *name,
|
||||
gint tattovalue);
|
||||
GIMP_DEPRECATED_FOR(gimp_image_get_vectors_by_tattoo)
|
||||
gchar* gimp_get_path_by_tattoo (gint32 image_ID,
|
||||
gint tattoo);
|
||||
GIMP_DEPRECATED_FOR(gimp_vectors_get_linked)
|
||||
gboolean gimp_path_get_locked (gint32 image_ID,
|
||||
const gchar *name);
|
||||
GIMP_DEPRECATED_FOR(gimp_vectors_set_linked)
|
||||
gboolean gimp_path_set_locked (gint32 image_ID,
|
||||
const gchar *name,
|
||||
gboolean locked);
|
||||
GIMP_DEPRECATED_FOR(gimp_vectors_to_selection)
|
||||
gboolean gimp_path_to_selection (gint32 image_ID,
|
||||
const gchar *name,
|
||||
GimpChannelOps op,
|
||||
gboolean antialias,
|
||||
gboolean feather,
|
||||
gdouble feather_radius_x,
|
||||
gdouble feather_radius_y);
|
||||
GIMP_DEPRECATED_FOR(gimp_vectors_import_from_file)
|
||||
gboolean gimp_path_import (gint32 image_ID,
|
||||
const gchar *filename,
|
||||
gboolean merge,
|
||||
gboolean scale);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GIMP_PATHS_PDB_H__ */
|
|
@ -22,8 +22,6 @@
|
|||
|
||||
#include "config.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "gimp.h"
|
||||
|
||||
|
||||
|
@ -109,86 +107,3 @@ gimp_patterns_get_list (const gchar *filter,
|
|||
|
||||
return pattern_list;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_patterns_get_pattern:
|
||||
* @width: The pattern width.
|
||||
* @height: The pattern height.
|
||||
*
|
||||
* Deprecated: Use gimp_context_get_pattern() instead.
|
||||
*
|
||||
* Returns: The pattern name.
|
||||
**/
|
||||
gchar *
|
||||
gimp_patterns_get_pattern (gint *width,
|
||||
gint *height)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gchar *name = NULL;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-patterns-get-pattern",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
{
|
||||
name = g_strdup (return_vals[1].data.d_string);
|
||||
*width = return_vals[2].data.d_int32;
|
||||
*height = return_vals[3].data.d_int32;
|
||||
}
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_patterns_get_pattern_data:
|
||||
* @name: The pattern name (\"\" means currently active pattern).
|
||||
* @width: The pattern width.
|
||||
* @height: The pattern height.
|
||||
* @mask_bpp: Pattern bytes per pixel.
|
||||
* @length: Length of pattern mask data.
|
||||
* @mask_data: The pattern mask data.
|
||||
*
|
||||
* Deprecated: Use gimp_pattern_get_pixels() instead.
|
||||
*
|
||||
* Returns: The pattern name.
|
||||
**/
|
||||
gchar *
|
||||
gimp_patterns_get_pattern_data (const gchar *name,
|
||||
gint *width,
|
||||
gint *height,
|
||||
gint *mask_bpp,
|
||||
gint *length,
|
||||
guint8 **mask_data)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gchar *actual_name = NULL;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-patterns-get-pattern-data",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_STRING, name,
|
||||
GIMP_PDB_END);
|
||||
|
||||
*length = 0;
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
{
|
||||
actual_name = g_strdup (return_vals[1].data.d_string);
|
||||
*width = return_vals[2].data.d_int32;
|
||||
*height = return_vals[3].data.d_int32;
|
||||
*mask_bpp = return_vals[4].data.d_int32;
|
||||
*length = return_vals[5].data.d_int32;
|
||||
*mask_data = g_new (guint8, *length);
|
||||
memcpy (*mask_data,
|
||||
return_vals[6].data.d_int8array,
|
||||
*length * sizeof (guint8));
|
||||
}
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return actual_name;
|
||||
}
|
||||
|
|
|
@ -35,16 +35,6 @@ G_BEGIN_DECLS
|
|||
gboolean gimp_patterns_refresh (void);
|
||||
gchar** gimp_patterns_get_list (const gchar *filter,
|
||||
gint *num_patterns);
|
||||
GIMP_DEPRECATED_FOR(gimp_context_get_pattern)
|
||||
gchar* gimp_patterns_get_pattern (gint *width,
|
||||
gint *height);
|
||||
GIMP_DEPRECATED_FOR(gimp_pattern_get_pixels)
|
||||
gchar* gimp_patterns_get_pattern_data (const gchar *name,
|
||||
gint *width,
|
||||
gint *height,
|
||||
gint *mask_bpp,
|
||||
gint *length,
|
||||
guint8 **mask_data);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
|
|
@ -533,60 +533,6 @@ gimp_selection_flood (gint32 image_ID)
|
|||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_selection_layer_alpha:
|
||||
* @layer_ID: Layer with alpha.
|
||||
*
|
||||
* Deprecated: Use gimp_image_select_item() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
**/
|
||||
gboolean
|
||||
gimp_selection_layer_alpha (gint32 layer_ID)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-selection-layer-alpha",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_LAYER, layer_ID,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_selection_load:
|
||||
* @channel_ID: The channel.
|
||||
*
|
||||
* Deprecated: Use gimp_image_select_item() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
**/
|
||||
gboolean
|
||||
gimp_selection_load (gint32 channel_ID)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-selection-load",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_CHANNEL, channel_ID,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_selection_save:
|
||||
* @image_ID: The image.
|
||||
|
@ -618,33 +564,3 @@ gimp_selection_save (gint32 image_ID)
|
|||
|
||||
return channel_ID;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_selection_combine:
|
||||
* @channel_ID: The channel.
|
||||
* @operation: The selection operation.
|
||||
*
|
||||
* Deprecated: Use gimp_image_select_item() instead.
|
||||
*
|
||||
* 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;
|
||||
}
|
||||
|
|
|
@ -61,14 +61,7 @@ gboolean gimp_selection_grow (gint32 image_ID,
|
|||
gboolean gimp_selection_shrink (gint32 image_ID,
|
||||
gint steps);
|
||||
gboolean gimp_selection_flood (gint32 image_ID);
|
||||
GIMP_DEPRECATED_FOR(gimp_image_select_item)
|
||||
gboolean gimp_selection_layer_alpha (gint32 layer_ID);
|
||||
GIMP_DEPRECATED_FOR(gimp_image_select_item)
|
||||
gboolean gimp_selection_load (gint32 channel_ID);
|
||||
gint32 gimp_selection_save (gint32 image_ID);
|
||||
GIMP_DEPRECATED_FOR(gimp_image_select_item)
|
||||
gboolean gimp_selection_combine (gint32 channel_ID,
|
||||
GimpChannelOps operation);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
|
|
@ -1,461 +0,0 @@
|
|||
/* LIBGIMP - The GIMP Library
|
||||
* Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
|
||||
*
|
||||
* gimpselectiontools_pdb.c
|
||||
*
|
||||
* This library is free software: you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see
|
||||
* <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* NOTE: This file is auto-generated by pdbgen.pl */
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "gimp.h"
|
||||
|
||||
|
||||
/**
|
||||
* SECTION: gimpselectiontools
|
||||
* @title: gimpselectiontools
|
||||
* @short_description: Access to toolbox selection tools.
|
||||
*
|
||||
* Functions giving access to toolbox selection tools.
|
||||
**/
|
||||
|
||||
|
||||
/**
|
||||
* gimp_by_color_select:
|
||||
* @drawable_ID: The affected drawable.
|
||||
* @color: The color to select.
|
||||
* @threshold: Threshold in intensity levels.
|
||||
* @operation: The selection operation.
|
||||
* @antialias: Antialiasing.
|
||||
* @feather: Feather option for selections.
|
||||
* @feather_radius: Radius for feather operation.
|
||||
* @sample_merged: Use the composite image, not the drawable.
|
||||
*
|
||||
* Deprecated: Use gimp_image_select_color() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
**/
|
||||
gboolean
|
||||
gimp_by_color_select (gint32 drawable_ID,
|
||||
const GimpRGB *color,
|
||||
gint threshold,
|
||||
GimpChannelOps operation,
|
||||
gboolean antialias,
|
||||
gboolean feather,
|
||||
gdouble feather_radius,
|
||||
gboolean sample_merged)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-by-color-select",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_COLOR, color,
|
||||
GIMP_PDB_INT32, threshold,
|
||||
GIMP_PDB_INT32, operation,
|
||||
GIMP_PDB_INT32, antialias,
|
||||
GIMP_PDB_INT32, feather,
|
||||
GIMP_PDB_FLOAT, feather_radius,
|
||||
GIMP_PDB_INT32, sample_merged,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_by_color_select_full:
|
||||
* @drawable_ID: The affected drawable.
|
||||
* @color: The color to select.
|
||||
* @threshold: Threshold in intensity levels.
|
||||
* @operation: The selection operation.
|
||||
* @antialias: Antialiasing.
|
||||
* @feather: Feather option for selections.
|
||||
* @feather_radius_x: Radius for feather operation in X direction.
|
||||
* @feather_radius_y: Radius for feather operation in Y direction.
|
||||
* @sample_merged: Use the composite image, not the drawable.
|
||||
* @select_transparent: Whether to consider transparent pixels for selection. If TRUE, transparency is considered as a unique selectable color.
|
||||
* @select_criterion: The criterion used to determine color similarity. SELECT_CRITERION_COMPOSITE is the standard choice.
|
||||
*
|
||||
* Deprecated: Use gimp_image_select_color() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
*
|
||||
* Since: 2.4
|
||||
**/
|
||||
gboolean
|
||||
gimp_by_color_select_full (gint32 drawable_ID,
|
||||
const GimpRGB *color,
|
||||
gint threshold,
|
||||
GimpChannelOps operation,
|
||||
gboolean antialias,
|
||||
gboolean feather,
|
||||
gdouble feather_radius_x,
|
||||
gdouble feather_radius_y,
|
||||
gboolean sample_merged,
|
||||
gboolean select_transparent,
|
||||
GimpSelectCriterion select_criterion)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-by-color-select-full",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_COLOR, color,
|
||||
GIMP_PDB_INT32, threshold,
|
||||
GIMP_PDB_INT32, operation,
|
||||
GIMP_PDB_INT32, antialias,
|
||||
GIMP_PDB_INT32, feather,
|
||||
GIMP_PDB_FLOAT, feather_radius_x,
|
||||
GIMP_PDB_FLOAT, feather_radius_y,
|
||||
GIMP_PDB_INT32, sample_merged,
|
||||
GIMP_PDB_INT32, select_transparent,
|
||||
GIMP_PDB_INT32, select_criterion,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_ellipse_select:
|
||||
* @image_ID: The image.
|
||||
* @x: x coordinate of upper-left corner of ellipse bounding box.
|
||||
* @y: y coordinate of upper-left corner of ellipse bounding box.
|
||||
* @width: The width of the ellipse.
|
||||
* @height: The height of the ellipse.
|
||||
* @operation: The selection operation.
|
||||
* @antialias: Antialiasing.
|
||||
* @feather: Feather option for selections.
|
||||
* @feather_radius: Radius for feather operation.
|
||||
*
|
||||
* Deprecated: Use gimp_image_select_ellipse() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
**/
|
||||
gboolean
|
||||
gimp_ellipse_select (gint32 image_ID,
|
||||
gdouble x,
|
||||
gdouble y,
|
||||
gdouble width,
|
||||
gdouble height,
|
||||
GimpChannelOps operation,
|
||||
gboolean antialias,
|
||||
gboolean feather,
|
||||
gdouble feather_radius)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-ellipse-select",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_IMAGE, image_ID,
|
||||
GIMP_PDB_FLOAT, x,
|
||||
GIMP_PDB_FLOAT, y,
|
||||
GIMP_PDB_FLOAT, width,
|
||||
GIMP_PDB_FLOAT, height,
|
||||
GIMP_PDB_INT32, operation,
|
||||
GIMP_PDB_INT32, antialias,
|
||||
GIMP_PDB_INT32, feather,
|
||||
GIMP_PDB_FLOAT, feather_radius,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_free_select:
|
||||
* @image_ID: The image.
|
||||
* @num_segs: Number of points (count 1 coordinate as two points).
|
||||
* @segs: Array of points: { p1.x, p1.y, p2.x, p2.y, ..., pn.x, pn.y}.
|
||||
* @operation: The selection operation.
|
||||
* @antialias: Antialiasing.
|
||||
* @feather: Feather option for selections.
|
||||
* @feather_radius: Radius for feather operation.
|
||||
*
|
||||
* Deprecated: Use gimp_image_select_polygon() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
**/
|
||||
gboolean
|
||||
gimp_free_select (gint32 image_ID,
|
||||
gint num_segs,
|
||||
const gdouble *segs,
|
||||
GimpChannelOps operation,
|
||||
gboolean antialias,
|
||||
gboolean feather,
|
||||
gdouble feather_radius)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-free-select",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_IMAGE, image_ID,
|
||||
GIMP_PDB_INT32, num_segs,
|
||||
GIMP_PDB_FLOATARRAY, segs,
|
||||
GIMP_PDB_INT32, operation,
|
||||
GIMP_PDB_INT32, antialias,
|
||||
GIMP_PDB_INT32, feather,
|
||||
GIMP_PDB_FLOAT, feather_radius,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_fuzzy_select:
|
||||
* @drawable_ID: The affected drawable.
|
||||
* @x: x coordinate of initial seed fill point: (image coordinates).
|
||||
* @y: y coordinate of initial seed fill point: (image coordinates).
|
||||
* @threshold: Threshold in intensity levels.
|
||||
* @operation: The selection operation.
|
||||
* @antialias: Antialiasing.
|
||||
* @feather: Feather option for selections.
|
||||
* @feather_radius: Radius for feather operation.
|
||||
* @sample_merged: Use the composite image, not the drawable.
|
||||
*
|
||||
* Deprecated: Use gimp_image_select_contiguous_color() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
**/
|
||||
gboolean
|
||||
gimp_fuzzy_select (gint32 drawable_ID,
|
||||
gdouble x,
|
||||
gdouble y,
|
||||
gint threshold,
|
||||
GimpChannelOps operation,
|
||||
gboolean antialias,
|
||||
gboolean feather,
|
||||
gdouble feather_radius,
|
||||
gboolean sample_merged)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-fuzzy-select",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_FLOAT, x,
|
||||
GIMP_PDB_FLOAT, y,
|
||||
GIMP_PDB_INT32, threshold,
|
||||
GIMP_PDB_INT32, operation,
|
||||
GIMP_PDB_INT32, antialias,
|
||||
GIMP_PDB_INT32, feather,
|
||||
GIMP_PDB_FLOAT, feather_radius,
|
||||
GIMP_PDB_INT32, sample_merged,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_fuzzy_select_full:
|
||||
* @drawable_ID: The affected drawable.
|
||||
* @x: x coordinate of initial seed fill point: (image coordinates).
|
||||
* @y: y coordinate of initial seed fill point: (image coordinates).
|
||||
* @threshold: Threshold in intensity levels.
|
||||
* @operation: The selection operation.
|
||||
* @antialias: Antialiasing.
|
||||
* @feather: Feather option for selections.
|
||||
* @feather_radius_x: Radius for feather operation in X direction.
|
||||
* @feather_radius_y: Radius for feather operation in Y direction.
|
||||
* @sample_merged: Use the composite image, not the drawable.
|
||||
* @select_transparent: Whether to consider transparent pixels for selection. If TRUE, transparency is considered as a unique selectable color.
|
||||
* @select_criterion: The criterion used to determine color similarity. SELECT_CRITERION_COMPOSITE is the standard choice.
|
||||
*
|
||||
* Deprecated: Use gimp_image_select_contiguous_color() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
*
|
||||
* Since: 2.4
|
||||
**/
|
||||
gboolean
|
||||
gimp_fuzzy_select_full (gint32 drawable_ID,
|
||||
gdouble x,
|
||||
gdouble y,
|
||||
gint threshold,
|
||||
GimpChannelOps operation,
|
||||
gboolean antialias,
|
||||
gboolean feather,
|
||||
gdouble feather_radius_x,
|
||||
gdouble feather_radius_y,
|
||||
gboolean sample_merged,
|
||||
gboolean select_transparent,
|
||||
GimpSelectCriterion select_criterion)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-fuzzy-select-full",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_FLOAT, x,
|
||||
GIMP_PDB_FLOAT, y,
|
||||
GIMP_PDB_INT32, threshold,
|
||||
GIMP_PDB_INT32, operation,
|
||||
GIMP_PDB_INT32, antialias,
|
||||
GIMP_PDB_INT32, feather,
|
||||
GIMP_PDB_FLOAT, feather_radius_x,
|
||||
GIMP_PDB_FLOAT, feather_radius_y,
|
||||
GIMP_PDB_INT32, sample_merged,
|
||||
GIMP_PDB_INT32, select_transparent,
|
||||
GIMP_PDB_INT32, select_criterion,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_rect_select:
|
||||
* @image_ID: The image.
|
||||
* @x: x coordinate of upper-left corner of rectangle.
|
||||
* @y: y coordinate of upper-left corner of rectangle.
|
||||
* @width: The width of the rectangle.
|
||||
* @height: The height of the rectangle.
|
||||
* @operation: The selection operation.
|
||||
* @feather: Feather option for selections.
|
||||
* @feather_radius: Radius for feather operation.
|
||||
*
|
||||
* Deprecated: Use gimp_image_select_rectangle() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
**/
|
||||
gboolean
|
||||
gimp_rect_select (gint32 image_ID,
|
||||
gdouble x,
|
||||
gdouble y,
|
||||
gdouble width,
|
||||
gdouble height,
|
||||
GimpChannelOps operation,
|
||||
gboolean feather,
|
||||
gdouble feather_radius)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-rect-select",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_IMAGE, image_ID,
|
||||
GIMP_PDB_FLOAT, x,
|
||||
GIMP_PDB_FLOAT, y,
|
||||
GIMP_PDB_FLOAT, width,
|
||||
GIMP_PDB_FLOAT, height,
|
||||
GIMP_PDB_INT32, operation,
|
||||
GIMP_PDB_INT32, feather,
|
||||
GIMP_PDB_FLOAT, feather_radius,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_round_rect_select:
|
||||
* @image_ID: The image.
|
||||
* @x: x coordinate of upper-left corner of rectangle.
|
||||
* @y: y coordinate of upper-left corner of rectangle.
|
||||
* @width: The width of the rectangle.
|
||||
* @height: The height of the rectangle.
|
||||
* @corner_radius_x: The corner radius in X direction.
|
||||
* @corner_radius_y: The corner radius in Y direction.
|
||||
* @operation: The selection operation.
|
||||
* @antialias: Antialiasing.
|
||||
* @feather: Feather option for selections.
|
||||
* @feather_radius_x: Radius for feather operation in X direction.
|
||||
* @feather_radius_y: Radius for feather operation in Y direction.
|
||||
*
|
||||
* Deprecated: Use gimp_image_select_round_rectangle() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
*
|
||||
* Since: 2.4
|
||||
**/
|
||||
gboolean
|
||||
gimp_round_rect_select (gint32 image_ID,
|
||||
gdouble x,
|
||||
gdouble y,
|
||||
gdouble width,
|
||||
gdouble height,
|
||||
gdouble corner_radius_x,
|
||||
gdouble corner_radius_y,
|
||||
GimpChannelOps operation,
|
||||
gboolean antialias,
|
||||
gboolean feather,
|
||||
gdouble feather_radius_x,
|
||||
gdouble feather_radius_y)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-round-rect-select",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_IMAGE, image_ID,
|
||||
GIMP_PDB_FLOAT, x,
|
||||
GIMP_PDB_FLOAT, y,
|
||||
GIMP_PDB_FLOAT, width,
|
||||
GIMP_PDB_FLOAT, height,
|
||||
GIMP_PDB_FLOAT, corner_radius_x,
|
||||
GIMP_PDB_FLOAT, corner_radius_y,
|
||||
GIMP_PDB_INT32, operation,
|
||||
GIMP_PDB_INT32, antialias,
|
||||
GIMP_PDB_INT32, feather,
|
||||
GIMP_PDB_FLOAT, feather_radius_x,
|
||||
GIMP_PDB_FLOAT, feather_radius_y,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
|
@ -1,123 +0,0 @@
|
|||
/* LIBGIMP - The GIMP Library
|
||||
* Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
|
||||
*
|
||||
* gimpselectiontools_pdb.h
|
||||
*
|
||||
* This library is free software: you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see
|
||||
* <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* NOTE: This file is auto-generated by pdbgen.pl */
|
||||
|
||||
#if !defined (__GIMP_H_INSIDE__) && !defined (GIMP_COMPILATION)
|
||||
#error "Only <libgimp/gimp.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#ifndef __GIMP_SELECTION_TOOLS_PDB_H__
|
||||
#define __GIMP_SELECTION_TOOLS_PDB_H__
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/* For information look into the C source or the html documentation */
|
||||
|
||||
|
||||
GIMP_DEPRECATED_FOR(gimp_image_select_color)
|
||||
gboolean gimp_by_color_select (gint32 drawable_ID,
|
||||
const GimpRGB *color,
|
||||
gint threshold,
|
||||
GimpChannelOps operation,
|
||||
gboolean antialias,
|
||||
gboolean feather,
|
||||
gdouble feather_radius,
|
||||
gboolean sample_merged);
|
||||
GIMP_DEPRECATED_FOR(gimp_image_select_color)
|
||||
gboolean gimp_by_color_select_full (gint32 drawable_ID,
|
||||
const GimpRGB *color,
|
||||
gint threshold,
|
||||
GimpChannelOps operation,
|
||||
gboolean antialias,
|
||||
gboolean feather,
|
||||
gdouble feather_radius_x,
|
||||
gdouble feather_radius_y,
|
||||
gboolean sample_merged,
|
||||
gboolean select_transparent,
|
||||
GimpSelectCriterion select_criterion);
|
||||
GIMP_DEPRECATED_FOR(gimp_image_select_ellipse)
|
||||
gboolean gimp_ellipse_select (gint32 image_ID,
|
||||
gdouble x,
|
||||
gdouble y,
|
||||
gdouble width,
|
||||
gdouble height,
|
||||
GimpChannelOps operation,
|
||||
gboolean antialias,
|
||||
gboolean feather,
|
||||
gdouble feather_radius);
|
||||
GIMP_DEPRECATED_FOR(gimp_image_select_polygon)
|
||||
gboolean gimp_free_select (gint32 image_ID,
|
||||
gint num_segs,
|
||||
const gdouble *segs,
|
||||
GimpChannelOps operation,
|
||||
gboolean antialias,
|
||||
gboolean feather,
|
||||
gdouble feather_radius);
|
||||
GIMP_DEPRECATED_FOR(gimp_image_select_contiguous_color)
|
||||
gboolean gimp_fuzzy_select (gint32 drawable_ID,
|
||||
gdouble x,
|
||||
gdouble y,
|
||||
gint threshold,
|
||||
GimpChannelOps operation,
|
||||
gboolean antialias,
|
||||
gboolean feather,
|
||||
gdouble feather_radius,
|
||||
gboolean sample_merged);
|
||||
GIMP_DEPRECATED_FOR(gimp_image_select_contiguous_color)
|
||||
gboolean gimp_fuzzy_select_full (gint32 drawable_ID,
|
||||
gdouble x,
|
||||
gdouble y,
|
||||
gint threshold,
|
||||
GimpChannelOps operation,
|
||||
gboolean antialias,
|
||||
gboolean feather,
|
||||
gdouble feather_radius_x,
|
||||
gdouble feather_radius_y,
|
||||
gboolean sample_merged,
|
||||
gboolean select_transparent,
|
||||
GimpSelectCriterion select_criterion);
|
||||
GIMP_DEPRECATED_FOR(gimp_image_select_rectangle)
|
||||
gboolean gimp_rect_select (gint32 image_ID,
|
||||
gdouble x,
|
||||
gdouble y,
|
||||
gdouble width,
|
||||
gdouble height,
|
||||
GimpChannelOps operation,
|
||||
gboolean feather,
|
||||
gdouble feather_radius);
|
||||
GIMP_DEPRECATED_FOR(gimp_image_select_round_rectangle)
|
||||
gboolean gimp_round_rect_select (gint32 image_ID,
|
||||
gdouble x,
|
||||
gdouble y,
|
||||
gdouble width,
|
||||
gdouble height,
|
||||
gdouble corner_radius_x,
|
||||
gdouble corner_radius_y,
|
||||
GimpChannelOps operation,
|
||||
gboolean antialias,
|
||||
gboolean feather,
|
||||
gdouble feather_radius_x,
|
||||
gdouble feather_radius_y);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GIMP_SELECTION_TOOLS_PDB_H__ */
|
|
@ -1051,77 +1051,3 @@ gimp_text_layer_resize (gint32 layer_ID,
|
|||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_text_layer_get_hinting:
|
||||
* @layer_ID: The text layer.
|
||||
* @autohint: A flag which is true if the text layer is forced to use the autohinter from FreeType.
|
||||
*
|
||||
* Deprecated: Use gimp_text_layer_get_hint_style() instead.
|
||||
*
|
||||
* Returns: A flag which is true if hinting is used on the font.
|
||||
**/
|
||||
gboolean
|
||||
gimp_text_layer_get_hinting (gint32 layer_ID,
|
||||
gboolean *autohint)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean hinting = FALSE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-text-layer-get-hinting",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_LAYER, layer_ID,
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
{
|
||||
hinting = return_vals[1].data.d_int32;
|
||||
*autohint = return_vals[2].data.d_int32;
|
||||
}
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return hinting;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_text_layer_set_hinting:
|
||||
* @layer_ID: The text layer.
|
||||
* @hinting: Enable/disable the use of hinting on the text.
|
||||
* @autohint: Force the use of the autohinter provided through FreeType.
|
||||
*
|
||||
* Enable/disable the use of hinting in a text layer.
|
||||
*
|
||||
* This procedure enables or disables hinting on the text of a text
|
||||
* layer. If you enable 'auto-hint', FreeType\'s automatic hinter will
|
||||
* be used and hinting information from the font will be ignored.
|
||||
*
|
||||
* Deprecated: Use gimp_text_layer_set_hint_style() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
*
|
||||
* Since: 2.6
|
||||
**/
|
||||
gboolean
|
||||
gimp_text_layer_set_hinting (gint32 layer_ID,
|
||||
gboolean hinting,
|
||||
gboolean autohint)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-text-layer-set-hinting",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_LAYER, layer_ID,
|
||||
GIMP_PDB_INT32, hinting,
|
||||
GIMP_PDB_INT32, autohint,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
|
|
@ -83,13 +83,6 @@ gboolean gimp_text_layer_set_letter_spacing (gint32
|
|||
gboolean gimp_text_layer_resize (gint32 layer_ID,
|
||||
gdouble width,
|
||||
gdouble height);
|
||||
GIMP_DEPRECATED_FOR(gimp_text_layer_get_hint_style)
|
||||
gboolean gimp_text_layer_get_hinting (gint32 layer_ID,
|
||||
gboolean *autohint);
|
||||
GIMP_DEPRECATED_FOR(gimp_text_layer_set_hint_style)
|
||||
gboolean gimp_text_layer_set_hinting (gint32 layer_ID,
|
||||
gboolean hinting,
|
||||
gboolean autohint);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
|
|
@ -168,157 +168,3 @@ gimp_text_get_extents_fontname (const gchar *text,
|
|||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_text:
|
||||
* @image_ID: The image.
|
||||
* @drawable_ID: The affected drawable: (-1 for a new text layer).
|
||||
* @x: The x coordinate for the left of the text bounding box.
|
||||
* @y: The y coordinate for the top of the text bounding box.
|
||||
* @text: The text to generate (in UTF-8 encoding).
|
||||
* @border: The size of the border.
|
||||
* @antialias: Antialiasing.
|
||||
* @size: The size of text in either pixels or points.
|
||||
* @size_type: The units of specified size.
|
||||
* @foundry: The font foundry.
|
||||
* @family: The font family.
|
||||
* @weight: The font weight.
|
||||
* @slant: The font slant.
|
||||
* @set_width: The font set-width.
|
||||
* @spacing: The font spacing.
|
||||
* @registry: The font registry.
|
||||
* @encoding: The font encoding.
|
||||
*
|
||||
* Deprecated: Use gimp_text_fontname() instead.
|
||||
*
|
||||
* Returns: The new text layer or -1 if no layer was created.
|
||||
**/
|
||||
gint32
|
||||
gimp_text (gint32 image_ID,
|
||||
gint32 drawable_ID,
|
||||
gdouble x,
|
||||
gdouble y,
|
||||
const gchar *text,
|
||||
gint border,
|
||||
gboolean antialias,
|
||||
gdouble size,
|
||||
GimpSizeType size_type,
|
||||
const gchar *foundry,
|
||||
const gchar *family,
|
||||
const gchar *weight,
|
||||
const gchar *slant,
|
||||
const gchar *set_width,
|
||||
const gchar *spacing,
|
||||
const gchar *registry,
|
||||
const gchar *encoding)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gint32 text_layer_ID = -1;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-text",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_IMAGE, image_ID,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_FLOAT, x,
|
||||
GIMP_PDB_FLOAT, y,
|
||||
GIMP_PDB_STRING, text,
|
||||
GIMP_PDB_INT32, border,
|
||||
GIMP_PDB_INT32, antialias,
|
||||
GIMP_PDB_FLOAT, size,
|
||||
GIMP_PDB_INT32, size_type,
|
||||
GIMP_PDB_STRING, foundry,
|
||||
GIMP_PDB_STRING, family,
|
||||
GIMP_PDB_STRING, weight,
|
||||
GIMP_PDB_STRING, slant,
|
||||
GIMP_PDB_STRING, set_width,
|
||||
GIMP_PDB_STRING, spacing,
|
||||
GIMP_PDB_STRING, registry,
|
||||
GIMP_PDB_STRING, encoding,
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
text_layer_ID = return_vals[1].data.d_layer;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return text_layer_ID;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_text_get_extents:
|
||||
* @text: The text to generate (in UTF-8 encoding).
|
||||
* @size: The size of text in either pixels or points.
|
||||
* @size_type: The units of specified size.
|
||||
* @foundry: The font foundry.
|
||||
* @family: The font family.
|
||||
* @weight: The font weight.
|
||||
* @slant: The font slant.
|
||||
* @set_width: The font set-width.
|
||||
* @spacing: The font spacing.
|
||||
* @registry: The font registry.
|
||||
* @encoding: The font encoding.
|
||||
* @width: The width of the specified font.
|
||||
* @height: The height of the specified font.
|
||||
* @ascent: The ascent of the specified font.
|
||||
* @descent: The descent of the specified font.
|
||||
*
|
||||
* Deprecated: Use gimp_text_get_extents_fontname() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
**/
|
||||
gboolean
|
||||
gimp_text_get_extents (const gchar *text,
|
||||
gdouble size,
|
||||
GimpSizeType size_type,
|
||||
const gchar *foundry,
|
||||
const gchar *family,
|
||||
const gchar *weight,
|
||||
const gchar *slant,
|
||||
const gchar *set_width,
|
||||
const gchar *spacing,
|
||||
const gchar *registry,
|
||||
const gchar *encoding,
|
||||
gint *width,
|
||||
gint *height,
|
||||
gint *ascent,
|
||||
gint *descent)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-text-get-extents",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_STRING, text,
|
||||
GIMP_PDB_FLOAT, size,
|
||||
GIMP_PDB_INT32, size_type,
|
||||
GIMP_PDB_STRING, foundry,
|
||||
GIMP_PDB_STRING, family,
|
||||
GIMP_PDB_STRING, weight,
|
||||
GIMP_PDB_STRING, slant,
|
||||
GIMP_PDB_STRING, set_width,
|
||||
GIMP_PDB_STRING, spacing,
|
||||
GIMP_PDB_STRING, registry,
|
||||
GIMP_PDB_STRING, encoding,
|
||||
GIMP_PDB_END);
|
||||
|
||||
*width = 0;
|
||||
*height = 0;
|
||||
*ascent = 0;
|
||||
*descent = 0;
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
if (success)
|
||||
{
|
||||
*width = return_vals[1].data.d_int32;
|
||||
*height = return_vals[2].data.d_int32;
|
||||
*ascent = return_vals[3].data.d_int32;
|
||||
*descent = return_vals[4].data.d_int32;
|
||||
}
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
|
|
@ -50,40 +50,6 @@ gboolean gimp_text_get_extents_fontname (const gchar *text,
|
|||
gint *height,
|
||||
gint *ascent,
|
||||
gint *descent);
|
||||
GIMP_DEPRECATED_FOR(gimp_text_fontname)
|
||||
gint32 gimp_text (gint32 image_ID,
|
||||
gint32 drawable_ID,
|
||||
gdouble x,
|
||||
gdouble y,
|
||||
const gchar *text,
|
||||
gint border,
|
||||
gboolean antialias,
|
||||
gdouble size,
|
||||
GimpSizeType size_type,
|
||||
const gchar *foundry,
|
||||
const gchar *family,
|
||||
const gchar *weight,
|
||||
const gchar *slant,
|
||||
const gchar *set_width,
|
||||
const gchar *spacing,
|
||||
const gchar *registry,
|
||||
const gchar *encoding);
|
||||
GIMP_DEPRECATED_FOR(gimp_text_get_extents_fontname)
|
||||
gboolean gimp_text_get_extents (const gchar *text,
|
||||
gdouble size,
|
||||
GimpSizeType size_type,
|
||||
const gchar *foundry,
|
||||
const gchar *family,
|
||||
const gchar *weight,
|
||||
const gchar *slant,
|
||||
const gchar *set_width,
|
||||
const gchar *spacing,
|
||||
const gchar *registry,
|
||||
const gchar *encoding,
|
||||
gint *width,
|
||||
gint *height,
|
||||
gint *ascent,
|
||||
gint *descent);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
|
|
@ -1,287 +0,0 @@
|
|||
/* LIBGIMP - The GIMP Library
|
||||
* Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
|
||||
*
|
||||
* gimptransformtools_pdb.c
|
||||
*
|
||||
* This library is free software: you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see
|
||||
* <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* NOTE: This file is auto-generated by pdbgen.pl */
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "gimp.h"
|
||||
|
||||
|
||||
/**
|
||||
* SECTION: gimptransformtools
|
||||
* @title: gimptransformtools
|
||||
* @short_description: Access to toolbox transform tools.
|
||||
*
|
||||
* Functions giving access to toolbox transform tools.
|
||||
**/
|
||||
|
||||
|
||||
/**
|
||||
* gimp_flip:
|
||||
* @drawable_ID: The affected drawable.
|
||||
* @flip_type: Type of flip.
|
||||
*
|
||||
* Deprecated: Use gimp_item_transform_flip_simple() instead.
|
||||
*
|
||||
* Returns: The flipped drawable.
|
||||
**/
|
||||
gint32
|
||||
gimp_flip (gint32 drawable_ID,
|
||||
GimpOrientationType flip_type)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gint32 ret_drawable_ID = -1;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-flip",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_INT32, flip_type,
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
ret_drawable_ID = return_vals[1].data.d_drawable;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return ret_drawable_ID;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_perspective:
|
||||
* @drawable_ID: The affected drawable.
|
||||
* @interpolation: Whether to use interpolation.
|
||||
* @x0: The new x coordinate of upper-left corner of original bounding box.
|
||||
* @y0: The new y coordinate of upper-left corner of original bounding box.
|
||||
* @x1: The new x coordinate of upper-right corner of original bounding box.
|
||||
* @y1: The new y coordinate of upper-right corner of original bounding box.
|
||||
* @x2: The new x coordinate of lower-left corner of original bounding box.
|
||||
* @y2: The new y coordinate of lower-left corner of original bounding box.
|
||||
* @x3: The new x coordinate of lower-right corner of original bounding box.
|
||||
* @y3: The new y coordinate of lower-right corner of original bounding box.
|
||||
*
|
||||
* Deprecated: Use gimp_item_transform_perspective() instead.
|
||||
*
|
||||
* Returns: The newly mapped drawable.
|
||||
**/
|
||||
gint32
|
||||
gimp_perspective (gint32 drawable_ID,
|
||||
gboolean interpolation,
|
||||
gdouble x0,
|
||||
gdouble y0,
|
||||
gdouble x1,
|
||||
gdouble y1,
|
||||
gdouble x2,
|
||||
gdouble y2,
|
||||
gdouble x3,
|
||||
gdouble y3)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gint32 ret_drawable_ID = -1;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-perspective",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_INT32, interpolation,
|
||||
GIMP_PDB_FLOAT, x0,
|
||||
GIMP_PDB_FLOAT, y0,
|
||||
GIMP_PDB_FLOAT, x1,
|
||||
GIMP_PDB_FLOAT, y1,
|
||||
GIMP_PDB_FLOAT, x2,
|
||||
GIMP_PDB_FLOAT, y2,
|
||||
GIMP_PDB_FLOAT, x3,
|
||||
GIMP_PDB_FLOAT, y3,
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
ret_drawable_ID = return_vals[1].data.d_drawable;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return ret_drawable_ID;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_rotate:
|
||||
* @drawable_ID: The affected drawable.
|
||||
* @interpolation: Whether to use interpolation.
|
||||
* @angle: The angle of rotation (radians).
|
||||
*
|
||||
* Deprecated: Use gimp_item_transform_rotate() instead.
|
||||
*
|
||||
* Returns: The rotated drawable.
|
||||
**/
|
||||
gint32
|
||||
gimp_rotate (gint32 drawable_ID,
|
||||
gboolean interpolation,
|
||||
gdouble angle)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gint32 ret_drawable_ID = -1;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-rotate",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_INT32, interpolation,
|
||||
GIMP_PDB_FLOAT, angle,
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
ret_drawable_ID = return_vals[1].data.d_drawable;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return ret_drawable_ID;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_scale:
|
||||
* @drawable_ID: The affected drawable.
|
||||
* @interpolation: Whether to use interpolation.
|
||||
* @x0: The new x coordinate of the upper-left corner of the scaled region.
|
||||
* @y0: The new y coordinate of the upper-left corner of the scaled region.
|
||||
* @x1: The new x coordinate of the lower-right corner of the scaled region.
|
||||
* @y1: The new y coordinate of the lower-right corner of the scaled region.
|
||||
*
|
||||
* Deprecated: Use gimp_item_transform_scale() instead.
|
||||
*
|
||||
* Returns: The scaled drawable.
|
||||
**/
|
||||
gint32
|
||||
gimp_scale (gint32 drawable_ID,
|
||||
gboolean interpolation,
|
||||
gdouble x0,
|
||||
gdouble y0,
|
||||
gdouble x1,
|
||||
gdouble y1)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gint32 ret_drawable_ID = -1;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-scale",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_INT32, interpolation,
|
||||
GIMP_PDB_FLOAT, x0,
|
||||
GIMP_PDB_FLOAT, y0,
|
||||
GIMP_PDB_FLOAT, x1,
|
||||
GIMP_PDB_FLOAT, y1,
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
ret_drawable_ID = return_vals[1].data.d_drawable;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return ret_drawable_ID;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_shear:
|
||||
* @drawable_ID: The affected drawable.
|
||||
* @interpolation: Whether to use interpolation.
|
||||
* @shear_type: Type of shear.
|
||||
* @magnitude: The magnitude of the shear.
|
||||
*
|
||||
* Deprecated: Use gimp_item_transform_shear() instead.
|
||||
*
|
||||
* Returns: The sheared drawable.
|
||||
**/
|
||||
gint32
|
||||
gimp_shear (gint32 drawable_ID,
|
||||
gboolean interpolation,
|
||||
GimpOrientationType shear_type,
|
||||
gdouble magnitude)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gint32 ret_drawable_ID = -1;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-shear",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_INT32, interpolation,
|
||||
GIMP_PDB_INT32, shear_type,
|
||||
GIMP_PDB_FLOAT, magnitude,
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
ret_drawable_ID = return_vals[1].data.d_drawable;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return ret_drawable_ID;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_transform_2d:
|
||||
* @drawable_ID: The affected drawable.
|
||||
* @interpolation: Whether to use interpolation.
|
||||
* @source_x: X coordinate of the transformation center.
|
||||
* @source_y: Y coordinate of the transformation center.
|
||||
* @scale_x: Amount to scale in x direction.
|
||||
* @scale_y: Amount to scale in y direction.
|
||||
* @angle: The angle of rotation (radians).
|
||||
* @dest_x: X coordinate of where the centre goes.
|
||||
* @dest_y: Y coordinate of where the centre goes.
|
||||
*
|
||||
* Deprecated: Use gimp_item_transform_2d() instead.
|
||||
*
|
||||
* Returns: The transformed drawable.
|
||||
**/
|
||||
gint32
|
||||
gimp_transform_2d (gint32 drawable_ID,
|
||||
gboolean interpolation,
|
||||
gdouble source_x,
|
||||
gdouble source_y,
|
||||
gdouble scale_x,
|
||||
gdouble scale_y,
|
||||
gdouble angle,
|
||||
gdouble dest_x,
|
||||
gdouble dest_y)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gint32 ret_drawable_ID = -1;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-transform-2d",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_DRAWABLE, drawable_ID,
|
||||
GIMP_PDB_INT32, interpolation,
|
||||
GIMP_PDB_FLOAT, source_x,
|
||||
GIMP_PDB_FLOAT, source_y,
|
||||
GIMP_PDB_FLOAT, scale_x,
|
||||
GIMP_PDB_FLOAT, scale_y,
|
||||
GIMP_PDB_FLOAT, angle,
|
||||
GIMP_PDB_FLOAT, dest_x,
|
||||
GIMP_PDB_FLOAT, dest_y,
|
||||
GIMP_PDB_END);
|
||||
|
||||
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
||||
ret_drawable_ID = return_vals[1].data.d_drawable;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return ret_drawable_ID;
|
||||
}
|
|
@ -1,79 +0,0 @@
|
|||
/* LIBGIMP - The GIMP Library
|
||||
* Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
|
||||
*
|
||||
* gimptransformtools_pdb.h
|
||||
*
|
||||
* This library is free software: you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see
|
||||
* <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* NOTE: This file is auto-generated by pdbgen.pl */
|
||||
|
||||
#if !defined (__GIMP_H_INSIDE__) && !defined (GIMP_COMPILATION)
|
||||
#error "Only <libgimp/gimp.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#ifndef __GIMP_TRANSFORM_TOOLS_PDB_H__
|
||||
#define __GIMP_TRANSFORM_TOOLS_PDB_H__
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/* For information look into the C source or the html documentation */
|
||||
|
||||
|
||||
GIMP_DEPRECATED_FOR(gimp_item_transform_flip_simple)
|
||||
gint32 gimp_flip (gint32 drawable_ID,
|
||||
GimpOrientationType flip_type);
|
||||
GIMP_DEPRECATED_FOR(gimp_item_transform_perspective)
|
||||
gint32 gimp_perspective (gint32 drawable_ID,
|
||||
gboolean interpolation,
|
||||
gdouble x0,
|
||||
gdouble y0,
|
||||
gdouble x1,
|
||||
gdouble y1,
|
||||
gdouble x2,
|
||||
gdouble y2,
|
||||
gdouble x3,
|
||||
gdouble y3);
|
||||
GIMP_DEPRECATED_FOR(gimp_item_transform_rotate)
|
||||
gint32 gimp_rotate (gint32 drawable_ID,
|
||||
gboolean interpolation,
|
||||
gdouble angle);
|
||||
GIMP_DEPRECATED_FOR(gimp_item_transform_scale)
|
||||
gint32 gimp_scale (gint32 drawable_ID,
|
||||
gboolean interpolation,
|
||||
gdouble x0,
|
||||
gdouble y0,
|
||||
gdouble x1,
|
||||
gdouble y1);
|
||||
GIMP_DEPRECATED_FOR(gimp_item_transform_shear)
|
||||
gint32 gimp_shear (gint32 drawable_ID,
|
||||
gboolean interpolation,
|
||||
GimpOrientationType shear_type,
|
||||
gdouble magnitude);
|
||||
GIMP_DEPRECATED_FOR(gimp_item_transform_2d)
|
||||
gint32 gimp_transform_2d (gint32 drawable_ID,
|
||||
gboolean interpolation,
|
||||
gdouble source_x,
|
||||
gdouble source_y,
|
||||
gdouble scale_x,
|
||||
gdouble scale_y,
|
||||
gdouble angle,
|
||||
gdouble dest_x,
|
||||
gdouble dest_y);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GIMP_TRANSFORM_TOOLS_PDB_H__ */
|
|
@ -950,50 +950,6 @@ gimp_vectors_bezier_stroke_new_ellipse (gint32 vectors_ID,
|
|||
return stroke_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_vectors_to_selection:
|
||||
* @vectors_ID: The vectors object to render to the selection.
|
||||
* @operation: The desired operation with current selection.
|
||||
* @antialias: Antialias selection.
|
||||
* @feather: Feather selection.
|
||||
* @feather_radius_x: Feather radius x.
|
||||
* @feather_radius_y: Feather radius y.
|
||||
*
|
||||
* Deprecated: Use gimp_image_select_item() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
*
|
||||
* Since: 2.4
|
||||
**/
|
||||
gboolean
|
||||
gimp_vectors_to_selection (gint32 vectors_ID,
|
||||
GimpChannelOps operation,
|
||||
gboolean antialias,
|
||||
gboolean feather,
|
||||
gdouble feather_radius_x,
|
||||
gdouble feather_radius_y)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-vectors-to-selection",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_VECTORS, vectors_ID,
|
||||
GIMP_PDB_INT32, operation,
|
||||
GIMP_PDB_INT32, antialias,
|
||||
GIMP_PDB_INT32, feather,
|
||||
GIMP_PDB_FLOAT, feather_radius_x,
|
||||
GIMP_PDB_FLOAT, feather_radius_y,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_vectors_import_from_file:
|
||||
* @image_ID: The image.
|
||||
|
|
|
@ -119,13 +119,6 @@ gint gimp_vectors_bezier_stroke_new_ellipse (gint32
|
|||
gdouble radius_x,
|
||||
gdouble radius_y,
|
||||
gdouble angle);
|
||||
GIMP_DEPRECATED_FOR(gimp_image_select_item)
|
||||
gboolean gimp_vectors_to_selection (gint32 vectors_ID,
|
||||
GimpChannelOps operation,
|
||||
gboolean antialias,
|
||||
gboolean feather,
|
||||
gdouble feather_radius_x,
|
||||
gdouble feather_radius_y);
|
||||
gboolean gimp_vectors_import_from_file (gint32 image_ID,
|
||||
const gchar *filename,
|
||||
gboolean merge,
|
||||
|
|
|
@ -7,14 +7,12 @@ pdb_groups = \
|
|||
groups/brushes.pdb \
|
||||
groups/buffer.pdb \
|
||||
groups/channel.pdb \
|
||||
groups/color.pdb \
|
||||
groups/context.pdb \
|
||||
groups/debug.pdb \
|
||||
groups/display.pdb \
|
||||
groups/drawable.pdb \
|
||||
groups/drawable_color.pdb \
|
||||
groups/drawable_edit.pdb \
|
||||
groups/drawable_transform.pdb \
|
||||
groups/dynamics.pdb \
|
||||
groups/edit.pdb \
|
||||
groups/fileops.pdb \
|
||||
|
@ -44,7 +42,6 @@ pdb_groups = \
|
|||
groups/palette.pdb \
|
||||
groups/palette_select.pdb \
|
||||
groups/palettes.pdb \
|
||||
groups/paths.pdb \
|
||||
groups/pattern.pdb \
|
||||
groups/pattern_select.pdb \
|
||||
groups/patterns.pdb \
|
||||
|
@ -53,10 +50,8 @@ pdb_groups = \
|
|||
groups/procedural_db.pdb \
|
||||
groups/progress.pdb \
|
||||
groups/selection.pdb \
|
||||
groups/selection_tools.pdb \
|
||||
groups/text_layer.pdb \
|
||||
groups/text_tool.pdb \
|
||||
groups/transform_tools.pdb \
|
||||
groups/unit.pdb \
|
||||
groups/vectors.pdb
|
||||
|
||||
|
|
|
@ -5,14 +5,12 @@
|
|||
brushes
|
||||
buffer
|
||||
channel
|
||||
color
|
||||
context
|
||||
debug
|
||||
display
|
||||
drawable
|
||||
drawable_color
|
||||
drawable_edit
|
||||
drawable_transform
|
||||
dynamics
|
||||
edit
|
||||
fileops
|
||||
|
@ -42,7 +40,6 @@
|
|||
palette
|
||||
palette_select
|
||||
palettes
|
||||
paths
|
||||
pattern
|
||||
pattern_select
|
||||
patterns
|
||||
|
@ -51,10 +48,8 @@
|
|||
procedural_db
|
||||
progress
|
||||
selection
|
||||
selection_tools
|
||||
text_layer
|
||||
text_tool
|
||||
transform_tools
|
||||
unit
|
||||
vectors
|
||||
);
|
||||
|
|
|
@ -69,140 +69,6 @@ CODE
|
|||
);
|
||||
}
|
||||
|
||||
sub brushes_get_brush {
|
||||
&std_pdb_deprecated ('gimp-context-get-brush');
|
||||
|
||||
@outargs = (
|
||||
{ name => 'name', type => 'string',
|
||||
desc => 'The brush name' },
|
||||
{ name => 'width', type => 'int32',
|
||||
desc => 'The brush width' },
|
||||
{ name => 'height', type => 'int32',
|
||||
desc => 'The brush height' },
|
||||
{ name => 'spacing', type => '0 <= int32 <= 1000',
|
||||
desc => 'The brush spacing' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
GimpBrush *brush = gimp_context_get_brush (context);
|
||||
|
||||
if (brush)
|
||||
{
|
||||
name = g_strdup (gimp_object_get_name (brush));
|
||||
width = gimp_brush_get_width (brush);
|
||||
height = gimp_brush_get_height (brush);
|
||||
spacing = gimp_brush_get_spacing (brush);
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub brushes_get_spacing {
|
||||
&std_pdb_deprecated ('gimp-brush-get-spacing');
|
||||
|
||||
@outargs = (
|
||||
{ name => 'spacing', type => '0 <= int32 <= 1000',
|
||||
desc => 'The brush spacing' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code =><<'CODE'
|
||||
{
|
||||
GimpBrush *brush = gimp_context_get_brush (context);
|
||||
|
||||
if (brush)
|
||||
spacing = gimp_brush_get_spacing (brush);
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub brushes_set_spacing {
|
||||
&std_pdb_deprecated ('gimp-brush-set-spacing');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'spacing', type => '0 <= int32 <= 1000',
|
||||
desc => 'The brush spacing' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
gimp_brush_set_spacing (gimp_context_get_brush (context), spacing);
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub brushes_get_brush_data {
|
||||
&std_pdb_deprecated ('gimp-brush-get-pixels');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'name', type => 'string', null_ok => 1,
|
||||
desc => 'The brush name ("" means current active brush)' }
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
{ name => 'actual_name', type => 'string',
|
||||
desc => 'The brush name' },
|
||||
{ name => 'opacity', type => '0 <= float <= 100',
|
||||
desc => 'The brush opacity' },
|
||||
{ name => 'spacing', type => '0 <= int32 <= 1000',
|
||||
desc => 'The brush spacing' },
|
||||
{ name => 'paint_mode', type => 'enum GimpLayerMode',
|
||||
default => 'GIMP_LAYER_MODE_NORMAL',
|
||||
desc => 'The paint mode' },
|
||||
{ name => 'width', type => 'int32',
|
||||
desc => 'The brush width' },
|
||||
{ name => 'height', type => 'int32',
|
||||
desc => 'The brush height' },
|
||||
{ name => 'mask_data', type => 'int8array',
|
||||
desc => 'The brush mask data',
|
||||
array => { name => 'length',
|
||||
desc => 'Length of brush mask data' } }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
GimpBrush *brush;
|
||||
|
||||
if (paint_mode == GIMP_LAYER_MODE_OVERLAY_LEGACY)
|
||||
paint_mode = GIMP_LAYER_MODE_SOFTLIGHT_LEGACY;
|
||||
|
||||
if (name && strlen (name))
|
||||
brush = gimp_pdb_get_brush (gimp, name, FALSE, error);
|
||||
else
|
||||
brush = gimp_context_get_brush (context);
|
||||
|
||||
if (brush)
|
||||
{
|
||||
GimpTempBuf *mask = gimp_brush_get_mask (brush);
|
||||
|
||||
actual_name = g_strdup (gimp_object_get_name (brush));
|
||||
opacity = 1.0;
|
||||
spacing = gimp_brush_get_spacing (brush);
|
||||
paint_mode = 0;
|
||||
width = gimp_brush_get_width (brush);
|
||||
height = gimp_brush_get_height (brush);
|
||||
length = gimp_temp_buf_get_data_size (mask);
|
||||
mask_data = g_memdup (gimp_temp_buf_get_data (mask), length);
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@headers = qw(<string.h>
|
||||
"core/gimp.h"
|
||||
"core/gimpbrush.h"
|
||||
|
@ -212,10 +78,7 @@ CODE
|
|||
"gimppdb-utils.h");
|
||||
|
||||
@procs = qw(brushes_refresh
|
||||
brushes_get_list
|
||||
brushes_get_brush
|
||||
brushes_get_spacing brushes_set_spacing
|
||||
brushes_get_brush_data);
|
||||
brushes_get_list);
|
||||
|
||||
%exports = (app => [@procs], lib => [@procs]);
|
||||
|
||||
|
|
|
@ -1,762 +0,0 @@
|
|||
# GIMP - The GNU Image Manipulation Program
|
||||
# Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (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
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# "Perlized" from C source by Manish Singh <yosh@gimp.org>
|
||||
|
||||
sub brightness_contrast {
|
||||
&std_pdb_deprecated ('gimp-drawable-brightness-contrast');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The drawable' },
|
||||
{ name => 'brightness', type => '-127 <= int32 <= 127',
|
||||
desc => 'Brightness adjustment' },
|
||||
{ name => 'contrast', type => '-127 <= int32 <= 127',
|
||||
desc => 'Contrast adjustment' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
headers => [ qw("operations/gimpbrightnesscontrastconfig.h") ],
|
||||
code => <<'CODE'
|
||||
{
|
||||
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
|
||||
GIMP_PDB_ITEM_CONTENT, error) &&
|
||||
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
|
||||
{
|
||||
GObject *config = g_object_new (GIMP_TYPE_BRIGHTNESS_CONTRAST_CONFIG,
|
||||
"brightness", brightness / 127.0,
|
||||
"contrast", contrast / 127.0,
|
||||
NULL);
|
||||
|
||||
gimp_drawable_apply_operation_by_name (drawable, progress,
|
||||
C_("undo-type", "Brightness-Contrast"),
|
||||
"gimp:brightness-contrast",
|
||||
config);
|
||||
g_object_unref (config);
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub levels {
|
||||
&std_pdb_deprecated ('gimp-drawable-levels');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The drawable' },
|
||||
{ name => 'channel', type => 'enum GimpHistogramChannel',
|
||||
desc => 'The channel to modify' },
|
||||
{ name => 'low_input', type => '0 <= int32 <= 255',
|
||||
desc => "Intensity of lowest input" },
|
||||
{ name => 'high_input', type => '0 <= int32 <= 255',
|
||||
desc => "Intensity of highest input" },
|
||||
{ name => 'gamma', type => '0.1 <= float <= 10',
|
||||
desc => 'Gamma adjustment factor' },
|
||||
{ name => 'low_output', type => '0 <= int32 <= 255',
|
||||
desc => "Intensity of lowest output" },
|
||||
{ name => 'high_output', type => '0 <= int32 <= 255',
|
||||
desc => "Intensity of highest output" }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
headers => [ qw("operations/gimplevelsconfig.h") ],
|
||||
code => <<'CODE'
|
||||
{
|
||||
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
|
||||
GIMP_PDB_ITEM_CONTENT, error) &&
|
||||
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) &&
|
||||
channel != GIMP_HISTOGRAM_LUMINANCE &&
|
||||
(gimp_drawable_has_alpha (drawable) || channel != GIMP_HISTOGRAM_ALPHA) &&
|
||||
(! gimp_drawable_is_gray (drawable) ||
|
||||
channel == GIMP_HISTOGRAM_VALUE || channel == GIMP_HISTOGRAM_ALPHA))
|
||||
{
|
||||
GObject *config = g_object_new (GIMP_TYPE_LEVELS_CONFIG,
|
||||
"channel", channel,
|
||||
NULL);
|
||||
|
||||
g_object_set (config,
|
||||
"low-input", low_input / 255.0,
|
||||
"high-input", high_input / 255.0,
|
||||
"clamp-input", TRUE,
|
||||
"gamma", gamma,
|
||||
"low-output", low_output / 255.0,
|
||||
"high-output", high_output / 255.0,
|
||||
"clamp-input", TRUE,
|
||||
NULL);
|
||||
|
||||
gimp_drawable_apply_operation_by_name (drawable, progress,
|
||||
C_("undo-type", "Levels"),
|
||||
"gimp:levels",
|
||||
config);
|
||||
g_object_unref (config);
|
||||
}
|
||||
else
|
||||
success = TRUE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub levels_stretch {
|
||||
&std_pdb_deprecated ('gimp-drawable-levels-stretch');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The drawable' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
headers => [ qw("core/gimpdrawable-levels.h") ],
|
||||
code => <<'CODE'
|
||||
{
|
||||
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
|
||||
GIMP_PDB_ITEM_CONTENT, error) &&
|
||||
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
|
||||
{
|
||||
gimp_drawable_levels_stretch (drawable, progress);
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub levels_auto {
|
||||
&std_pdb_deprecated ('gimp-drawable-levels-stretch');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The drawable' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
headers => [ qw("core/gimpdrawable-levels.h") ],
|
||||
code => <<'CODE'
|
||||
{
|
||||
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
|
||||
GIMP_PDB_ITEM_CONTENT, error) &&
|
||||
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
|
||||
{
|
||||
gimp_drawable_levels_stretch (drawable, progress);
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub posterize {
|
||||
&std_pdb_deprecated ('gimp-drawable-posterize');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The drawable' },
|
||||
{ name => 'levels', type => '2 <= int32 <= 255',
|
||||
desc => 'Levels of posterization' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
|
||||
GIMP_PDB_ITEM_CONTENT, error) &&
|
||||
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
|
||||
{
|
||||
GeglNode *node =
|
||||
gegl_node_new_child (NULL,
|
||||
"operation", "gimp:posterize",
|
||||
"levels", levels,
|
||||
NULL);
|
||||
|
||||
gimp_drawable_apply_operation (drawable, progress,
|
||||
C_("undo-type", "Posterize"),
|
||||
node);
|
||||
g_object_unref (node);
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub desaturate {
|
||||
&std_pdb_deprecated ('gimp-drawable-desaturate');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The drawable' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
|
||||
GIMP_PDB_ITEM_CONTENT, error) &&
|
||||
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) &&
|
||||
gimp_drawable_is_rgb (drawable))
|
||||
{
|
||||
GeglNode *node =
|
||||
gegl_node_new_child (NULL,
|
||||
"operation", "gimp:desaturate",
|
||||
"mode", GIMP_DESATURATE_LIGHTNESS,
|
||||
NULL);
|
||||
|
||||
gimp_drawable_apply_operation (drawable, progress,
|
||||
C_("undo-type", "Desaturate"),
|
||||
node);
|
||||
g_object_unref (node);
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub desaturate_full {
|
||||
&std_pdb_deprecated ('gimp-drawable-desaturate');
|
||||
$since = '2.4';
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The drawable' },
|
||||
{ name => 'desaturate_mode', type => 'enum GimpDesaturateMode',
|
||||
desc => 'The formula to use to desaturate' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
|
||||
GIMP_PDB_ITEM_CONTENT, error) &&
|
||||
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) &&
|
||||
gimp_drawable_is_rgb (drawable))
|
||||
{
|
||||
GeglNode *node =
|
||||
gegl_node_new_child (NULL,
|
||||
"operation", "gimp:desaturate",
|
||||
"mode", desaturate_mode,
|
||||
NULL);
|
||||
|
||||
gimp_drawable_apply_operation (drawable, progress,
|
||||
C_("undo-type", "Desaturate"),
|
||||
node);
|
||||
g_object_unref (node);
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub equalize {
|
||||
&std_pdb_deprecated ('gimp-drawable-equalize');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The drawable' },
|
||||
{ name => 'mask_only', type => 'boolean',
|
||||
desc => 'Equalization option' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
headers => [ qw("core/gimpdrawable-equalize.h") ],
|
||||
code => <<'CODE'
|
||||
{
|
||||
if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
|
||||
GIMP_PDB_ITEM_CONTENT, error) ||
|
||||
! gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
|
||||
success = FALSE;
|
||||
|
||||
if (success)
|
||||
gimp_drawable_equalize (drawable, mask_only);
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub invert {
|
||||
&std_pdb_deprecated ('gimp-drawable-invert');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The drawable' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
|
||||
GIMP_PDB_ITEM_CONTENT, error) &&
|
||||
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
|
||||
{
|
||||
gimp_drawable_apply_operation_by_name (drawable, progress,
|
||||
_("Invert"),
|
||||
"gegl:invert-gamma",
|
||||
NULL);
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub curves_spline {
|
||||
&std_pdb_deprecated ('gimp-drawable-curves-spline');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The drawable' },
|
||||
{ name => 'channel', type => 'enum GimpHistogramChannel',
|
||||
desc => 'The channel to modify' },
|
||||
{ name => 'control_pts', type => 'int8array',
|
||||
desc => 'The spline control points: { cp1.x, cp1.y, cp2.x, cp2.y,
|
||||
... }',
|
||||
array => { name => 'num_points', type => '4 <= int32 <= 34',
|
||||
desc => 'The number of values in the control point array' }
|
||||
}
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
headers => [ qw("operations/gimpcurvesconfig.h") ],
|
||||
code => <<'CODE'
|
||||
{
|
||||
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
|
||||
GIMP_PDB_ITEM_CONTENT, error) &&
|
||||
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) &&
|
||||
! (num_points & 1) &&
|
||||
(gimp_drawable_has_alpha (drawable) || channel != GIMP_HISTOGRAM_ALPHA) &&
|
||||
(! gimp_drawable_is_gray (drawable) ||
|
||||
channel == GIMP_HISTOGRAM_VALUE || channel == GIMP_HISTOGRAM_ALPHA) &&
|
||||
channel != GIMP_HISTOGRAM_LUMINANCE)
|
||||
{
|
||||
GObject *config = gimp_curves_config_new_spline_cruft (channel,
|
||||
control_pts,
|
||||
num_points / 2);
|
||||
|
||||
gimp_drawable_apply_operation_by_name (drawable, progress,
|
||||
C_("undo-type", "Curves"),
|
||||
"gimp:curves",
|
||||
config);
|
||||
g_object_unref (config);
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub curves_explicit {
|
||||
&std_pdb_deprecated ('gimp-drawable-curves-explicit');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The drawable' },
|
||||
{ name => 'channel', type => 'enum GimpHistogramChannel',
|
||||
desc => 'The channel to modify' },
|
||||
{ name => 'curve', type => 'int8array',
|
||||
desc => 'The explicit curve',
|
||||
array => { name => 'num_bytes',
|
||||
desc => 'The number of bytes in the new curve (always
|
||||
256)' } }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
headers => [ qw("operations/gimpcurvesconfig.h") ],
|
||||
code => <<'CODE'
|
||||
{
|
||||
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
|
||||
GIMP_PDB_ITEM_CONTENT, error) &&
|
||||
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) &&
|
||||
(num_bytes == 256) &&
|
||||
(gimp_drawable_has_alpha (drawable) || channel != GIMP_HISTOGRAM_ALPHA) &&
|
||||
(! gimp_drawable_is_gray (drawable) ||
|
||||
channel == GIMP_HISTOGRAM_VALUE || channel == GIMP_HISTOGRAM_ALPHA) &&
|
||||
channel != GIMP_HISTOGRAM_LUMINANCE)
|
||||
{
|
||||
GObject *config = gimp_curves_config_new_explicit_cruft (channel,
|
||||
curve,
|
||||
num_bytes);
|
||||
|
||||
gimp_drawable_apply_operation_by_name (drawable, progress,
|
||||
C_("undo-type", "Curves"),
|
||||
"gimp:curves",
|
||||
config);
|
||||
g_object_unref (config);
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub color_balance {
|
||||
$blurb = 'Modify the color balance of the specified drawable.';
|
||||
|
||||
$help = <<'HELP';
|
||||
Modify the color balance of the specified drawable. There are three axis which
|
||||
can be modified: cyan-red, magenta-green, and yellow-blue. Negative values
|
||||
increase the amount of the former, positive values increase the amount of the
|
||||
latter. Color balance can be controlled with the 'transfer_mode' setting, which
|
||||
allows shadows, mid-tones, and highlights in an image to be affected
|
||||
differently. The 'preserve-lum' parameter, if TRUE, ensures that the
|
||||
luminosity of each pixel remains fixed.
|
||||
HELP
|
||||
|
||||
&std_pdb_misc;
|
||||
$date = '1997';
|
||||
$deprecated = 'gimp-drawable-color-color-balance';
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The drawable' },
|
||||
{ name => 'transfer_mode', type => 'enum GimpTransferMode',
|
||||
desc => 'Transfer mode' },
|
||||
{ name => 'preserve_lum', type => 'boolean',
|
||||
desc => 'Preserve luminosity values at each pixel' },
|
||||
{ name => 'cyan_red', type => '-100 <= float <= 100',
|
||||
desc => 'Cyan-Red color balance' },
|
||||
{ name => 'magenta_green', type => '-100 <= float <= 100',
|
||||
desc => 'Magenta-Green color balance' },
|
||||
{ name => 'yellow_blue', type => '-100 <= float <= 100',
|
||||
desc => 'Yellow-Blue color balance' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
headers => [ qw("operations/gimpcolorbalanceconfig.h") ],
|
||||
code => <<'CODE'
|
||||
{
|
||||
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
|
||||
GIMP_PDB_ITEM_CONTENT, error) &&
|
||||
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
|
||||
{
|
||||
GObject *config = g_object_new (GIMP_TYPE_COLOR_BALANCE_CONFIG,
|
||||
"range", transfer_mode,
|
||||
"preserve-luminosity", preserve_lum,
|
||||
NULL);
|
||||
|
||||
g_object_set (config,
|
||||
"cyan-red", cyan_red / 100.0,
|
||||
"magenta-green", magenta_green / 100.0,
|
||||
"yellow-blue", yellow_blue / 100.0,
|
||||
NULL);
|
||||
|
||||
gimp_drawable_apply_operation_by_name (drawable, progress,
|
||||
C_("undo-type", "Color Balance"),
|
||||
"gimp:color-balance",
|
||||
config);
|
||||
g_object_unref (config);
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub colorize {
|
||||
&std_pdb_deprecated ('gimp-drawable-colorize-hsl');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The drawable' },
|
||||
{ name => 'hue', type => '0 <= float <= 360',
|
||||
desc => 'Hue in degrees' },
|
||||
{ name => 'saturation', type => '0 <= float <= 100',
|
||||
desc => 'Saturation in percent' },
|
||||
{ name => 'lightness', type => '-100 <= float <= 100',
|
||||
desc => 'Lightness in percent' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
|
||||
GIMP_PDB_ITEM_CONTENT, error) &&
|
||||
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) &&
|
||||
! gimp_drawable_is_gray (drawable))
|
||||
{
|
||||
GeglNode *node =
|
||||
gegl_node_new_child (NULL,
|
||||
"operation", "gimp:colorize",
|
||||
"hue", hue / 360.0,
|
||||
"saturation", saturation / 100.0,
|
||||
"lightness", lightness / 100.0,
|
||||
NULL);
|
||||
|
||||
gimp_drawable_apply_operation (drawable, progress,
|
||||
C_("undo-type", "Colorize"),
|
||||
node);
|
||||
g_object_unref (node);
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub histogram {
|
||||
$blurb = <<'BLURB';
|
||||
Returns information on the intensity histogram for the specified drawable.
|
||||
BLURB
|
||||
|
||||
$help = <<'HELP';
|
||||
This tool makes it possible to gather information about the intensity
|
||||
histogram of a drawable. A channel to examine is first specified. This
|
||||
can be either value, red, green, or blue, depending on whether the
|
||||
drawable is of type color or grayscale. Second, a range of intensities
|
||||
are specified. The gimp_histogram() function returns statistics based
|
||||
on the pixels in the drawable that fall under this range of
|
||||
values. Mean, standard deviation, median, number of pixels, and
|
||||
percentile are all returned. Additionally, the total count of pixels
|
||||
in the image is returned. Counts of pixels are weighted by any
|
||||
associated alpha values and by the current selection mask. That is,
|
||||
pixels that lie outside an active selection mask will not be
|
||||
counted. Similarly, pixels with transparent alpha values will not be
|
||||
counted. The returned mean, std_dev and median are in the range (0..255)
|
||||
for 8-bit images, or if the plug-in is not precision-aware, and in the
|
||||
range (0.0..1.0) otherwise.
|
||||
HELP
|
||||
|
||||
&std_pdb_deprecated ('gimp-drawable-histogram');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The drawable' },
|
||||
{ name => 'channel', type => 'enum GimpHistogramChannel',
|
||||
desc => 'The channel to modify' },
|
||||
{ name => 'start_range', type => '0 <= int32 < 256',
|
||||
desc => 'Start of the intensity measurement range' },
|
||||
{ name => 'end_range', type => '0 <= int32 < 256',
|
||||
desc => 'End of the intensity measurement range' }
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
{ name => 'mean', type => 'float', void_ret => 1,
|
||||
desc => 'Mean intensity value' },
|
||||
{ name => 'std_dev', type => 'float',
|
||||
desc => 'Standard deviation of intensity values' },
|
||||
{ name => 'median', type => 'float',
|
||||
desc => 'Median intensity value' },
|
||||
{ name => 'pixels', type => 'float',
|
||||
desc => 'Alpha-weighted pixel count for entire image' },
|
||||
{ name => 'count', type => 'float',
|
||||
desc => 'Alpha-weighted pixel count for range' },
|
||||
{ name => 'percentile', type => 'float',
|
||||
desc => 'Percentile that range falls under' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
headers => [ qw("core/gimpdrawable-histogram.h"
|
||||
"core/gimphistogram.h") ],
|
||||
code => <<'CODE'
|
||||
{
|
||||
if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, 0, error) ||
|
||||
(! gimp_drawable_has_alpha (drawable) &&
|
||||
channel == GIMP_HISTOGRAM_ALPHA) ||
|
||||
(gimp_drawable_is_gray (drawable) &&
|
||||
channel != GIMP_HISTOGRAM_VALUE && channel != GIMP_HISTOGRAM_ALPHA))
|
||||
success = FALSE;
|
||||
|
||||
if (success)
|
||||
{
|
||||
GimpHistogram *histogram;
|
||||
gint start = start_range;
|
||||
gint end = end_range;
|
||||
gboolean precision_enabled;
|
||||
gboolean linear;
|
||||
gint n_bins;
|
||||
|
||||
precision_enabled =
|
||||
gimp->plug_in_manager->current_plug_in &&
|
||||
gimp_plug_in_precision_enabled (gimp->plug_in_manager->current_plug_in);
|
||||
|
||||
if (precision_enabled)
|
||||
linear = gimp_drawable_get_linear (drawable);
|
||||
else
|
||||
linear = FALSE;
|
||||
|
||||
histogram = gimp_histogram_new (linear);
|
||||
gimp_drawable_calculate_histogram (drawable, histogram, FALSE);
|
||||
|
||||
n_bins = gimp_histogram_n_bins (histogram);
|
||||
|
||||
if (n_bins != 256)
|
||||
{
|
||||
start = ROUND ((gdouble) start * (n_bins - 1) / 255);
|
||||
end = ROUND ((gdouble) end * (n_bins - 1) / 255);
|
||||
}
|
||||
|
||||
mean = gimp_histogram_get_mean (histogram, channel,
|
||||
start, end);
|
||||
std_dev = gimp_histogram_get_std_dev (histogram, channel,
|
||||
start, end);
|
||||
median = gimp_histogram_get_median (histogram, channel,
|
||||
start, end);
|
||||
pixels = gimp_histogram_get_count (histogram, channel, 0, n_bins - 1);
|
||||
count = gimp_histogram_get_count (histogram, channel,
|
||||
start, end);
|
||||
percentile = count / pixels;
|
||||
|
||||
g_object_unref (histogram);
|
||||
|
||||
if (n_bins == 256 || ! precision_enabled)
|
||||
{
|
||||
mean *= 255;
|
||||
std_dev *= 255;
|
||||
median *= 255;
|
||||
}
|
||||
}
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub hue_saturation {
|
||||
&std_pdb_deprecated ('gimp-drawable-hue-saturation');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The drawable' },
|
||||
{ name => 'hue_range', type => 'enum GimpHueRange',
|
||||
desc => 'Range of affected hues' },
|
||||
{ name => 'hue_offset', type => '-180 <= float <= 180',
|
||||
desc => 'Hue offset in degrees' },
|
||||
{ name => 'lightness', type => '-100 <= float <= 100',
|
||||
desc => 'Lightness modification' },
|
||||
{ name => 'saturation', type => '-100 <= float <= 100',
|
||||
desc => 'Saturation modification' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
headers => [ qw("operations/gimphuesaturationconfig.h") ],
|
||||
code => <<'CODE'
|
||||
{
|
||||
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
|
||||
GIMP_PDB_ITEM_CONTENT, error) &&
|
||||
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
|
||||
{
|
||||
GObject *config = g_object_new (GIMP_TYPE_HUE_SATURATION_CONFIG,
|
||||
"range", hue_range,
|
||||
NULL);
|
||||
|
||||
g_object_set (config,
|
||||
"hue", hue_offset / 180.0,
|
||||
"saturation", saturation / 100.0,
|
||||
"lightness", lightness / 100.0,
|
||||
NULL);
|
||||
|
||||
gimp_drawable_apply_operation_by_name (drawable, progress,
|
||||
_("Hue-Saturation"),
|
||||
"gimp:hue-saturation",
|
||||
config);
|
||||
g_object_unref (config);
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub threshold {
|
||||
$blurb = 'Threshold the specified drawable.';
|
||||
|
||||
$help = <<'HELP';
|
||||
This procedures generates a threshold map of the specified drawable. All pixels
|
||||
between the values of 'low_threshold' and 'high_threshold' are replaced with
|
||||
white, and all other pixels with black.
|
||||
HELP
|
||||
|
||||
&std_pdb_deprecated ('gimp-drawable-threshold');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The drawable' },
|
||||
{ name => 'low_threshold', type => '0 <= int32 <= 255',
|
||||
desc => 'The low threshold value' },
|
||||
{ name => 'high_threshold', type => '0 <= int32 <= 255',
|
||||
desc => 'The high threshold value' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
|
||||
GIMP_PDB_ITEM_CONTENT, error) &&
|
||||
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
|
||||
{
|
||||
GeglNode *node =
|
||||
gegl_node_new_child (NULL,
|
||||
"operation", "gimp:threshold",
|
||||
"low", low_threshold / 255.0,
|
||||
"high", high_threshold / 255.0,
|
||||
NULL);
|
||||
|
||||
gimp_drawable_apply_operation (drawable, progress,
|
||||
C_("undo-type", "Threshold"),
|
||||
node);
|
||||
g_object_unref (node);
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@headers = qw("libgimpmath/gimpmath.h"
|
||||
"core/gimp.h"
|
||||
"core/gimpdrawable.h"
|
||||
"core/gimpdrawable-operation.h"
|
||||
"plug-in/gimpplugin.h"
|
||||
"plug-in/gimppluginmanager.h"
|
||||
"gimppdb-utils.h"
|
||||
"gimp-intl.h");
|
||||
|
||||
@procs = qw(brightness_contrast
|
||||
levels levels_auto levels_stretch
|
||||
posterize
|
||||
desaturate desaturate_full
|
||||
equalize
|
||||
invert
|
||||
curves_spline curves_explicit
|
||||
color_balance
|
||||
colorize
|
||||
histogram
|
||||
hue_saturation
|
||||
threshold);
|
||||
|
||||
%exports = (app => [@procs], lib => [@procs]);
|
||||
|
||||
$desc = 'Color';
|
||||
$doc_title = 'gimpcolor';
|
||||
$doc_short_desc = 'Functions for manipulating color.';
|
||||
$doc_long_desc = 'Functions for manipulating color, including curves and histograms.';
|
||||
|
||||
1;
|
|
@ -2853,39 +2853,6 @@ CODE
|
|||
);
|
||||
}
|
||||
|
||||
sub context_get_transform_recursion {
|
||||
&std_pdb_deprecated();
|
||||
|
||||
@outargs = (
|
||||
{ name => 'transform_recursion', type => '1 <= int32',
|
||||
desc => 'This returns always 3 and is meaningless' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
transform_recursion = 3;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub context_set_transform_recursion {
|
||||
&std_pdb_deprecated();
|
||||
|
||||
@inargs = (
|
||||
{ name => 'transform_recursion', type => '1 <= int32', dead => 1,
|
||||
desc => 'This parameter is ignored' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub context_get_ink_size {
|
||||
$blurb = 'Get ink blob size in pixels.';
|
||||
$help = 'Get the ink blob size in pixels for ink tool.';
|
||||
|
@ -3437,7 +3404,6 @@ CODE
|
|||
context_get_interpolation context_set_interpolation
|
||||
context_get_transform_direction context_set_transform_direction
|
||||
context_get_transform_resize context_set_transform_resize
|
||||
context_get_transform_recursion context_set_transform_recursion
|
||||
context_get_ink_size context_set_ink_size
|
||||
context_get_ink_angle context_set_ink_angle
|
||||
context_get_ink_size_sensitivity context_set_ink_size_sensitivity
|
||||
|
|
|
@ -704,26 +704,6 @@ CODE
|
|||
);
|
||||
}
|
||||
|
||||
sub drawable_set_image {
|
||||
&std_pdb_deprecated();
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The drawable' },
|
||||
{ name => 'image', type => 'image',
|
||||
desc => 'The image' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code =><<'CODE'
|
||||
{
|
||||
if (image != gimp_item_get_image (GIMP_ITEM (drawable)))
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub drawable_thumbnail {
|
||||
$blurb = 'Get a thumbnail of a drawable.';
|
||||
|
||||
|
@ -996,6 +976,7 @@ CODE
|
|||
"core/gimp.h"
|
||||
"core/gimpchannel-select.h"
|
||||
"core/gimpdrawable-offset.h"
|
||||
"core/gimpimage.h"
|
||||
"core/gimptempbuf.h"
|
||||
"gimppdb-utils.h"
|
||||
"gimppdbcontext.h"
|
||||
|
@ -1012,7 +993,6 @@ CODE
|
|||
drawable_width
|
||||
drawable_height
|
||||
drawable_offsets
|
||||
drawable_set_image
|
||||
drawable_mask_bounds
|
||||
drawable_mask_intersect
|
||||
drawable_merge_shadow
|
||||
|
|
|
@ -1,934 +0,0 @@
|
|||
# GIMP - The GNU Image Manipulation Program
|
||||
# Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (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
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# "Perlized" from C source by Manish Singh <yosh@gimp.org>
|
||||
# Derived from old transform_tools by
|
||||
# Joao S. O. Bueno Calligaris <gwidion@mpc.com.br>
|
||||
|
||||
# Drawable Transformations
|
||||
|
||||
# shortcuts
|
||||
|
||||
sub transform_invoke {
|
||||
my ($progress_text, $assemble_matrix, $check) = @_;
|
||||
my $success_check = 'gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
|
||||
GIMP_PDB_ITEM_CONTENT |
|
||||
GIMP_PDB_ITEM_POSITION,
|
||||
error);';
|
||||
|
||||
if ($check) {
|
||||
$success_check = "(gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
|
||||
GIMP_PDB_ITEM_CONTENT |
|
||||
GIMP_PDB_ITEM_POSITION, error) && " . $check . ");";
|
||||
}
|
||||
|
||||
%invoke = (
|
||||
code => <<"CODE"
|
||||
{
|
||||
gint x, y, width, height;
|
||||
|
||||
success = $success_check
|
||||
|
||||
if (success &&
|
||||
gimp_item_mask_intersect (GIMP_ITEM (drawable), &x, &y, &width, &height))
|
||||
{
|
||||
GimpMatrix3 matrix;
|
||||
gint off_x, off_y;
|
||||
|
||||
gimp_item_get_offset (GIMP_ITEM (drawable), &off_x, &off_y);
|
||||
|
||||
x += off_x;
|
||||
y += off_y;
|
||||
|
||||
/* Assemble the transformation matrix */
|
||||
$assemble_matrix
|
||||
|
||||
if (progress)
|
||||
gimp_progress_start (progress, FALSE, _(\"$progress_text\"));
|
||||
|
||||
if (! gimp_viewable_get_children (GIMP_VIEWABLE (drawable)) &&
|
||||
! gimp_channel_is_empty (gimp_image_get_mask (gimp_item_get_image (GIMP_ITEM (drawable)))))
|
||||
{
|
||||
if (! gimp_drawable_transform_affine (drawable, context,
|
||||
&matrix, transform_direction,
|
||||
interpolation,
|
||||
clip_result, progress))
|
||||
{
|
||||
success = FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gimp_item_transform (GIMP_ITEM (drawable), context, &matrix,
|
||||
transform_direction,
|
||||
interpolation,
|
||||
clip_result, progress);
|
||||
}
|
||||
|
||||
if (progress)
|
||||
gimp_progress_end (progress);
|
||||
}
|
||||
}
|
||||
CODE
|
||||
)
|
||||
}
|
||||
|
||||
sub transform_default_invoke {
|
||||
my ($progress_text, $assemble_matrix, $check) = @_;
|
||||
my $success_check = 'gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
|
||||
GIMP_PDB_ITEM_CONTENT |
|
||||
GIMP_PDB_ITEM_POSITION, error);';
|
||||
|
||||
if ($check) {
|
||||
$success_check = "(gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
|
||||
GIMP_PDB_ITEM_CONTENT |
|
||||
GIMP_PDB_ITEM_POSITION, error) && " . $check . ");";
|
||||
}
|
||||
|
||||
%invoke = (
|
||||
code => <<"CODE"
|
||||
{
|
||||
gint x, y, width, height;
|
||||
|
||||
success = $success_check
|
||||
|
||||
if (success &&
|
||||
gimp_item_mask_intersect (GIMP_ITEM (drawable), &x, &y, &width, &height))
|
||||
{
|
||||
GimpMatrix3 matrix;
|
||||
GimpInterpolationType interpolation_type = GIMP_INTERPOLATION_NONE;
|
||||
gint off_x, off_y;
|
||||
|
||||
gimp_item_get_offset (GIMP_ITEM (drawable), &off_x, &off_y);
|
||||
|
||||
x += off_x;
|
||||
y += off_y;
|
||||
|
||||
/* Assemble the transformation matrix */
|
||||
$assemble_matrix
|
||||
|
||||
if (interpolate)
|
||||
interpolation_type = gimp->config->interpolation_type;
|
||||
|
||||
if (progress)
|
||||
gimp_progress_start (progress, FALSE, _(\"$progress_text\"));
|
||||
|
||||
if (! gimp_viewable_get_children (GIMP_VIEWABLE (drawable)) &&
|
||||
! gimp_channel_is_empty (gimp_image_get_mask (gimp_item_get_image (GIMP_ITEM (drawable)))))
|
||||
{
|
||||
if (! gimp_drawable_transform_affine (drawable, context,
|
||||
&matrix, GIMP_TRANSFORM_FORWARD,
|
||||
interpolation_type,
|
||||
clip_result, progress))
|
||||
{
|
||||
success = FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gimp_item_transform (GIMP_ITEM (drawable), context, &matrix,
|
||||
GIMP_TRANSFORM_FORWARD,
|
||||
interpolation_type,
|
||||
clip_result, progress);
|
||||
}
|
||||
|
||||
if (progress)
|
||||
gimp_progress_end (progress);
|
||||
}
|
||||
}
|
||||
CODE
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
# The defs
|
||||
|
||||
sub drawable_transform_flip_simple {
|
||||
&std_pdb_deprecated('gimp-item-transform-flip-simple');
|
||||
&joao_pdb_misc('2004', '2.2');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The affected drawable' },
|
||||
{ name => 'flip_type',
|
||||
type => 'enum GimpOrientationType (no GIMP_ORIENTATION_UNKNOWN)',
|
||||
desc => 'Type of flip' },
|
||||
{ name => 'auto_center', type => 'boolean',
|
||||
desc => 'Whether to automatically position the axis in the selection center' },
|
||||
{ name => 'axis', type => 'float',
|
||||
desc => 'coord. of flip axis' },
|
||||
{ name => 'clip_result', type => 'boolean',
|
||||
desc => 'Whether to clip results' }
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
{ name => 'drawable', type => 'drawable', no_declare => 1,
|
||||
desc => 'The flipped drawable' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
gint x, y, width, height;
|
||||
|
||||
success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
|
||||
GIMP_PDB_ITEM_CONTENT |
|
||||
GIMP_PDB_ITEM_POSITION, error);
|
||||
|
||||
if (success &&
|
||||
gimp_item_mask_intersect (GIMP_ITEM (drawable), &x, &y, &width, &height))
|
||||
{
|
||||
gimp_transform_get_flip_axis (x, y, width, height,
|
||||
flip_type, auto_center, &axis);
|
||||
|
||||
if (! gimp_viewable_get_children (GIMP_VIEWABLE (drawable)) &&
|
||||
! gimp_channel_is_empty (gimp_image_get_mask (gimp_item_get_image (GIMP_ITEM (drawable)))))
|
||||
{
|
||||
if (! gimp_drawable_transform_flip (drawable, context,
|
||||
flip_type, axis, clip_result))
|
||||
{
|
||||
success = FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gimp_item_flip (GIMP_ITEM (drawable), context,
|
||||
flip_type, axis, clip_result);
|
||||
}
|
||||
}
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
sub drawable_transform_flip {
|
||||
&std_pdb_deprecated('gimp-item-transform-flip');
|
||||
&joao_pdb_misc('2004', '2.2');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The affected drawable' },
|
||||
{ name => 'x0', type => 'float',
|
||||
desc => 'horz. coord. of one end of axis' },
|
||||
{ name => 'y0', type => 'float',
|
||||
desc => 'vert. coord. of one end of axis' },
|
||||
{ name => 'x1', type => 'float',
|
||||
desc => 'horz. coord. of other end of axis' },
|
||||
{ name => 'y1', type => 'float',
|
||||
desc => 'vert. coord. of other end of axis' },
|
||||
{ name => 'transform_direction', type => 'enum GimpTransformDirection',
|
||||
desc => 'Direction of transformation' },
|
||||
{ name => 'interpolation', type => 'enum GimpInterpolationType',
|
||||
desc => 'Type of interpolation' },
|
||||
{ name => 'supersample', type => 'boolean', dead => 1,
|
||||
desc => 'This parameter is ignored' },
|
||||
{ name => 'recursion_level', type => '1 <= int32', dead => 1,
|
||||
desc => 'This parameter is ignored' },
|
||||
{ name => 'clip_result', type => 'boolean',
|
||||
desc => 'Whether to clip results' }
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
{ name => 'drawable', type => 'drawable', no_declare => 1,
|
||||
desc => 'The flipped drawable' }
|
||||
);
|
||||
|
||||
transform_invoke ("Flipping", <<CODE);
|
||||
gimp_matrix3_identity (&matrix);
|
||||
gimp_transform_matrix_flip_free (&matrix,
|
||||
x0, y0, x1, y1);
|
||||
CODE
|
||||
}
|
||||
|
||||
|
||||
sub drawable_transform_flip_default {
|
||||
&std_pdb_deprecated('gimp-item-transform-flip');
|
||||
&joao_pdb_misc('2004', '2.2');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The affected drawable' },
|
||||
{ name => 'x0', type => 'float',
|
||||
desc => 'horz. coord. of one end of axis' },
|
||||
{ name => 'y0', type => 'float',
|
||||
desc => 'vert. coord. of one end of axis' },
|
||||
{ name => 'x1', type => 'float',
|
||||
desc => 'horz. coord. of other end of axis' },
|
||||
{ name => 'y1', type => 'float',
|
||||
desc => 'vert. coord. of other end of axis' },
|
||||
{ name => 'interpolate', type => 'boolean',
|
||||
desc => 'Whether to use interpolation and supersampling' },
|
||||
{ name => 'clip_result', type => 'boolean',
|
||||
desc => 'Whether to clip results' }
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
{ name => 'drawable', type => 'drawable', no_declare => 1,
|
||||
desc => 'The flipped drawable' }
|
||||
);
|
||||
|
||||
transform_default_invoke ("Flipping", <<CODE);
|
||||
gimp_matrix3_identity (&matrix);
|
||||
gimp_transform_matrix_flip_free (&matrix,
|
||||
x0, y0, x1, y1);
|
||||
CODE
|
||||
}
|
||||
|
||||
|
||||
sub drawable_transform_perspective {
|
||||
&std_pdb_deprecated('gimp-item-transform-perspective');
|
||||
&joao_pdb_misc('2004', '2.2');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The affected drawable' },
|
||||
{ name => 'x0', type => 'float',
|
||||
desc => 'The new x coordinate of upper-left corner of original
|
||||
bounding box' },
|
||||
{ name => 'y0', type => 'float',
|
||||
desc => 'The new y coordinate of upper-left corner of original
|
||||
bounding box' },
|
||||
{ name => 'x1', type => 'float',
|
||||
desc => 'The new x coordinate of upper-right corner of original
|
||||
bounding box' },
|
||||
{ name => 'y1', type => 'float',
|
||||
desc => 'The new y coordinate of upper-right corner of original
|
||||
bounding box' },
|
||||
{ name => 'x2', type => 'float',
|
||||
desc => 'The new x coordinate of lower-left corner of original
|
||||
bounding box' },
|
||||
{ name => 'y2', type => 'float',
|
||||
desc => 'The new y coordinate of lower-left corner of original
|
||||
bounding box' },
|
||||
{ name => 'x3', type => 'float',
|
||||
desc => 'The new x coordinate of lower-right corner of original
|
||||
bounding box' },
|
||||
{ name => 'y3', type => 'float',
|
||||
desc => 'The new y coordinate of lower-right corner of original
|
||||
bounding box' },
|
||||
{ name => 'transform_direction', type => 'enum GimpTransformDirection',
|
||||
desc => 'Direction of transformation' },
|
||||
{ name => 'interpolation', type => 'enum GimpInterpolationType',
|
||||
desc => 'Type of interpolation' },
|
||||
{ name => 'supersample', type => 'boolean', dead => 1,
|
||||
desc => 'This parameter is ignored' },
|
||||
{ name => 'recursion_level', type => '1 <= int32', dead => 1,
|
||||
desc => 'This parameter is ignored' },
|
||||
{ name => 'clip_result', type => 'enum GimpTransformResize',
|
||||
desc => 'How to clip results' }
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
{ name => 'drawable', type => 'drawable', no_declare => 1,
|
||||
desc => 'The newly mapped drawable' }
|
||||
);
|
||||
|
||||
transform_invoke ("Perspective", <<CODE);
|
||||
gimp_matrix3_identity (&matrix);
|
||||
gimp_transform_matrix_perspective (&matrix,
|
||||
x, y, width, height,
|
||||
x0, y0, x1, y1,
|
||||
x2, y2, x3, y3);
|
||||
CODE
|
||||
}
|
||||
|
||||
|
||||
sub drawable_transform_perspective_default {
|
||||
&std_pdb_deprecated('gimp-item-transform-perspective');
|
||||
&joao_pdb_misc('2004', '2.2');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The affected drawable' },
|
||||
{ name => 'x0', type => 'float',
|
||||
desc => 'The new x coordinate of upper-left corner of original
|
||||
bounding box' },
|
||||
{ name => 'y0', type => 'float',
|
||||
desc => 'The new y coordinate of upper-left corner of original
|
||||
bounding box' },
|
||||
{ name => 'x1', type => 'float',
|
||||
desc => 'The new x coordinate of upper-right corner of original
|
||||
bounding box' },
|
||||
{ name => 'y1', type => 'float',
|
||||
desc => 'The new y coordinate of upper-right corner of original
|
||||
bounding box' },
|
||||
{ name => 'x2', type => 'float',
|
||||
desc => 'The new x coordinate of lower-left corner of original
|
||||
bounding box' },
|
||||
{ name => 'y2', type => 'float',
|
||||
desc => 'The new y coordinate of lower-left corner of original
|
||||
bounding box' },
|
||||
{ name => 'x3', type => 'float',
|
||||
desc => 'The new x coordinate of lower-right corner of original
|
||||
bounding box' },
|
||||
{ name => 'y3', type => 'float',
|
||||
desc => 'The new y coordinate of lower-right corner of original
|
||||
bounding box' },
|
||||
{ name => 'interpolate', type => 'boolean',
|
||||
desc => 'Whether to use interpolation and supersampling' },
|
||||
{ name => 'clip_result', type => 'enum GimpTransformResize',
|
||||
desc => 'How to clip results' }
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
{ name => 'drawable', type => 'drawable', no_declare => 1,
|
||||
desc => 'The newly mapped drawable' }
|
||||
);
|
||||
|
||||
transform_default_invoke ("Perspective", <<CODE);
|
||||
gimp_matrix3_identity (&matrix);
|
||||
gimp_transform_matrix_perspective (&matrix,
|
||||
x, y, width, height,
|
||||
x0, y0, x1, y1,
|
||||
x2, y2, x3, y3);
|
||||
CODE
|
||||
}
|
||||
|
||||
|
||||
sub drawable_transform_rotate_simple {
|
||||
&std_pdb_deprecated('gimp-item-transform-rotate-simple');
|
||||
&joao_pdb_misc('2004', '2.2');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The affected drawable' },
|
||||
{ name => 'rotate_type', type => 'enum GimpRotationType',
|
||||
desc => 'Type of rotation' },
|
||||
{ name => 'auto_center', type => 'boolean',
|
||||
desc => 'Whether to automatically rotate around the selection center' },
|
||||
{ name => 'center_x', type => 'int32',
|
||||
desc => 'The hor. coordinate of the center of rotation' },
|
||||
{ name => 'center_y', type => 'int32',
|
||||
desc => 'The vert. coordinate of the center of rotation' },
|
||||
{ name => 'clip_result', type => 'boolean',
|
||||
desc => 'Whether to clip results' }
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
{ name => 'drawable', type => 'drawable', no_declare => 1,
|
||||
desc => 'The rotated drawable' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
gint x, y, width, height;
|
||||
|
||||
success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
|
||||
GIMP_PDB_ITEM_CONTENT |
|
||||
GIMP_PDB_ITEM_POSITION, error);
|
||||
|
||||
if (success &&
|
||||
gimp_item_mask_intersect (GIMP_ITEM (drawable), &x, &y, &width, &height))
|
||||
{
|
||||
gdouble cx = center_x;
|
||||
gdouble cy = center_y;
|
||||
|
||||
gimp_transform_get_rotate_center (x, y, width, height,
|
||||
auto_center, &cx, &cy);
|
||||
|
||||
if (! gimp_viewable_get_children (GIMP_VIEWABLE (drawable)) &&
|
||||
! gimp_channel_is_empty (gimp_image_get_mask (gimp_item_get_image (GIMP_ITEM (drawable)))))
|
||||
{
|
||||
if (! gimp_drawable_transform_rotate (drawable, context,
|
||||
rotate_type, cx, cy,
|
||||
clip_result))
|
||||
{
|
||||
success = FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gimp_item_rotate (GIMP_ITEM (drawable), context,
|
||||
rotate_type, cx, cy,
|
||||
clip_result);
|
||||
}
|
||||
}
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub drawable_transform_rotate {
|
||||
&std_pdb_deprecated('gimp-item-transform-rotate');
|
||||
&joao_pdb_misc('2004', '2.2');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The affected drawable' },
|
||||
{ name => 'angle', type => 'float',
|
||||
desc => 'The angle of rotation (radians)' },
|
||||
{ name => 'auto_center', type => 'boolean',
|
||||
desc => 'Whether to automatically rotate around the selection center' },
|
||||
{ name => 'center_x', type => 'int32',
|
||||
desc => 'The hor. coordinate of the center of rotation' },
|
||||
{ name => 'center_y', type => 'int32',
|
||||
desc => 'The vert. coordinate of the center of rotation' },
|
||||
{ name => 'transform_direction', type => 'enum GimpTransformDirection',
|
||||
desc => 'Direction of transformation' },
|
||||
{ name => 'interpolation', type => 'enum GimpInterpolationType',
|
||||
desc => 'Type of interpolation' },
|
||||
{ name => 'supersample', type => 'boolean', dead => 1,
|
||||
desc => 'This parameter is ignored' },
|
||||
{ name => 'recursion_level', type => '1 <= int32', dead => 1,
|
||||
desc => 'This parameter is ignored' },
|
||||
{ name => 'clip_result', type => 'enum GimpTransformResize',
|
||||
desc => 'How to clip results' }
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
{ name => 'drawable', type => 'drawable', no_declare => 1,
|
||||
desc => 'The rotated drawable' }
|
||||
);
|
||||
|
||||
transform_invoke ("Rotating", <<CODE);
|
||||
gimp_matrix3_identity (&matrix);
|
||||
if (auto_center)
|
||||
gimp_transform_matrix_rotate_rect (&matrix,
|
||||
x, y, width, height, angle);
|
||||
else
|
||||
gimp_transform_matrix_rotate_center (&matrix,
|
||||
center_x, center_y, angle);
|
||||
CODE
|
||||
}
|
||||
|
||||
|
||||
sub drawable_transform_rotate_default {
|
||||
&std_pdb_deprecated('gimp-item-transform-rotate');
|
||||
&joao_pdb_misc('2004', '2.2');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The affected drawable' },
|
||||
{ name => 'angle', type => 'float',
|
||||
desc => 'The angle of rotation (radians)' },
|
||||
{ name => 'auto_center', type => 'boolean',
|
||||
desc => 'Whether to automatically rotate around the selection center' },
|
||||
{ name => 'center_x', type => 'int32',
|
||||
desc => 'The hor. coordinate of the center of rotation' },
|
||||
{ name => 'center_y', type => 'int32',
|
||||
desc => 'The vert. coordinate of the center of rotation' },
|
||||
{ name => 'interpolate', type => 'boolean',
|
||||
desc => 'Whether to use interpolation and supersampling' },
|
||||
{ name => 'clip_result', type => 'enum GimpTransformResize',
|
||||
desc => 'How to clip results' }
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
{ name => 'drawable', type => 'drawable', no_declare => 1,
|
||||
desc => 'The rotated drawable' }
|
||||
);
|
||||
|
||||
transform_default_invoke ("Rotating", <<CODE);
|
||||
gimp_matrix3_identity (&matrix);
|
||||
if (auto_center)
|
||||
gimp_transform_matrix_rotate_rect (&matrix,
|
||||
x, y, width, height, angle);
|
||||
else
|
||||
gimp_transform_matrix_rotate_center (&matrix,
|
||||
center_x, center_y, angle);
|
||||
CODE
|
||||
}
|
||||
|
||||
|
||||
sub drawable_transform_scale {
|
||||
&std_pdb_deprecated('gimp-item-transform-scale');
|
||||
&joao_pdb_misc('2004', '2.2');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The affected drawable' },
|
||||
{ name => 'x0', type => 'float',
|
||||
desc => 'The new x coordinate of the upper-left corner of the
|
||||
scaled region' },
|
||||
{ name => 'y0', type => 'float',
|
||||
desc => 'The new y coordinate of the upper-left corner of the
|
||||
scaled region' },
|
||||
{ name => 'x1', type => 'float',
|
||||
desc => 'The new x coordinate of the lower-right corner of the
|
||||
scaled region' },
|
||||
{ name => 'y1', type => 'float',
|
||||
desc => 'The new y coordinate of the lower-right corner of the
|
||||
scaled region' },
|
||||
{ name => 'transform_direction', type => 'enum GimpTransformDirection',
|
||||
desc => 'Direction of transformation' },
|
||||
{ name => 'interpolation', type => 'enum GimpInterpolationType',
|
||||
desc => 'Type of interpolation' },
|
||||
{ name => 'supersample', type => 'boolean', dead => 1,
|
||||
desc => 'This parameter is ignored' },
|
||||
{ name => 'recursion_level', type => '1 <= int32', dead => 1,
|
||||
desc => 'This parameter is ignored' },
|
||||
{ name => 'clip_result', type => 'enum GimpTransformResize',
|
||||
desc => 'How to clip results' }
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
{ name => 'drawable', type => 'drawable', no_declare => 1,
|
||||
desc => 'The scaled drawable' }
|
||||
);
|
||||
|
||||
transform_invoke ("Scaling", <<CODE, 'x0 < x1 && y0 < y1');
|
||||
gimp_matrix3_identity (&matrix);
|
||||
gimp_transform_matrix_scale (&matrix,
|
||||
x, y, width, height,
|
||||
x0, y0, x1 - x0, y1 - y0);
|
||||
CODE
|
||||
}
|
||||
|
||||
|
||||
sub drawable_transform_scale_default {
|
||||
&std_pdb_deprecated('gimp-item-transform-scale');
|
||||
&joao_pdb_misc('2004', '2.2');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The affected drawable' },
|
||||
{ name => 'x0', type => 'float',
|
||||
desc => 'The new x coordinate of the upper-left corner of the
|
||||
scaled region' },
|
||||
{ name => 'y0', type => 'float',
|
||||
desc => 'The new y coordinate of the upper-left corner of the
|
||||
scaled region' },
|
||||
{ name => 'x1', type => 'float',
|
||||
desc => 'The new x coordinate of the lower-right corner of the
|
||||
scaled region' },
|
||||
{ name => 'y1', type => 'float',
|
||||
desc => 'The new y coordinate of the lower-right corner of the
|
||||
scaled region' },
|
||||
{ name => 'interpolate', type => 'boolean',
|
||||
desc => 'Whether to use interpolation and supersampling' },
|
||||
{ name => 'clip_result', type => 'enum GimpTransformResize',
|
||||
desc => 'How to clip results' }
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
{ name => 'drawable', type => 'drawable', no_declare => 1,
|
||||
desc => 'The scaled drawable' }
|
||||
);
|
||||
|
||||
transform_default_invoke ("Scaling", <<CODE, 'x0 < x1 && y0 < y1');
|
||||
gimp_matrix3_identity (&matrix);
|
||||
gimp_transform_matrix_scale (&matrix,
|
||||
x, y, width, height,
|
||||
x0, y0, x1 - x0, y1 - y0);
|
||||
CODE
|
||||
}
|
||||
|
||||
|
||||
sub drawable_transform_shear {
|
||||
&std_pdb_deprecated('gimp-item-transform-shear');
|
||||
&joao_pdb_misc('2004', '2.2');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The affected drawable' },
|
||||
{ name => 'shear_type',
|
||||
type => 'enum GimpOrientationType (no GIMP_ORIENTATION_UNKNOWN)',
|
||||
desc => 'Type of shear' },
|
||||
{ name => 'magnitude', type => 'float',
|
||||
desc => 'The magnitude of the shear' },
|
||||
{ name => 'transform_direction', type => 'enum GimpTransformDirection',
|
||||
desc => 'Direction of transformation' },
|
||||
{ name => 'interpolation', type => 'enum GimpInterpolationType',
|
||||
desc => 'Type of interpolation' },
|
||||
{ name => 'supersample', type => 'boolean', dead => 1,
|
||||
desc => 'This parameter is ignored' },
|
||||
{ name => 'recursion_level', type => '1 <= int32', dead => 1,
|
||||
desc => 'This parameter is ignored' },
|
||||
{ name => 'clip_result', type => 'enum GimpTransformResize',
|
||||
desc => 'How to clip results' }
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
{ name => 'drawable', type => 'drawable', no_declare => 1,
|
||||
desc => 'The sheared drawable' }
|
||||
);
|
||||
|
||||
transform_invoke ("Shearing", <<CODE);
|
||||
gimp_matrix3_identity (&matrix);
|
||||
gimp_transform_matrix_shear (&matrix,
|
||||
x, y, width, height,
|
||||
shear_type, magnitude);
|
||||
CODE
|
||||
}
|
||||
|
||||
|
||||
sub drawable_transform_shear_default {
|
||||
&std_pdb_deprecated('gimp-item-transform-shear');
|
||||
&joao_pdb_misc('2004', '2.2');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The affected drawable' },
|
||||
{ name => 'shear_type',
|
||||
type => 'enum GimpOrientationType (no GIMP_ORIENTATION_UNKNOWN)',
|
||||
desc => 'Type of shear' },
|
||||
{ name => 'magnitude', type => 'float',
|
||||
desc => 'The magnitude of the shear' },
|
||||
{ name => 'interpolate', type => 'boolean',
|
||||
desc => 'Whether to use interpolation and supersampling' },
|
||||
{ name => 'clip_result', type => 'enum GimpTransformResize',
|
||||
desc => 'How to clip results' }
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
{ name => 'drawable', type => 'drawable', no_declare => 1,
|
||||
desc => 'The sheared drawable' }
|
||||
);
|
||||
|
||||
transform_default_invoke ("Shearing", <<CODE);
|
||||
gimp_matrix3_identity (&matrix);
|
||||
gimp_transform_matrix_shear (&matrix,
|
||||
x, y, width, height,
|
||||
shear_type, magnitude);
|
||||
CODE
|
||||
}
|
||||
|
||||
|
||||
sub drawable_transform_2d {
|
||||
&std_pdb_deprecated('gimp-item-transform-2d');
|
||||
&joao_pdb_misc('2004', '2.2');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The affected drawable' },
|
||||
{ name => 'source_x', type => 'float',
|
||||
desc => 'X coordinate of the transformation center' },
|
||||
{ name => 'source_y', type => 'float',
|
||||
desc => 'Y coordinate of the transformation center' },
|
||||
{ name => 'scale_x', type => 'float',
|
||||
desc => 'Amount to scale in x direction' },
|
||||
{ name => 'scale_y', type => 'float',
|
||||
desc => 'Amount to scale in y direction' },
|
||||
{ name => 'angle', type => 'float',
|
||||
desc => 'The angle of rotation (radians)' },
|
||||
{ name => 'dest_x', type => 'float',
|
||||
desc => 'X coordinate of where the center goes' },
|
||||
{ name => 'dest_y', type => 'float',
|
||||
desc => 'Y coordinate of where the center goes' },
|
||||
{ name => 'transform_direction', type => 'enum GimpTransformDirection',
|
||||
desc => 'Direction of transformation' },
|
||||
{ name => 'interpolation', type => 'enum GimpInterpolationType',
|
||||
desc => 'Type of interpolation' },
|
||||
{ name => 'supersample', type => 'boolean', dead => 1,
|
||||
desc => 'This parameter is ignored' },
|
||||
{ name => 'recursion_level', type => '1 <= int32', dead => 1,
|
||||
desc => 'This parameter is ignored' },
|
||||
{ name => 'clip_result', type => 'enum GimpTransformResize',
|
||||
desc => 'How to clip results' }
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
{ name => 'drawable', type => 'drawable', no_declare => 1,
|
||||
desc => 'The transformed drawable' }
|
||||
);
|
||||
|
||||
transform_invoke ("2D Transform", <<CODE);
|
||||
gimp_matrix3_identity (&matrix);
|
||||
gimp_matrix3_translate (&matrix, -source_x, -source_y);
|
||||
gimp_matrix3_scale (&matrix, scale_x, scale_y);
|
||||
gimp_matrix3_rotate (&matrix, angle);
|
||||
gimp_matrix3_translate (&matrix, dest_x, dest_y);
|
||||
CODE
|
||||
}
|
||||
|
||||
|
||||
sub drawable_transform_2d_default {
|
||||
&std_pdb_deprecated('gimp-item-transform-2d');
|
||||
&joao_pdb_misc('2004', '2.2');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The affected drawable' },
|
||||
{ name => 'source_x', type => 'float',
|
||||
desc => 'X coordinate of the transformation center' },
|
||||
{ name => 'source_y', type => 'float',
|
||||
desc => 'Y coordinate of the transformation center' },
|
||||
{ name => 'scale_x', type => 'float',
|
||||
desc => 'Amount to scale in x direction' },
|
||||
{ name => 'scale_y', type => 'float',
|
||||
desc => 'Amount to scale in y direction' },
|
||||
{ name => 'angle', type => 'float',
|
||||
desc => 'The angle of rotation (radians)' },
|
||||
{ name => 'dest_x', type => 'float',
|
||||
desc => 'X coordinate of where the center goes' },
|
||||
{ name => 'dest_y', type => 'float',
|
||||
desc => 'Y coordinate of where the center goes' },
|
||||
{ name => 'interpolate', type => 'boolean',
|
||||
desc => 'Whether to use interpolation and supersampling' },
|
||||
{ name => 'clip_result', type => 'enum GimpTransformResize',
|
||||
desc => 'How to clip results' }
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
{ name => 'drawable', type => 'drawable', no_declare => 1,
|
||||
desc => 'The transformed drawable' }
|
||||
);
|
||||
|
||||
transform_default_invoke ("2D Transforming", <<CODE);
|
||||
gimp_matrix3_identity (&matrix);
|
||||
gimp_matrix3_translate (&matrix, -source_x, -source_y);
|
||||
gimp_matrix3_scale (&matrix, scale_x, scale_y);
|
||||
gimp_matrix3_rotate (&matrix, angle);
|
||||
gimp_matrix3_translate (&matrix, dest_x, dest_y);
|
||||
CODE
|
||||
}
|
||||
|
||||
|
||||
sub drawable_transform_matrix {
|
||||
&std_pdb_deprecated('gimp-item-transform-matrix');
|
||||
&joao_pdb_misc('2004', '2.2');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The affected drawable' },
|
||||
{ name => 'coeff_0_0', type => 'float',
|
||||
desc => 'coefficient (0,0) of the transformation matrix' },
|
||||
{ name => 'coeff_0_1', type => 'float',
|
||||
desc => 'coefficient (0,1) of the transformation matrix' },
|
||||
{ name => 'coeff_0_2', type => 'float',
|
||||
desc => 'coefficient (0,2) of the transformation matrix' },
|
||||
{ name => 'coeff_1_0', type => 'float',
|
||||
desc => 'coefficient (1,0) of the transformation matrix' },
|
||||
{ name => 'coeff_1_1', type => 'float',
|
||||
desc => 'coefficient (1,1) of the transformation matrix' },
|
||||
{ name => 'coeff_1_2', type => 'float',
|
||||
desc => 'coefficient (1,2) of the transformation matrix' },
|
||||
{ name => 'coeff_2_0', type => 'float',
|
||||
desc => 'coefficient (2,0) of the transformation matrix' },
|
||||
{ name => 'coeff_2_1', type => 'float',
|
||||
desc => 'coefficient (2,1) of the transformation matrix' },
|
||||
{ name => 'coeff_2_2', type => 'float',
|
||||
desc => 'coefficient (2,2) of the transformation matrix' },
|
||||
{ name => 'transform_direction', type => 'enum GimpTransformDirection',
|
||||
desc => 'Direction of transformation' },
|
||||
{ name => 'interpolation', type => 'enum GimpInterpolationType',
|
||||
desc => 'Type of interpolation' },
|
||||
{ name => 'supersample', type => 'boolean', dead => 1,
|
||||
desc => 'This parameter is ignored' },
|
||||
{ name => 'recursion_level', type => '1 <= int32', dead => 1,
|
||||
desc => 'This parameter is ignored' },
|
||||
{ name => 'clip_result', type => 'enum GimpTransformResize',
|
||||
desc => 'How to clip results' }
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
{ name => 'drawable', type => 'drawable', no_declare => 1,
|
||||
desc => 'The transformed drawable' }
|
||||
);
|
||||
|
||||
transform_invoke ("2D Transforming", <<CODE);
|
||||
matrix.coeff[0][0] = coeff_0_0;
|
||||
matrix.coeff[0][1] = coeff_0_1;
|
||||
matrix.coeff[0][2] = coeff_0_2;
|
||||
matrix.coeff[1][0] = coeff_1_0;
|
||||
matrix.coeff[1][1] = coeff_1_1;
|
||||
matrix.coeff[1][2] = coeff_1_2;
|
||||
matrix.coeff[2][0] = coeff_2_0;
|
||||
matrix.coeff[2][1] = coeff_2_1;
|
||||
matrix.coeff[2][2] = coeff_2_2;
|
||||
CODE
|
||||
}
|
||||
|
||||
|
||||
sub drawable_transform_matrix_default {
|
||||
&std_pdb_deprecated('gimp-item-transform-matrix');
|
||||
&joao_pdb_misc('2004', '2.2');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The affected drawable' },
|
||||
{ name => 'coeff_0_0', type => 'float',
|
||||
desc => 'coefficient (0,0) of the transformation matrix' },
|
||||
{ name => 'coeff_0_1', type => 'float',
|
||||
desc => 'coefficient (0,1) of the transformation matrix' },
|
||||
{ name => 'coeff_0_2', type => 'float',
|
||||
desc => 'coefficient (0,2) of the transformation matrix' },
|
||||
{ name => 'coeff_1_0', type => 'float',
|
||||
desc => 'coefficient (1,0) of the transformation matrix' },
|
||||
{ name => 'coeff_1_1', type => 'float',
|
||||
desc => 'coefficient (1,1) of the transformation matrix' },
|
||||
{ name => 'coeff_1_2', type => 'float',
|
||||
desc => 'coefficient (1,2) of the transformation matrix' },
|
||||
{ name => 'coeff_2_0', type => 'float',
|
||||
desc => 'coefficient (2,0) of the transformation matrix' },
|
||||
{ name => 'coeff_2_1', type => 'float',
|
||||
desc => 'coefficient (2,1) of the transformation matrix' },
|
||||
{ name => 'coeff_2_2', type => 'float',
|
||||
desc => 'coefficient (2,2) of the transformation matrix' },
|
||||
{ name => 'interpolate', type => 'boolean',
|
||||
desc => 'Whether to use interpolation and supersampling' },
|
||||
{ name => 'clip_result', type => 'enum GimpTransformResize',
|
||||
desc => 'How to clip results' }
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
{ name => 'drawable', type => 'drawable', no_declare => 1,
|
||||
desc => 'The transformed drawable' }
|
||||
);
|
||||
|
||||
transform_default_invoke ("2D Transforming", <<CODE);
|
||||
matrix.coeff[0][0] = coeff_0_0;
|
||||
matrix.coeff[0][1] = coeff_0_1;
|
||||
matrix.coeff[0][2] = coeff_0_2;
|
||||
matrix.coeff[1][0] = coeff_1_0;
|
||||
matrix.coeff[1][1] = coeff_1_1;
|
||||
matrix.coeff[1][2] = coeff_1_2;
|
||||
matrix.coeff[2][0] = coeff_2_0;
|
||||
matrix.coeff[2][1] = coeff_2_1;
|
||||
matrix.coeff[2][2] = coeff_2_2;
|
||||
CODE
|
||||
}
|
||||
|
||||
|
||||
@headers = qw("libgimpmath/gimpmath.h"
|
||||
"config/gimpcoreconfig.h"
|
||||
"core/gimp.h"
|
||||
"core/gimp-transform-utils.h"
|
||||
"core/gimpchannel.h"
|
||||
"core/gimpimage.h"
|
||||
"core/gimpdrawable.h"
|
||||
"core/gimpdrawable-transform.h"
|
||||
"core/gimpprogress.h"
|
||||
"gimppdb-utils.h"
|
||||
"gimp-intl.h");
|
||||
|
||||
@procs = qw(drawable_transform_flip_simple
|
||||
drawable_transform_flip
|
||||
drawable_transform_flip_default
|
||||
drawable_transform_perspective
|
||||
drawable_transform_perspective_default
|
||||
drawable_transform_rotate_simple
|
||||
drawable_transform_rotate
|
||||
drawable_transform_rotate_default
|
||||
drawable_transform_scale
|
||||
drawable_transform_scale_default
|
||||
drawable_transform_shear
|
||||
drawable_transform_shear_default
|
||||
drawable_transform_2d
|
||||
drawable_transform_2d_default
|
||||
drawable_transform_matrix
|
||||
drawable_transform_matrix_default);
|
||||
|
||||
%exports = (app => [@procs], lib => [@procs]);
|
||||
|
||||
$desc = 'Transformation procedures';
|
||||
$doc_title = 'gimpdrawabletransform';
|
||||
$doc_short_desc = 'Functions to perform transformatrions on drawables.';
|
||||
$doc_long_desc = 'Functions to perform transformatrions on drawables.';
|
||||
|
||||
1;
|
|
@ -506,536 +506,6 @@ CODE
|
|||
);
|
||||
}
|
||||
|
||||
sub edit_clear {
|
||||
$blurb = 'Clear selected area of drawable.';
|
||||
|
||||
$help = <<'HELP';
|
||||
This procedure clears the specified drawable. If the drawable has an
|
||||
alpha channel, the cleared pixels will become transparent. If the
|
||||
drawable does not have an alpha channel, cleared pixels will be set to
|
||||
the background color. This procedure only affects regions within a
|
||||
selection if there is a selection active.
|
||||
HELP
|
||||
|
||||
&std_pdb_misc;
|
||||
|
||||
$deprecated = 'gimp-drawable-edit-clear';
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The drawable to clear from' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<CODE
|
||||
{
|
||||
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
|
||||
GIMP_PDB_ITEM_CONTENT, error) &&
|
||||
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
|
||||
{
|
||||
gimp_drawable_edit_clear (drawable, context);
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub edit_fill {
|
||||
$blurb = 'Fill selected area of drawable.';
|
||||
|
||||
$help = <<'HELP';
|
||||
This procedure fills the specified drawable with the fill mode. If the
|
||||
fill mode is foreground, the current foreground color is used. If the
|
||||
fill mode is background, the current background color is used. Other
|
||||
fill modes should not be used. This procedure only affects regions
|
||||
within a selection if there is a selection active. If you want to fill
|
||||
the whole drawable, regardless of the selection, use
|
||||
gimp_drawable_fill().
|
||||
HELP
|
||||
|
||||
&std_pdb_misc;
|
||||
$author .= ' & Raphael Quinet';
|
||||
$date = '1995-2000';
|
||||
|
||||
$deprecated = 'gimp-drawable-edit-fill';
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => "The drawable to fill to" },
|
||||
{ name => 'fill_type', type => 'enum GimpFillType',
|
||||
desc => 'The type of fill' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<CODE
|
||||
{
|
||||
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
|
||||
GIMP_PDB_ITEM_CONTENT, error) &&
|
||||
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
|
||||
{
|
||||
GimpFillOptions *options = gimp_fill_options_new (gimp, NULL, FALSE);
|
||||
|
||||
if (gimp_fill_options_set_by_fill_type (options, context,
|
||||
fill_type, error))
|
||||
{
|
||||
gimp_drawable_edit_fill (drawable, options, NULL);
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
|
||||
g_object_unref (options);
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub edit_bucket_fill {
|
||||
$blurb = <<'BLURB';
|
||||
Fill the area specified either by the current selection if there is one, or by
|
||||
a seed fill starting at the specified coordinates.
|
||||
BLURB
|
||||
|
||||
$help = <<'HELP';
|
||||
This tool requires information on the paint application mode, and the
|
||||
fill mode, which can either be in the foreground color, or in the
|
||||
currently active pattern. If there is no selection, a seed fill is
|
||||
executed at the specified coordinates and extends outward in keeping
|
||||
with the threshold parameter. If there is a selection in the target
|
||||
image, the threshold, sample merged, x, and y arguments are unused. If
|
||||
the sample_merged parameter is TRUE, the data of the composite
|
||||
image will be used instead of that for the specified drawable. This
|
||||
is equivalent to sampling for colors after merging all visible
|
||||
layers. In the case of merged sampling, the x and y coordinates are
|
||||
relative to the image's origin; otherwise, they are relative to the
|
||||
drawable's origin.
|
||||
HELP
|
||||
|
||||
&std_pdb_misc;
|
||||
|
||||
$deprecated = 'gimp-drawable-edit-bucket-fill';
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The affected drawable' },
|
||||
{ name => 'fill_mode', type => 'enum GimpBucketFillMode',
|
||||
desc => 'The type of fill' },
|
||||
{ name => paint_mode, type => 'enum GimpLayerMode',
|
||||
default => 'GIMP_LAYER_MODE_NORMAL',
|
||||
desc => 'The paint application mode' },
|
||||
{ name => 'opacity', type => '0 <= float <= 100',
|
||||
desc => 'The opacity of the final bucket fill' },
|
||||
{ name => 'threshold', type => '0 <= float <= 255',
|
||||
desc => "The threshold determines how extensive the seed fill will
|
||||
be. It's value is specified in terms of intensity levels.
|
||||
This parameter is only valid when there is no selection in
|
||||
the specified image." },
|
||||
{ name => 'sample_merged', type => 'boolean',
|
||||
desc => 'Use the composite image, not the drawable' },
|
||||
{ name => 'x', type => 'float',
|
||||
desc => "The x coordinate of this bucket fill's application.
|
||||
This parameter is only valid when there is no selection
|
||||
in the specified image." },
|
||||
{ name => 'y', type => 'float',
|
||||
desc => "The y coordinate of this bucket fill's application.
|
||||
This parameter is only valid when there is no selection
|
||||
in the specified image." }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
headers => [ qw ("core/gimpdrawable-bucket-fill.h"
|
||||
"core/gimpchannel.h") ],
|
||||
code => <<'CODE'
|
||||
{
|
||||
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
|
||||
GIMP_PDB_ITEM_CONTENT, error) &&
|
||||
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
|
||||
{
|
||||
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
|
||||
GimpFillOptions *options = gimp_fill_options_new (gimp, NULL, FALSE);
|
||||
|
||||
if (gimp_fill_options_set_by_fill_mode (options, context,
|
||||
fill_mode, error))
|
||||
{
|
||||
if (paint_mode == GIMP_LAYER_MODE_OVERLAY_LEGACY)
|
||||
paint_mode = GIMP_LAYER_MODE_SOFTLIGHT_LEGACY;
|
||||
|
||||
gimp_context_set_opacity (GIMP_CONTEXT (options), opacity / 100.0);
|
||||
gimp_context_set_paint_mode (GIMP_CONTEXT (options), paint_mode);
|
||||
|
||||
if (! gimp_channel_is_empty (gimp_image_get_mask (image)))
|
||||
{
|
||||
gimp_drawable_edit_fill (drawable, options, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
gimp_drawable_bucket_fill (drawable, options,
|
||||
FALSE /* don't fill transparent */,
|
||||
GIMP_SELECT_CRITERION_COMPOSITE,
|
||||
threshold / 255.0,
|
||||
sample_merged,
|
||||
FALSE /* no diagonal neighbors */,
|
||||
x, y);
|
||||
}
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
|
||||
g_object_unref (options);
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub edit_bucket_fill_full {
|
||||
$blurb = <<'BLURB';
|
||||
Fill the area specified either by the current selection if there is one, or by
|
||||
a seed fill starting at the specified coordinates.
|
||||
BLURB
|
||||
|
||||
$help = <<'HELP';
|
||||
This tool requires information on the paint application mode, and the
|
||||
fill mode, which can either be in the foreground color, or in the
|
||||
currently active pattern. If there is no selection, a seed fill is
|
||||
executed at the specified coordinates and extends outward in keeping
|
||||
with the threshold parameter. If there is a selection in the target
|
||||
image, the threshold, sample merged, x, and y arguments are unused. If
|
||||
the sample_merged parameter is TRUE, the data of the composite
|
||||
image will be used instead of that for the specified drawable. This
|
||||
is equivalent to sampling for colors after merging all visible
|
||||
layers. In the case of merged sampling, the x and y coordinates are
|
||||
relative to the image's origin; otherwise, they are relative to the
|
||||
drawable's origin.
|
||||
HELP
|
||||
|
||||
&david_pdb_misc('2006', '2.4');
|
||||
|
||||
$deprecated = 'gimp-drawable-edit-bucket-fill';
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The affected drawable' },
|
||||
{ name => 'fill_mode', type => 'enum GimpBucketFillMode',
|
||||
desc => 'The type of fill' },
|
||||
{ name => paint_mode, type => 'enum GimpLayerMode',
|
||||
default => 'GIMP_LAYER_MODE_NORMAL',
|
||||
desc => 'The paint application mode' },
|
||||
{ name => 'opacity', type => '0 <= float <= 100',
|
||||
desc => 'The opacity of the final bucket fill' },
|
||||
{ name => 'threshold', type => '0 <= float <= 255',
|
||||
desc => "The threshold determines how extensive the seed fill will
|
||||
be. It's value is specified in terms of intensity levels.
|
||||
This parameter is only valid when there is no selection in
|
||||
the specified image." },
|
||||
{ name => 'sample_merged', type => 'boolean',
|
||||
desc => 'Use the composite image, not the drawable' },
|
||||
{ name => 'fill_transparent', type => 'boolean',
|
||||
desc => "Whether to consider transparent pixels for filling.
|
||||
If TRUE, transparency is considered as a unique fillable
|
||||
color." },
|
||||
{ name => 'select_criterion', type => 'enum GimpSelectCriterion',
|
||||
desc => "The criterion used to determine color similarity.
|
||||
SELECT_CRITERION_COMPOSITE is the standard choice.
|
||||
" },
|
||||
{ name => 'x', type => 'float',
|
||||
desc => "The x coordinate of this bucket fill's application.
|
||||
This parameter is only valid when there is no selection
|
||||
in the specified image." },
|
||||
{ name => 'y', type => 'float',
|
||||
desc => "The y coordinate of this bucket fill's application.
|
||||
This parameter is only valid when there is no selection
|
||||
in the specified image." }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
headers => [ qw ("core/gimpdrawable-bucket-fill.h"
|
||||
"core/gimpchannel.h") ],
|
||||
code => <<'CODE'
|
||||
{
|
||||
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
|
||||
GIMP_PDB_ITEM_CONTENT, error) &&
|
||||
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
|
||||
{
|
||||
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
|
||||
GimpFillOptions *options = gimp_fill_options_new (gimp, NULL, FALSE);
|
||||
|
||||
if (gimp_fill_options_set_by_fill_mode (options, context,
|
||||
fill_mode, error))
|
||||
{
|
||||
if (paint_mode == GIMP_LAYER_MODE_OVERLAY_LEGACY)
|
||||
paint_mode = GIMP_LAYER_MODE_SOFTLIGHT_LEGACY;
|
||||
|
||||
gimp_context_set_opacity (GIMP_CONTEXT (options), opacity / 100.0);
|
||||
gimp_context_set_paint_mode (GIMP_CONTEXT (options), paint_mode);
|
||||
|
||||
if (! gimp_channel_is_empty (gimp_image_get_mask (image)))
|
||||
{
|
||||
gimp_drawable_edit_fill (drawable, options, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
gimp_drawable_bucket_fill (drawable, options,
|
||||
fill_transparent,
|
||||
select_criterion,
|
||||
threshold / 255.0,
|
||||
sample_merged,
|
||||
FALSE /* no diagonal neighbors */,
|
||||
x, y);
|
||||
}
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
|
||||
g_object_unref (options);
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub edit_blend {
|
||||
$blurb = <<'BLURB';
|
||||
Blend between the starting and ending coordinates with the specified
|
||||
blend mode and gradient type.
|
||||
BLURB
|
||||
|
||||
$help = <<'HELP';
|
||||
This tool requires information on the paint application mode, the
|
||||
blend mode, and the gradient type. It creates the specified variety of
|
||||
blend using the starting and ending coordinates as defined for each
|
||||
gradient type.
|
||||
For shapeburst gradient types, the context's distance metric is also
|
||||
relevant and can be updated with gimp_context_set_distance_metric().
|
||||
HELP
|
||||
|
||||
&std_pdb_misc;
|
||||
|
||||
$deprecated = 'gimp-drawable-edit-gradient-fill';
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The affected drawable' },
|
||||
{ name => 'blend_mode', type => 'enum GimpBlendMode',
|
||||
desc => 'The type of blend' },
|
||||
{ name => 'paint_mode', type => 'enum GimpLayerMode',
|
||||
default => 'GIMP_LAYER_MODE_NORMAL',
|
||||
desc => 'The paint application mode' },
|
||||
{ name => 'gradient_type', type => 'enum GimpGradientType',
|
||||
desc => 'The type of gradient' },
|
||||
{ name => 'opacity', type => '0 <= float <= 100',
|
||||
desc => 'The opacity of the final blend' },
|
||||
{ name => 'offset', type => '0 <= float',
|
||||
desc => 'Offset relates to the starting and ending coordinates
|
||||
specified for the blend. This parameter is mode dependent.' },
|
||||
{ name => 'repeat', type => 'enum GimpRepeatMode',
|
||||
desc => 'Repeat mode' },
|
||||
{ name => 'reverse', type => 'boolean',
|
||||
desc => 'Use the reverse gradient' },
|
||||
{ name => 'supersample', type => 'boolean',
|
||||
desc => 'Do adaptive supersampling' },
|
||||
{ name => 'max_depth', type => '1 <= int32 <= 9', no_validate => 1,
|
||||
desc => 'Maximum recursion levels for supersampling' },
|
||||
{ name => 'threshold', type => '0 <= float <= 4', no_validate => 1,
|
||||
desc => 'Supersampling threshold' },
|
||||
{ name => 'dither', type => 'boolean',
|
||||
desc => 'Use dithering to reduce banding' },
|
||||
{ name => 'x1', type => 'float',
|
||||
desc => "The x coordinate of this blend's starting point" },
|
||||
{ name => 'y1', type => 'float',
|
||||
desc => "The y coordinate of this blend's starting point" },
|
||||
{ name => 'x2', type => 'float',
|
||||
desc => "The x coordinate of this blend's ending point" },
|
||||
{ name => 'y2', type => 'float',
|
||||
desc => "The y coordinate of this blend's ending point" }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
headers => [ qw("core/gimp-gradients.h" "core/gimpdrawable-gradient.h") ],
|
||||
code => <<'CODE'
|
||||
{
|
||||
success = (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
|
||||
GIMP_PDB_ITEM_CONTENT, error) &&
|
||||
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error));
|
||||
|
||||
if (success)
|
||||
{
|
||||
if (supersample)
|
||||
{
|
||||
if (max_depth < 1 || max_depth > 9)
|
||||
success = FALSE;
|
||||
|
||||
if (threshold < 0.0 || threshold > 4.0)
|
||||
success = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
max_depth = CLAMP (max_depth, 1, 9);
|
||||
threshold = CLAMP (threshold, 0.0, 4.0);
|
||||
}
|
||||
}
|
||||
|
||||
if (success)
|
||||
{
|
||||
GimpGradient *gradient;
|
||||
|
||||
if (paint_mode == GIMP_LAYER_MODE_OVERLAY_LEGACY)
|
||||
paint_mode = GIMP_LAYER_MODE_SOFTLIGHT_LEGACY;
|
||||
|
||||
if (progress)
|
||||
gimp_progress_start (progress, FALSE, _("Gradient"));
|
||||
|
||||
switch (blend_mode)
|
||||
{
|
||||
case GIMP_BLEND_FG_BG_RGB:
|
||||
gradient = gimp_gradients_get_fg_bg_rgb (context->gimp);
|
||||
break;
|
||||
|
||||
case GIMP_BLEND_FG_BG_HSV:
|
||||
gradient = gimp_gradients_get_fg_bg_hsv_cw (context->gimp);
|
||||
break;
|
||||
|
||||
case GIMP_BLEND_FG_TRANSPARENT:
|
||||
gradient = gimp_gradients_get_fg_transparent (context->gimp);
|
||||
break;
|
||||
|
||||
case GIMP_BLEND_CUSTOM:
|
||||
default:
|
||||
gradient = gimp_context_get_gradient (context);
|
||||
break;
|
||||
}
|
||||
|
||||
gimp_drawable_gradient (drawable,
|
||||
context,
|
||||
gradient,
|
||||
GIMP_PDB_CONTEXT (context)->distance_metric,
|
||||
paint_mode,
|
||||
gradient_type,
|
||||
opacity / 100.0,
|
||||
offset, repeat, reverse,
|
||||
GIMP_GRADIENT_BLEND_RGB_PERCEPTUAL,
|
||||
supersample, max_depth,
|
||||
threshold, dither,
|
||||
x1, y1, x2, y2,
|
||||
progress);
|
||||
|
||||
if (progress)
|
||||
gimp_progress_end (progress);
|
||||
}
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub edit_stroke {
|
||||
$blurb = 'Stroke the current selection';
|
||||
|
||||
$help = <<'HELP';
|
||||
This procedure strokes the current selection, painting along the selection
|
||||
boundary with the active brush and foreground color. The paint is applied to
|
||||
the specified drawable regardless of the active selection.
|
||||
HELP
|
||||
|
||||
&std_pdb_misc;
|
||||
|
||||
$deprecated = 'gimp-drawable-edit-stroke-selection';
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The drawable to stroke to' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
headers => [ qw("core/gimpstrokeoptions.h") ],
|
||||
code => <<'CODE'
|
||||
{
|
||||
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
|
||||
GIMP_PDB_ITEM_CONTENT, error) &&
|
||||
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
|
||||
{
|
||||
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
|
||||
GimpStrokeOptions *options;
|
||||
GimpPaintOptions *paint_options;
|
||||
|
||||
options = gimp_pdb_context_get_stroke_options (GIMP_PDB_CONTEXT (context));
|
||||
|
||||
paint_options =
|
||||
gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context), NULL);
|
||||
paint_options = gimp_config_duplicate (GIMP_CONFIG (paint_options));
|
||||
|
||||
success = gimp_item_stroke (GIMP_ITEM (gimp_image_get_mask (image)),
|
||||
drawable, context, options, paint_options,
|
||||
TRUE, progress, error);
|
||||
|
||||
g_object_unref (paint_options);
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub edit_stroke_vectors {
|
||||
$blurb = 'Stroke the specified vectors object';
|
||||
|
||||
$help = <<'HELP';
|
||||
This procedure strokes the specified vectors object, painting along the
|
||||
path with the active brush and foreground color.
|
||||
HELP
|
||||
|
||||
&simon_pdb_misc('2006', '2.4');
|
||||
|
||||
$deprecated = 'gimp-drawable-edit-stroke-item';
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The drawable to stroke to' },
|
||||
{ name => 'vectors', type => 'vectors',
|
||||
desc => 'The vectors object' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
headers => [ qw("core/gimpstrokeoptions.h") ],
|
||||
code => <<'CODE'
|
||||
{
|
||||
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
|
||||
GIMP_PDB_ITEM_CONTENT, error) &&
|
||||
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) &&
|
||||
gimp_pdb_item_is_attached (GIMP_ITEM (vectors),
|
||||
gimp_item_get_image (GIMP_ITEM (drawable)),
|
||||
0, error))
|
||||
{
|
||||
GimpStrokeOptions *options;
|
||||
GimpPaintOptions *paint_options;
|
||||
|
||||
options = gimp_pdb_context_get_stroke_options (GIMP_PDB_CONTEXT (context));
|
||||
|
||||
paint_options =
|
||||
gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context), NULL);
|
||||
paint_options = gimp_config_duplicate (GIMP_CONFIG (paint_options));
|
||||
|
||||
success = gimp_item_stroke (GIMP_ITEM (vectors),
|
||||
drawable, context, options, paint_options,
|
||||
TRUE, progress, error);
|
||||
|
||||
g_object_unref (paint_options);
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@headers = qw("libgimpconfig/gimpconfig.h"
|
||||
"core/gimp.h"
|
||||
|
@ -1057,14 +527,7 @@ CODE
|
|||
edit_named_copy
|
||||
edit_named_copy_visible
|
||||
edit_named_paste
|
||||
edit_named_paste_as_new_image
|
||||
edit_clear
|
||||
edit_fill
|
||||
edit_bucket_fill
|
||||
edit_bucket_fill_full
|
||||
edit_blend
|
||||
edit_stroke
|
||||
edit_stroke_vectors);
|
||||
edit_named_paste_as_new_image);
|
||||
|
||||
%exports = (app => [@procs], lib => [@procs]);
|
||||
|
||||
|
|
|
@ -164,40 +164,6 @@ CODE
|
|||
);
|
||||
}
|
||||
|
||||
sub floating_sel_rigor {
|
||||
&std_pdb_deprecated ();
|
||||
|
||||
@inargs = (
|
||||
{ name => 'floating_sel', type => 'layer', dead => 1,
|
||||
desc => 'The floating selection' },
|
||||
{ name => 'undo', type => 'boolean', dead => 1 }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub floating_sel_relax {
|
||||
&std_pdb_deprecated ();
|
||||
|
||||
@inargs = (
|
||||
{ name => 'floating_sel', type => 'layer', dead => 1,
|
||||
desc => 'The floating selection' },
|
||||
{ name => 'undo', type => 'boolean', dead => 1 }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@headers = qw("core/gimpimage.h"
|
||||
"core/gimplayer-floating-selection.h"
|
||||
|
@ -208,9 +174,7 @@ CODE
|
|||
@procs = qw(floating_sel_remove
|
||||
floating_sel_anchor
|
||||
floating_sel_to_layer
|
||||
floating_sel_attach
|
||||
floating_sel_rigor
|
||||
floating_sel_relax);
|
||||
floating_sel_attach);
|
||||
|
||||
%exports = (app => [@procs], lib => [@procs]);
|
||||
|
||||
|
|
|
@ -69,187 +69,6 @@ CODE
|
|||
);
|
||||
}
|
||||
|
||||
sub gradients_sample_uniform {
|
||||
&std_pdb_deprecated ('gimp-gradient-get-uniform-samples');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'num_samples', type => '2 <= int32',
|
||||
desc => 'The number of samples to take' },
|
||||
{ name => 'reverse', type => 'boolean',
|
||||
desc => 'Use the reverse gradient' }
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
{ name => 'color_samples', type => 'floatarray',
|
||||
desc => 'Color samples: { R1, G1, B1, A1, ..., Rn, Gn, Bn, An }',
|
||||
array => { name => 'array_length', no_lib => 1,
|
||||
desc => 'Length of the color_samples array (4 *
|
||||
num_samples)' } }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
GimpGradient *gradient;
|
||||
GimpGradientSegment *seg = NULL;
|
||||
gdouble pos, delta;
|
||||
GimpRGB color;
|
||||
gdouble *pv;
|
||||
|
||||
pos = 0.0;
|
||||
delta = 1.0 / (num_samples - 1);
|
||||
|
||||
array_length = num_samples * 4;
|
||||
|
||||
pv = color_samples = g_new (gdouble, array_length);
|
||||
|
||||
gradient = gimp_context_get_gradient (context);
|
||||
|
||||
while (num_samples--)
|
||||
{
|
||||
seg = gimp_gradient_get_color_at (gradient, context, seg,
|
||||
pos, reverse,
|
||||
GIMP_GRADIENT_BLEND_RGB_PERCEPTUAL,
|
||||
&color);
|
||||
|
||||
*pv++ = color.r;
|
||||
*pv++ = color.g;
|
||||
*pv++ = color.b;
|
||||
*pv++ = color.a;
|
||||
|
||||
pos += delta;
|
||||
}
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub gradients_sample_custom {
|
||||
&std_pdb_deprecated ('gimp-gradient-get-custom-samples');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'positions', type => 'floatarray',
|
||||
desc => 'The list of positions to sample along the gradient',
|
||||
array => { name => 'num_samples',
|
||||
desc => 'The number of samples to take' } },
|
||||
{ name => 'reverse', type => 'boolean',
|
||||
desc => 'Use the reverse gradient' }
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
{ name => 'color_samples', type => 'floatarray',
|
||||
desc => 'Color samples: { R1, G1, B1, A1, ..., Rn, Gn, Bn, An }',
|
||||
array => { name => 'array_length', no_lib => 1,
|
||||
desc => 'Length of the color_samples array (4 *
|
||||
num_samples)' } }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
GimpGradient *gradient;
|
||||
GimpGradientSegment *seg = NULL;
|
||||
GimpRGB color;
|
||||
gdouble *pv;
|
||||
|
||||
array_length = num_samples * 4;
|
||||
|
||||
pv = color_samples = g_new (gdouble, array_length);
|
||||
|
||||
gradient = gimp_context_get_gradient (context);
|
||||
|
||||
while (num_samples--)
|
||||
{
|
||||
seg = gimp_gradient_get_color_at (gradient, context, seg,
|
||||
*positions, reverse,
|
||||
GIMP_GRADIENT_BLEND_RGB_PERCEPTUAL,
|
||||
&color);
|
||||
|
||||
*pv++ = color.r;
|
||||
*pv++ = color.g;
|
||||
*pv++ = color.b;
|
||||
*pv++ = color.a;
|
||||
|
||||
positions++;
|
||||
}
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub gradients_get_gradient_data {
|
||||
&std_pdb_deprecated ('gimp-gradient-get-uniform-samples');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'name', type => 'string', null_ok => 1,
|
||||
desc => 'The gradient name ("" means current active gradient)' },
|
||||
{ name => 'sample_size', type => '1 <= int32 <= 10000',
|
||||
no_validate => 1,
|
||||
desc => 'Size of the sample to return when the gradient is changed' },
|
||||
{ name => 'reverse', type => 'boolean',
|
||||
desc => 'Use the reverse gradient' }
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
{ name => 'actual_name', type => 'string',
|
||||
desc => 'The gradient name' },
|
||||
{ name => 'grad_data', type => 'floatarray',
|
||||
desc => 'The gradient sample data',
|
||||
array => { name => 'width',
|
||||
desc => 'The gradient sample width (r,g,b,a)' } }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<"CODE"
|
||||
{
|
||||
GimpGradient *gradient;
|
||||
|
||||
if (sample_size < 1 || sample_size > 10000)
|
||||
sample_size = GIMP_GRADIENT_DEFAULT_SAMPLE_SIZE;
|
||||
|
||||
if (name && strlen (name))
|
||||
gradient = gimp_pdb_get_gradient (gimp, name, FALSE, error);
|
||||
else
|
||||
gradient = gimp_context_get_gradient (context);
|
||||
|
||||
if (gradient)
|
||||
{
|
||||
GimpGradientSegment *seg = NULL;
|
||||
gdouble *pv;
|
||||
gdouble pos, delta;
|
||||
GimpRGB color;
|
||||
|
||||
pos = 0.0;
|
||||
delta = 1.0 / (sample_size - 1);
|
||||
|
||||
actual_name = g_strdup (gimp_object_get_name (gradient));
|
||||
grad_data = g_new (gdouble, sample_size * 4);
|
||||
width = sample_size * 4;
|
||||
|
||||
pv = grad_data;
|
||||
|
||||
while (sample_size--)
|
||||
{
|
||||
seg = gimp_gradient_get_color_at (gradient, context, seg,
|
||||
pos, reverse,
|
||||
GIMP_GRADIENT_BLEND_RGB_PERCEPTUAL,
|
||||
&color);
|
||||
|
||||
*pv++ = color.r;
|
||||
*pv++ = color.g;
|
||||
*pv++ = color.b;
|
||||
*pv++ = color.a;
|
||||
|
||||
pos += delta;
|
||||
}
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@headers = qw(<string.h>
|
||||
"core/gimp.h"
|
||||
|
@ -259,10 +78,7 @@ CODE
|
|||
"gimppdb-utils.h");
|
||||
|
||||
@procs = qw(gradients_refresh
|
||||
gradients_get_list
|
||||
gradients_sample_uniform
|
||||
gradients_sample_custom
|
||||
gradients_get_gradient_data);
|
||||
gradients_get_list);
|
||||
|
||||
%exports = (app => [@procs], lib => [@procs]);
|
||||
|
||||
|
|
|
@ -239,22 +239,6 @@ CODE
|
|||
);
|
||||
}
|
||||
|
||||
sub image_free_shadow {
|
||||
&std_pdb_deprecated ('gimp-drawable-free-shadow');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'image', type => 'image', dead => 1,
|
||||
desc => 'The image' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub image_get_layers {
|
||||
$blurb = 'Returns the list of layers contained in the specified image.';
|
||||
|
||||
|
@ -849,36 +833,6 @@ CODE
|
|||
);
|
||||
}
|
||||
|
||||
sub image_add_layer {
|
||||
&std_pdb_deprecated ('gimp-image-insert-layer');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'image', type => 'image',
|
||||
desc => 'The image' },
|
||||
{ name => 'layer', type => 'layer',
|
||||
desc => 'The layer' },
|
||||
{ name => 'position', type => 'int32',
|
||||
desc => 'The layer position' }
|
||||
);
|
||||
|
||||
$invoke{code} = <<'CODE';
|
||||
{
|
||||
if (gimp_pdb_item_is_floating (GIMP_ITEM (layer), image, error) &&
|
||||
gimp_pdb_image_is_base_type (image,
|
||||
gimp_drawable_get_base_type (GIMP_DRAWABLE (layer)),
|
||||
error))
|
||||
{
|
||||
success = gimp_image_add_layer (image, layer,
|
||||
NULL, MAX (position, -1), TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
success = FALSE;
|
||||
}
|
||||
}
|
||||
CODE
|
||||
}
|
||||
|
||||
sub image_insert_layer {
|
||||
$blurb = 'Add the specified layer to the image.';
|
||||
|
||||
|
@ -964,61 +918,6 @@ CODE
|
|||
);
|
||||
}
|
||||
|
||||
sub image_add_layer_mask {
|
||||
&std_pdb_deprecated ('gimp-layer-add-mask');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'image', type => 'image',
|
||||
desc => 'The image' },
|
||||
{ name => 'layer', type => 'layer',
|
||||
desc => 'The layer to receive the mask' },
|
||||
{ name => 'mask', type => 'layer_mask',
|
||||
desc => 'The mask to add to the layer' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
if (gimp_pdb_item_is_floating (GIMP_ITEM (mask), image, error) &&
|
||||
gimp_pdb_item_is_not_group (GIMP_ITEM (layer), error))
|
||||
success = (gimp_layer_add_mask (layer, mask, TRUE, error) == mask);
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub image_remove_layer_mask {
|
||||
&std_pdb_deprecated ('gimp-layer-remove-mask');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'image', type => 'image',
|
||||
desc => 'The image' },
|
||||
{ name => 'layer', type => 'layer',
|
||||
desc => 'The layer from which to remove mask' },
|
||||
{ name => 'mode', type => 'enum GimpMaskApplyMode',
|
||||
desc => 'Removal mode' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
GimpPDBItemModify modify = 0;
|
||||
|
||||
if (mode == GIMP_MASK_APPLY)
|
||||
modify |= GIMP_PDB_ITEM_CONTENT;
|
||||
|
||||
if (gimp_pdb_item_is_attached (GIMP_ITEM (layer), image, modify, error) &&
|
||||
gimp_layer_get_mask (layer))
|
||||
gimp_layer_apply_mask (layer, mode, TRUE);
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub image_freeze_layers {
|
||||
$blurb = "Freeze the image's layer list.";
|
||||
|
||||
|
@ -1095,35 +994,6 @@ CODE
|
|||
);
|
||||
}
|
||||
|
||||
sub image_add_channel {
|
||||
&std_pdb_deprecated ('gimp-image-insert-channel');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'image', type => 'image',
|
||||
desc => 'The image' },
|
||||
{ name => 'channel', type => 'channel',
|
||||
desc => 'The channel' },
|
||||
{ name => 'position', type => 'int32',
|
||||
desc => 'The channel position' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
if (gimp_pdb_item_is_floating (GIMP_ITEM (channel), image, error))
|
||||
{
|
||||
success = gimp_image_add_channel (image, channel,
|
||||
NULL, MAX (position, -1), TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
success = FALSE;
|
||||
}
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub image_insert_channel {
|
||||
$blurb = 'Add the specified channel to the image.';
|
||||
|
||||
|
@ -1275,33 +1145,6 @@ CODE
|
|||
);
|
||||
}
|
||||
|
||||
sub image_add_vectors {
|
||||
&std_pdb_deprecated ('gimp-image-insert-vectors');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'image', type => 'image',
|
||||
desc => 'The image' },
|
||||
{ name => 'vectors', type => 'vectors',
|
||||
desc => 'The vectors object' },
|
||||
{ name => 'position', type => 'int32',
|
||||
desc => 'The vectors objects position' }
|
||||
);
|
||||
|
||||
$invoke{code} = <<'CODE';
|
||||
{
|
||||
if (gimp_pdb_item_is_floating (GIMP_ITEM (vectors), image, error))
|
||||
{
|
||||
success = gimp_image_add_vectors (image, vectors,
|
||||
NULL, MAX (position, -1), TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
success = FALSE;
|
||||
}
|
||||
}
|
||||
CODE
|
||||
}
|
||||
|
||||
sub image_insert_vectors {
|
||||
$blurb = 'Add the specified vectors to the image.';
|
||||
|
||||
|
@ -3096,7 +2939,6 @@ CODE
|
|||
image_get_precision
|
||||
image_get_default_new_layer_mode
|
||||
image_width image_height
|
||||
image_free_shadow
|
||||
image_get_layers
|
||||
image_get_channels
|
||||
image_get_vectors
|
||||
|
@ -3106,18 +2948,17 @@ CODE
|
|||
image_floating_sel_attached_to
|
||||
image_pick_color
|
||||
image_pick_correlate_layer
|
||||
image_add_layer image_insert_layer image_remove_layer
|
||||
image_insert_layer image_remove_layer
|
||||
image_freeze_layers image_thaw_layers
|
||||
image_add_channel image_insert_channel image_remove_channel
|
||||
image_insert_channel image_remove_channel
|
||||
image_freeze_channels image_thaw_channels
|
||||
image_add_vectors image_insert_vectors image_remove_vectors
|
||||
image_insert_vectors image_remove_vectors
|
||||
image_freeze_vectors image_thaw_vectors
|
||||
image_get_item_position
|
||||
image_raise_item image_lower_item
|
||||
image_raise_item_to_top image_lower_item_to_bottom
|
||||
image_reorder_item
|
||||
image_flatten image_merge_visible_layers image_merge_down
|
||||
image_add_layer_mask image_remove_layer_mask
|
||||
image_get_colormap image_set_colormap
|
||||
image_get_metadata image_set_metadata
|
||||
image_clean_all image_is_dirty
|
||||
|
@ -3147,11 +2988,7 @@ CODE
|
|||
image_get_parasite
|
||||
image_get_parasite_list);
|
||||
|
||||
# For the lib parameter EXCLUDE functions #45 and #46, which are
|
||||
# image_add_layer_mask and image_remove_layer_mask.
|
||||
# If adding or removing functions, make sure the range below is
|
||||
# updated correctly!
|
||||
%exports = (app => [@procs], lib => [@procs[0..44,47..87]]);
|
||||
%exports = (app => [@procs], lib => [@procs]);
|
||||
|
||||
$desc = 'Image';
|
||||
$doc_title = 'gimpimage';
|
||||
|
|
|
@ -126,37 +126,6 @@ CODE
|
|||
);
|
||||
}
|
||||
|
||||
sub image_scale_full {
|
||||
&std_pdb_deprecated('gimp-image-scale');
|
||||
&neo_pdb_misc('2008', '2.6');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'image', type => 'image',
|
||||
desc => 'The image' },
|
||||
{ name => 'new_width', type => '1 <= int32 <= GIMP_MAX_IMAGE_SIZE',
|
||||
desc => 'New image width' },
|
||||
{ name => 'new_height', type => '1 <= int32 <= GIMP_MAX_IMAGE_SIZE',
|
||||
desc => 'New image height' },
|
||||
{ name => 'interpolation', type => 'enum GimpInterpolationType',
|
||||
desc => 'Type of interpolation' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
headers => [ qw("core/gimpimage-scale.h") ],
|
||||
code => <<'CODE'
|
||||
{
|
||||
if (progress)
|
||||
gimp_progress_start (progress, FALSE, _("Scaling"));
|
||||
|
||||
gimp_image_scale (image, new_width, new_height, interpolation, progress);
|
||||
|
||||
if (progress)
|
||||
gimp_progress_end (progress);
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub image_crop {
|
||||
$blurb = 'Crop the image to the specified extents.';
|
||||
|
||||
|
@ -263,7 +232,7 @@ CODE
|
|||
"gimp-intl.h");
|
||||
|
||||
@procs = qw(image_resize image_resize_to_layers
|
||||
image_scale image_scale_full
|
||||
image_scale
|
||||
image_crop image_flip image_rotate);
|
||||
|
||||
%exports = (app => [@procs], lib => [@procs]);
|
||||
|
|
|
@ -486,49 +486,6 @@ CODE
|
|||
);
|
||||
}
|
||||
|
||||
sub layer_scale_full {
|
||||
&std_pdb_deprecated('gimp-layer-scale');
|
||||
&neo_pdb_misc('2008', '2.6');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'layer', type => 'layer',
|
||||
desc => 'The layer' },
|
||||
{ name => 'new_width', type => '1 <= int32 <= GIMP_MAX_IMAGE_SIZE',
|
||||
desc => 'New layer width' },
|
||||
{ name => 'new_height', type => '1 <= int32 <= GIMP_MAX_IMAGE_SIZE',
|
||||
desc => 'New layer height' },
|
||||
{ name => 'local_origin', type => 'boolean',
|
||||
desc => 'Use a local origin (as opposed to the image origin)' },
|
||||
{ name => 'interpolation', type => 'enum GimpInterpolationType',
|
||||
desc => 'Type of interpolation' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
if (gimp_pdb_item_is_attached (GIMP_ITEM (layer), NULL,
|
||||
GIMP_PDB_ITEM_CONTENT | GIMP_PDB_ITEM_POSITION,
|
||||
error))
|
||||
{
|
||||
if (progress)
|
||||
gimp_progress_start (progress, FALSE, _("Scaling"));
|
||||
|
||||
gimp_item_scale_by_origin (GIMP_ITEM (layer), new_width, new_height,
|
||||
interpolation, progress,
|
||||
local_origin);
|
||||
|
||||
if (progress)
|
||||
gimp_progress_end (progress);
|
||||
}
|
||||
else
|
||||
{
|
||||
success = FALSE;
|
||||
}
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub layer_resize {
|
||||
$blurb = 'Resize the layer to the specified extents.';
|
||||
|
||||
|
@ -600,52 +557,6 @@ CODE
|
|||
);
|
||||
}
|
||||
|
||||
sub layer_translate {
|
||||
$blurb = 'Translate the layer by the specified offsets.';
|
||||
|
||||
$help = <<'HELP';
|
||||
This procedure translates the layer by the amounts specified in the x and y
|
||||
arguments. These can be negative, and are considered offsets from the current
|
||||
position. This command only works if the layer has been added to an image. All
|
||||
additional layers contained in the image which have the linked flag set to TRUE
|
||||
w ill also be translated by the specified offsets.
|
||||
HELP
|
||||
|
||||
&std_pdb_misc;
|
||||
|
||||
$deprecated = 'gimp-item-transform-translate';
|
||||
|
||||
@inargs = (
|
||||
{ name => 'layer', type => 'layer',
|
||||
desc => 'The layer' },
|
||||
{ name => 'offx', type => 'int32',
|
||||
desc => "Offset in x direction" },
|
||||
{ name => 'offy', type => 'int32',
|
||||
desc => "Offset in y direction" }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
if (gimp_pdb_item_is_modifiable (GIMP_ITEM (layer),
|
||||
GIMP_PDB_ITEM_POSITION, error))
|
||||
{
|
||||
if (gimp_item_get_linked (GIMP_ITEM (layer)))
|
||||
{
|
||||
gimp_item_linked_translate (GIMP_ITEM (layer), offx, offy, TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
gimp_item_translate (GIMP_ITEM (layer), offx, offy, TRUE);
|
||||
}
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub layer_add_alpha {
|
||||
$blurb = <<'BLURB';
|
||||
Add an alpha channel to the layer if it doesn't already have one.
|
||||
|
@ -1380,9 +1291,8 @@ CODE
|
|||
layer_copy
|
||||
layer_add_alpha
|
||||
layer_flatten
|
||||
layer_scale layer_scale_full
|
||||
layer_scale
|
||||
layer_resize layer_resize_to_image_size
|
||||
layer_translate
|
||||
layer_set_offsets
|
||||
layer_create_mask
|
||||
layer_get_mask
|
||||
|
|
|
@ -68,82 +68,6 @@ CODE
|
|||
);
|
||||
}
|
||||
|
||||
sub palettes_get_palette {
|
||||
&std_pdb_deprecated ('gimp-context-get-palette');
|
||||
|
||||
@outargs = (
|
||||
{ name => 'name', type => 'string', null_ok => 1,
|
||||
desc => 'The palette name' },
|
||||
{ name => 'num_colors', type => 'int32',
|
||||
desc => 'The palette num_colors' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
GimpPalette *palette = gimp_context_get_palette (context);
|
||||
|
||||
if (palette)
|
||||
{
|
||||
name = g_strdup (gimp_object_get_name (palette));
|
||||
num_colors = gimp_palette_get_n_colors (palette);
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub palettes_get_palette_entry {
|
||||
&std_pdb_deprecated ('gimp-palette-entry-get-color');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'name', type => 'string', null_ok => 1,
|
||||
desc => 'The palette name ("" means currently active palette)' },
|
||||
{ name => 'entry_num', type => 'int32',
|
||||
desc => 'The entry to retrieve' }
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
{ name => 'actual_name', type => 'string',
|
||||
desc => 'The palette name' },
|
||||
{ name => 'num_colors', type => 'int32',
|
||||
desc => 'The palette num_colors' },
|
||||
{ name => 'color', type => 'color', void_ret => 1,
|
||||
desc => 'The color requested' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
GimpPalette *palette;
|
||||
|
||||
if (name && strlen (name))
|
||||
palette = gimp_pdb_get_palette (gimp, name, FALSE, error);
|
||||
else
|
||||
palette = gimp_context_get_palette (context);
|
||||
|
||||
if (palette)
|
||||
{
|
||||
GimpPaletteEntry *entry = gimp_palette_get_entry (palette, entry_num);
|
||||
|
||||
if (entry)
|
||||
{
|
||||
actual_name = g_strdup (gimp_object_get_name (palette));
|
||||
num_colors = gimp_palette_get_n_colors (palette);
|
||||
color = entry->color;
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@headers = qw(<string.h>
|
||||
"core/gimp.h"
|
||||
|
@ -153,9 +77,7 @@ CODE
|
|||
"gimppdb-utils.h");
|
||||
|
||||
@procs = qw(palettes_refresh
|
||||
palettes_get_list
|
||||
palettes_get_palette
|
||||
palettes_get_palette_entry);
|
||||
palettes_get_list);
|
||||
|
||||
%exports = (app => [@procs], lib => [@procs]);
|
||||
|
||||
|
|
|
@ -1,636 +0,0 @@
|
|||
# GIMP - The GNU Image Manipulation Program
|
||||
# Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (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
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# "Perlized" from C source by Andy Thomas <alt@gimp.org>
|
||||
|
||||
sub path_list {
|
||||
&std_pdb_deprecated('gimp-image-get-vectors');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'image', type => 'image',
|
||||
desc => 'The image to list the paths from' }
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
{ name => 'path_list', type => 'stringarray',
|
||||
desc => 'List of the paths belonging to this image',
|
||||
array => { name => 'num_paths',
|
||||
desc => 'The number of paths returned.' } }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
path_list = gimp_container_get_name_array (gimp_image_get_vectors (image),
|
||||
&num_paths);
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub path_get_points {
|
||||
&std_pdb_deprecated('gimp-vectors-stroke-get-points');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'image', type => 'image',
|
||||
desc => 'The image to list the paths from' },
|
||||
{ name => 'name', type => 'string',
|
||||
desc => 'The name of the path whose points should be listed.' }
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
{ name => 'path_type', type => 'int32',
|
||||
desc => 'The type of the path. Currently only one type (1 = Bezier)
|
||||
is supported' },
|
||||
{ name => 'path_closed', type => 'int32',
|
||||
desc => 'Return if the path is closed. (0 = path open, 1 = path
|
||||
closed)' },
|
||||
{ name => 'points_pairs', type => 'floatarray',
|
||||
desc => 'The points in the path represented as 3 floats. The first is
|
||||
the x pos, next is the y pos, last is the type of the pnt.
|
||||
The type field is dependent on the path type. For beziers
|
||||
(type 1 paths) the type can either be (1.0 = BEZIER_ANCHOR,
|
||||
2.0 = BEZIER_CONTROL, 3.0 = BEZIER_MOVE). Note all points
|
||||
are returned in pixel resolution.',
|
||||
array => { name => 'num_path_point_details',
|
||||
desc => 'The number of points returned. Each point is
|
||||
made up of (x, y, pnt_type) of floats.' } }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
GimpVectors *vectors = gimp_image_get_vectors_by_name (image, name);
|
||||
|
||||
if (vectors)
|
||||
{
|
||||
GimpVectorsCompatPoint *points;
|
||||
gint num_points;
|
||||
|
||||
path_type = 1; /* BEZIER (1.2 compat) */
|
||||
|
||||
points = gimp_vectors_compat_get_points (vectors, &num_points,
|
||||
&path_closed);
|
||||
|
||||
num_path_point_details = num_points * 3;
|
||||
|
||||
if (points)
|
||||
{
|
||||
gdouble *curr_point;
|
||||
gint i;
|
||||
|
||||
points_pairs = g_new0 (gdouble, num_path_point_details);
|
||||
|
||||
for (i = 0, curr_point = points_pairs;
|
||||
i < num_points;
|
||||
i++, curr_point += 3)
|
||||
{
|
||||
curr_point[0] = points[i].x;
|
||||
curr_point[1] = points[i].y;
|
||||
curr_point[2] = points[i].type;
|
||||
}
|
||||
|
||||
g_free (points);
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub path_get_current {
|
||||
&std_pdb_deprecated('gimp-image-get-active-vectors');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'image', type => 'image',
|
||||
desc => 'The image to get the current path from' },
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
{ name => 'name', type => 'string',
|
||||
desc => 'The name of the current path.' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
GimpVectors *vectors = gimp_image_get_active_vectors (image);
|
||||
|
||||
if (vectors)
|
||||
name = g_strdup (gimp_object_get_name (vectors));
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub path_set_current {
|
||||
&std_pdb_deprecated('gimp-image-set-active-vectors');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'image', type => 'image',
|
||||
desc => 'The image in which a path will become current' },
|
||||
{ name => 'name', type => 'string',
|
||||
desc => 'The name of the path to make current.' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
GimpVectors *vectors = gimp_image_get_vectors_by_name (image, name);
|
||||
|
||||
if (vectors)
|
||||
gimp_image_set_active_vectors (image, vectors);
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub path_set_points {
|
||||
&std_pdb_deprecated('gimp-vectors-stroke-new-from-points');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'image', type => 'image',
|
||||
desc => 'The image to set the paths in' },
|
||||
{ name => 'name', type => 'string',
|
||||
desc => 'The name of the path to create. If it exists then a unique
|
||||
name will be created - query the list of paths if you want
|
||||
to make sure that the name of the path you create is
|
||||
unique. This will be set as the current path.' },
|
||||
{ name => 'ptype', type => 'int32', dead => 1,
|
||||
desc => 'The type of the path. Currently only one type (1 = Bezier)
|
||||
is supported.' },
|
||||
{ name => 'points_pairs', type => 'floatarray',
|
||||
desc => 'The points in the path represented as 3 floats. The first is
|
||||
the x pos, next is the y pos, last is the type of the pnt.
|
||||
The type field is dependent on the path type. For beziers
|
||||
(type 1 paths) the type can either be (1.0 = BEZIER_ANCHOR,
|
||||
2.0 = BEZIER_CONTROL, 3.0= BEZIER_MOVE). Note all points are
|
||||
returned in pixel resolution.',
|
||||
array => { name => 'num_path_points',
|
||||
desc => 'The number of elements in the array, i.e. the number
|
||||
of points in the path * 3. Each point is
|
||||
made up of (x, y, type) of floats. Currently only
|
||||
the creation of bezier curves is allowed. The type
|
||||
parameter must be set to (1) to indicate a BEZIER
|
||||
type curve. Note that for BEZIER curves, points
|
||||
must be given in the following order: ACCACCAC...
|
||||
If the path is not closed the last control
|
||||
point is missed off. Points consist of three
|
||||
control points (control/anchor/control) so for a
|
||||
curve that is not closed there must be at least
|
||||
two points passed (2 x,y pairs). If
|
||||
(num_path_points/3) % 3 = 0 then the path is
|
||||
assumed to be closed and the points are
|
||||
ACCACCACCACC.' } }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
gboolean closed = FALSE;
|
||||
|
||||
if ((num_path_points / 3) % 3 == 0)
|
||||
closed = TRUE;
|
||||
else if ((num_path_points / 3) % 3 != 2)
|
||||
success = FALSE;
|
||||
|
||||
if (success)
|
||||
{
|
||||
GimpVectors *vectors;
|
||||
const gdouble *curr_point_pair;
|
||||
GimpVectorsCompatPoint *points;
|
||||
gint n_points;
|
||||
gint i;
|
||||
|
||||
n_points = num_path_points / 3;
|
||||
|
||||
points = g_new0 (GimpVectorsCompatPoint, n_points);
|
||||
|
||||
for (i = 0, curr_point_pair = points_pairs;
|
||||
i < n_points;
|
||||
i++, curr_point_pair += 3)
|
||||
{
|
||||
points[i].x = curr_point_pair[0];
|
||||
points[i].y = curr_point_pair[1];
|
||||
points[i].type = curr_point_pair[2];
|
||||
}
|
||||
|
||||
vectors = gimp_vectors_compat_new (image, name, points, n_points,
|
||||
closed);
|
||||
|
||||
g_free (points);
|
||||
|
||||
if (vectors)
|
||||
success = gimp_image_add_vectors (image, vectors, NULL, 0, TRUE);
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub path_stroke_current {
|
||||
&std_pdb_deprecated('gimp-edit-stroke-vectors');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'image', type => 'image',
|
||||
desc => 'The image which contains the path to stroke' },
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
headers => [ qw("core/gimpstrokeoptions.h") ],
|
||||
code => <<'CODE'
|
||||
{
|
||||
GimpVectors *vectors = gimp_image_get_active_vectors (image);
|
||||
GimpDrawable *drawable = gimp_image_get_active_drawable (image);
|
||||
|
||||
if (vectors && drawable &&
|
||||
gimp_pdb_item_is_modifiable (GIMP_ITEM (drawable),
|
||||
GIMP_PDB_ITEM_CONTENT, error) &&
|
||||
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
|
||||
{
|
||||
GimpStrokeOptions *options;
|
||||
GimpPaintOptions *paint_options;
|
||||
|
||||
options = gimp_stroke_options_new (gimp, context, TRUE);
|
||||
g_object_set (options,
|
||||
"method", GIMP_STROKE_PAINT_METHOD,
|
||||
NULL);
|
||||
|
||||
paint_options =
|
||||
gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context), NULL);
|
||||
paint_options = gimp_config_duplicate (GIMP_CONFIG (paint_options));
|
||||
|
||||
success = gimp_item_stroke (GIMP_ITEM (vectors),
|
||||
drawable, context, options, paint_options,
|
||||
TRUE, progress, error);
|
||||
|
||||
g_object_unref (options);
|
||||
g_object_unref (paint_options);
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub path_get_point_at_dist {
|
||||
&std_pdb_deprecated('gimp-vectors-stroke-get-point-at-dist');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'image', type => 'image',
|
||||
desc => 'The image the paths belongs to' },
|
||||
{ name => 'distance', type => 'float',
|
||||
desc => 'The distance along the path.' }
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
{ name => 'x_point', type => 'int32',
|
||||
desc => 'The x position of the point.' },
|
||||
{ name => 'y_point', type => 'int32',
|
||||
desc => 'The y position of the point.' },
|
||||
{ name => 'slope', type => 'float',
|
||||
desc => 'The slope (dy / dx) at the specified point.' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
GimpVectors *vectors;
|
||||
GimpStroke *stroke;
|
||||
gdouble distance_along;
|
||||
gdouble stroke_length;
|
||||
gdouble stroke_distance;
|
||||
GimpCoords position;
|
||||
|
||||
vectors = gimp_image_get_active_vectors (image);
|
||||
|
||||
if (vectors)
|
||||
{
|
||||
distance_along = 0.0;
|
||||
stroke = gimp_vectors_stroke_get_next (vectors, NULL);
|
||||
|
||||
while (stroke != NULL )
|
||||
{
|
||||
stroke_length = gimp_stroke_get_length (stroke, 0.5);
|
||||
|
||||
if (distance_along + stroke_length < distance)
|
||||
{
|
||||
distance_along += stroke_length;
|
||||
}
|
||||
else
|
||||
{
|
||||
stroke_distance = distance - distance_along;
|
||||
stroke_distance = stroke_distance < 0 ? 0: stroke_distance;
|
||||
|
||||
if (!gimp_stroke_get_point_at_dist (stroke, stroke_distance, 0.5,
|
||||
&position, &slope))
|
||||
{
|
||||
success = FALSE;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
success = TRUE;
|
||||
x_point = ROUND (position.x);
|
||||
y_point = ROUND (position.y);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
stroke = gimp_vectors_stroke_get_next (vectors, stroke);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
success = FALSE;
|
||||
}
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub path_get_tattoo {
|
||||
&std_pdb_deprecated('gimp-vectors-get-tattoo');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'image', type => 'image',
|
||||
desc => 'The image' },
|
||||
{ name => 'name', type => 'string',
|
||||
desc => 'The name of the path whose tattoo should be obtained.' }
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
{ name => 'tattoo', type => 'int32',
|
||||
desc => 'The tattoo associated with the named path.' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
GimpVectors *vectors = gimp_image_get_vectors_by_name (image, name);
|
||||
|
||||
if (vectors)
|
||||
tattoo = gimp_item_get_tattoo (GIMP_ITEM (vectors));
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub path_set_tattoo {
|
||||
&std_pdb_deprecated('gimp-vectors-set-tattoo');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'image', type => 'image',
|
||||
desc => 'The image' },
|
||||
{ name => 'name', type => 'string',
|
||||
desc => 'the name of the path whose tattoo should be set' },
|
||||
{ name => 'tattovalue', type => 'int32',
|
||||
desc => "The tattoo associated with the name path. Only values
|
||||
returned from 'path_get_tattoo' should be used here" }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
GimpVectors *vectors = gimp_image_get_vectors_by_name (image, name);
|
||||
|
||||
if (vectors)
|
||||
gimp_item_set_tattoo (GIMP_ITEM (vectors), tattovalue);
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub get_path_by_tattoo {
|
||||
&std_pdb_deprecated('gimp-image-get-vectors-by-tattoo');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'image', type => 'image',
|
||||
desc => 'The image' },
|
||||
{ name => 'tattoo', type => 'int32',
|
||||
desc => 'The tattoo of the required path.' }
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
{ name => 'name', type => 'string',
|
||||
desc => 'The name of the path with the specified tattoo.' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
GimpVectors *vectors = gimp_image_get_vectors_by_tattoo (image, tattoo);
|
||||
|
||||
if (vectors)
|
||||
name = g_strdup (gimp_object_get_name (vectors));
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub path_delete {
|
||||
&std_pdb_deprecated('gimp-image-remove-vectors');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'image', type => 'image',
|
||||
desc => 'The image to delete the path from' },
|
||||
{ name => 'name', type => 'string',
|
||||
desc => 'The name of the path to delete.' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
GimpVectors *vectors = gimp_image_get_vectors_by_name (image, name);
|
||||
|
||||
if (vectors)
|
||||
gimp_image_remove_vectors (image, vectors, TRUE, NULL);
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub path_get_locked {
|
||||
&std_pdb_deprecated('gimp-vectors-get-linked');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'image', type => 'image',
|
||||
desc => 'The image' },
|
||||
{ name => 'name', type => 'string',
|
||||
desc => 'The name of the path whose locked status should be
|
||||
obtained.' }
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
{ name => 'locked', type => 'boolean',
|
||||
desc => 'TRUE if the path is locked, FALSE otherwise' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
GimpVectors *vectors = gimp_image_get_vectors_by_name (image, name);
|
||||
|
||||
if (vectors)
|
||||
locked = gimp_item_get_linked (GIMP_ITEM (vectors));
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub path_set_locked {
|
||||
&std_pdb_deprecated('gimp-vectors-set-linked');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'image', type => 'image',
|
||||
desc => 'The image' },
|
||||
{ name => 'name', type => 'string',
|
||||
desc => 'the name of the path whose locked status should be set' },
|
||||
{ name => 'locked', type => 'boolean',
|
||||
desc => 'Whether the path is locked' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
GimpVectors *vectors = gimp_image_get_vectors_by_name (image, name);
|
||||
|
||||
if (vectors)
|
||||
gimp_item_set_linked (GIMP_ITEM (vectors), locked, TRUE);
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub path_to_selection {
|
||||
&std_pdb_deprecated('gimp-vectors-to-selection');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'image', type => 'image',
|
||||
desc => 'The image' },
|
||||
{ name => 'name', type => 'string',
|
||||
desc => 'The name of the path which should be made into selection.' },
|
||||
{ name => 'op', type => 'enum GimpChannelOps',
|
||||
desc => 'The desired operation with current selection' },
|
||||
{ name => 'antialias', type => 'boolean',
|
||||
desc => 'Antialias selection.' },
|
||||
{ name => 'feather', type => 'boolean',
|
||||
desc => 'Feather selection.' },
|
||||
{ name => 'feather_radius_x', type => 'float',
|
||||
desc => 'Feather radius x.' },
|
||||
{ name => 'feather_radius_y', type => 'float',
|
||||
desc => 'Feather radius y.' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
GimpVectors *vectors = gimp_image_get_vectors_by_name (image, name);
|
||||
|
||||
if (vectors)
|
||||
gimp_item_to_selection (GIMP_ITEM (vectors),
|
||||
op,
|
||||
antialias,
|
||||
feather,
|
||||
feather_radius_x,
|
||||
feather_radius_y);
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub path_import {
|
||||
&std_pdb_deprecated('gimp-vectors-import-from-file');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'image', type => 'image',
|
||||
desc => 'The image' },
|
||||
{ name => 'filename', type => 'string', allow_non_utf8 => 1,
|
||||
desc => 'The name of the SVG file to import.' },
|
||||
{ name => 'merge', type => 'boolean',
|
||||
desc => 'Merge paths into a single vectors object.' },
|
||||
{ name => 'scale', type => 'boolean',
|
||||
desc => 'Scale the SVG to image dimensions.' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
headers => [ qw("vectors/gimpvectors-import.h") ],
|
||||
code => <<'CODE'
|
||||
{
|
||||
GFile *file = g_file_new_for_path (filename);
|
||||
|
||||
success = gimp_vectors_import_file (image, file,
|
||||
merge, scale, NULL, -1, NULL, NULL);
|
||||
|
||||
g_object_unref (file);
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@headers = qw(<string.h>
|
||||
"libgimpconfig/gimpconfig.h"
|
||||
"libgimpmath/gimpmath.h"
|
||||
"core/gimplist.h"
|
||||
"vectors/gimpanchor.h"
|
||||
"vectors/gimpbezierstroke.h"
|
||||
"vectors/gimpvectors.h"
|
||||
"vectors/gimpvectors-compat.h"
|
||||
"gimppdb-utils.h"
|
||||
"gimppdbcontext.h"
|
||||
"gimp-intl.h");
|
||||
|
||||
@procs = qw(path_list path_get_current path_set_current path_delete
|
||||
path_get_points path_set_points
|
||||
path_stroke_current path_get_point_at_dist
|
||||
path_get_tattoo path_set_tattoo get_path_by_tattoo
|
||||
path_get_locked path_set_locked
|
||||
path_to_selection path_import);
|
||||
|
||||
%exports = (app => [@procs], lib => [@procs]);
|
||||
|
||||
$desc = 'Paths';
|
||||
$doc_title = 'gimppaths';
|
||||
$doc_short_desc = 'Deprecated operations related to paths.';
|
||||
$doc_long_desc = 'Deprecated operations related to paths.';
|
||||
|
||||
1;
|
|
@ -68,85 +68,6 @@ CODE
|
|||
);
|
||||
}
|
||||
|
||||
sub patterns_get_pattern {
|
||||
&std_pdb_deprecated ('gimp-context-get-pattern');
|
||||
|
||||
@outargs = (
|
||||
{ name => 'name', type => 'string',
|
||||
desc => 'The pattern name' },
|
||||
{ name => 'width', type => 'int32',
|
||||
desc => 'The pattern width' },
|
||||
{ name => 'height', type => 'int32',
|
||||
desc => 'The pattern height' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
GimpPattern *pattern = gimp_context_get_pattern (context);
|
||||
|
||||
if (pattern)
|
||||
{
|
||||
name = g_strdup (gimp_object_get_name (pattern));
|
||||
width = gimp_temp_buf_get_width (pattern->mask);
|
||||
height = gimp_temp_buf_get_height (pattern->mask);
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub patterns_get_pattern_data {
|
||||
&std_pdb_deprecated ('gimp-pattern-get-pixels');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'name', type => 'string', null_ok => 1,
|
||||
desc => 'The pattern name ("" means currently active pattern)' }
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
{ name => 'actual_name', type => 'string',
|
||||
desc => 'The pattern name' },
|
||||
{ name => 'width', type => 'int32',
|
||||
desc => 'The pattern width' },
|
||||
{ name => 'height', type => 'int32',
|
||||
desc => 'The pattern height' },
|
||||
{ name => 'mask_bpp', type => 'int32',
|
||||
desc => 'Pattern bytes per pixel' },
|
||||
{ name => 'mask_data', type => 'int8array',
|
||||
desc => 'The pattern mask data',
|
||||
array => { name => 'length',
|
||||
desc => 'Length of pattern mask data' } }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
GimpPattern *pattern;
|
||||
|
||||
if (name && strlen (name))
|
||||
pattern = gimp_pdb_get_pattern (gimp, name, error);
|
||||
else
|
||||
pattern = gimp_context_get_pattern (context);
|
||||
|
||||
if (pattern)
|
||||
{
|
||||
actual_name = g_strdup (gimp_object_get_name (pattern));
|
||||
width = gimp_temp_buf_get_width (pattern->mask);
|
||||
height = gimp_temp_buf_get_height (pattern->mask);
|
||||
mask_bpp = babl_format_get_bytes_per_pixel (gimp_temp_buf_get_format (pattern->mask));
|
||||
length = gimp_temp_buf_get_data_size (pattern->mask);
|
||||
mask_data = g_memdup (gimp_temp_buf_get_data (pattern->mask), length);
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@headers = qw(<string.h>
|
||||
"core/gimp.h"
|
||||
|
@ -157,9 +78,7 @@ CODE
|
|||
"gimppdb-utils.h");
|
||||
|
||||
@procs = qw(patterns_refresh
|
||||
patterns_get_list
|
||||
patterns_get_pattern
|
||||
patterns_get_pattern_data);
|
||||
patterns_get_list);
|
||||
|
||||
%exports = (app => [@procs], lib => [@procs]);
|
||||
|
||||
|
|
|
@ -454,74 +454,6 @@ CODE
|
|||
);
|
||||
}
|
||||
|
||||
sub selection_layer_alpha {
|
||||
&std_pdb_deprecated ('gimp-image-select-item');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'layer', type => 'layer',
|
||||
desc => 'Layer with alpha' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
if (gimp_pdb_item_is_attached (GIMP_ITEM (layer), NULL, 0, error))
|
||||
gimp_item_to_selection (GIMP_ITEM (layer),
|
||||
GIMP_CHANNEL_OP_REPLACE,
|
||||
TRUE, FALSE, 0.0, 0.0);
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub selection_load {
|
||||
&std_pdb_deprecated ('gimp-image-select-item');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'channel', type => 'channel',
|
||||
desc => 'The channel' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
if (gimp_pdb_item_is_attached (GIMP_ITEM (channel), NULL, 0, error))
|
||||
gimp_item_to_selection (GIMP_ITEM (channel),
|
||||
GIMP_CHANNEL_OP_REPLACE,
|
||||
TRUE, FALSE, 0.0, 0.0);
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub selection_combine {
|
||||
&std_pdb_deprecated ('gimp-image-select-item');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'channel', type => 'channel',
|
||||
desc => 'The channel' },
|
||||
{ name => 'operation', type => 'enum GimpChannelOps',
|
||||
desc => 'The selection operation' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
if (gimp_pdb_item_is_attached (GIMP_ITEM (channel), NULL, 0, error))
|
||||
gimp_item_to_selection (GIMP_ITEM (channel),
|
||||
operation,
|
||||
TRUE, FALSE, 0.0, 0.0);
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub selection_save {
|
||||
$blurb = 'Copy the selection mask to a new channel.';
|
||||
|
||||
|
@ -574,8 +506,8 @@ CODE
|
|||
selection_translate selection_float
|
||||
selection_invert selection_sharpen selection_all selection_none
|
||||
selection_feather selection_border selection_grow selection_shrink
|
||||
selection_flood selection_layer_alpha selection_load selection_save
|
||||
selection_combine);
|
||||
selection_flood
|
||||
selection_save);
|
||||
|
||||
%exports = (app => [@procs], lib => [@procs]);
|
||||
|
||||
|
|
|
@ -1,419 +0,0 @@
|
|||
# GIMP - The GNU Image Manipulation Program
|
||||
# Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (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
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# "Perlized" from C source by Manish Singh <yosh@gimp.org>
|
||||
|
||||
sub by_color_select {
|
||||
&std_pdb_deprecated ('gimp-image-select-color');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The affected drawable' },
|
||||
{ name => 'color', type => 'color',
|
||||
desc => 'The color to select' },
|
||||
{ name => 'threshold', type => '0 <= int32 <= 255',
|
||||
desc => 'Threshold in intensity levels' },
|
||||
{ name => 'operation', type => 'enum GimpChannelOps',
|
||||
desc => 'The selection operation' },
|
||||
{ name => 'antialias', type => 'boolean',
|
||||
desc => 'Antialiasing' },
|
||||
{ name => 'feather', type => 'boolean',
|
||||
desc => 'Feather option for selections' },
|
||||
{ name => 'feather_radius', type => '0 <= float',
|
||||
desc => 'Radius for feather operation' },
|
||||
{ name => 'sample_merged', type => 'boolean',
|
||||
desc => 'Use the composite image, not the drawable' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
|
||||
|
||||
gimp_channel_select_by_color (gimp_image_get_mask (image), drawable,
|
||||
sample_merged,
|
||||
&color,
|
||||
threshold / 255.0,
|
||||
FALSE /* don't select transparent */,
|
||||
GIMP_SELECT_CRITERION_COMPOSITE,
|
||||
operation,
|
||||
antialias,
|
||||
feather,
|
||||
feather_radius,
|
||||
feather_radius);
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
sub by_color_select_full {
|
||||
&std_pdb_deprecated ('gimp-image-select-color');
|
||||
&david_pdb_misc('2006','2.4');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The affected drawable' },
|
||||
{ name => 'color', type => 'color',
|
||||
desc => 'The color to select' },
|
||||
{ name => 'threshold', type => '0 <= int32 <= 255',
|
||||
desc => 'Threshold in intensity levels' },
|
||||
{ name => 'operation', type => 'enum GimpChannelOps',
|
||||
desc => 'The selection operation' },
|
||||
{ name => 'antialias', type => 'boolean',
|
||||
desc => 'Antialiasing' },
|
||||
{ name => 'feather', type => 'boolean',
|
||||
desc => 'Feather option for selections' },
|
||||
{ name => 'feather_radius_x', type => '0 <= float',
|
||||
desc => 'Radius for feather operation in X direction' },
|
||||
{ name => 'feather_radius_y', type => '0 <= float',
|
||||
desc => 'Radius for feather operation in Y direction' },
|
||||
{ name => 'sample_merged', type => 'boolean',
|
||||
desc => 'Use the composite image, not the drawable' },
|
||||
{ name => 'select_transparent', type => 'boolean',
|
||||
desc => "Whether to consider transparent pixels for selection.
|
||||
If TRUE, transparency is considered as a unique selectable
|
||||
color." },
|
||||
{ name => 'select_criterion', type => 'enum GimpSelectCriterion',
|
||||
desc => "The criterion used to determine color similarity.
|
||||
SELECT_CRITERION_COMPOSITE is the standard choice.
|
||||
" },
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
|
||||
|
||||
gimp_channel_select_by_color (gimp_image_get_mask (image), drawable,
|
||||
sample_merged,
|
||||
&color,
|
||||
threshold / 255.0,
|
||||
select_transparent,
|
||||
select_criterion,
|
||||
operation,
|
||||
antialias,
|
||||
feather,
|
||||
feather_radius_x,
|
||||
feather_radius_y);
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
sub ellipse_select {
|
||||
&std_pdb_deprecated ('gimp-image-select-ellipse');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'image', type => 'image',
|
||||
desc => 'The image' },
|
||||
{ name => 'x', type => 'float',
|
||||
desc => 'x coordinate of upper-left corner of ellipse bounding box' },
|
||||
{ name => 'y', type => 'float',
|
||||
desc => 'y coordinate of upper-left corner of ellipse bounding box' },
|
||||
{ name => 'width', type => '0 < float',
|
||||
desc => 'The width of the ellipse' },
|
||||
{ name => 'height', type => '0 < float',
|
||||
desc => 'The height of the ellipse' },
|
||||
{ name => 'operation', type => 'enum GimpChannelOps',
|
||||
desc => 'The selection operation' },
|
||||
{ name => 'antialias', type => 'boolean',
|
||||
desc => 'Antialiasing' },
|
||||
{ name => 'feather', type => 'boolean',
|
||||
desc => 'Feather option for selections' },
|
||||
{ name => 'feather_radius', type => '0 <= float',
|
||||
desc => 'Radius for feather operation' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
gimp_channel_select_ellipse (gimp_image_get_mask (image),
|
||||
(gint) x, (gint) y,
|
||||
(gint) width, (gint) height,
|
||||
operation,
|
||||
antialias,
|
||||
feather,
|
||||
feather_radius,
|
||||
feather_radius,
|
||||
TRUE);
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
sub free_select {
|
||||
&std_pdb_deprecated ('gimp-image-select-polygon');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'image', type => 'image',
|
||||
desc => 'The image' },
|
||||
{ name => 'segs', type => 'floatarray',
|
||||
desc => 'Array of points: { p1.x, p1.y, p2.x, p2.y, ...,
|
||||
pn.x, pn.y}',
|
||||
array => { type => '2 <= int32',
|
||||
desc => 'Number of points (count 1 coordinate as two
|
||||
points)' } },
|
||||
{ name => 'operation', type => 'enum GimpChannelOps',
|
||||
desc => 'The selection operation' },
|
||||
{ name => 'antialias', type => 'boolean',
|
||||
desc => 'Antialiasing' },
|
||||
{ name => 'feather', type => 'boolean',
|
||||
desc => 'Feather option for selections' },
|
||||
{ name => 'feather_radius', type => '0 <= float',
|
||||
desc => 'Radius for feather operation' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
gimp_channel_select_polygon (gimp_image_get_mask (image),
|
||||
_("Free Select"),
|
||||
num_segs / 2,
|
||||
(GimpVector2 *) segs,
|
||||
operation,
|
||||
antialias,
|
||||
feather,
|
||||
feather_radius,
|
||||
feather_radius,
|
||||
TRUE);
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
sub fuzzy_select {
|
||||
&std_pdb_deprecated ('gimp-image-select-contiguous-color');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The affected drawable' },
|
||||
{ name => 'x', type => 'float',
|
||||
desc => 'x coordinate of initial seed fill point: (image
|
||||
coordinates)' },
|
||||
{ name => 'y', type => 'float',
|
||||
desc => 'y coordinate of initial seed fill point: (image
|
||||
coordinates)' },
|
||||
{ name => 'threshold', type => '0 <= int32 <= 255',
|
||||
desc => 'Threshold in intensity levels' },
|
||||
{ name => 'operation', type => 'enum GimpChannelOps',
|
||||
desc => 'The selection operation' },
|
||||
{ name => 'antialias', type => 'boolean',
|
||||
desc => 'Antialiasing' },
|
||||
{ name => 'feather', type => 'boolean',
|
||||
desc => 'Feather option for selections' },
|
||||
{ name => 'feather_radius', type => '0 <= float',
|
||||
desc => 'Radius for feather operation' },
|
||||
{ name => 'sample_merged', type => 'boolean',
|
||||
desc => 'Use the composite image, not the drawable' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
|
||||
|
||||
gimp_channel_select_fuzzy (gimp_image_get_mask (image),
|
||||
drawable,
|
||||
sample_merged,
|
||||
x, y,
|
||||
threshold / 255.0,
|
||||
FALSE /* don't select transparent */,
|
||||
GIMP_SELECT_CRITERION_COMPOSITE,
|
||||
FALSE /* no diagonal neighbors */,
|
||||
operation,
|
||||
antialias,
|
||||
feather,
|
||||
feather_radius,
|
||||
feather_radius);
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
sub fuzzy_select_full {
|
||||
&std_pdb_deprecated ('gimp-image-select-contiguous-color');
|
||||
&david_pdb_misc("2006","2.4");
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The affected drawable' },
|
||||
{ name => 'x', type => 'float',
|
||||
desc => 'x coordinate of initial seed fill point: (image
|
||||
coordinates)' },
|
||||
{ name => 'y', type => 'float',
|
||||
desc => 'y coordinate of initial seed fill point: (image
|
||||
coordinates)' },
|
||||
{ name => 'threshold', type => '0 <= int32 <= 255',
|
||||
desc => 'Threshold in intensity levels' },
|
||||
{ name => 'operation', type => 'enum GimpChannelOps',
|
||||
desc => 'The selection operation' },
|
||||
{ name => 'antialias', type => 'boolean',
|
||||
desc => 'Antialiasing' },
|
||||
{ name => 'feather', type => 'boolean',
|
||||
desc => 'Feather option for selections' },
|
||||
{ name => 'feather_radius_x', type => '0 <= float',
|
||||
desc => 'Radius for feather operation in X direction' },
|
||||
{ name => 'feather_radius_y', type => '0 <= float',
|
||||
desc => 'Radius for feather operation in Y direction' },
|
||||
{ name => 'sample_merged', type => 'boolean',
|
||||
desc => 'Use the composite image, not the drawable' },
|
||||
{ name => 'select_transparent', type => 'boolean',
|
||||
desc => "Whether to consider transparent pixels for selection.
|
||||
If TRUE, transparency is considered as a unique selectable
|
||||
color." },
|
||||
{ name => 'select_criterion', type => 'enum GimpSelectCriterion',
|
||||
desc => "The criterion used to determine color similarity.
|
||||
SELECT_CRITERION_COMPOSITE is the standard choice.
|
||||
" },
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
|
||||
|
||||
gimp_channel_select_fuzzy (gimp_image_get_mask (image),
|
||||
drawable,
|
||||
sample_merged,
|
||||
x, y,
|
||||
threshold / 255.0,
|
||||
select_transparent,
|
||||
select_criterion,
|
||||
FALSE /* no diagonal neighbors */,
|
||||
operation,
|
||||
antialias,
|
||||
feather,
|
||||
feather_radius_x,
|
||||
feather_radius_y);
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
sub rect_select {
|
||||
&std_pdb_deprecated ('gimp-image-select-rectangle');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'image', type => 'image',
|
||||
desc => 'The image' },
|
||||
{ name => 'x', type => 'float',
|
||||
desc => 'x coordinate of upper-left corner of rectangle' },
|
||||
{ name => 'y', type => 'float',
|
||||
desc => 'y coordinate of upper-left corner of rectangle' },
|
||||
{ name => 'width', type => '0 < float',
|
||||
desc => 'The width of the rectangle' },
|
||||
{ name => 'height', type => '0 < float',
|
||||
desc => 'The height of the rectangle' },
|
||||
{ name => 'operation', type => 'enum GimpChannelOps',
|
||||
desc => 'The selection operation' },
|
||||
{ name => 'feather', type => 'boolean',
|
||||
desc => 'Feather option for selections' },
|
||||
{ name => 'feather_radius', type => '0 <= float',
|
||||
desc => 'Radius for feather operation' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
gimp_channel_select_rectangle (gimp_image_get_mask (image),
|
||||
(gint) x, (gint) y,
|
||||
(gint) width, (gint) height,
|
||||
operation,
|
||||
feather,
|
||||
feather_radius,
|
||||
feather_radius,
|
||||
TRUE);
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
sub round_rect_select {
|
||||
&std_pdb_deprecated ('gimp-image-select-round-rectangle');
|
||||
&martin_pdb_misc("2006","2.4");
|
||||
|
||||
@inargs = (
|
||||
{ name => 'image', type => 'image',
|
||||
desc => 'The image' },
|
||||
{ name => 'x', type => 'float',
|
||||
desc => 'x coordinate of upper-left corner of rectangle' },
|
||||
{ name => 'y', type => 'float',
|
||||
desc => 'y coordinate of upper-left corner of rectangle' },
|
||||
{ name => 'width', type => '0 < float',
|
||||
desc => 'The width of the rectangle' },
|
||||
{ name => 'height', type => '0 < float',
|
||||
desc => 'The height of the rectangle' },
|
||||
{ name => 'corner_radius_x', type => '0 < float < GIMP_MAX_IMAGE_SIZE',
|
||||
desc => 'The corner radius in X direction' },
|
||||
{ name => 'corner_radius_y', type => '0 < float < GIMP_MAX_IMAGE_SIZE',
|
||||
desc => 'The corner radius in Y direction' },
|
||||
{ name => 'operation', type => 'enum GimpChannelOps',
|
||||
desc => 'The selection operation' },
|
||||
{ name => 'antialias', type => 'boolean',
|
||||
desc => 'Antialiasing' },
|
||||
{ name => 'feather', type => 'boolean',
|
||||
desc => 'Feather option for selections' },
|
||||
{ name => 'feather_radius_x', type => '0 <= float',
|
||||
desc => 'Radius for feather operation in X direction' },
|
||||
{ name => 'feather_radius_y', type => '0 <= float',
|
||||
desc => 'Radius for feather operation in Y direction' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
gimp_channel_select_round_rect (gimp_image_get_mask (image),
|
||||
(gint) x, (gint) y,
|
||||
(gint) width, (gint) height,
|
||||
corner_radius_x,
|
||||
corner_radius_y,
|
||||
operation,
|
||||
antialias,
|
||||
feather,
|
||||
feather_radius_x,
|
||||
feather_radius_y,
|
||||
TRUE);
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@headers = qw("libgimpbase/gimpbase.h"
|
||||
"core/gimpchannel-select.h"
|
||||
"gimp-intl.h");
|
||||
|
||||
@procs = qw(by_color_select by_color_select_full
|
||||
ellipse_select
|
||||
free_select
|
||||
fuzzy_select fuzzy_select_full
|
||||
rect_select round_rect_select);
|
||||
|
||||
%exports = (app => [@procs], lib => [@procs]);
|
||||
|
||||
$desc = 'Selection Tool procedures';
|
||||
$doc_title = 'gimpselectiontools';
|
||||
$doc_short_desc = 'Access to toolbox selection tools.';
|
||||
$doc_long_desc = 'Functions giving access to toolbox selection tools.';
|
||||
|
||||
1;
|
|
@ -346,80 +346,6 @@ CODE
|
|||
);
|
||||
}
|
||||
|
||||
sub text_layer_get_hinting {
|
||||
&std_pdb_deprecated ('gimp-text-layer-get-hint-style');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'layer', type => 'layer',
|
||||
desc => 'The text layer' }
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
{ name => 'hinting', type => 'boolean',
|
||||
desc => 'A flag which is true if hinting is used on the font.' },
|
||||
{ name => 'autohint', type => 'boolean',
|
||||
desc => 'A flag which is true if the text layer is forced to use the autohinter from FreeType.' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
if (gimp_pdb_layer_is_text_layer (layer, 0, error))
|
||||
{
|
||||
g_object_get (gimp_text_layer_get_text (GIMP_TEXT_LAYER (layer)),
|
||||
"hinting", &hinting,
|
||||
NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
success = FALSE;
|
||||
}
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub text_layer_set_hinting {
|
||||
&std_pdb_deprecated ('gimp-text-layer-set-hint-style');
|
||||
|
||||
$blurb = 'Enable/disable the use of hinting in a text layer.';
|
||||
|
||||
$help = <<'HELP';
|
||||
This procedure enables or disables hinting on the text of a text
|
||||
layer. If you enable 'auto-hint', FreeType\'s automatic hinter will be
|
||||
used and hinting information from the font will be ignored.
|
||||
HELP
|
||||
|
||||
&marcus_pdb_misc('2008', '2.6');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'layer', type => 'layer',
|
||||
desc => 'The text layer' },
|
||||
{ name => 'hinting', type => 'boolean',
|
||||
desc => 'Enable/disable the use of hinting on the text' },
|
||||
{ name => 'autohint', type => 'boolean', dead => 1,
|
||||
desc => 'Force the use of the autohinter provided through FreeType' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
if (gimp_pdb_layer_is_text_layer (layer, GIMP_PDB_ITEM_CONTENT, error))
|
||||
{
|
||||
gimp_text_layer_set (GIMP_TEXT_LAYER (layer),
|
||||
_("Set text layer attribute"),
|
||||
"hinting", hinting,
|
||||
NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
success = FALSE;
|
||||
}
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub text_layer_get_antialias {
|
||||
$blurb = 'Check if antialiasing is used in the text layer.';
|
||||
|
||||
|
@ -1238,10 +1164,7 @@ CODE
|
|||
text_layer_set_line_spacing
|
||||
text_layer_get_letter_spacing
|
||||
text_layer_set_letter_spacing
|
||||
text_layer_resize
|
||||
text_layer_get_hinting
|
||||
text_layer_set_hinting
|
||||
);
|
||||
text_layer_resize);
|
||||
|
||||
%exports = (app => [@procs], lib => [@procs]);
|
||||
|
||||
|
|
|
@ -146,137 +146,13 @@ CODE
|
|||
);
|
||||
}
|
||||
|
||||
sub text {
|
||||
&std_pdb_deprecated ('gimp-text-fontname');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'image', type => 'image',
|
||||
desc => 'The image' },
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The affected drawable: (-1 for a new text layer)',
|
||||
none_ok => 1 },
|
||||
{ name => 'x', type => 'float',
|
||||
desc => 'The x coordinate for the left of the text bounding box' },
|
||||
{ name => 'y', type => 'float',
|
||||
desc => 'The y coordinate for the top of the text bounding box' },
|
||||
{ name => 'text', type => 'string',
|
||||
desc => 'The text to generate (in UTF-8 encoding)' },
|
||||
{ name => 'border', type => '-1 <= int32',
|
||||
desc => 'The size of the border' },
|
||||
{ name => 'antialias', type => 'boolean',
|
||||
desc => 'Antialiasing' },
|
||||
{ name => 'size', type => '0 < float',
|
||||
desc => 'The size of text in either pixels or points' },
|
||||
{ name => 'size_type', type => 'enum GimpSizeType', dead => 1,
|
||||
desc => 'The units of specified size' },
|
||||
{ name => 'foundry', type => 'string', allow_non_utf8 => 1, dead => 1,
|
||||
desc => 'The font foundry' },
|
||||
{ name => 'family', type => 'string', allow_non_utf8 => 1,
|
||||
desc => 'The font family' },
|
||||
{ name => 'weight', type => 'string', allow_non_utf8 => 1, dead => 1,
|
||||
desc => 'The font weight' },
|
||||
{ name => 'slant', type => 'string', allow_non_utf8 => 1, dead => 1,
|
||||
desc => 'The font slant' },
|
||||
{ name => 'set_width', type => 'string', allow_non_utf8 => 1, dead => 1,
|
||||
desc => 'The font set-width' },
|
||||
{ name => 'spacing', type => 'string', allow_non_utf8 => 1, dead => 1,
|
||||
desc => 'The font spacing' },
|
||||
{ name => 'registry', type => 'string', allow_non_utf8 => 1, dead => 1,
|
||||
desc => 'The font registry' },
|
||||
{ name => 'encoding', type => 'string', allow_non_utf8 => 1, dead => 1,
|
||||
desc => 'The font encoding' }
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
{ name => 'text_layer', type => 'layer',
|
||||
desc => 'The new text layer or -1 if no layer was created.' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
if (drawable &&
|
||||
(! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), image,
|
||||
GIMP_PDB_ITEM_CONTENT, error) ||
|
||||
! gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error)))
|
||||
success = FALSE;
|
||||
|
||||
if (success)
|
||||
{
|
||||
gchar *real_fontname = g_strdup_printf ("%s %d", family, (gint) size);
|
||||
|
||||
text_layer = text_render (image, drawable, context,
|
||||
x, y, real_fontname, text,
|
||||
border, antialias);
|
||||
|
||||
g_free (real_fontname);
|
||||
}
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub text_get_extents {
|
||||
&std_pdb_deprecated ('gimp-text-get-extents-fontname');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'text', type => 'string',
|
||||
desc => 'The text to generate (in UTF-8 encoding)' },
|
||||
{ name => 'size', type => '0 < float',
|
||||
desc => 'The size of text in either pixels or points' },
|
||||
{ name => 'size_type', type => 'enum GimpSizeType', dead => 1,
|
||||
desc => 'The units of specified size' },
|
||||
{ name => 'foundry', type => 'string', allow_non_utf8 => 1, dead => 1,
|
||||
desc => 'The font foundry' },
|
||||
{ name => 'family', type => 'string', allow_non_utf8 => 1,
|
||||
desc => 'The font family' },
|
||||
{ name => 'weight', type => 'string', allow_non_utf8 => 1, dead => 1,
|
||||
desc => 'The font weight' },
|
||||
{ name => 'slant', type => 'string', allow_non_utf8 => 1, dead => 1,
|
||||
desc => 'The font slant' },
|
||||
{ name => 'set_width', type => 'string', allow_non_utf8 => 1, dead => 1,
|
||||
desc => 'The font set-width' },
|
||||
{ name => 'spacing', type => 'string', allow_non_utf8 => 1, dead => 1,
|
||||
desc => 'The font spacing' },
|
||||
{ name => 'registry', type => 'string', allow_non_utf8 => 1, dead => 1,
|
||||
desc => 'The font registry' },
|
||||
{ name => 'encoding', type => 'string', allow_non_utf8 => 1, dead => 1,
|
||||
desc => 'The font encoding' }
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
{ name => 'width', type => 'int32', void_ret => 1,
|
||||
desc => 'The width of the specified font' },
|
||||
{ name => 'height', type => 'int32',
|
||||
desc => 'The height of the specified font' },
|
||||
{ name => 'ascent', type => 'int32',
|
||||
desc => 'The ascent of the specified font' },
|
||||
{ name => 'descent', type => 'int32',
|
||||
desc => 'The descent of the specified font' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
gchar *real_fontname = g_strdup_printf ("%s %d", family, (gint) size);
|
||||
|
||||
success = text_get_extents (real_fontname, text,
|
||||
&width, &height,
|
||||
&ascent, &descent);
|
||||
|
||||
g_free (real_fontname);
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@headers = qw("libgimpbase/gimpbase.h"
|
||||
"text/gimptext-compat.h"
|
||||
"gimppdb-utils.h");
|
||||
|
||||
@procs = qw(text_fontname text_get_extents_fontname
|
||||
text text_get_extents);
|
||||
@procs = qw(text_fontname
|
||||
text_get_extents_fontname);
|
||||
|
||||
%exports = (app => [@procs], lib => [@procs]);
|
||||
|
||||
|
|
|
@ -1,532 +0,0 @@
|
|||
# GIMP - The GNU Image Manipulation Program
|
||||
# Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (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
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# "Perlized" from C source by Manish Singh <yosh@gimp.org>
|
||||
|
||||
sub flip {
|
||||
&std_pdb_deprecated ('gimp-item-transform-flip-simple');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The affected drawable' },
|
||||
{ name => 'flip_type',
|
||||
type => 'enum GimpOrientationType (no GIMP_ORIENTATION_UNKNOWN)',
|
||||
desc => 'Type of flip' }
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
{ name => 'drawable', type => 'drawable', no_declare => 1,
|
||||
desc => 'The flipped drawable' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
gint x, y, width, height;
|
||||
|
||||
success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
|
||||
GIMP_PDB_ITEM_CONTENT |
|
||||
GIMP_PDB_ITEM_POSITION, error);
|
||||
|
||||
if (success &&
|
||||
gimp_item_mask_intersect (GIMP_ITEM (drawable), &x, &y, &width, &height))
|
||||
{
|
||||
gdouble axis;
|
||||
|
||||
gimp_transform_get_flip_axis (x, y, width, height,
|
||||
flip_type, TRUE, &axis);
|
||||
|
||||
if (! gimp_viewable_get_children (GIMP_VIEWABLE (drawable)) &&
|
||||
! gimp_channel_is_empty (gimp_image_get_mask (gimp_item_get_image (GIMP_ITEM (drawable)))))
|
||||
{
|
||||
if (! gimp_drawable_transform_flip (drawable, context,
|
||||
flip_type, axis, FALSE))
|
||||
{
|
||||
success = FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gimp_item_flip (GIMP_ITEM (drawable), context,
|
||||
flip_type, axis, FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub perspective {
|
||||
&std_pdb_deprecated ('gimp-item-transform-perspective');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The affected drawable' },
|
||||
{ name => 'interpolation', type => 'boolean',
|
||||
desc => 'Whether to use interpolation' },
|
||||
{ name => 'x0', type => 'float',
|
||||
desc => 'The new x coordinate of upper-left corner of original
|
||||
bounding box' },
|
||||
{ name => 'y0', type => 'float',
|
||||
desc => 'The new y coordinate of upper-left corner of original
|
||||
bounding box' },
|
||||
{ name => 'x1', type => 'float',
|
||||
desc => 'The new x coordinate of upper-right corner of original
|
||||
bounding box' },
|
||||
{ name => 'y1', type => 'float',
|
||||
desc => 'The new y coordinate of upper-right corner of original
|
||||
bounding box' },
|
||||
{ name => 'x2', type => 'float',
|
||||
desc => 'The new x coordinate of lower-left corner of original
|
||||
bounding box' },
|
||||
{ name => 'y2', type => 'float',
|
||||
desc => 'The new y coordinate of lower-left corner of original
|
||||
bounding box' },
|
||||
{ name => 'x3', type => 'float',
|
||||
desc => 'The new x coordinate of lower-right corner of original
|
||||
bounding box' },
|
||||
{ name => 'y3', type => 'float',
|
||||
desc => 'The new y coordinate of lower-right corner of original
|
||||
bounding box' }
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
{ name => 'drawable', type => 'drawable', no_declare => 1,
|
||||
desc => 'The newly mapped drawable' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
gint x, y, width, height;
|
||||
|
||||
success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
|
||||
GIMP_PDB_ITEM_CONTENT |
|
||||
GIMP_PDB_ITEM_POSITION, error);
|
||||
|
||||
if (success &&
|
||||
gimp_item_mask_intersect (GIMP_ITEM (drawable), &x, &y, &width, &height))
|
||||
{
|
||||
GimpMatrix3 matrix;
|
||||
GimpInterpolationType interpolation_type = GIMP_INTERPOLATION_NONE;
|
||||
gint off_x, off_y;
|
||||
|
||||
gimp_item_get_offset (GIMP_ITEM (drawable), &off_x, &off_y);
|
||||
|
||||
x += off_x;
|
||||
y += off_y;
|
||||
|
||||
/* Assemble the transformation matrix */
|
||||
gimp_matrix3_identity (&matrix);
|
||||
gimp_transform_matrix_perspective (&matrix,
|
||||
x, y, width, height,
|
||||
x0, y0, x1, y1,
|
||||
x2, y2, x3, y3);
|
||||
|
||||
if (interpolation)
|
||||
interpolation_type = gimp->config->interpolation_type;
|
||||
|
||||
if (progress)
|
||||
gimp_progress_start (progress, FALSE, _("Perspective"));
|
||||
|
||||
if (! gimp_viewable_get_children (GIMP_VIEWABLE (drawable)) &&
|
||||
! gimp_channel_is_empty (gimp_image_get_mask (gimp_item_get_image (GIMP_ITEM (drawable)))))
|
||||
{
|
||||
if (! gimp_drawable_transform_affine (drawable, context,
|
||||
&matrix,
|
||||
GIMP_TRANSFORM_FORWARD,
|
||||
interpolation_type,
|
||||
FALSE, progress))
|
||||
{
|
||||
success = FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gimp_item_transform (GIMP_ITEM (drawable), context, &matrix,
|
||||
GIMP_TRANSFORM_FORWARD,
|
||||
interpolation,
|
||||
FALSE, progress);
|
||||
}
|
||||
|
||||
if (progress)
|
||||
gimp_progress_end (progress);
|
||||
}
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub rotate {
|
||||
&std_pdb_deprecated ('gimp-item-transform-rotate');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The affected drawable' },
|
||||
{ name => 'interpolation', type => 'boolean',
|
||||
desc => 'Whether to use interpolation' },
|
||||
{ name => 'angle', type => 'float',
|
||||
desc => 'The angle of rotation (radians)' }
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
{ name => 'drawable', type => 'drawable', no_declare => 1,
|
||||
desc => 'The rotated drawable' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
gint x, y, width, height;
|
||||
|
||||
success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
|
||||
GIMP_PDB_ITEM_CONTENT |
|
||||
GIMP_PDB_ITEM_POSITION, error);
|
||||
|
||||
if (success &&
|
||||
gimp_item_mask_intersect (GIMP_ITEM (drawable), &x, &y, &width, &height))
|
||||
{
|
||||
GimpMatrix3 matrix;
|
||||
GimpInterpolationType interpolation_type = GIMP_INTERPOLATION_NONE;
|
||||
gint off_x, off_y;
|
||||
|
||||
gimp_item_get_offset (GIMP_ITEM (drawable), &off_x, &off_y);
|
||||
|
||||
x += off_x;
|
||||
y += off_y;
|
||||
|
||||
/* Assemble the transformation matrix */
|
||||
gimp_matrix3_identity (&matrix);
|
||||
gimp_transform_matrix_rotate_rect (&matrix,
|
||||
x, y, width, height,
|
||||
angle);
|
||||
|
||||
if (interpolation)
|
||||
interpolation_type = gimp->config->interpolation_type;
|
||||
|
||||
if (progress)
|
||||
gimp_progress_start (progress, FALSE, _("Rotating"));
|
||||
|
||||
if (! gimp_viewable_get_children (GIMP_VIEWABLE (drawable)) &&
|
||||
! gimp_channel_is_empty (gimp_image_get_mask (gimp_item_get_image (GIMP_ITEM (drawable)))))
|
||||
{
|
||||
if (! gimp_drawable_transform_affine (drawable, context,
|
||||
&matrix,
|
||||
GIMP_TRANSFORM_FORWARD,
|
||||
interpolation_type,
|
||||
FALSE, progress))
|
||||
{
|
||||
success = FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gimp_item_transform (GIMP_ITEM (drawable), context, &matrix,
|
||||
GIMP_TRANSFORM_FORWARD,
|
||||
interpolation,
|
||||
FALSE, progress);
|
||||
}
|
||||
|
||||
if (progress)
|
||||
gimp_progress_end (progress);
|
||||
}
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub scale {
|
||||
&std_pdb_deprecated ('gimp-item-transform-scale');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The affected drawable' },
|
||||
{ name => 'interpolation', type => 'boolean',
|
||||
desc => 'Whether to use interpolation' },
|
||||
{ name => 'x0', type => 'float',
|
||||
desc => 'The new x coordinate of the upper-left corner of the
|
||||
scaled region' },
|
||||
{ name => 'y0', type => 'float',
|
||||
desc => 'The new y coordinate of the upper-left corner of the
|
||||
scaled region' },
|
||||
{ name => 'x1', type => 'float',
|
||||
desc => 'The new x coordinate of the lower-right corner of the
|
||||
scaled region' },
|
||||
{ name => 'y1', type => 'float',
|
||||
desc => 'The new y coordinate of the lower-right corner of the
|
||||
scaled region' }
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
{ name => 'drawable', type => 'drawable', no_declare => 1,
|
||||
desc => 'The scaled drawable' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
gint x, y, width, height;
|
||||
|
||||
success = (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
|
||||
GIMP_PDB_ITEM_CONTENT |
|
||||
GIMP_PDB_ITEM_POSITION, error) &&
|
||||
x0 < x1 && y0 < y1);
|
||||
|
||||
if (success &&
|
||||
gimp_item_mask_intersect (GIMP_ITEM (drawable), &x, &y, &width, &height))
|
||||
{
|
||||
GimpMatrix3 matrix;
|
||||
GimpInterpolationType interpolation_type = GIMP_INTERPOLATION_NONE;
|
||||
gint off_x, off_y;
|
||||
|
||||
gimp_item_get_offset (GIMP_ITEM (drawable), &off_x, &off_y);
|
||||
|
||||
x += off_x;
|
||||
y += off_y;
|
||||
|
||||
/* Assemble the transformation matrix */
|
||||
gimp_matrix3_identity (&matrix);
|
||||
gimp_transform_matrix_scale (&matrix,
|
||||
x, y, width, height,
|
||||
x0, y0, x1 - x0, y1 - y0);
|
||||
|
||||
if (interpolation)
|
||||
interpolation_type = gimp->config->interpolation_type;
|
||||
|
||||
if (progress)
|
||||
gimp_progress_start (progress, FALSE, _("Scaling"));
|
||||
|
||||
if (! gimp_viewable_get_children (GIMP_VIEWABLE (drawable)) &&
|
||||
! gimp_channel_is_empty (gimp_image_get_mask (gimp_item_get_image (GIMP_ITEM (drawable)))))
|
||||
{
|
||||
if (! gimp_drawable_transform_affine (drawable, context,
|
||||
&matrix,
|
||||
GIMP_TRANSFORM_FORWARD,
|
||||
interpolation_type,
|
||||
FALSE, progress))
|
||||
{
|
||||
success = FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gimp_item_transform (GIMP_ITEM (drawable), context, &matrix,
|
||||
GIMP_TRANSFORM_FORWARD,
|
||||
interpolation,
|
||||
FALSE, progress);
|
||||
}
|
||||
|
||||
if (progress)
|
||||
gimp_progress_end (progress);
|
||||
}
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub shear {
|
||||
&std_pdb_deprecated ('gimp-item-transform-shear');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The affected drawable' },
|
||||
{ name => 'interpolation', type => 'boolean',
|
||||
desc => 'Whether to use interpolation' },
|
||||
{ name => 'shear_type',
|
||||
type => 'enum GimpOrientationType (no GIMP_ORIENTATION_UNKNOWN)',
|
||||
desc => 'Type of shear' },
|
||||
{ name => 'magnitude', type => 'float',
|
||||
desc => 'The magnitude of the shear' }
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
{ name => 'drawable', type => 'drawable', no_declare => 1,
|
||||
desc => 'The sheared drawable' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
gint x, y, width, height;
|
||||
|
||||
success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
|
||||
GIMP_PDB_ITEM_CONTENT |
|
||||
GIMP_PDB_ITEM_POSITION, error);
|
||||
|
||||
if (success &&
|
||||
gimp_item_mask_intersect (GIMP_ITEM (drawable), &x, &y, &width, &height))
|
||||
{
|
||||
GimpMatrix3 matrix;
|
||||
GimpInterpolationType interpolation_type = GIMP_INTERPOLATION_NONE;
|
||||
gint off_x, off_y;
|
||||
|
||||
gimp_item_get_offset (GIMP_ITEM (drawable), &off_x, &off_y);
|
||||
|
||||
x += off_x;
|
||||
y += off_y;
|
||||
|
||||
/* Assemble the transformation matrix */
|
||||
gimp_matrix3_identity (&matrix);
|
||||
gimp_transform_matrix_shear (&matrix,
|
||||
x, y, width, height,
|
||||
shear_type, magnitude);
|
||||
|
||||
if (interpolation)
|
||||
interpolation_type = gimp->config->interpolation_type;
|
||||
|
||||
if (progress)
|
||||
gimp_progress_start (progress, FALSE, _("Shearing"));
|
||||
|
||||
if (! gimp_viewable_get_children (GIMP_VIEWABLE (drawable)) &&
|
||||
! gimp_channel_is_empty (gimp_image_get_mask (gimp_item_get_image (GIMP_ITEM (drawable)))))
|
||||
{
|
||||
if (! gimp_drawable_transform_affine (drawable, context,
|
||||
&matrix,
|
||||
GIMP_TRANSFORM_FORWARD,
|
||||
interpolation_type,
|
||||
FALSE, progress))
|
||||
{
|
||||
success = FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gimp_item_transform (GIMP_ITEM (drawable), context, &matrix,
|
||||
GIMP_TRANSFORM_FORWARD,
|
||||
interpolation,
|
||||
FALSE, progress);
|
||||
}
|
||||
|
||||
if (progress)
|
||||
gimp_progress_end (progress);
|
||||
}
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub transform_2d {
|
||||
&std_pdb_deprecated ('gimp-item-transform-2d');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'The affected drawable' },
|
||||
{ name => 'interpolation', type => 'boolean',
|
||||
desc => 'Whether to use interpolation' },
|
||||
{ name => 'source_x', type => 'float',
|
||||
desc => 'X coordinate of the transformation center' },
|
||||
{ name => 'source_y', type => 'float',
|
||||
desc => 'Y coordinate of the transformation center' },
|
||||
{ name => 'scale_x', type => 'float',
|
||||
desc => 'Amount to scale in x direction' },
|
||||
{ name => 'scale_y', type => 'float',
|
||||
desc => 'Amount to scale in y direction' },
|
||||
{ name => 'angle', type => 'float',
|
||||
desc => 'The angle of rotation (radians)' },
|
||||
{ name => 'dest_x', type => 'float',
|
||||
desc => 'X coordinate of where the centre goes' },
|
||||
{ name => 'dest_y', type => 'float',
|
||||
desc => 'Y coordinate of where the centre goes' }
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
{ name => 'drawable', type => 'drawable', no_declare => 1,
|
||||
desc => 'The transformed drawable' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
gint x, y, width, height;
|
||||
|
||||
success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
|
||||
GIMP_PDB_ITEM_CONTENT |
|
||||
GIMP_PDB_ITEM_POSITION, error);
|
||||
|
||||
if (success &&
|
||||
gimp_item_mask_intersect (GIMP_ITEM (drawable), &x, &y, &width, &height))
|
||||
{
|
||||
GimpMatrix3 matrix;
|
||||
GimpInterpolationType interpolation_type = GIMP_INTERPOLATION_NONE;
|
||||
|
||||
/* Assemble the transformation matrix */
|
||||
gimp_matrix3_identity (&matrix);
|
||||
gimp_matrix3_translate (&matrix, -source_x, -source_y);
|
||||
gimp_matrix3_scale (&matrix, scale_x, scale_y);
|
||||
gimp_matrix3_rotate (&matrix, angle);
|
||||
gimp_matrix3_translate (&matrix, dest_x, dest_y);
|
||||
|
||||
if (interpolation)
|
||||
interpolation_type = gimp->config->interpolation_type;
|
||||
|
||||
if (progress)
|
||||
gimp_progress_start (progress, FALSE, _("2D Transform"));
|
||||
|
||||
if (! gimp_viewable_get_children (GIMP_VIEWABLE (drawable)) &&
|
||||
! gimp_channel_is_empty (gimp_image_get_mask (gimp_item_get_image (GIMP_ITEM (drawable)))))
|
||||
{
|
||||
if (! gimp_drawable_transform_affine (drawable, context,
|
||||
&matrix, GIMP_TRANSFORM_FORWARD,
|
||||
interpolation_type,
|
||||
FALSE, progress))
|
||||
{
|
||||
success = FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gimp_item_transform (GIMP_ITEM (drawable), context, &matrix,
|
||||
GIMP_TRANSFORM_FORWARD,
|
||||
interpolation,
|
||||
FALSE, progress);
|
||||
}
|
||||
|
||||
if (progress)
|
||||
gimp_progress_end (progress);
|
||||
}
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@headers = qw("libgimpmath/gimpmath.h"
|
||||
"config/gimpcoreconfig.h"
|
||||
"core/gimp.h"
|
||||
"core/gimpchannel.h"
|
||||
"core/gimp-transform-utils.h"
|
||||
"core/gimpimage.h"
|
||||
"core/gimpdrawable.h"
|
||||
"core/gimpdrawable-transform.h"
|
||||
"core/gimpprogress.h"
|
||||
"gimppdb-utils.h"
|
||||
"gimp-intl.h");
|
||||
|
||||
@procs = qw(flip
|
||||
perspective
|
||||
rotate
|
||||
scale
|
||||
shear
|
||||
transform_2d);
|
||||
|
||||
%exports = (app => [@procs], lib => [@procs]);
|
||||
|
||||
$desc = 'Transform Tool procedures';
|
||||
$doc_title = 'gimptransformtools';
|
||||
$doc_short_desc = 'Access to toolbox transform tools.';
|
||||
$doc_long_desc = 'Functions giving access to toolbox transform tools.';
|
||||
|
||||
1;
|
|
@ -1074,43 +1074,6 @@ CODE
|
|||
);
|
||||
}
|
||||
|
||||
sub vectors_to_selection {
|
||||
&std_pdb_deprecated ('gimp-image-select-item');
|
||||
&simon_pdb_misc('2006', '2.4');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'vectors', type => 'vectors',
|
||||
desc => 'The vectors object to render to the selection' },
|
||||
{ name => 'operation', type => 'enum GimpChannelOps',
|
||||
desc => 'The desired operation with current selection' },
|
||||
{ name => 'antialias', type => 'boolean',
|
||||
desc => 'Antialias selection.' },
|
||||
{ name => 'feather', type => 'boolean',
|
||||
desc => 'Feather selection.' },
|
||||
{ name => 'feather_radius_x', type => 'float',
|
||||
desc => 'Feather radius x.' },
|
||||
{ name => 'feather_radius_y', type => 'float',
|
||||
desc => 'Feather radius y.' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
if (gimp_pdb_item_is_attached (GIMP_ITEM (vectors), NULL, 0, error))
|
||||
gimp_item_to_selection (GIMP_ITEM (vectors),
|
||||
operation,
|
||||
antialias,
|
||||
feather,
|
||||
feather_radius_x,
|
||||
feather_radius_y);
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
sub vectors_import_from_file {
|
||||
$blurb = 'Import paths from an SVG file.';
|
||||
|
||||
|
@ -1349,7 +1312,6 @@ CODE
|
|||
vectors_bezier_stroke_conicto
|
||||
vectors_bezier_stroke_cubicto
|
||||
vectors_bezier_stroke_new_ellipse
|
||||
vectors_to_selection
|
||||
vectors_import_from_file
|
||||
vectors_import_from_string
|
||||
vectors_export_to_file
|
||||
|
|
|
@ -334,11 +334,9 @@ app/paint/gimpsourceoptions.c
|
|||
app/paint/paint-enums.c
|
||||
|
||||
app/pdb/channel-cmds.c
|
||||
app/pdb/color-cmds.c
|
||||
app/pdb/drawable-cmds.c
|
||||
app/pdb/drawable-color-cmds.c
|
||||
app/pdb/drawable-edit-cmds.c
|
||||
app/pdb/drawable-transform-cmds.c
|
||||
app/pdb/edit-cmds.c
|
||||
app/pdb/floating-sel-cmds.c
|
||||
app/pdb/gimppdb-query.c
|
||||
|
@ -355,13 +353,10 @@ app/pdb/image-transform-cmds.c
|
|||
app/pdb/image-undo-cmds.c
|
||||
app/pdb/item-transform-cmds.c
|
||||
app/pdb/layer-cmds.c
|
||||
app/pdb/paths-cmds.c
|
||||
app/pdb/plug-in-compat-cmds.c
|
||||
app/pdb/procedural-db-cmds.c
|
||||
app/pdb/selection-cmds.c
|
||||
app/pdb/selection-tools-cmds.c
|
||||
app/pdb/text-layer-cmds.c
|
||||
app/pdb/transform-tools-cmds.c
|
||||
app/pdb/vectors-cmds.c
|
||||
|
||||
app/plug-in/gimpenvirontable.c
|
||||
|
|
Loading…
Reference in New Issue