pdb: Allow ripple to take floating point inputs
Partially resolves #7211. plug-in-ripple is a wrapper for the GEGL ripple effect. GEGL allows for double values for period and amplitude, while the GIMP PDB only allows integers. This patch aligns the datatypes. Note that Angle and Phi are still limited to the current design.
This commit is contained in:
parent
57909356ff
commit
2a94671269
2 changed files with 20 additions and 20 deletions
|
|
@ -3714,8 +3714,8 @@ plug_in_ripple_invoker (GimpProcedure *procedure,
|
|||
{
|
||||
gboolean success = TRUE;
|
||||
GimpDrawable *drawable;
|
||||
gint period;
|
||||
gint amplitude;
|
||||
gdouble period;
|
||||
gdouble amplitude;
|
||||
gint orientation;
|
||||
gint edges;
|
||||
gint waveform;
|
||||
|
|
@ -3723,8 +3723,8 @@ plug_in_ripple_invoker (GimpProcedure *procedure,
|
|||
gboolean tile;
|
||||
|
||||
drawable = g_value_get_object (gimp_value_array_index (args, 2));
|
||||
period = g_value_get_int (gimp_value_array_index (args, 3));
|
||||
amplitude = g_value_get_int (gimp_value_array_index (args, 4));
|
||||
period = g_value_get_double (gimp_value_array_index (args, 3));
|
||||
amplitude = g_value_get_double (gimp_value_array_index (args, 4));
|
||||
orientation = g_value_get_int (gimp_value_array_index (args, 5));
|
||||
edges = g_value_get_int (gimp_value_array_index (args, 6));
|
||||
waveform = g_value_get_int (gimp_value_array_index (args, 7));
|
||||
|
|
@ -8504,17 +8504,17 @@ register_plug_in_compat_procs (GimpPDB *pdb)
|
|||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_int ("period",
|
||||
"period",
|
||||
"Period: number of pixels for one wave to complete",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
g_param_spec_double ("period",
|
||||
"period",
|
||||
"Period: number of pixels for one wave to complete",
|
||||
0.0, 1000.0, 200,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_int ("amplitude",
|
||||
"amplitude",
|
||||
"Amplitude: maximum displacement of wave",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
g_param_spec_double ("amplitude",
|
||||
"amplitude",
|
||||
"Amplitude: maximum displacement of wave",
|
||||
0.0, 1000.0, 25,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_int ("orientation",
|
||||
"orientation",
|
||||
|
|
|
|||
|
|
@ -3795,10 +3795,10 @@ HELP
|
|||
desc => 'Input image (unused)' },
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'Input drawable' },
|
||||
{ name => 'period', type => 'int32',
|
||||
desc => 'Period: number of pixels for one wave to complete' },
|
||||
{ name => 'amplitude', type => 'int32',
|
||||
desc => 'Amplitude: maximum displacement of wave' },
|
||||
{ name => 'period', type => ' 0.0 < float < 1000.0',
|
||||
default => 200.0, desc => 'Period: number of pixels for one wave to complete' },
|
||||
{ name => 'amplitude', type => ' 0.0 < float < 1000.0',
|
||||
default => 25.0, desc => 'Amplitude: maximum displacement of wave' },
|
||||
{ name => 'orientation', type => '0 <= int32 <= 1',
|
||||
desc => 'Orientation { ORIENTATION-HORIZONTAL (0), ORIENTATION-VERTICAL (1) }' },
|
||||
{ name => 'edges', type => '0 <= int32 <= 2',
|
||||
|
|
@ -3828,8 +3828,8 @@ HELP
|
|||
|
||||
node = gegl_node_new_child (NULL,
|
||||
"operation", "gegl:ripple",
|
||||
"amplitude", (gdouble) amplitude,
|
||||
"period", (gdouble) period,
|
||||
"amplitude", amplitude,
|
||||
"period", period,
|
||||
"phi", phi,
|
||||
"angle", angle,
|
||||
"sampler_type", antialias ? GEGL_SAMPLER_CUBIC : GEGL_SAMPLER_NEAREST,
|
||||
|
|
|
|||
Loading…
Reference in a new issue