Adds generated files after hue-saturation-overlap call. Addresses #634008

This commit is contained in:
João S. O. Bueno 2014-01-08 20:20:05 -02:00
parent 1ad14fa6d6
commit 8c14f3822a
4 changed files with 223 additions and 59 deletions

View File

@ -733,6 +733,60 @@ hue_saturation_invoker (GimpProcedure *procedure,
error ? *error : NULL);
}
static GimpValueArray *
hue_saturation_overlap_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GimpValueArray *args,
GError **error)
{
gboolean success = TRUE;
GimpDrawable *drawable;
gint32 hue_range;
gdouble hue_offset;
gdouble lightness;
gdouble saturation;
gdouble overlap;
drawable = gimp_value_get_drawable (gimp_value_array_index (args, 0), gimp);
hue_range = g_value_get_enum (gimp_value_array_index (args, 1));
hue_offset = g_value_get_double (gimp_value_array_index (args, 2));
lightness = g_value_get_double (gimp_value_array_index (args, 3));
saturation = g_value_get_double (gimp_value_array_index (args, 4));
overlap = g_value_get_double (gimp_value_array_index (args, 5));
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))
{
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,
"overlap", overlap / 100.0,
NULL);
gimp_drawable_apply_operation_by_name (drawable, progress,
_("Hue-Saturation"),
"gimp:hue-saturation",
config);
g_object_unref (config);
}
else
success = FALSE;
}
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static GimpValueArray *
threshold_invoker (GimpProcedure *procedure,
Gimp *gimp,
@ -1319,7 +1373,7 @@ register_color_procs (GimpPDB *pdb)
gimp_procedure_set_static_strings (procedure,
"gimp-hue-saturation",
"Modify hue, lightness, and saturation in the specified drawable.",
"This procedures allows the hue, lightness, and saturation in the specified drawable to be modified. The 'hue-range' parameter provides the capability to limit range of affected hues.",
"This procedure allows the hue, lightness, and saturation in the specified drawable to be modified. The 'hue-range' parameter provides the capability to limit range of affected hues.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1997",
@ -1358,6 +1412,60 @@ register_color_procs (GimpPDB *pdb)
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-hue-saturation-overlap
*/
procedure = gimp_procedure_new (hue_saturation_overlap_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-hue-saturation-overlap");
gimp_procedure_set_static_strings (procedure,
"gimp-hue-saturation-overlap",
"Modify hue, lightness, and saturation in the specified drawable.",
"This procedure allows the hue, lightness, and saturation in the specified drawable to be modified. The 'hue-range' parameter provides the capability to limit range of affected hues. The 'overlap' parameter provides blending into neighboring hue channels when rendering.",
"Jo\xc3\xa3o S. O. Bueno",
"Jo\xc3\xa3o S. O. Bueno",
"2014",
NULL);
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,
g_param_spec_enum ("hue-range",
"hue range",
"Range of affected hues",
GIMP_TYPE_HUE_RANGE,
GIMP_ALL_HUES,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("hue-offset",
"hue offset",
"Hue offset in degrees",
-180, 180, -180,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("lightness",
"lightness",
"Lightness modification",
-100, 100, -100,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("saturation",
"saturation",
"Saturation modification",
-100, 100, -100,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("overlap",
"overlap",
"Overlap other hue channels",
0, 100, 0,
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-threshold
*/

View File

@ -28,7 +28,7 @@
#include "internal-procs.h"
/* 706 procedures registered total */
/* 707 procedures registered total */
void
internal_procs_init (GimpPDB *pdb)

View File

@ -630,7 +630,7 @@ gimp_histogram (gint32 drawable_ID,
*
* Modify hue, lightness, and saturation in the specified drawable.
*
* This procedures allows the hue, lightness, and saturation in the
* This procedure allows the hue, lightness, and saturation in the
* specified drawable to be modified. The 'hue-range' parameter
* provides the capability to limit range of affected hues.
*
@ -663,6 +663,56 @@ gimp_hue_saturation (gint32 drawable_ID,
return success;
}
/**
* gimp_hue_saturation_overlap:
* @drawable_ID: The drawable.
* @hue_range: Range of affected hues.
* @hue_offset: Hue offset in degrees.
* @lightness: Lightness modification.
* @saturation: Saturation modification.
* @overlap: Overlap other hue channels.
*
* Modify hue, lightness, and saturation in the specified drawable.
*
* This procedure allows the hue, lightness, and saturation in the
* specified drawable to be modified. The 'hue-range' parameter
* provides the capability to limit range of affected hues. The
* 'overlap' parameter provides blending into neighboring hue channels
* when rendering.
*
* Returns: TRUE on success.
*
* Since: GIMP 2.10
**/
gboolean
gimp_hue_saturation_overlap (gint32 drawable_ID,
GimpHueRange hue_range,
gdouble hue_offset,
gdouble lightness,
gdouble saturation,
gdouble overlap)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp-hue-saturation-overlap",
&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_FLOAT, overlap,
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.

View File

@ -32,63 +32,69 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
gboolean gimp_brightness_contrast (gint32 drawable_ID,
gint brightness,
gint contrast);
gboolean gimp_levels (gint32 drawable_ID,
GimpHistogramChannel channel,
gint low_input,
gint high_input,
gdouble gamma,
gint low_output,
gint high_output);
gboolean gimp_brightness_contrast (gint32 drawable_ID,
gint brightness,
gint contrast);
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_levels_stretch)
gboolean gimp_levels_auto (gint32 drawable_ID);
gboolean gimp_levels_stretch (gint32 drawable_ID);
gboolean gimp_posterize (gint32 drawable_ID,
gint levels);
gboolean gimp_desaturate (gint32 drawable_ID);
gboolean gimp_desaturate_full (gint32 drawable_ID,
GimpDesaturateMode desaturate_mode);
gboolean gimp_equalize (gint32 drawable_ID,
gboolean mask_only);
gboolean gimp_invert (gint32 drawable_ID);
gboolean gimp_curves_spline (gint32 drawable_ID,
GimpHistogramChannel channel,
gint num_points,
const guint8 *control_pts);
gboolean gimp_curves_explicit (gint32 drawable_ID,
GimpHistogramChannel channel,
gint num_bytes,
const guint8 *curve);
gboolean gimp_color_balance (gint32 drawable_ID,
GimpTransferMode transfer_mode,
gboolean preserve_lum,
gdouble cyan_red,
gdouble magenta_green,
gdouble yellow_blue);
gboolean gimp_colorize (gint32 drawable_ID,
gdouble hue,
gdouble saturation,
gdouble lightness);
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);
gboolean gimp_hue_saturation (gint32 drawable_ID,
GimpHueRange hue_range,
gdouble hue_offset,
gdouble lightness,
gdouble saturation);
gboolean gimp_threshold (gint32 drawable_ID,
gint low_threshold,
gint high_threshold);
gboolean gimp_levels_auto (gint32 drawable_ID);
gboolean gimp_levels_stretch (gint32 drawable_ID);
gboolean gimp_posterize (gint32 drawable_ID,
gint levels);
gboolean gimp_desaturate (gint32 drawable_ID);
gboolean gimp_desaturate_full (gint32 drawable_ID,
GimpDesaturateMode desaturate_mode);
gboolean gimp_equalize (gint32 drawable_ID,
gboolean mask_only);
gboolean gimp_invert (gint32 drawable_ID);
gboolean gimp_curves_spline (gint32 drawable_ID,
GimpHistogramChannel channel,
gint num_points,
const guint8 *control_pts);
gboolean gimp_curves_explicit (gint32 drawable_ID,
GimpHistogramChannel channel,
gint num_bytes,
const guint8 *curve);
gboolean gimp_color_balance (gint32 drawable_ID,
GimpTransferMode transfer_mode,
gboolean preserve_lum,
gdouble cyan_red,
gdouble magenta_green,
gdouble yellow_blue);
gboolean gimp_colorize (gint32 drawable_ID,
gdouble hue,
gdouble saturation,
gdouble lightness);
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);
gboolean gimp_hue_saturation (gint32 drawable_ID,
GimpHueRange hue_range,
gdouble hue_offset,
gdouble lightness,
gdouble saturation);
gboolean gimp_hue_saturation_overlap (gint32 drawable_ID,
GimpHueRange hue_range,
gdouble hue_offset,
gdouble lightness,
gdouble saturation,
gdouble overlap);
gboolean gimp_threshold (gint32 drawable_ID,
gint low_threshold,
gint high_threshold);
G_END_DECLS