libgimp, pdb: port gimp_drawable_curves_explicit,spline() to double

and deprecate gimp_curves_explicit,spline().
This commit is contained in:
Michael Natterer 2014-06-17 22:37:46 +02:00
parent 847606d177
commit 98f97a9580
8 changed files with 94 additions and 131 deletions

View file

@ -1063,12 +1063,12 @@ register_color_procs (GimpPDB *pdb)
"gimp-curves-spline"); "gimp-curves-spline");
gimp_procedure_set_static_strings (procedure, gimp_procedure_set_static_strings (procedure,
"gimp-curves-spline", "gimp-curves-spline",
"Modifies the intensity curve(s) for specified drawable.", "Deprecated: Use 'gimp-drawable-curves-spline' instead.",
"Modifies the intensity mapping for one channel in the specified drawable. The drawable must be either grayscale or RGB, and the channel can be either an intensity component, or the value. The 'control_pts' parameter is an array of integers which define a set of control points which describe a Catmull Rom spline which yields the final intensity curve. Use the 'gimp-curves-explicit' function to explicitly modify intensity levels.", "Deprecated: Use 'gimp-drawable-curves-spline' instead.",
"Spencer Kimball & Peter Mattis", "",
"Spencer Kimball & Peter Mattis", "",
"1995-1996", "",
NULL); "gimp-drawable-curves-spline");
gimp_procedure_add_argument (procedure, gimp_procedure_add_argument (procedure,
gimp_param_spec_drawable_id ("drawable", gimp_param_spec_drawable_id ("drawable",
"drawable", "drawable",
@ -1104,12 +1104,12 @@ register_color_procs (GimpPDB *pdb)
"gimp-curves-explicit"); "gimp-curves-explicit");
gimp_procedure_set_static_strings (procedure, gimp_procedure_set_static_strings (procedure,
"gimp-curves-explicit", "gimp-curves-explicit",
"Modifies the intensity curve(s) for specified drawable.", "Deprecated: Use 'gimp-drawable-curves-explicit' instead.",
"Modifies the intensity mapping for one channel in the specified drawable. The drawable must be either grayscale or RGB, and the channel can be either an intensity component, or the value. The 'curve' parameter is an array of bytes which explicitly defines how each pixel value in the drawable will be modified. Use the 'gimp-curves-spline' function to modify intensity levels with Catmull Rom splines.", "Deprecated: Use 'gimp-drawable-curves-explicit' instead.",
"Spencer Kimball & Peter Mattis", "",
"Spencer Kimball & Peter Mattis", "",
"1995-1996", "",
NULL); "gimp-drawable-curves-explicit");
gimp_procedure_add_argument (procedure, gimp_procedure_add_argument (procedure,
gimp_param_spec_drawable_id ("drawable", gimp_param_spec_drawable_id ("drawable",
"drawable", "drawable",

View file

@ -210,27 +210,28 @@ drawable_curves_explicit_invoker (GimpProcedure *procedure,
gboolean success = TRUE; gboolean success = TRUE;
GimpDrawable *drawable; GimpDrawable *drawable;
gint32 channel; gint32 channel;
gint32 num_bytes; gint32 num_values;
const guint8 *curve; const gdouble *values;
drawable = gimp_value_get_drawable (gimp_value_array_index (args, 0), gimp); drawable = gimp_value_get_drawable (gimp_value_array_index (args, 0), gimp);
channel = g_value_get_enum (gimp_value_array_index (args, 1)); channel = g_value_get_enum (gimp_value_array_index (args, 1));
num_bytes = g_value_get_int (gimp_value_array_index (args, 2)); num_values = g_value_get_int (gimp_value_array_index (args, 2));
curve = gimp_value_get_int8array (gimp_value_array_index (args, 3)); values = gimp_value_get_floatarray (gimp_value_array_index (args, 3));
if (success) if (success)
{ {
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
GIMP_PDB_ITEM_CONTENT, error) && GIMP_PDB_ITEM_CONTENT, error) &&
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) && gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) &&
(num_bytes == 256) && (num_values >= 256) &&
(num_values <= 4096) &&
(gimp_drawable_has_alpha (drawable) || channel != GIMP_HISTOGRAM_ALPHA) && (gimp_drawable_has_alpha (drawable) || channel != GIMP_HISTOGRAM_ALPHA) &&
(! gimp_drawable_is_gray (drawable) || (! gimp_drawable_is_gray (drawable) ||
channel == GIMP_HISTOGRAM_VALUE || channel == GIMP_HISTOGRAM_ALPHA)) channel == GIMP_HISTOGRAM_VALUE || channel == GIMP_HISTOGRAM_ALPHA))
{ {
GObject *config = gimp_curves_config_new_explicit_cruft (channel, GObject *config = gimp_curves_config_new_explicit (channel,
curve, values,
num_bytes); num_values);
gimp_drawable_apply_operation_by_name (drawable, progress, gimp_drawable_apply_operation_by_name (drawable, progress,
C_("undo-type", "Curves"), C_("undo-type", "Curves"),
@ -258,12 +259,12 @@ drawable_curves_spline_invoker (GimpProcedure *procedure,
GimpDrawable *drawable; GimpDrawable *drawable;
gint32 channel; gint32 channel;
gint32 num_points; gint32 num_points;
const guint8 *control_pts; const gdouble *points;
drawable = gimp_value_get_drawable (gimp_value_array_index (args, 0), gimp); drawable = gimp_value_get_drawable (gimp_value_array_index (args, 0), gimp);
channel = g_value_get_enum (gimp_value_array_index (args, 1)); channel = g_value_get_enum (gimp_value_array_index (args, 1));
num_points = g_value_get_int (gimp_value_array_index (args, 2)); num_points = g_value_get_int (gimp_value_array_index (args, 2));
control_pts = gimp_value_get_int8array (gimp_value_array_index (args, 3)); points = gimp_value_get_floatarray (gimp_value_array_index (args, 3));
if (success) if (success)
{ {
@ -275,8 +276,8 @@ drawable_curves_spline_invoker (GimpProcedure *procedure,
(! gimp_drawable_is_gray (drawable) || (! gimp_drawable_is_gray (drawable) ||
channel == GIMP_HISTOGRAM_VALUE || channel == GIMP_HISTOGRAM_ALPHA)) channel == GIMP_HISTOGRAM_VALUE || channel == GIMP_HISTOGRAM_ALPHA))
{ {
GObject *config = gimp_curves_config_new_spline_cruft (channel, GObject *config = gimp_curves_config_new_spline (channel,
control_pts, points,
num_points / 2); num_points / 2);
gimp_drawable_apply_operation_by_name (drawable, progress, gimp_drawable_apply_operation_by_name (drawable, progress,
@ -855,7 +856,7 @@ register_drawable_color_procs (GimpPDB *pdb)
gimp_procedure_set_static_strings (procedure, gimp_procedure_set_static_strings (procedure,
"gimp-drawable-curves-explicit", "gimp-drawable-curves-explicit",
"Modifies the intensity curve(s) for specified drawable.", "Modifies the intensity curve(s) for specified drawable.",
"Modifies the intensity mapping for one channel in the specified drawable. The drawable must be either grayscale or RGB, and the channel can be either an intensity component, or the value. The 'curve' parameter is an array of bytes which explicitly defines how each pixel value in the drawable will be modified. Use the 'gimp-curves-spline' function to modify intensity levels with Catmull Rom splines.", "Modifies the intensity mapping for one channel in the specified drawable. The channel can be either an intensity component, or the value. The 'values' parameter is an array of doubles which explicitly defines how each pixel value in the drawable will be modified. Use the 'gimp-curves-spline' function to modify intensity levels with Catmull Rom splines.",
"Spencer Kimball & Peter Mattis", "Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis", "Spencer Kimball & Peter Mattis",
"1995-1996", "1995-1996",
@ -874,14 +875,14 @@ register_drawable_color_procs (GimpPDB *pdb)
GIMP_HISTOGRAM_VALUE, GIMP_HISTOGRAM_VALUE,
GIMP_PARAM_READWRITE)); GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure, gimp_procedure_add_argument (procedure,
gimp_param_spec_int32 ("num-bytes", gimp_param_spec_int32 ("num-values",
"num bytes", "num values",
"The number of bytes in the new curve (always 256)", "The number of values in the new curve",
0, G_MAXINT32, 0, 256, 2096, 256,
GIMP_PARAM_READWRITE)); GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure, gimp_procedure_add_argument (procedure,
gimp_param_spec_int8_array ("curve", gimp_param_spec_float_array ("values",
"curve", "values",
"The explicit curve", "The explicit curve",
GIMP_PARAM_READWRITE)); GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure); gimp_pdb_register_procedure (pdb, procedure);
@ -896,7 +897,7 @@ register_drawable_color_procs (GimpPDB *pdb)
gimp_procedure_set_static_strings (procedure, gimp_procedure_set_static_strings (procedure,
"gimp-drawable-curves-spline", "gimp-drawable-curves-spline",
"Modifies the intensity curve(s) for specified drawable.", "Modifies the intensity curve(s) for specified drawable.",
"Modifies the intensity mapping for one channel in the specified drawable. The drawable must be either grayscale or RGB, and the channel can be either an intensity component, or the value. The 'control_pts' parameter is an array of integers which define a set of control points which describe a Catmull Rom spline which yields the final intensity curve. Use the 'gimp-curves-explicit' function to explicitly modify intensity levels.", "Modifies the intensity mapping for one channel in the specified drawable. The channel can be either an intensity component, or the value. The 'points' parameter is an array of doubles which define a set of control points which describe a Catmull Rom spline which yields the final intensity curve. Use the 'gimp-curves-explicit' function to explicitly modify intensity levels.",
"Spencer Kimball & Peter Mattis", "Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis", "Spencer Kimball & Peter Mattis",
"1995-1996", "1995-1996",
@ -918,11 +919,11 @@ register_drawable_color_procs (GimpPDB *pdb)
gimp_param_spec_int32 ("num-points", gimp_param_spec_int32 ("num-points",
"num points", "num points",
"The number of values in the control point array", "The number of values in the control point array",
4, 34, 4, 4, 2048, 4,
GIMP_PARAM_READWRITE)); GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure, gimp_procedure_add_argument (procedure,
gimp_param_spec_int8_array ("control-pts", gimp_param_spec_float_array ("points",
"control pts", "points",
"The spline control points: { cp1.x, cp1.y, cp2.x, cp2.y, ... }", "The spline control points: { cp1.x, cp1.y, cp2.x, cp2.y, ... }",
GIMP_PARAM_READWRITE)); GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure); gimp_pdb_register_procedure (pdb, procedure);

View file

@ -323,15 +323,7 @@ gimp_invert (gint32 drawable_ID)
* @num_points: The number of values in the control point array. * @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, ... }. * @control_pts: The spline control points: { cp1.x, cp1.y, cp2.x, cp2.y, ... }.
* *
* Modifies the intensity curve(s) for specified drawable. * Deprecated: Use gimp_drawable_curves_spline() instead.
*
* Modifies the intensity mapping for one channel in the specified
* drawable. The drawable must be either grayscale or RGB, and the
* channel can be either an intensity component, or the value. The
* 'control_pts' parameter is an array of integers which define a set
* of control points which describe a Catmull Rom spline which yields
* the final intensity curve. Use the gimp_curves_explicit() function
* to explicitly modify intensity levels.
* *
* Returns: TRUE on success. * Returns: TRUE on success.
**/ **/
@ -367,15 +359,7 @@ gimp_curves_spline (gint32 drawable_ID,
* @num_bytes: The number of bytes in the new curve (always 256). * @num_bytes: The number of bytes in the new curve (always 256).
* @curve: The explicit curve. * @curve: The explicit curve.
* *
* Modifies the intensity curve(s) for specified drawable. * Deprecated: Use gimp_drawable_curves_explicit() instead.
*
* Modifies the intensity mapping for one channel in the specified
* drawable. The drawable must be either grayscale or RGB, and the
* channel can be either an intensity component, or the value. The
* 'curve' parameter is an array of bytes which explicitly defines how
* each pixel value in the drawable will be modified. Use the
* gimp_curves_spline() function to modify intensity levels with
* Catmull Rom splines.
* *
* Returns: TRUE on success. * Returns: TRUE on success.
**/ **/

View file

@ -60,10 +60,12 @@ GIMP_DEPRECATED_FOR(gimp_drawable_equalize)
gboolean gimp_equalize (gint32 drawable_ID, gboolean gimp_equalize (gint32 drawable_ID,
gboolean mask_only); gboolean mask_only);
gboolean gimp_invert (gint32 drawable_ID); gboolean gimp_invert (gint32 drawable_ID);
GIMP_DEPRECATED_FOR(gimp_drawable_curves_spline)
gboolean gimp_curves_spline (gint32 drawable_ID, gboolean gimp_curves_spline (gint32 drawable_ID,
GimpHistogramChannel channel, GimpHistogramChannel channel,
gint num_points, gint num_points,
const guint8 *control_pts); const guint8 *control_pts);
GIMP_DEPRECATED_FOR(gimp_drawable_curves_explicit)
gboolean gimp_curves_explicit (gint32 drawable_ID, gboolean gimp_curves_explicit (gint32 drawable_ID,
GimpHistogramChannel channel, GimpHistogramChannel channel,
gint num_bytes, gint num_bytes,

View file

@ -174,18 +174,17 @@ gimp_drawable_colorize_hsl (gint32 drawable_ID,
* gimp_drawable_curves_explicit: * gimp_drawable_curves_explicit:
* @drawable_ID: The drawable. * @drawable_ID: The drawable.
* @channel: The channel to modify. * @channel: The channel to modify.
* @num_bytes: The number of bytes in the new curve (always 256). * @num_values: The number of values in the new curve.
* @curve: The explicit curve. * @values: The explicit curve.
* *
* Modifies the intensity curve(s) for specified drawable. * Modifies the intensity curve(s) for specified drawable.
* *
* Modifies the intensity mapping for one channel in the specified * Modifies the intensity mapping for one channel in the specified
* drawable. The drawable must be either grayscale or RGB, and the * drawable. The channel can be either an intensity component, or the
* channel can be either an intensity component, or the value. The * value. The 'values' parameter is an array of doubles which
* 'curve' parameter is an array of bytes which explicitly defines how * explicitly defines how each pixel value in the drawable will be
* each pixel value in the drawable will be modified. Use the * modified. Use the gimp_curves_spline() function to modify intensity
* gimp_curves_spline() function to modify intensity levels with * levels with Catmull Rom splines.
* Catmull Rom splines.
* *
* Returns: TRUE on success. * Returns: TRUE on success.
* *
@ -194,8 +193,8 @@ gimp_drawable_colorize_hsl (gint32 drawable_ID,
gboolean gboolean
gimp_drawable_curves_explicit (gint32 drawable_ID, gimp_drawable_curves_explicit (gint32 drawable_ID,
GimpHistogramChannel channel, GimpHistogramChannel channel,
gint num_bytes, gint num_values,
const guint8 *curve) const gdouble *values)
{ {
GimpParam *return_vals; GimpParam *return_vals;
gint nreturn_vals; gint nreturn_vals;
@ -205,8 +204,8 @@ gimp_drawable_curves_explicit (gint32 drawable_ID,
&nreturn_vals, &nreturn_vals,
GIMP_PDB_DRAWABLE, drawable_ID, GIMP_PDB_DRAWABLE, drawable_ID,
GIMP_PDB_INT32, channel, GIMP_PDB_INT32, channel,
GIMP_PDB_INT32, num_bytes, GIMP_PDB_INT32, num_values,
GIMP_PDB_INT8ARRAY, curve, GIMP_PDB_FLOATARRAY, values,
GIMP_PDB_END); GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS; success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
@ -221,17 +220,16 @@ gimp_drawable_curves_explicit (gint32 drawable_ID,
* @drawable_ID: The drawable. * @drawable_ID: The drawable.
* @channel: The channel to modify. * @channel: The channel to modify.
* @num_points: The number of values in the control point array. * @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, ... }. * @points: The spline control points: { cp1.x, cp1.y, cp2.x, cp2.y, ... }.
* *
* Modifies the intensity curve(s) for specified drawable. * Modifies the intensity curve(s) for specified drawable.
* *
* Modifies the intensity mapping for one channel in the specified * Modifies the intensity mapping for one channel in the specified
* drawable. The drawable must be either grayscale or RGB, and the * drawable. The channel can be either an intensity component, or the
* channel can be either an intensity component, or the value. The * value. The 'points' parameter is an array of doubles which define a
* 'control_pts' parameter is an array of integers which define a set * set of control points which describe a Catmull Rom spline which
* of control points which describe a Catmull Rom spline which yields * yields the final intensity curve. Use the gimp_curves_explicit()
* the final intensity curve. Use the gimp_curves_explicit() function * function to explicitly modify intensity levels.
* to explicitly modify intensity levels.
* *
* Returns: TRUE on success. * Returns: TRUE on success.
* *
@ -241,7 +239,7 @@ gboolean
gimp_drawable_curves_spline (gint32 drawable_ID, gimp_drawable_curves_spline (gint32 drawable_ID,
GimpHistogramChannel channel, GimpHistogramChannel channel,
gint num_points, gint num_points,
const guint8 *control_pts) const gdouble *points)
{ {
GimpParam *return_vals; GimpParam *return_vals;
gint nreturn_vals; gint nreturn_vals;
@ -252,7 +250,7 @@ gimp_drawable_curves_spline (gint32 drawable_ID,
GIMP_PDB_DRAWABLE, drawable_ID, GIMP_PDB_DRAWABLE, drawable_ID,
GIMP_PDB_INT32, channel, GIMP_PDB_INT32, channel,
GIMP_PDB_INT32, num_points, GIMP_PDB_INT32, num_points,
GIMP_PDB_INT8ARRAY, control_pts, GIMP_PDB_FLOATARRAY, points,
GIMP_PDB_END); GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS; success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;

View file

@ -47,12 +47,12 @@ gboolean gimp_drawable_colorize_hsl (gint32 drawable_ID,
gdouble lightness); gdouble lightness);
gboolean gimp_drawable_curves_explicit (gint32 drawable_ID, gboolean gimp_drawable_curves_explicit (gint32 drawable_ID,
GimpHistogramChannel channel, GimpHistogramChannel channel,
gint num_bytes, gint num_values,
const guint8 *curve); const gdouble *values);
gboolean gimp_drawable_curves_spline (gint32 drawable_ID, gboolean gimp_drawable_curves_spline (gint32 drawable_ID,
GimpHistogramChannel channel, GimpHistogramChannel channel,
gint num_points, gint num_points,
const guint8 *control_pts); const gdouble *points);
gboolean gimp_drawable_desaturate (gint32 drawable_ID, gboolean gimp_drawable_desaturate (gint32 drawable_ID,
GimpDesaturateMode desaturate_mode); GimpDesaturateMode desaturate_mode);
gboolean gimp_drawable_equalize (gint32 drawable_ID, gboolean gimp_drawable_equalize (gint32 drawable_ID,

View file

@ -328,18 +328,7 @@ CODE
} }
sub curves_spline { sub curves_spline {
$blurb = 'Modifies the intensity curve(s) for specified drawable.'; &std_pdb_deprecated ('gimp-drawable-curves-spline');
$help = <<'HELP';
Modifies the intensity mapping for one channel in the specified drawable. The
drawable must be either grayscale or RGB, and the channel can be either an
intensity component, or the value. The 'control_pts' parameter is an array of
integers which define a set of control points which describe a Catmull Rom
spline which yields the final intensity curve. Use the gimp_curves_explicit()
function to explicitly modify intensity levels.
HELP
&std_pdb_misc;
@inargs = ( @inargs = (
{ name => 'drawable', type => 'drawable', { name => 'drawable', type => 'drawable',
@ -384,18 +373,7 @@ CODE
} }
sub curves_explicit { sub curves_explicit {
$blurb = 'Modifies the intensity curve(s) for specified drawable.'; &std_pdb_deprecated ('gimp-drawable-curves-explicit');
$help = <<'HELP';
Modifies the intensity mapping for one channel in the specified drawable. The
drawable must be either grayscale or RGB, and the channel can be either an
intensity component, or the value. The 'curve' parameter is an array of bytes
which explicitly defines how each pixel value in the drawable will be modified.
Use the gimp_curves_spline() function to modify intensity levels with Catmull
Rom splines.
HELP
&std_pdb_misc;
@inargs = ( @inargs = (
{ name => 'drawable', type => 'drawable', { name => 'drawable', type => 'drawable',

View file

@ -181,12 +181,12 @@ sub drawable_curves_explicit {
$blurb = 'Modifies the intensity curve(s) for specified drawable.'; $blurb = 'Modifies the intensity curve(s) for specified drawable.';
$help = <<'HELP'; $help = <<'HELP';
Modifies the intensity mapping for one channel in the specified drawable. The Modifies the intensity mapping for one channel in the specified
drawable must be either grayscale or RGB, and the channel can be either an drawable. The channel can be either an intensity component, or the
intensity component, or the value. The 'curve' parameter is an array of bytes value. The 'values' parameter is an array of doubles which explicitly
which explicitly defines how each pixel value in the drawable will be modified. defines how each pixel value in the drawable will be modified. Use
Use the gimp_curves_spline() function to modify intensity levels with Catmull the gimp_curves_spline() function to modify intensity levels with
Rom splines. Catmull Rom splines.
HELP HELP
&std_pdb_misc; &std_pdb_misc;
@ -197,11 +197,10 @@ HELP
desc => 'The drawable' }, desc => 'The drawable' },
{ name => 'channel', type => 'enum GimpHistogramChannel', { name => 'channel', type => 'enum GimpHistogramChannel',
desc => 'The channel to modify' }, desc => 'The channel to modify' },
{ name => 'curve', type => 'int8array', { name => 'values', type => 'floatarray',
desc => 'The explicit curve', desc => 'The explicit curve',
array => { name => 'num_bytes', array => { name => 'num_values', type => '256 <= int32 <= 2096',
desc => 'The number of bytes in the new curve (always desc => 'The number of values in the new curve' } }
256)' } }
); );
%invoke = ( %invoke = (
@ -211,14 +210,15 @@ HELP
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
GIMP_PDB_ITEM_CONTENT, error) && GIMP_PDB_ITEM_CONTENT, error) &&
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) && gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) &&
(num_bytes == 256) && (num_values >= 256) &&
(num_values <= 4096) &&
(gimp_drawable_has_alpha (drawable) || channel != GIMP_HISTOGRAM_ALPHA) && (gimp_drawable_has_alpha (drawable) || channel != GIMP_HISTOGRAM_ALPHA) &&
(! gimp_drawable_is_gray (drawable) || (! gimp_drawable_is_gray (drawable) ||
channel == GIMP_HISTOGRAM_VALUE || channel == GIMP_HISTOGRAM_ALPHA)) channel == GIMP_HISTOGRAM_VALUE || channel == GIMP_HISTOGRAM_ALPHA))
{ {
GObject *config = gimp_curves_config_new_explicit_cruft (channel, GObject *config = gimp_curves_config_new_explicit (channel,
curve, values,
num_bytes); num_values);
gimp_drawable_apply_operation_by_name (drawable, progress, gimp_drawable_apply_operation_by_name (drawable, progress,
C_("undo-type", "Curves"), C_("undo-type", "Curves"),
@ -237,12 +237,12 @@ sub drawable_curves_spline {
$blurb = 'Modifies the intensity curve(s) for specified drawable.'; $blurb = 'Modifies the intensity curve(s) for specified drawable.';
$help = <<'HELP'; $help = <<'HELP';
Modifies the intensity mapping for one channel in the specified drawable. The Modifies the intensity mapping for one channel in the specified
drawable must be either grayscale or RGB, and the channel can be either an drawable. The channel can be either an intensity component, or the
intensity component, or the value. The 'control_pts' parameter is an array of value. The 'points' parameter is an array of doubles which define a
integers which define a set of control points which describe a Catmull Rom set of control points which describe a Catmull Rom spline which yields
spline which yields the final intensity curve. Use the gimp_curves_explicit() the final intensity curve. Use the gimp_curves_explicit() function to
function to explicitly modify intensity levels. explicitly modify intensity levels.
HELP HELP
&std_pdb_misc; &std_pdb_misc;
@ -253,10 +253,10 @@ HELP
desc => 'The drawable' }, desc => 'The drawable' },
{ name => 'channel', type => 'enum GimpHistogramChannel', { name => 'channel', type => 'enum GimpHistogramChannel',
desc => 'The channel to modify' }, desc => 'The channel to modify' },
{ name => 'control_pts', type => 'int8array', { name => 'points', type => 'floatarray',
desc => 'The spline control points: { cp1.x, cp1.y, cp2.x, cp2.y, desc => 'The spline control points: { cp1.x, cp1.y, cp2.x, cp2.y,
... }', ... }',
array => { name => 'num_points', type => '4 <= int32 <= 34', array => { name => 'num_points', type => '4 <= int32 <= 2048',
desc => 'The number of values in the control point array' } desc => 'The number of values in the control point array' }
} }
); );
@ -273,8 +273,8 @@ HELP
(! gimp_drawable_is_gray (drawable) || (! gimp_drawable_is_gray (drawable) ||
channel == GIMP_HISTOGRAM_VALUE || channel == GIMP_HISTOGRAM_ALPHA)) channel == GIMP_HISTOGRAM_VALUE || channel == GIMP_HISTOGRAM_ALPHA))
{ {
GObject *config = gimp_curves_config_new_spline_cruft (channel, GObject *config = gimp_curves_config_new_spline (channel,
control_pts, points,
num_points / 2); num_points / 2);
gimp_drawable_apply_operation_by_name (drawable, progress, gimp_drawable_apply_operation_by_name (drawable, progress,