Commit dc7e1319 authored by Øyvind Kolås's avatar Øyvind Kolås

improved documentation strings for many operations

parent e6843e3d
2006-09-12 Øyvind Kolås <pippin@gimp.org>
Improved documentation strings for most operations.
* tools/operation_reference.c: (category_menu_item),
(category_index), (main): hide the "hidden" category from being
output.
* operations/blur/box-blur.c:
* operations/blur/gaussian-blur.c:
* operations/color/brightness-contrast.c:
* operations/color/invert.c:
* operations/color/stretch-contrast.c:
* operations/color/threshold.c:
* operations/core/buffer.c:
* operations/core/crop.c:
* operations/core/nop.c:
* operations/core/shift.c:
* operations/display/display.c:
* operations/file-io/jpg-load.c:
* operations/file-io/magick-load.c:
* operations/file-io/png-load.c:
* operations/file-io/png-save.c:
* operations/file-io/raw-load.c:
* operations/meta/dropshadow.c:
* operations/meta/unsharp-mask.c:
* operations/render/blank.c:
* operations/render/checkerboard.c:
* operations/render/noise.c:
* operations/render/text.c:
* operations/transform/rotate.c:
* operations/transform/scale.c:
* operations/transform/shear.c:
* operations/transform/translate.c:
* operations/transparency/opacity.c:
2006-09-11 Øyvind Kolås <pippin@gimp.org>
Made gegl_color_set_from_string and gegl_color_get_string private, and
......
......@@ -19,7 +19,8 @@
*/
#if GEGL_CHANT_PROPERTIES
gegl_chant_double (radius, 0.0, 200.0, 4.0, "radius of square pixel region, (width and height will be radius*2+1.")
gegl_chant_double (radius, 0.0, 200.0, 4.0,
"Radius of square pixel region, (width and height will be radius*2+1.")
#else
......
......@@ -22,8 +22,10 @@
#if GEGL_CHANT_PROPERTIES
gegl_chant_double (radius_x, -0.91675, 500.0, 4.0, "blur radius in horizontal direction.")
gegl_chant_double (radius_y, -0.91675, 500.0, 4.0, "blur radius in vertical direction.")
gegl_chant_double (radius_x, -0.91675, 500.0, 4.0,
"Standard deviation for the horizontal axis.")
gegl_chant_double (radius_y, -0.91675, 500.0, 4.0,
"Standard deviation for the vertical axis.")
#else
......
......@@ -25,8 +25,10 @@
* the the parameters are:
* property name, min, max, default, "description of property" */
gegl_chant_double (contrast, -100.0, 100.0, 1.0, "Range scale factor")
gegl_chant_double (brightness, -10.0, 10.0, 0.0, "Amount to increase brightness")
gegl_chant_double (contrast, -100.0, 100.0, 1.0,
"Range scale factor")
gegl_chant_double (brightness, -10.0, 10.0, 0.0,
"Amount to increase brightness")
/* this will create the following structure for our use, and register the
* property with the given ranges, default values and a comment for the
......
......@@ -23,7 +23,7 @@
#define GEGL_CHANT_POINT_FILTER
#define GEGL_CHANT_NAME invert
#define GEGL_CHANT_DESCRIPTION "inverts the components (except alpha, one by one)"
#define GEGL_CHANT_DESCRIPTION "Inverts the components (except alpha), the result is the corresponding \"negative\" image."
#define GEGL_CHANT_SELF "invert.c"
#define GEGL_CHANT_CATEGORIES "color"
#define GEGL_CHANT_INIT
......
......@@ -23,7 +23,7 @@
#define GEGL_CHANT_FILTER
#define GEGL_CHANT_NAME stretch_contrast
#define GEGL_CHANT_DESCRIPTION "Scales the components of the buffer to be in the 0.0-1.0 range"
#define GEGL_CHANT_DESCRIPTION "Scales the components of the buffer to be in the 0.0-1.0 range. This improves images that makes poor use of the available contrast (little contrast, very dark, or very bright images)."
#define GEGL_CHANT_SELF "stretch-contrast.c"
#define GEGL_CHANT_CLASS_INIT /*< we need to modify the standard class init
......
......@@ -19,13 +19,14 @@
*/
#if GEGL_CHANT_PROPERTIES
gegl_chant_double (value, -100.0, 100.0, 0.5, "global threshold level (used when there is no aux input")
gegl_chant_double (value, -100.0, 100.0, 0.5,
"Global threshold level (used when there is no auxiliary input buffer).")
#else
#define GEGL_CHANT_POINT_COMPOSER
#define GEGL_CHANT_NAME threshold
#define GEGL_CHANT_DESCRIPTION "thresholds the image to white/black based on either the global value set in the value property, or per pixel from the aux input"
#define GEGL_CHANT_DESCRIPTION "Thresholds the image to white/black based on either the global value set in the value property, or per pixel from the aux input."
#define GEGL_CHANT_SELF "threshold.c"
#define GEGL_CHANT_CATEGORIES "color"
#define GEGL_CHANT_INIT
......
......@@ -18,7 +18,7 @@
* Copyright 2006 Øyvind Kolås <pippin@gimp.org>
*/
#if GEGL_CHANT_PROPERTIES
gegl_chant_object(buffer, "GeglBuffer to use")
gegl_chant_object (buffer, "GeglBuffer to use")
#else
#define GEGL_CHANT_SOURCE
......
......@@ -19,19 +19,21 @@
*/
#if GEGL_CHANT_PROPERTIES
gegl_chant_double (x, -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, "left most pixel coordinate")
gegl_chant_double (y, -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, "top pixel coordinate")
gegl_chant_double (width, -G_MAXDOUBLE, G_MAXDOUBLE, 10.0, "width in pixels")
gegl_chant_double (height, -G_MAXDOUBLE, G_MAXDOUBLE, 10.0, "height in pixels")
gegl_chant_double (x, -G_MAXDOUBLE, G_MAXDOUBLE, 0.0,
"Left-most pixel coordinate.")
gegl_chant_double (y, -G_MAXDOUBLE, G_MAXDOUBLE, 0.0,
"Top-most pixel coordinate.")
gegl_chant_double (width, -G_MAXDOUBLE, G_MAXDOUBLE, 10.0,
"Width in pixels.")
gegl_chant_double (height, -G_MAXDOUBLE, G_MAXDOUBLE, 10.0,
"Height in pixels.")
#else
#define GEGL_CHANT_FILTER
#define GEGL_CHANT_NAME crop
#define GEGL_CHANT_SELF "crop.c"
#define GEGL_CHANT_DESCRIPTION "crops the image, can be used to rectangulary" \
"clip buffers, as well as specifying what " \
"portion of a composition to render to file"
#define GEGL_CHANT_DESCRIPTION "Crops the resulting image buffer computed by the sources of the crop operation, can be used to mask out unwanted data, the cropped out regions are interpreted as transparent black by nodes using regions outside the crop-area for compositing."
#define GEGL_CHANT_CATEGORIES "geometry"
#define GEGL_CHANT_CLASS_INIT
#include "gegl-chant.h"
......
......@@ -23,7 +23,7 @@
#define GEGL_CHANT_FILTER
#define GEGL_CHANT_NAME nop
#define GEGL_CHANT_DESCRIPTION "Passthrough operation"
#define GEGL_CHANT_DESCRIPTION "Passthrough operation. Used mostly for routing/place holder purposes internally in GEGL."
#define GEGL_CHANT_SELF "nop.c"
#include "gegl-chant.h"
......
......@@ -19,14 +19,16 @@
*/
#if GEGL_CHANT_PROPERTIES
gegl_chant_double (x, -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, "x coordinate of new origin")
gegl_chant_double (y, -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, "y coordinate of new origin")
gegl_chant_double (x, -G_MAXDOUBLE, G_MAXDOUBLE, 0.0,
"X coordinate of new origin.")
gegl_chant_double (y, -G_MAXDOUBLE, G_MAXDOUBLE, 0.0,
"Y coordinate of new origin.")
#else
#define GEGL_CHANT_FILTER
#define GEGL_CHANT_NAME shift
#define GEGL_CHANT_DESCRIPTION "Translate the buffer, an integer amount of pixels."
#define GEGL_CHANT_DESCRIPTION "Translate the buffer, an integer amount of pixels. (This is a lower level operation than the affine 'translate' operation.)"
#define GEGL_CHANT_SELF "shift.c"
#define GEGL_CHANT_CATEGORIES "geometry"
#define GEGL_CHANT_CLASS_INIT
......
......@@ -19,9 +19,11 @@
*/
#if GEGL_CHANT_PROPERTIES
gegl_chant_string(window_title, "window_title", "Title to be given output window")
gegl_chant_string(icon_title, "icon_title", "Icon to be used for output window")
gegl_chant_pointer(screen, "private")
gegl_chant_string (window_title, "window_title",
"Title to be given output window")
gegl_chant_string (icon_title, "icon_title",
"Icon to be used for output window")
gegl_chant_pointer (screen, "private")
gegl_chant_int(w, 0, 1000, 0, "private")
gegl_chant_int(h, 0, 1000, 0, "private")
gegl_chant_int(width, 0, 1000, 0, "private")
......@@ -158,8 +160,8 @@ process (GeglOperation *operation)
self->width = need->w;
self->height = need->h;
/*self->output = g_object_ref (self->input);*/
return TRUE;
}
......
......@@ -19,7 +19,8 @@
*/
#if GEGL_CHANT_PROPERTIES
gegl_chant_string (path, "/tmp/romedalen.jpg", "Path to jpg file on disk to load")
gegl_chant_string (path, "/tmp/romedalen.jpg",
"Path of file to load.")
#else
......
......@@ -19,8 +19,10 @@
*/
#if GEGL_CHANT_PROPERTIES
gegl_chant_string(path, "/tmp/lena.png", "Path of file to load.")
gegl_chant_boolean(cache, TRUE, "Whether to cache the entire buffer loaded from the file.")
gegl_chant_string (path, "/tmp/lena.png",
"Path of file to load.")
gegl_chant_boolean (cache, TRUE,
"Whether to cache the entire buffer loaded from the file.")
#else
......
......@@ -18,12 +18,13 @@
* Copyright 2006 Øyvind Kolås <pippin@gimp.org>
*/
#if GEGL_CHANT_PROPERTIES
gegl_chant_string (path, "/tmp/gegl-logo.svg", "path to file to load")
gegl_chant_string (path, "/tmp/gegl-logo.svg",
"Path of file to load.")
#else
#define GEGL_CHANT_SOURCE
#define GEGL_CHANT_NAME magick_load
#define GEGL_CHANT_DESCRIPTION "Image Magick wrapper using the png op"
#define GEGL_CHANT_DESCRIPTION "Image Magick wrapper using the png op."
#define GEGL_CHANT_SELF "magick-load.c"
#define GEGL_CHANT_CATEGORIES "hidden"
......
......@@ -19,13 +19,14 @@
*/
#if GEGL_CHANT_PROPERTIES
gegl_chant_string (path, "/tmp/romedalen.png", "path to file to load")
gegl_chant_string (path, "/tmp/romedalen.png",
"Path of file to load.")
#else
#define GEGL_CHANT_SOURCE
#define GEGL_CHANT_NAME png_load
#define GEGL_CHANT_DESCRIPTION "PNG image loader"
#define GEGL_CHANT_DESCRIPTION "PNG image loader."
#define GEGL_CHANT_SELF "png-load.c"
#define GEGL_CHANT_CATEGORIES "hidden"
#define GEGL_CHANT_CLASS_INIT
......
......@@ -19,13 +19,14 @@
*/
#if GEGL_CHANT_PROPERTIES
gegl_chant_string(path, "/tmp/fnord.png", "path to new file to save - for stdout")
gegl_chant_string (path, "/tmp/fnord.png",
"Target path and filename, use '-' for stdout.")
#else
#define GEGL_CHANT_FILTER
#define GEGL_CHANT_NAME png_save
#define GEGL_CHANT_DESCRIPTION "saves a png image using libpng (as a side effect)"
#define GEGL_CHANT_DESCRIPTION "PNG image saver (passes the buffer through, saves as a side-effect.)"
#define GEGL_CHANT_SELF "png-save.c"
#define GEGL_CHANT_CATEGORIES "output"
#include "gegl-chant.h"
......@@ -54,6 +55,8 @@ process (GeglOperation *operation)
result->x, result->y,
result->w, result->h);
/*op_filter->output = g_object_ref (input);*/
return TRUE;
}
......
......@@ -18,12 +18,13 @@
* Copyright 2006 Øyvind Kolås <pippin@gimp.org>
*/
#if GEGL_CHANT_PROPERTIES
gegl_chant_string (path, "/tmp/test.raw", "path to file to load")
gegl_chant_string (path, "/tmp/test.raw",
"Path of file to load.")
#else
#define GEGL_CHANT_SOURCE
#define GEGL_CHANT_NAME raw_load
#define GEGL_CHANT_DESCRIPTION "Raw image loader, wrapping dcraw with pipes"
#define GEGL_CHANT_DESCRIPTION "Raw image loader, wrapping dcraw with pipes."
#define GEGL_CHANT_SELF "raw-load.c"
#define GEGL_CHANT_CATEGORIES "hidden"
......
......@@ -20,15 +20,18 @@
#if GEGL_CHANT_PROPERTIES
gegl_chant_double (opacity, 0.0, 1.0, 0.5, "Opacity")
gegl_chant_double (x, -G_MAXDOUBLE, G_MAXDOUBLE, 20.0, "horizontal position")
gegl_chant_double (y, -G_MAXDOUBLE, G_MAXDOUBLE, 20.0, "vertical position")
gegl_chant_double (radius, -G_MAXDOUBLE, G_MAXDOUBLE, 10.0, "blur radius")
gegl_chant_double (x, -G_MAXDOUBLE, G_MAXDOUBLE, 20.0,
"Horizontal shadow offset.")
gegl_chant_double (y, -G_MAXDOUBLE, G_MAXDOUBLE, 20.0,
"Vertical shadow offset.")
gegl_chant_double (radius, -G_MAXDOUBLE, G_MAXDOUBLE, 10.0,
"Blur radius.")
#else
#define GEGL_CHANT_GRAPH
#define GEGL_CHANT_NAME dropshadow
#define GEGL_CHANT_DESCRIPTION "Creates a dropshadow"
#define GEGL_CHANT_DESCRIPTION "Creates a dropshadow effect on the input buffer."
#define GEGL_CHANT_SELF "dropshadow.c"
#define GEGL_CHANT_CATEGORIES "meta:effects"
#define GEGL_CHANT_CLASS_INIT
......
......@@ -26,7 +26,7 @@ gegl_chant_double(scale, 0.0, 100.0, 10.0, "Scale")
#define GEGL_CHANT_GRAPH
#define GEGL_CHANT_NAME unsharp_mask
#define GEGL_CHANT_DESCRIPTION "Performs an unsharp mask"
#define GEGL_CHANT_DESCRIPTION "Performs an unsharp mask on the input buffer (sharpens an image by adding false mach-bands around edges)."
#define GEGL_CHANT_SELF "unsharp-mask.c"
#define GEGL_CHANT_CATEGORIES "meta:enhance"
#define GEGL_CHANT_CLASS_INIT
......
......@@ -23,10 +23,10 @@
#define GEGL_CHANT_SOURCE
#define GEGL_CHANT_NAME blank
#define GEGL_CHANT_DESCRIPTION "Generates an infinite black plane"
#define GEGL_CHANT_DESCRIPTION "Generates an infinite transparent plane"
#define GEGL_CHANT_SELF "blank.c"
#define GEGL_CHANT_CATEGORIES "sources"
#define GEGL_CHANT_CATEGORIES "sources"
#include "gegl-chant.h"
static gboolean
......
......@@ -19,28 +19,23 @@
*/
#if GEGL_CHANT_PROPERTIES
gegl_chant_int (x, -G_MAXINT, G_MAXINT, 16, "")
gegl_chant_int (y, -G_MAXINT, G_MAXINT, 16, "")
gegl_chant_int (x_offset, -G_MAXINT, G_MAXINT, 0, "")
gegl_chant_int (y_offset, -G_MAXINT, G_MAXINT, 0, "")
gegl_chant_color (color1, "black", "")
gegl_chant_color (color2, "white", "")
gegl_chant_int (x, -G_MAXINT, G_MAXINT, 16, "Horizontal width of cells pixels.")
gegl_chant_int (y, -G_MAXINT, G_MAXINT, 16, "Vertical width of cells in pixels.")
gegl_chant_int (x_offset, -G_MAXINT, G_MAXINT, 0, "Horizontal offset (from origin) for start of grid.")
gegl_chant_int (y_offset, -G_MAXINT, G_MAXINT, 0, "Vertical offset (from origin) for start of grid.")
gegl_chant_color (color1, "black", "One of the cell colors (defaults to 'black')")
gegl_chant_color (color2, "white", "The other cell color (defaults to 'white')")
#else
#define GEGL_CHANT_SOURCE
#define GEGL_CHANT_NAME checkerboard
#define GEGL_CHANT_DESCRIPTION "Checkerboard renderer. Colors defaults to black and white. "
#define GEGL_CHANT_DESCRIPTION "Checkerboard renderer."
#define GEGL_CHANT_SELF "checkerboard.c"
#define GEGL_CHANT_CATEGORIES "sources:render"
#include "gegl-chant.h"
#define REMAINDER(dividend, divisor) \
((dividend) < 0 ? \
(divisor) - 1 - ((-(dividend) - 1) % (divisor)) : \
(dividend) % (divisor))
static gboolean
process (GeglOperation *operation)
{
......
......@@ -29,7 +29,7 @@ gegl_chant_double (n, 0, 20.0, 6.0, "")
#define GEGL_CHANT_SOURCE
#define GEGL_CHANT_NAME perlin_noise
#define GEGL_CHANT_DESCRIPTION "Perlin noise generator"
#define GEGL_CHANT_DESCRIPTION "Perlin noise generator."
#define GEGL_CHANT_SELF "noise.c"
#define GEGL_CHANT_CATEGORIES "sources:render"
......
......@@ -19,17 +19,22 @@
*/
#if GEGL_CHANT_PROPERTIES
gegl_chant_string (string, "Hello", "utf8 string to display")
gegl_chant_string (font, "Sans", "utf8 font family")
gegl_chant_double (size, 1.0, 2048.0, 10.0, "approximate height of text in pixels")
gegl_chant_int (width, 0, 1000000, 0, "private")
gegl_chant_int (height, 0, 1000000, 0, "private")
gegl_chant_string (string, "Hello",
"String to display. (utf8)")
gegl_chant_string (font, "Sans",
"Font family. (utf8)")
gegl_chant_double (size, 1.0, 2048.0, 10.0,
"Approximate height of text in pixels.")
gegl_chant_int (width, 0, 1000000, 0,
"Rendered width in pixels. (read only)")
gegl_chant_int (height, 0, 1000000, 0,
"Rendered height in pixels. (read only)")
#else
#define GEGL_CHANT_SOURCE
#define GEGL_CHANT_NAME text
#define GEGL_CHANT_DESCRIPTION "Display a string of text using cairo"
#define GEGL_CHANT_DESCRIPTION "Display a string of text using pango and cairo."
#define GEGL_CHANT_SELF "text.c"
#define GEGL_CHANT_CATEGORIES "sources:render"
#include "gegl-chant.h"
......
......@@ -20,11 +20,12 @@
#if GEGL_CHANT_PROPERTIES
gegl_chant_double (degrees, -G_MAXDOUBLE, G_MAXDOUBLE, 0., "")
gegl_chant_double (degrees, -G_MAXDOUBLE, G_MAXDOUBLE, 0., "Angle to rotate (clockwize)")
#else
#define GEGL_CHANT_NAME rotate
#define GEGL_CHANT_DESCRIPTION "Rotate the buffer around the specfied origin."
#define GEGL_CHANT_SELF "rotate.c"
#include "chant.h"
......
......@@ -20,12 +20,13 @@
#if GEGL_CHANT_PROPERTIES
gegl_chant_double (x, -G_MAXDOUBLE, G_MAXDOUBLE, 1., "")
gegl_chant_double (y, -G_MAXDOUBLE, G_MAXDOUBLE, 1., "")
gegl_chant_double (x, -G_MAXDOUBLE, G_MAXDOUBLE, 1., "Horizontal scale factor.")
gegl_chant_double (y, -G_MAXDOUBLE, G_MAXDOUBLE, 1., "Vertical scale factor.")
#else
#define GEGL_CHANT_NAME scale
#define GEGL_CHANT_DESCRIPTION "Scales the buffer."
#define GEGL_CHANT_SELF "scale.c"
#include "chant.h"
......
......@@ -20,12 +20,15 @@
#if GEGL_CHANT_PROPERTIES
gegl_chant_double (x, -G_MAXDOUBLE, G_MAXDOUBLE, 1., "")
gegl_chant_double (y, -G_MAXDOUBLE, G_MAXDOUBLE, 1., "")
gegl_chant_double (x, -G_MAXDOUBLE, G_MAXDOUBLE, 1.,
"Horizontal shear amount.")
gegl_chant_double (y, -G_MAXDOUBLE, G_MAXDOUBLE, 1.,
"Vertical shear amount.")
#else
#define GEGL_CHANT_NAME shear
#define GEGL_CHANT_DESCRIPTION "Shears the buffer."
#define GEGL_CHANT_SELF "shear.c"
#include "chant.h"
......
......@@ -20,12 +20,15 @@
#if GEGL_CHANT_PROPERTIES
gegl_chant_double (x, -G_MAXDOUBLE, G_MAXDOUBLE, 1., "")
gegl_chant_double (y, -G_MAXDOUBLE, G_MAXDOUBLE, 1., "")
gegl_chant_double (x, -G_MAXDOUBLE, G_MAXDOUBLE, 1.,
"Horizontal translation.")
gegl_chant_double (y, -G_MAXDOUBLE, G_MAXDOUBLE, 1.,
"Vertical translation.")
#else
#define GEGL_CHANT_NAME translate
#define GEGL_CHANT_DESCRIPTION "Repositions the buffer (with subpixel precision)."
#define GEGL_CHANT_SELF "translate.c"
#include "chant.h"
......
......@@ -18,12 +18,12 @@
* Copyright 2006 Øyvind Kolås <pippin@gimp.org>
*/
#if GEGL_CHANT_PROPERTIES
gegl_chant_double (value, -10.0, 10.0, 0.5, "global opacity value, used if no aux input is provided")
gegl_chant_double (value, -10.0, 10.0, 0.5, "Global opacity value, used if no auxiliary input buffer is provided.")
#else
#define GEGL_CHANT_POINT_COMPOSER
#define GEGL_CHANT_NAME opacity
#define GEGL_CHANT_DESCRIPTION "weights the opacity of the input with either the value of the aux input or the global value property"
#define GEGL_CHANT_DESCRIPTION "Weights the opacity of the input with either the value of the aux input or the global value property."
#define GEGL_CHANT_SELF "opacity.c"
#define GEGL_CHANT_CATEGORIES "transparency"
#define GEGL_CHANT_INIT
......
......@@ -119,6 +119,8 @@ void category_menu_item (gpointer key,
gpointer user_data)
{
gchar *category = key;
if (!strcmp (category, "hidden"))
return;
g_print ("<li><a href='#cat_%s'>&nbsp;&nbsp;%s</a></li>\n", category, category);
}
......@@ -131,12 +133,16 @@ void category_index (gpointer key,
GList *iter;
gboolean comma;
if (!strcmp (category, "hidden"))
return;
g_print ("<a name='cat_%s'><h3>%s</h3></a>\n", category, category);
g_print ("<p>\n");
for (iter=operations, comma=FALSE;iter;iter = g_list_next (iter))
{
GeglOperationClass *klass = iter->data;
if (strstr (klass->categories, "hidden"))
continue;
g_print ("%s<a href='#op_%s'>%s</a>", comma?", ":"", klass->name, klass->name);
comma = TRUE;
}
......@@ -204,6 +210,8 @@ main (gint argc,
for (iter=operations;iter;iter = g_list_next (iter))
{
GeglOperationClass *klass = iter->data;
if (strstr (klass->categories, "hidden"))
continue;
g_print ("<tr><td colspan='1'>&nbsp;</td><td class='op_name' colspan='4'><a name='op_%s'>%s</a></td></tr>\n", klass->name, klass->name);
if (klass->description)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment