Commit 8aa3b1d4 authored by Ville Sokk's avatar Ville Sokk Committed by Øyvind "pippin" Kolås

added reference compositions to brightness-contrast, color-reduction,...

added reference compositions to brightness-contrast, color-reduction, color-temperature, color-to-alpha so that the example images would be more interesting
parent 21e3fddd
......@@ -114,9 +114,8 @@ process_operations (GType type)
if (output_all && matches)
g_printf ("%s\n", name);
if (image && xml && matches)
if (xml && matches)
{
gchar *image_path = g_build_path (G_DIR_SEPARATOR_S, reference_dir, image, NULL);
gchar *output_path = operation_to_path (name, FALSE);
GeglNode *composition;
......@@ -144,8 +143,10 @@ process_operations (GType type)
gegl_node_process (output);
/* don't test if run with --all */
if (!output_all)
if (!output_all && image)
{
gchar *image_path = g_build_path (G_DIR_SEPARATOR_S, reference_dir, image, NULL);
ref_img = gegl_node_new_child (composition,
"operation", "gegl:load",
"path", image_path,
......@@ -205,11 +206,12 @@ process_operations (GType type)
result = FALSE;
}
}
g_free (image_path);
}
}
g_object_unref (composition);
g_free (image_path);
g_free (output_path);
}
/* if we are running with --all and the operation doesn't have a
......
......@@ -128,6 +128,20 @@ gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationPointFilterClass *point_filter_class;
gchar *composition = "<?xml version='1.0' encoding='UTF-8'?>"
"<gegl>"
"<node operation='gegl:brightness-contrast'>"
" <params>"
" <param name='contrast'>1.8</param>"
" <param name='brightness'>0.25</param>"
" </params>"
"</node>"
"<node operation='gegl:load'>"
" <params>"
" <param name='path'>standard-input.png</param>"
" </params>"
"</node>"
"</gegl>";
operation_class = GEGL_OPERATION_CLASS (klass);
point_filter_class = GEGL_OPERATION_POINT_FILTER_CLASS (klass);
......@@ -141,9 +155,10 @@ gegl_chant_class_init (GeglChantClass *klass)
gegl_operation_class_set_keys (operation_class,
"name", "gegl:brightness-contrast",
"categories", "color",
"categories", "color",
"description", _("Changes the light level and contrast."),
"cl-source" , kernel_source,
"reference-composition", composition,
NULL);
}
......
......@@ -440,7 +440,7 @@ process (GeglOperation *operation,
process_random (input, output, result, channel_bits);
break;
case GEGL_DITHER_RANDOM_COVARIANT:
process_random_covariant (input, output, result,
process_random_covariant (input, output, result,
channel_bits);
break;
case GEGL_DITHER_FLOYD_STEINBERG:
......@@ -462,6 +462,23 @@ gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationFilterClass *filter_class;
gchar *composition = "<?xml version='1.0' encoding='UTF-8'?>"
"<gegl>"
"<node operation='gegl:color-reduction'>"
" <params>"
" <param name='red-bits'>2</param>"
" <param name='green-bits'>2</param>"
" <param name='blue-bits'>2</param>"
" <param name='alpha-bits'>2</param>"
" <param name='dither-strategy'>Floyd-Steinberg</param>"
" </params>"
"</node>"
"<node operation='gegl:load'>"
" <params>"
" <param name='path'>standard-input.png</param>"
" </params>"
"</node>"
"</gegl>";
operation_class = GEGL_OPERATION_CLASS (klass);
filter_class = GEGL_OPERATION_FILTER_CLASS (klass);
......@@ -476,6 +493,7 @@ gegl_chant_class_init (GeglChantClass *klass)
"categories" , "misc",
"description" ,
_("Reduces the number of bits per channel (colors and alpha), with optional dithering"),
"reference-composition", composition,
NULL);
}
......
......@@ -245,6 +245,19 @@ gegl_chant_class_init (GeglChantClass *klass)
GObjectClass *object_class;
GeglOperationClass *operation_class;
GeglOperationPointFilterClass *point_filter_class;
gchar *composition = "<?xml version='1.0' encoding='UTF-8'?>"
"<gegl>"
"<node operation='gegl:color-temperature'>"
" <params>"
" <param name='intended-temperature'>12000</param>"
" </params>"
"</node>"
"<node operation='gegl:load'>"
" <params>"
" <param name='path'>standard-input.png</param>"
" </params>"
"</node>"
"</gegl>";
object_class = G_OBJECT_CLASS (klass);
operation_class = GEGL_OPERATION_CLASS (klass);
......@@ -265,6 +278,7 @@ gegl_chant_class_init (GeglChantClass *klass)
"categories" , "color",
"description",
_("Allows changing the color temperature of an image."),
"reference-composition", composition,
NULL);
}
......
......@@ -161,8 +161,29 @@ process (GeglOperation *operation,
static void
gegl_chant_class_init (GeglChantClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationClass *operation_class;
GeglOperationPointFilterClass *filter_class;
gchar *composition = "<?xml version='1.0' encoding='UTF-8'?>"
"<gegl>"
"<node operation='svg:dst-over'>"
" <node operation='gegl:crop'>"
" <params>"
" <param name='width'>200.0</param>"
" <param name='height'>200.0</param>"
" </params>"
" </node>"
" <node operation='gegl:checkerboard'>"
" <params><param name='color1'>rgb(0.5, 0.5, 0.5)</param></params>"
" </node>"
"</node>"
"<node operation='gegl:color-to-alpha'>"
"</node>"
"<node operation='gegl:load'>"
" <params>"
" <param name='path'>standard-input.png</param>"
" </params>"
"</node>"
"</gegl>";
operation_class = GEGL_OPERATION_CLASS (klass);
filter_class = GEGL_OPERATION_POINT_FILTER_CLASS (klass);
......@@ -174,6 +195,7 @@ gegl_chant_class_init (GeglChantClass *klass)
"name" , "gegl:color-to-alpha",
"categories" , "color",
"description", _("Performs color-to-alpha on the image."),
"reference-composition", composition,
NULL);
}
......
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