ops: port many more ops to macro based property meta data

parent 32f9dd53
......@@ -24,21 +24,19 @@
/* Here in the top of the file the properties of the operation is declared,
* this causes the declaration of a structure for containing the data.
*
* The first member of each gegl_property_ macro becomes a struct member
* The first member of each property_ macro becomes a struct member
* in the GeglProperties struct used when processing.
*/
gegl_property_double (contrast, _("Contrast"),
"description", _("Magnitude of contrast scaling >1.0 brighten < 1.0 darken"),
"default", 1.0, "min", -5.0, "max", 5.0,
"ui-min", 0.0, "ui-max", 2.0, "ui-gamma", 1.0,
NULL)
property_double (contrast, _("Contrast"), 1.0)
description (_("Magnitude of contrast scaling >1.0 brighten < 1.0 darken"))
value_range (-5.0, 5.0)
ui_range (0.0, 2.0)
gegl_property_double (brightness, _("Brightness"),
"description", _("Amount to increase brightness"),
"default", 0.0, "min", -3.0, "max", 3.0,
"ui-min", -1.0, "ui-max", 1.0, "ui-gamma", 1.0,
NULL)
property_double (brightness, _("Brightness"), 0.0)
description (_("Amount to increase brightness"))
value_range (-3.0, 3.0)
ui_range (-1.0, 1.0)
#else
......@@ -84,7 +82,7 @@ process (GeglOperation *op,
const GeglRectangle *roi,
gint level)
{
/* Retrieve a pointer to GeglChantO structure which contains all the
/* Retrieve a pointer to GeglProperties structure which contains all the
* chanted properties
*/
GeglProperties *o = GEGL_PROPERTIES (op);
......@@ -156,4 +154,4 @@ gegl_op_class_init (GeglOpClass *klass)
NULL);
}
#endif /* closing #ifdef GEGL_CHANT_PROPERTIES ... else ... */
#endif /* closing #ifdef GEGL_PROPERTIES ... else ... */
......@@ -22,52 +22,44 @@
#ifdef GEGL_PROPERTIES
gegl_property_int (x, _("Width"),
"description", _("Horizontal width of cells pixels"),
"default", 16,
"min", 1,
"ui-min", 1, "ui-max", 256, "ui-gamma", 1.5,
"unit", "pixel-distance",
"axis", "x",
NULL)
gegl_property_int (y, _("Height"),
"description", _("Vertical width of cells pixels"),
"default", 16, "min", 1,
"ui-min", 1, "ui-max", 256, "ui-gamma", 1.5,
"unit", "pixel-distance",
"axis", "y",
NULL)
gegl_property_int (x_offset, _("Offset X"),
"description", _("Horizontal offset (from origin) for start of grid"),
"ui-min", -10, "ui-max", 10,
"unit", "pixel-coordinate",
"axis", "x",
NULL)
gegl_property_int (y_offset, _("Offset Y"),
"description", _("Vertical offset (from origin) for start of grid"),
"ui-min", -10, "ui-max", 10,
"unit", "pixel-coordinate",
"axis", "y",
NULL)
gegl_property_color (color1, _("Color"),
"description", _("One of the cell colors (defaults to 'black')"),
"default", "black",
"role", "color-primary",
NULL)
gegl_property_color (color2, _("Color"),
"description", _("One of the cell colors (defaults to 'white')"),
"default", "white",
"role", "color-secondary",
NULL)
gegl_property_format (format, _("Babl Format"),
"description", _("The babl format of the output"),
NULL)
property_int (x, _("Width"), 16)
description (_("Horizontal width of cells pixels"))
value_range (1, G_MAXINT)
ui_range (1, 256)
ui_gamma (1.5)
ui_meta ("unit", "pixel-distance")
ui_meta ("axis", "x")
property_int (y, _("Height"), 16)
description (_("Vertical width of cells pixels"))
value_range (1, G_MAXINT)
ui_range (1, 256)
ui_gamma (1.5)
ui_meta ("unit", "pixel-distance")
ui_meta ("axis", "y")
property_int (x_offset, _("Offset X"), 0.0)
description (_("Horizontal offset (from origin) for start of grid"))
ui_range (-10, 10)
ui_meta("unit", "pixel-coordinate")
ui_meta ("axis", "x")
property_int (y_offset, _("Offset Y"), 0)
description (_("Vertical offset (from origin) for start of grid"))
ui_range (-10, 10)
ui_meta ("unit", "pixel-coordinate")
ui_meta ("axis", "y")
property_color (color1, _("Color"), "black")
description (_("One of the cell colors (defaults to 'black')"))
ui_meta ("role", "color-primary")
property_color (color2, _("Color"), "white")
description (_("One of the cell colors (defaults to 'white')"))
ui_meta ("role", "color-secondary")
property_format (format, _("Babl Format"), NULL)
description ( _("The babl format of the output"))
#else
......
......@@ -27,23 +27,19 @@
#ifdef GEGL_PROPERTIES
gegl_property_double (tile_size, _("Tile size"),
"default", 10.0, "min", 0.0, "max", 256.0,
"description", _("Average diameter of each tile (in pixels)"),
"unit", "pixel-distance",
NULL)
gegl_property_double (tile_saturation, _("Tile saturation"),
"default", 2.5, "min", 0.0, "max", 10.0,
_("Expand tiles by this amount"),
NULL)
gegl_property_color (bg_color, _("Background Color"),
"description", _("The tiles' background color"),
"default", "rgba(0.0, 0.0, 0.0, 0.0)",
NULL)
gegl_property_seed (seed, _("Random seed"), rand, NULL)
property_double (tile_size, _("Tile size"), 10.0)
description (_("Average diameter of each tile (in pixels)"))
value_range (0.0, 256.0)
ui_meta ("unit", "pixel-distance")
property_double (tile_saturation, _("Tile saturation"), 2.5)
description (_("Expand tiles by this amount"))
value_range (0.0, 10.0)
property_color (bg_color, _("Background Color"), "rgba(0.0, 0.0, 0.0, 0.0)")
description (("The tiles' background color"))
property_seed (seed, _("Random seed"), rand)
#else
......
......@@ -39,48 +39,44 @@ enum_start (gegl_fractal_explorer_type)
enum_value (GEGL_FRACTAL_EXPLORER_TYPE_SIERPINSKI, "Sierpinski")
enum_end (GeglFractalExplorerType)
gegl_property_enum (fractaltype, _("Fractal type"),
property_enum (fractaltype, _("Fractal type"),
GeglFractalExplorerType, gegl_fractal_explorer_type,
"description", _("Type of a fractal"),
"default", GEGL_FRACTAL_EXPLORER_TYPE_MANDELBROT,
NULL)
gegl_property_int (iter, _("Iterations"),
"description", _("Iterations"),
"default", 50, "min", 1, "max", 1000,
NULL)
gegl_property_double (zoom, _("Zoom"),
"description", _("Zoom in the fractal space"),
"default", 300.0 , "min" , 0.0000001, "max" , 10000000.0,
"ui-min", 0.0001, "ui-max", 10000.0 , "ui-gamma", 1.5,
NULL)
gegl_property_double (shiftx, _("Shift X"),
"description", _("X shift in the fractal space"),
"ui-min", -1000.0, "ui-max", 1000.0, "ui-gamma", 1.5,
NULL)
gegl_property_double (shifty, _("Shift Y"),
"description", _("Y shift in the fractal space"),
"ui-min", -1000.0, "ui-max", 1000.0, "ui-gamma", 1.5,
NULL)
gegl_property_double (cx, _("CX"),
"description", _("CX (No effect in Mandelbrot and Sierpinski)"),
"default", -0.75, "min", -2.5, "max", 2.5,
NULL)
gegl_property_double (cy, _("CY"),
"description", _("CY (No effect in Mandelbrot and Sierpinski)"),
"default", 0.2, "min", -2.5, "max", 2.5,
NULL)
gegl_property_double (redstretch, _("Red stretch"),
"description", _("Red stretching factor"),
"default", 1.0, "min", 0.0, "max", 1.0,
NULL)
gegl_property_double (greenstretch, _("Green stretch"),
"description", _("Green stretching factor"),
"default", 1.0, "min", 0.0, "max", 1.0,
NULL)
gegl_property_double (bluestretch, _("Blue stretch"),
"description", _("Green stretching factor"),
"default", 1.0, "min", 0.0, "max", 1.0,
NULL)
GEGL_FRACTAL_EXPLORER_TYPE_MANDELBROT)
description (_("Type of a fractal"))
property_int (iter, _("Iterations"), 50)
value_range (1, 1000)
property_double (zoom, _("Zoom"), 300.0)
description (_("Zoom in the fractal space"))
value_range (0.0000001, 10000000.0)
ui_range (0.0000001, 10000.0)
ui_gamma (1.5)
property_double (shiftx, _("Shift X"), 0.0)
description (_("X shift in the fractal space"))
ui_range (-1000.0, 1000.0)
property_double (shifty, _("Shift Y"), 0.0)
description (_("Y shift in the fractal space"))
ui_range (-1000.0, 1000.0)
property_double (cx, _("CX"), -0.75)
description (_("CX (No effect in Mandelbrot and Sierpinski)"))
value_range (-2.5, 2.5)
property_double (cy, _("CY"), -0.2)
description (_("CY (No effect in Mandelbrot and Sierpinski)"))
value_range (-2.5, 2.5)
property_double (redstretch, _("Red stretching factor"), 1.0)
value_range (0.0, 1.0)
property_double (greenstretch, _("Green stretching factor"), 1.0)
value_range (0.0, 1.0)
property_double (bluestretch, _("Blue stretching factor"), 1.0)
value_range (0.0, 1.0)
enum_start (gegl_fractal_explorer_mode)
enum_value (GEGL_FRACTAL_EXPLORER_MODE_SIN , "Sine")
......@@ -88,34 +84,26 @@ enum_start (gegl_fractal_explorer_mode)
enum_value (GEGL_FRACTAL_EXPLORER_MODE_NONE, "None")
enum_end (GeglFractalExplorerMode)
gegl_property_enum (redmode, _("Red mode"),
property_enum (redmode, _("Red application mode"),
GeglFractalExplorerMode, gegl_fractal_explorer_mode,
"description", _("Red application mode"),
"default", GEGL_FRACTAL_EXPLORER_MODE_COS,
NULL)
GEGL_FRACTAL_EXPLORER_MODE_COS)
gegl_property_enum (greenmode, _("Green mode"),
property_enum (greenmode, _("Green application mode"),
GeglFractalExplorerMode, gegl_fractal_explorer_mode,
"default", GEGL_FRACTAL_EXPLORER_MODE_COS,
"description", _("Green application mode"),
NULL)
GEGL_FRACTAL_EXPLORER_MODE_COS)
gegl_property_enum (bluemode, _("Blue mode"),
property_enum (bluemode, _("Blue application mode"),
GeglFractalExplorerMode, gegl_fractal_explorer_mode,
"description", _("Blue application mode"),
"default", GEGL_FRACTAL_EXPLORER_MODE_SIN,
NULL)
GEGL_FRACTAL_EXPLORER_MODE_SIN)
gegl_property_boolean (redinvert , _("Red inversion") , NULL)
gegl_property_boolean (greeninvert, _("Green inversion"), NULL)
gegl_property_boolean (blueinvert , _("Blue inversion") , NULL)
property_boolean (redinvert , _("Red inversion") , FALSE)
property_boolean (greeninvert, _("Green inversion"), FALSE)
property_boolean (blueinvert , _("Blue inversion") , FALSE)
gegl_property_int (ncolors, _("Colors"),
"description", _("Number of colors"),
"default", 256, "min", 2, "max", MAXNCOLORS,
NULL)
property_int (ncolors, _("Number of colors"), 256)
value_range (2, MAXNCOLORS)
gegl_property_boolean (useloglog, _("Loglog smoothing"), NULL)
property_boolean (useloglog, _("Loglog smoothing"), FALSE)
#else
......
......@@ -33,27 +33,26 @@ enum_start (gegl_gaussian_blur_filter)
enum_value (GEGL_GAUSSIAN_BLUR_FILTER_IIR, "IIR")
enum_end (GeglGaussianBlurFilter)
gegl_property_double (std_dev_x, _("Size X"),
"description", _("Standard deviation for the horizontal axis (multiply by ~2 to get radius)"),
"default", 1.5, "min", 0.0, "max", 1500.0,
"ui-min", 0.0, "ui-max", 100.0, "ui-gamma", 3.0,
"axis", "x",
"unit", "pixel-coordinate",
NULL)
gegl_property_double (std_dev_y, _("Size Y"),
"description", _("Standard deviation for the horizontal axis (multiply by ~2 to get radius)"),
"default", 1.5, "min", 0.0, "max", 1500.0,
"ui-min", 0.0, "ui-max", 100.0, "ui-gamma", 3.0,
"axis", "y",
"unit", "pixel-coordinate",
NULL)
gegl_property_enum (filter, _("Filter"),
property_double (std_dev_x, _("Size X"), 1.5)
description (_("Standard deviation for the horizontal axis"))
value_range (0.0, 1500.0)
ui_range (0.0, 100.0)
ui_gamma (3.0)
ui_meta ("axis", "x")
ui_meta ("unit", "pixel-coordinate")
property_double (std_dev_y, _("Size Y"), 1.5)
description (_("Standard deviation for the vertical axis"))
value_range (0.0, 1500.0)
ui_range (0.0, 100.0)
ui_gamma (3.0)
ui_meta ("axis", "y")
ui_meta ("unit", "pixel-coordinate")
property_enum (filter, _("Filter"),
GeglGaussianBlurFilter, gegl_gaussian_blur_filter,
"default", GEGL_GAUSSIAN_BLUR_FILTER_AUTO,
"description", _("Optional parameter to override the automatic selection of blur filter"),
NULL)
GEGL_GAUSSIAN_BLUR_FILTER_AUTO)
description (_("Optional parameter to override the automatic selection of blur filter"))
#else
......
......@@ -21,59 +21,49 @@
#ifdef GEGL_PROPERTIES
gegl_property_int (x, _("Width"),
"description", _("Horizontal width of cells pixels"),
"default", 32, "min", 1, "max", G_MAXINT,
"ui-min", 1, "ui-max", 128,
"unit", "pixel-distance",
"axis", "x",
NULL)
gegl_property_int (y, _("Height"),
"description", _("Vertical width of cells pixels"),
"default", 32, "min", 1, "max", G_MAXINT,
"ui-min", 1, "ui-max", 128,
"unit", "pixel-distance",
"axis", "y",
NULL)
gegl_property_int (x_offset, _("Offset X"),
"description", _("Horizontal offset (from origin) for start of grid"),
"default", 0,
"ui-min", -64, "ui-max", 64,
"unit", "pixel-coordinate",
"axis", "x",
NULL)
gegl_property_int (y_offset, _("Offset Y"),
"description", _("Vertical offset (from origin) for start of grid"),
"default", 0,
"ui-min", -64, "ui-max", 64,
"unit", "pixel-coordinate",
"axis", "y",
NULL)
gegl_property_int (line_width, _("Line width"),
"description", _("Width of grid lines in pixels"),
"default", 4, "min", 0,
"ui-min", 0, "ui-max", 16,
"unit", "pixel-distance",
"axis", "x",
NULL)
gegl_property_int (line_height, _("Line height"),
"description", _("Width of grid lines in pixels"),
"default", 4, "min", 0,
"ui-min", 0, "ui-max", 16,
"unit", "pixel-distance",
"axis", "y",
NULL)
gegl_property_color (line_color, _("Color"),
"description", _("Color of the grid lines"),
"default", "black",
"role", "color-primary",
NULL)
property_int (x, _("Width"), 32)
description (_("Horizontal width of cells pixels"))
value_range (1, G_MAXINT)
ui_range (1, 128)
ui_meta ("unit", "pixel-distance")
ui_meta ("axis", "x")
property_int (y, _("Height"), 32)
description (_("Vertical width of cells pixels"))
value_range (1, G_MAXINT)
ui_range (1, 128)
ui_meta ("unit", "pixel-distance")
ui_meta ("axis", "y")
property_int (x_offset, _("Offset X"), 0)
description (_("Horizontal offset (from origin) for start of grid"))
ui_range (-64, 64)
ui_meta ("unit", "pixel-coordinate")
ui_meta ("axis", "x")
property_int (y_offset, _("Offset Y"), 0)
description (_("Vertical offset (from origin) for start of grid"))
ui_range (-64, 64)
ui_meta ("unit", "pixel-coordinate")
ui_meta ("axis", "y")
property_int (line_width, _("Line width"), 4)
description (_("Width of grid lines in pixels"))
value_range (0, G_MAXINT)
ui_range (0, 16)
ui_meta ("unit", "pixel-distance")
ui_meta ("axis", "x")
property_int (line_height, _("Line height"), 4)
description (_("Height of grid lines in pixels"))
value_range (0, G_MAXINT)
ui_range (0, 16)
ui_meta ("unit", "pixel-distance")
ui_meta ("axis", "y")
property_color (line_color, _("Color"), "black")
description (_("Color of the grid lines"))
ui_meta ("role", "color-primary")
#else
......
......@@ -23,9 +23,7 @@
#ifdef GEGL_PROPERTIES
gegl_property_object(node, _("Node"),
"description", _("GeglNode to introspect"),
NULL)
property_object(node, _("Node"), GEGL_TYPE_NODE)
#else
......
......@@ -27,36 +27,27 @@
#ifdef GEGL_PROPERTIES
gegl_property_string(composite_op, _("Operation"),
"description", _("Composite operation to use"),
"default", "gegl:over",
NULL)
gegl_property_double(opacity, _("Opacity"),
"default", 1.0, "min", 0.0, "max", 1.0,
NULL)
gegl_property_double(x, _("X"),
"description", _("Horizontal position in pixels"),
"axis", "x",
"unit", "pixel-coordinate",
NULL)
gegl_property_double(y, _("Y"),
"description", _("Vertical position in pixels"),
"axis", "y",
"unit", "pixel-coordinate",
NULL)
gegl_property_double(scale, _("Scale"),
"description", _("Scale 1:1 size"),
"default", 1.0,
NULL)
gegl_property_file_path(src, _("Source"),
"description", _("Source image file path (png, jpg, raw, svg, bmp, tif, ...)"),
"default", "",
NULL)
property_string(composite_op, _("Operation"), "gegl:over")
description (_("Composite operation to use"))
property_double(opacity, _("Opacity"), 1.0)
value_range (0.0, 1.0)
property_double(x, _("X"), 0.0)
description (_("Horizontal position in pixels"))
ui_meta ("axis", "x")
ui_meta ("unit", "pixel-coordinate")
property_double(y, _("Y"), 0.0)
description (_("Vertical position in pixels"))
ui_meta ("axis", "y")
ui_meta ("unit", "pixel-coordinate")
property_double(scale, _("Scale"), 1.0)
description (_("Scale 1:1 size"))
property_file_path(src, _("Source"), "")
description (_("Source image file path (png, jpg, raw, svg, bmp, tif, ...)"))
#else
......
......@@ -30,40 +30,31 @@
#ifdef GEGL_PROPERTIES
gegl_property_double (main, _("Main"),
"description", _("Amount of second-order distortion"),
"min", -100.0, "max", 100.0,
NULL)
gegl_property_double (edge, _("Edge"),
"description", _("Amount of fourth-order distortion"),
"min", -100.0, "max", 100.0,
NULL)
gegl_property_double (zoom, _("Zoom"),
"description", _("Rescale overall image size"),
"min", -100.0, "max", 100.0,
NULL)
gegl_property_double (x_shift, _("Shift X"),
"description", _("Effect centre offset in X"),
"min", -100.0, "max", 100.0,
NULL)
gegl_property_double (y_shift, _("Shift Y"),
"description", _("Effect centre offset in Y"),
"min", -100.0, "max", 100.0,
NULL)
gegl_property_double (brighten, _("Brighten"),
"description", _("Adjust brightness in corners"),
"min", -100.0, "max", 100.0,
NULL)
gegl_property_color (background, _("Background"),
"description", _("Background color"),
"default", "white",
NULL)
property_double (main, _("Main"), 0.0)
description (_("Amount of second-order distortion"))
value_range (-100.0, 100.0)
property_double (edge, _("Edge"), 0.0)
description (_("Amount of fourth-order distortion"))
value_range (-100.0, 100.0)
property_double (zoom, _("Zoom"), 0.0)
description (_("Rescale overall image size"))
value_range (-100, 100.0)
property_double (x_shift, _("Shift X"), 0.0)
description (_("Effect centre offset in X"))
value_range (-100.0, 100.0)
property_double (y_shift, _("Shift Y"), 0.0)
description (_("Effect centre offset in Y"))
value_range (-100.0, 100.0)
property_double (brighten, _("Brighten"), 0.0)
description (_("Adjust brightness in corners"))
value_range (-100.0, 100.0)
property_color (background, _("Background color"), "white")
#else
......
......@@ -23,22 +23,25 @@
#ifdef GEGL_PROPERTIES
gegl_property_double (in_low, _("Low input"),
"description", _("Input luminance level to become lowest output"),
"min", -1.0, "max", 4.0, "default", 0.0, "ui-min", 0.0, "ui-max", 1.0,
NULL)
gegl_property_double (in_high, _("High input"),
"description", _("Input luminance level to become white"),
"min", -1.0, "max", 4.0, "default", 1.0, "ui-min", 0.0, "ui-max", 1.0,
NULL)
gegl_property_double (out_low, _("Low output"),
"description", _("Lowest luminance level in output"),
"min", -1.0, "max", 4.0, "default", 0.0, "ui-min", 0.0, "ui-max", 1.0,
NULL)
gegl_property_double (out_high, _("High output"),
"description", _("Highest luminance level in output"),
"min", -1.0, "max", 4.0, "default", 1.0, "ui-min", 0.0, "ui-max", 1.0,
NULL)
property_double (in_low, _("Low input"), 0.0)
description ( _("Input luminance level to become lowest output"))
value_range (-1.0, 4.0)
ui_range (0.0, 1.0)
property_double (in_high, _("High input"), 1.0)
description (_("Input luminance level to become white"))
value_range (-1.0, 4.0)
ui_range (0.0, 1.0)
property_double (out_low, _("Low output"), 0.0)
description (_("Lowest luminance level in output"))
value_range (-1.0, 4.0)
ui_range (0.0, 1.0)
property_double (out_high, _("High output"), 1.0)
description (_("Highest luminance level in output"))
value_range (-1.0, 4.0)
ui_range (0.0, 1.0)
#else
......
......@@ -22,39 +22,29 @@
#ifdef GEGL_PROPERTIES
gegl_property_double (start_x, _("X1"),
"default", 25.0,
"unit", "pixel-coordinate",
"axis", "x",
NULL)
gegl_property_double (start_y, _("Y1"),
"default", 25.0,
"unit", "pixel-coordinate",
"axis", "y",
NULL)
gegl_property_double (end_x, _("X2"),
"default", 150.0,
"unit", "pixel-coordinate",
"axis", "x",
NULL)
gegl_property_double (end_y, _("Y2"),
"default", 150.0,
"unit", "pixel-coordinate",
"axis", "y",
NULL)
gegl_property_color (start_color, _("Start Color"),
"description", _("The color at (x1, y1)"),
"default", "black",
"role", "color-primary",
NULL)
gegl_property_color (end_color, _("End Color"),
"description", _("The color at (x2, y2)"),
"default", "white",
"role", "color-secondary",
NULL)
property_double (start_x, _("X1"), 25.0)
ui_meta("unit", "pixel-coordinate")
ui_meta("axis", "x")
property_double (start_y, _("Y1"), 25.0)
ui_meta("unit", "pixel-coordinate")
ui_meta("axis", "y")
property_double (end_x, _("X2"), 150.0)
ui_meta("unit", "pixel-coordinate")
ui_meta("axis", "x")
property_double (end_y, _("Y2"), 150.0)
ui_meta ("unit", "pixel-coordinate")
ui_meta ("axis", "y")
property_color (start_color, _("Start Color"), "black")
description (_("The color at (x1, y1)"))
ui_meta ("role", "color-primary")
property_color (end_color, _("End Color"), "white")
description (_("The color at (x2, y2)"))
ui_meta ("role", "color-secondary")