[gegl] ops: specify human ranges for op properties
- From: Ãyvind KolÃs <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] ops: specify human ranges for op properties
- Date: Fri, 30 Mar 2012 22:45:14 +0000 (UTC)
commit f4004dbbb19c94128566ee052536917ddae99dfd
Author: Ãyvind KolÃs <pippin gimp org>
Date: Fri Mar 30 23:45:04 2012 +0100
ops: specify human ranges for op properties
operations/common/bilateral-filter.c | 4 ++--
operations/common/box-blur.c | 2 +-
operations/common/brightness-contrast.c | 4 ++--
operations/common/c2g.c | 6 +++---
operations/common/checkerboard.c | 8 ++++----
operations/common/difference-of-gaussians.c | 6 ++++--
operations/common/dropshadow.c | 8 ++++----
operations/common/fractal-explorer.c | 6 ++++--
operations/common/grid.c | 12 ++++++------
operations/common/lens-distortion.c | 4 ++--
operations/common/levels.c | 10 +++++-----
operations/common/mono-mixer.c | 9 ++++++---
operations/common/motion-blur.c | 8 ++++----
operations/common/noise-reduction.c | 2 +-
operations/common/noise.c | 15 ++++++++++-----
operations/common/posterize.c | 2 +-
operations/common/ripple.c | 4 ++--
operations/common/snn-mean.c | 2 +-
operations/common/stress.c | 6 +++---
operations/common/threshold.c | 2 +-
operations/common/unsharp-mask.c | 5 +++--
operations/common/waves.c | 4 ++--
22 files changed, 71 insertions(+), 58 deletions(-)
---
diff --git a/operations/common/bilateral-filter.c b/operations/common/bilateral-filter.c
index 0bce6b1..9aafbb2 100644
--- a/operations/common/bilateral-filter.c
+++ b/operations/common/bilateral-filter.c
@@ -24,9 +24,9 @@
#ifdef GEGL_CHANT_PROPERTIES
-gegl_chant_double (blur_radius, _("Blur radius"), 0.0, 70.0, 4.0,
+gegl_chant_double_ui (blur_radius, _("Blur radius"), 0.0, 1000.0, 4.0, 0.0, 100.0, 1.5,
_("Radius of square pixel region, (width and height will be radius*2+1)."))
-gegl_chant_double (edge_preservation, _("Edge preservation"), 0.0, 70.0, 8.0,
+gegl_chant_double (edge_preservation, _("Edge preservation"), 0.0, 100.0, 8.0,
_("Amount of edge preservation"))
#else
diff --git a/operations/common/box-blur.c b/operations/common/box-blur.c
index a59163e..c33fd23 100644
--- a/operations/common/box-blur.c
+++ b/operations/common/box-blur.c
@@ -21,7 +21,7 @@
#ifdef GEGL_CHANT_PROPERTIES
-gegl_chant_double (radius, _("Radius"), 0.0, 200.0, 4.0,
+gegl_chant_double_ui (radius, _("Radius"), 0.0, 1000.0, 4.0, 0.0, 100.0, 1.5,
_("Radius of square pixel region, (width and height will be radius*2+1)."))
#else
diff --git a/operations/common/brightness-contrast.c b/operations/common/brightness-contrast.c
index a7592ef..1081e82 100644
--- a/operations/common/brightness-contrast.c
+++ b/operations/common/brightness-contrast.c
@@ -26,9 +26,9 @@
* property name, min, max, default, "description of property"
*/
-gegl_chant_double (contrast, _("Contrast"), -5.0, 5.0, 1.0,
+gegl_chant_double_ui (contrast, _("Contrast"), -5.0, 5.0, 1.0, 0.0, 2.0, 1.0,
_("Range scale factor"))
-gegl_chant_double (brightness, _("Brightness"), -3.0, 3.0, 0.0,
+gegl_chant_double_ui (brightness, _("Brightness"), -3.0, 3.0, 0.0, -1.0, 1.0, 1.0,
_("Amount to increase brightness"))
/* this will create the instance structure for our use, and register the
diff --git a/operations/common/c2g.c b/operations/common/c2g.c
index be7fb80..16f8e30 100644
--- a/operations/common/c2g.c
+++ b/operations/common/c2g.c
@@ -24,11 +24,11 @@
#ifdef GEGL_CHANT_PROPERTIES
-gegl_chant_int (radius, _("Radius"), 2, 3000.0, 300,
+gegl_chant_int_ui (radius, _("Radius"), 2, 3000, 300, 2, 3000, 1.6,
_("Neighbourhood taken into account, this is the radius in pixels taken into account when deciding which colors map to which gray values."))
-gegl_chant_int (samples, _("Samples"), 0, 1000, 4,
+gegl_chant_int_ui (samples, _("Samples"), 1, 1000, 4, 1, 20, 1.0,
_("Number of samples to do per iteration looking for the range of colors."))
-gegl_chant_int (iterations, _("Iterations"), 0, 1000, 10,
+gegl_chant_int_ui (iterations, _("Iterations"), 1, 1000, 10, 1, 20, 1.0,
_("Number of iterations, a higher number of iterations provides a less noisy results at computational cost."))
/*
diff --git a/operations/common/checkerboard.c b/operations/common/checkerboard.c
index 5a37304..5be3e73 100644
--- a/operations/common/checkerboard.c
+++ b/operations/common/checkerboard.c
@@ -22,13 +22,13 @@
#ifdef GEGL_CHANT_PROPERTIES
-gegl_chant_int (x, _("Width"), 1, G_MAXINT, 16,
+gegl_chant_int_ui (x, _("Width"), 1, G_MAXINT, 16, 1, 256, 1.5,
_("Horizontal width of cells pixels."))
-gegl_chant_int (y, _("Height"), 1, G_MAXINT, 16,
+gegl_chant_int_ui (y, _("Height"), 1, G_MAXINT, 16, 1, 256, 1.5,
_("Vertical width of cells in pixels."))
-gegl_chant_int (x_offset, _("X offset"), -G_MAXINT, G_MAXINT, 0,
+gegl_chant_int_ui (x_offset, _("X offset"), -G_MAXINT, G_MAXINT, 0, -10, 10, 1.0,
_("Horizontal offset (from origin) for start of grid."))
-gegl_chant_int (y_offset, _("Y offset"), -G_MAXINT, G_MAXINT, 0,
+gegl_chant_int_ui (y_offset, _("Y offset"), -G_MAXINT, G_MAXINT, 0, -10, 10, 1.0,
_("Vertical offset (from origin) for start of grid."))
gegl_chant_color (color1, _("Color"), "black",
_("One of the cell colors (defaults to 'black')"))
diff --git a/operations/common/difference-of-gaussians.c b/operations/common/difference-of-gaussians.c
index 86dc24b..a7e11ab 100644
--- a/operations/common/difference-of-gaussians.c
+++ b/operations/common/difference-of-gaussians.c
@@ -22,8 +22,10 @@
#ifdef GEGL_CHANT_PROPERTIES
-gegl_chant_double(radius1, _("Radius 1"), 0.0, 10.0, 1.0, _("Radius"))
-gegl_chant_double(radius2, _("Radius 2"), 0.0, 10.0, 2.0, _("Radius"))
+gegl_chant_double_ui (radius1, _("Radius 1"), 0.0, 1000.0, 1.0, 0.0, 10.0, 1.5,
+ _("Radius"))
+gegl_chant_double_ui (radius2, _("Radius 2"), 0.0, 1000.0, 2.0, 0.0, 10.0, 1.5,
+ _("Radius"))
#else
diff --git a/operations/common/dropshadow.c b/operations/common/dropshadow.c
index 8798350..0f02b34 100644
--- a/operations/common/dropshadow.c
+++ b/operations/common/dropshadow.c
@@ -22,12 +22,12 @@
#ifdef GEGL_CHANT_PROPERTIES
-gegl_chant_double (opacity, _("Opacity"), -10.0, 10.0, 0.5, _("Opacity"))
-gegl_chant_double (x, _("X"), -G_MAXDOUBLE, G_MAXDOUBLE, 20.0,
+gegl_chant_double (opacity, _("Opacity"), -1.0, 1.0, 0.5, _("Opacity"))
+gegl_chant_double_ui (x, _("X"), -G_MAXDOUBLE, G_MAXDOUBLE, 20.0, -20.0, 20.0, 1.0,
_("Horizontal shadow offset."))
-gegl_chant_double (y, _("Y"), -G_MAXDOUBLE, G_MAXDOUBLE, 20.0,
+gegl_chant_double_ui (y, _("Y"), -G_MAXDOUBLE, G_MAXDOUBLE, 20.0, -20.0, 20.0, 1.0,
_("Vertical shadow offset."))
-gegl_chant_double (radius, _("Radius"), -G_MAXDOUBLE, G_MAXDOUBLE, 10.0,
+gegl_chant_double_ui (radius, _("Radius"), 0.0, G_MAXDOUBLE, 10.0, 0.0, 300.0, 1.5,
_("Blur radius."))
#else
diff --git a/operations/common/fractal-explorer.c b/operations/common/fractal-explorer.c
index e30a7e2..08c71aa 100644
--- a/operations/common/fractal-explorer.c
+++ b/operations/common/fractal-explorer.c
@@ -27,8 +27,10 @@
#ifdef GEGL_CHANT_PROPERTIES
-gegl_chant_int (width, _("Width"), 10, 10000000, 400, _("Width"))
-gegl_chant_int (height, _("Height"), 10, 10000000, 400, _("Height"))
+gegl_chant_int_ui (width, _("Width"), 1, 10000000, 400, 1, 2000, 1.5,
+ _("Width"))
+gegl_chant_int_ui (height, _("Height"), 1, 10000000, 400, 1, 2000, 1.5,
+ _("Height"))
gegl_chant_int (fractaltype, _("Fractal type"), 0, 8, 0, _("Fractal Type"))
diff --git a/operations/common/grid.c b/operations/common/grid.c
index 3811f0a..9bc9f82 100644
--- a/operations/common/grid.c
+++ b/operations/common/grid.c
@@ -21,17 +21,17 @@
#ifdef GEGL_CHANT_PROPERTIES
-gegl_chant_int (x, _("Width"), 1, G_MAXINT, 32,
+gegl_chant_int_ui (x, _("Width"), 1, G_MAXINT, 32, 1, 128, 1.0,
_("Horizontal width of cells pixels."))
-gegl_chant_int (y, _("Height"), 1, G_MAXINT, 32,
+gegl_chant_int_ui (y, _("Height"), 1, G_MAXINT, 32, 1, 128, 1.0,
_("Vertical width of cells in pixels."))
-gegl_chant_int (x_offset, _("X offset"), -G_MAXINT, G_MAXINT, 0,
+gegl_chant_int_ui (x_offset, _("X offset"), -G_MAXINT, G_MAXINT, 0, -64, 64, 1.0,
_("Horizontal offset (from origin) for start of grid."))
-gegl_chant_int (y_offset, _("Y offset"), -G_MAXINT, G_MAXINT, 0,
+gegl_chant_int_ui (y_offset, _("Y offset"), -G_MAXINT, G_MAXINT, 0, -64, 64, 1.0,
_("Vertical offset (from origin) for start of grid."))
-gegl_chant_int (line_width, _("Line Width"), 0, G_MAXINT, 4,
+gegl_chant_int_ui (line_width, _("Line Width"), 0, G_MAXINT, 4, 0, 16, 1.0,
_("Width of grid lines in pixels."))
-gegl_chant_int (line_height, _("Line Height"), 0, G_MAXINT, 4,
+gegl_chant_int_ui (line_height, _("Line Height"), 0, G_MAXINT, 4, 0, 16, 1.0,
_("Height of grid lines in pixels."))
gegl_chant_color (line_color, _("Color"), "black",
_("Color of the grid lines"))
diff --git a/operations/common/lens-distortion.c b/operations/common/lens-distortion.c
index ccceeed..9d5005b 100644
--- a/operations/common/lens-distortion.c
+++ b/operations/common/lens-distortion.c
@@ -32,7 +32,7 @@
gegl_chant_double (main, _("Main:"), -100.0, 100.0, 0.0,
_("Main value of distortion"))
-gegl_chant_double (zoo, _("Zoom:"), -100.0, 100.0, 0.0,
+gegl_chant_double (zoom, _("Zoom:"), -100.0, 100.0, 0.0,
_("Main value of distortion"))
gegl_chant_double (edge, _("Edge:"), -100.0, 100.0, 0.0,
_("Edge value of distortion"))
@@ -74,7 +74,7 @@ lens_setup_calc (GeglChantO *o,
old->centre_y = boundary.height * (100.0 + o->y_shift) / 200.0;
old->mult_sq = o->main / 200.0;
old->mult_qd = o->edge / 200.0;
- old->rescale = pow (2.0, -o->zoo / 100.0);
+ old->rescale = pow (2.0, -o->zoom / 100.0);
old->brighten = -o->brighten / 10.0;
}
diff --git a/operations/common/levels.c b/operations/common/levels.c
index 33778c9..1274973 100644
--- a/operations/common/levels.c
+++ b/operations/common/levels.c
@@ -23,14 +23,14 @@
#ifdef GEGL_CHANT_PROPERTIES
-gegl_chant_double (in_low, _("Low input"), -1.0, 4.0, 0.0,
+gegl_chant_double_ui (in_low, _("Low input"), -1.0, 4.0, 0.0, 0.0, 1.0, 1.0,
_("Input luminance level to become lowest output"))
-gegl_chant_double (in_high, _("High input"), -1.0, 4.0, 1.0,
+gegl_chant_double_ui (in_high, _("High input"), -1.0, 4.0, 1.0, 0.0, 1.0, 1.0,
_("Input luminance level to become white."))
-gegl_chant_double (out_low, _("Low output"), -1.0, 4.0, 0.0,
+gegl_chant_double_ui (out_low, _("Low output"), -1.0, 4.0, 0.0, 0.0, 1.0, 1.0,
_("Lowest luminance level in output"))
-gegl_chant_double (out_high, _("High output"),
- -1.0, 4.0, 1.0, _("Highest luminance level in output"))
+gegl_chant_double_ui (out_high, _("High output"), -1.0, 4.0, 1.0, 0.0, 1.0, 1.0,
+ _("Highest luminance level in output"))
#else
diff --git a/operations/common/mono-mixer.c b/operations/common/mono-mixer.c
index eb3b807..fe5f306 100644
--- a/operations/common/mono-mixer.c
+++ b/operations/common/mono-mixer.c
@@ -23,9 +23,12 @@
#ifdef GEGL_CHANT_PROPERTIES
-gegl_chant_double (red, _("Red"), -10.0, 10.0, 0.5, _("Amount of red"))
-gegl_chant_double (green, _("Green"), -10.0, 10.0, 0.25, _("Amount of green"))
-gegl_chant_double (blue, _("Blue"), -10.0, 10.0, 0.25, _("Amount of blue"))
+gegl_chant_double_ui (red, _("Red"), -10.0, 10.0, 0.5, -1.0, 1.0, 1.0,
+ _("Amount of red"))
+gegl_chant_double_ui (green, _("Green"), -10.0, 10.0, 0.25, -1.0, 1.0, 1.0,
+ _("Amount of green"))
+gegl_chant_double_ui (blue, _("Blue"), -10.0, 10.0, 0.25, -1.0, 1.0, 1.0,
+ _("Amount of blue"))
#else
diff --git a/operations/common/motion-blur.c b/operations/common/motion-blur.c
index fe58aaa..d3611d7 100644
--- a/operations/common/motion-blur.c
+++ b/operations/common/motion-blur.c
@@ -24,10 +24,10 @@
#ifdef GEGL_CHANT_PROPERTIES
-gegl_chant_double (length, _("Length"), 0.0, 200.0, 10.0,
- _("Length of blur in pixels"))
-gegl_chant_double (angle, _("Angle"), -360, 360, 0,
- _("Angle of blur in degrees"))
+gegl_chant_double_ui (length, _("Length"), 0.0, 1000.0, 10.0, 0.0, 300.0, 1.5,
+ _("Length of blur in pixels"))
+gegl_chant_double_ui (angle, _("Angle"), -360, 360, 0, -180.0, 180.0, 1.0,
+ _("Angle of blur in degrees"))
#else
diff --git a/operations/common/noise-reduction.c b/operations/common/noise-reduction.c
index 66f209d..7d44a69 100644
--- a/operations/common/noise-reduction.c
+++ b/operations/common/noise-reduction.c
@@ -18,7 +18,7 @@
#ifdef GEGL_CHANT_PROPERTIES
-gegl_chant_int (iterations, "Strength", 1, 32, 4, "How many iteratarion to run the algorithm.")
+gegl_chant_int_ui (iterations, "Strength", 0, 32, 4, 0, 8, 1, "How many iteratarion to run the algorithm.")
#else
diff --git a/operations/common/noise.c b/operations/common/noise.c
index 188a0d9..3df9b00 100644
--- a/operations/common/noise.c
+++ b/operations/common/noise.c
@@ -22,11 +22,16 @@
#ifdef GEGL_CHANT_PROPERTIES
-gegl_chant_double (alpha, _("Alpha"), -G_MAXDOUBLE, G_MAXDOUBLE, 1.2, _(""))
-gegl_chant_double (scale, _("Scale"), -G_MAXDOUBLE, G_MAXDOUBLE, 1.8, _(""))
-gegl_chant_double (zoff, _("Z offset"), -G_MAXDOUBLE, G_MAXDOUBLE, -1, _(""))
-gegl_chant_double (seed, _("Seed"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, _(""))
-gegl_chant_int (n, _("Iteration"), 0, 20, 3, _(""))
+gegl_chant_double_ui (alpha, _("Alpha"), -G_MAXDOUBLE, G_MAXDOUBLE, 1.2, 0.0, 4.0, 1.0,
+ NULL)
+gegl_chant_double_ui (scale, _("Scale"), -G_MAXDOUBLE, G_MAXDOUBLE, 1.8, 0.0, 20.0, 1.0,
+ NULL)
+gegl_chant_double_ui (zoff, _("Z offset"), -G_MAXDOUBLE, G_MAXDOUBLE, -1, -1.0, 8.0, 1.0,
+ NULL)
+gegl_chant_double_ui (seed, _("Seed"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, 0.0, 100.0, 1.0,
+ NULL)
+gegl_chant_int (n, _("Iteration"), 0, 20, 3,
+ NULL)
#else
diff --git a/operations/common/posterize.c b/operations/common/posterize.c
index 146e6f9..0fcca17 100644
--- a/operations/common/posterize.c
+++ b/operations/common/posterize.c
@@ -22,7 +22,7 @@
#ifdef GEGL_CHANT_PROPERTIES
-gegl_chant_int (levels, _("Levels"), 1, 64, 8,
+gegl_chant_int_ui (levels, _("Levels"), 1, 64, 8, 1, 64, 2,
_("number of levels per component"))
#else
diff --git a/operations/common/ripple.c b/operations/common/ripple.c
index c2d32fa..30d6d53 100644
--- a/operations/common/ripple.c
+++ b/operations/common/ripple.c
@@ -24,10 +24,10 @@
#ifdef GEGL_CHANT_PROPERTIES
-gegl_chant_double (amplitude, _("Amplitude"), 0.0, 1000.0, 25.0,
+gegl_chant_double_ui (amplitude, _("Amplitude"), 0.0, 1000.0, 25.0, 0.0, 1000.0, 2.0,
_("Amplitude of the ripple"))
-gegl_chant_double (period, _("Period"), 0.0, 1000.0, 200.0,
+gegl_chant_double_ui (period, _("Period"), 0.0, 1000.0, 200.0, 0.0, 1000.0, 1.5,
_("Period of the ripple"))
gegl_chant_double (phi, _("Phase shift"), -1.0, 1.0, 0.0,
diff --git a/operations/common/snn-mean.c b/operations/common/snn-mean.c
index 799b481..65c181f 100644
--- a/operations/common/snn-mean.c
+++ b/operations/common/snn-mean.c
@@ -23,7 +23,7 @@
#ifdef GEGL_CHANT_PROPERTIES
-gegl_chant_double (radius, _("Radius"), 0.0, 70.0, 8.0,
+gegl_chant_int_ui (radius, _("Radius"), 0, 100, 8, 0, 40, 1.5,
_("Radius of square pixel region, (width and height will be radius*2+1)"))
gegl_chant_int (pairs, _("Pairs"), 1, 2, 2,
_("Number of pairs; higher number preserves more acute features"))
diff --git a/operations/common/stress.c b/operations/common/stress.c
index c1c8434..ca01015 100644
--- a/operations/common/stress.c
+++ b/operations/common/stress.c
@@ -24,11 +24,11 @@
#ifdef GEGL_CHANT_PROPERTIES
-gegl_chant_int (radius, _("Radius"), 2, 3000.0, 300,
+gegl_chant_int_ui (radius, _("Radius"), 2, 5000.0, 300, 2, 2000, 1.0,
_("Neighbourhood taken into account, for enhancement ideal values are close to the longest side of the image, increasing this increases the runtime."))
-gegl_chant_int (samples, _("Samples"), 0, 1000, 4,
+gegl_chant_int_ui (samples, _("Samples"), 2, 200, 5, 2, 10, 1.0,
_("Number of samples to do per iteration looking for the range of colors."))
-gegl_chant_int (iterations, _("Iterations"), 0, 1000, 10,
+gegl_chant_int_ui (iterations, _("Iterations"), 1, 200, 5, 1, 10, 1.0,
_("Number of iterations, a higher number of iterations provides a less noisy rendering at computational cost."))
diff --git a/operations/common/threshold.c b/operations/common/threshold.c
index 1767f87..fe6fe16 100644
--- a/operations/common/threshold.c
+++ b/operations/common/threshold.c
@@ -22,7 +22,7 @@
#ifdef GEGL_CHANT_PROPERTIES
-gegl_chant_double (value, _("Threshold"), -10.0, 10.0, 0.5,
+gegl_chant_double_ui (value, _("Threshold"), -10.0, 10.0, 0.5, 0.0, 1.0, 1.0,
_("Global threshold level (used when there is no auxiliary input buffer)."))
#else
diff --git a/operations/common/unsharp-mask.c b/operations/common/unsharp-mask.c
index f439568..6a2d470 100644
--- a/operations/common/unsharp-mask.c
+++ b/operations/common/unsharp-mask.c
@@ -21,9 +21,10 @@
#ifdef GEGL_CHANT_PROPERTIES
-gegl_chant_double(std_dev, _("Std. Dev."), 0.0, 100.0, 1.0,
+gegl_chant_double_ui (std_dev, _("Std. Dev."), 0.0, 500.0, 1.0, 0.0, 200.0, 1.5,
_("Standard deviation (spatial scale factor)"))
-gegl_chant_double(scale, _("Scale"), 0.0, 100.0, 1.0, _("Scale, strength of effect."))
+gegl_chant_double_ui (scale, _("Scale"), 0.0, 100.0, 1.0, 0.0, 100.0, 1.5,
+ _("Scale, strength of effect."))
#else
diff --git a/operations/common/waves.c b/operations/common/waves.c
index ef0689b..895aea1 100644
--- a/operations/common/waves.c
+++ b/operations/common/waves.c
@@ -23,10 +23,10 @@
#ifdef GEGL_CHANT_PROPERTIES
-gegl_chant_double (x, _("X"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0,
+gegl_chant_double_ui (x, _("X"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, 0.0, 1024.0, 1.0,
_("X coordinate of the center of the waves"))
-gegl_chant_double (y, _("Y"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0,
+gegl_chant_double_ui (y, _("Y"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, 0.0, 1024.0, 1.0,
_("Coordinate y of the center of the waves"))
gegl_chant_double (amplitude, _("Amplitude"), 0.0, 1000.0, 25.0,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]