void gegl_operation_set_key (const gchar *operation_name, const gchar *key_name, const gchar *key_value) { GType type; GObjectClass *klass; type = gegl_operation_gtype_from_name (operation_name); if (!type) return; klass = g_type_class_ref (type); gegl_operation_class_set_key (GEGL_OPERATION_CLASS (klass), key_name, key_value); g_type_class_unref (klass); }
void gegl_operation_class_set_keys (GeglOperationClass *klass, const gchar *key_name, ...) { va_list var_args; va_start (var_args, key_name); while (key_name) { const char *value = va_arg (var_args, char *); gegl_operation_class_set_key (klass, key_name, value); key_name = va_arg (var_args, char *); } va_end (var_args); }
static void gegl_chant_class_init (GeglChantClass *klass) { GeglOperationClass *operation_class; GeglOperationPointComposerClass *point_composer_class; operation_class = GEGL_OPERATION_CLASS (klass); point_composer_class = GEGL_OPERATION_POINT_COMPOSER_CLASS (klass); point_composer_class->process = process; operation_class->prepare = prepare; gegl_operation_class_set_keys (operation_class, "name" , "gegl:soft-light", "description" , _("SVG blend operation soft-light (<code>if 2 * cA < aA: d = cB * (aA - (aB == 0 ? 1 : 1 - cB / aB) * (2 * cA - aA)) + cA * (1 - aB) + cB * (1 - aA); if 8 * cB <= aB: d = cB * (aA - (aB == 0 ? 1 : 1 - cB / aB) * (2 * cA - aA) * (aB == 0 ? 3 : 3 - 8 * cB / aB)) + cA * (1 - aB) + cB * (1 - aA); otherwise: d = (aA * cB + (aB == 0 ? 0 : sqrt (cB / aB) * aB - cB) * (2 * cA - aA)) + cA * (1 - aB) + cB * (1 - aA)</code>)"), NULL); gegl_operation_class_set_key (operation_class, "categories", "compositors:svgfilter"); }
static void gegl_chant_class_init (GeglChantClass *klass) { GeglOperationClass *operation_class; GeglOperationPointComposerClass *point_composer_class; operation_class = GEGL_OPERATION_CLASS (klass); point_composer_class = GEGL_OPERATION_POINT_COMPOSER_CLASS (klass); point_composer_class->process = process; operation_class->process = operation_process; operation_class->prepare = prepare; gegl_operation_class_set_keys (operation_class, "name" , "svg:difference", "compat-name" , "gegl:difference", "description" , _("SVG blend operation difference (<code>d = cA + cB - 2 * (MIN (cA * aB, cB * aA))</code>)"), NULL); gegl_operation_class_set_key (operation_class, "categories", "compositors:svgfilter"); }
static void gegl_chant_class_init (GeglChantClass *klass) { GeglOperationClass *operation_class; GeglOperationPointComposerClass *point_composer_class; operation_class = GEGL_OPERATION_CLASS (klass); point_composer_class = GEGL_OPERATION_POINT_COMPOSER_CLASS (klass); point_composer_class->process = process; operation_class->prepare = prepare; operation_class->compat_name = "gegl:exclusion"; gegl_operation_class_set_keys (operation_class, "name" , "svg:exclusion", "description" , _("SVG blend operation exclusion (<tt>d = (cA * aB + cB * aA - 2 * cA * cB) + cA * (1 - aB) + cB * (1 - aA)</tt>)"), NULL); gegl_operation_class_set_key (operation_class, "categories", "compositors:svgfilter"); }
static void gegl_chant_class_init (GeglChantClass *klass) { GeglOperationClass *operation_class; GeglOperationPointComposerClass *point_composer_class; operation_class = GEGL_OPERATION_CLASS (klass); point_composer_class = GEGL_OPERATION_POINT_COMPOSER_CLASS (klass); point_composer_class->process = process; operation_class->process = operation_process; operation_class->prepare = prepare; operation_class->compat_name = "gegl:hard-light"; gegl_operation_class_set_keys (operation_class, "name" , "svg:hard-light", "description" , _("SVG blend operation hard-light (<code>if 2 * cA < aA: d = 2 * cA * cB + cA * (1 - aB) + cB * (1 - aA) otherwise: d = aA * aB - 2 * (aB - cB) * (aA - cA) + cA * (1 - aB) + cB * (1 - aA)</code>)"), NULL); gegl_operation_class_set_key (operation_class, "categories", "compositors:svgfilter"); }
static void gegl_op_class_init (GeglOpClass *klass) { GeglOperationClass *operation_class; GeglOperationPointComposerClass *point_composer_class; operation_class = GEGL_OPERATION_CLASS (klass); point_composer_class = GEGL_OPERATION_POINT_COMPOSER_CLASS (klass); point_composer_class->process = process; operation_class->process = operation_process; operation_class->prepare = prepare; gegl_operation_class_set_keys (operation_class, "name" , "svg:screen", "compat-name" , "gegl:screen", "reference-hash" , "dd4057b688a2721774557d5637e59a50", "description" , _("SVG blend operation screen (<code>d = cA + cB - cA * cB</code>)"), NULL); gegl_operation_class_set_key (operation_class, "categories", "compositors:svgfilter"); }
static void gegl_op_class_init (GeglOpClass *klass) { GeglOperationClass *operation_class; GeglOperationPointComposerClass *point_composer_class; operation_class = GEGL_OPERATION_CLASS (klass); point_composer_class = GEGL_OPERATION_POINT_COMPOSER_CLASS (klass); point_composer_class->process = process; operation_class->process = operation_process; operation_class->prepare = prepare; gegl_operation_class_set_keys (operation_class, "name" , "svg:color-burn", "compat-name" , "gegl:color-burn", "title" , "Color-burn", "description" , _("SVG blend operation color-burn (<code>if cA * aB + cB * aA <= aA * aB: d = cA * (1 - aB) + cB * (1 - aA) otherwise: d = (cA == 0 ? 1 : (aA * (cA * aB + cB * aA - aA * aB) / cA) + cA * (1 - aB) + cB * (1 - aA))</code>)"), NULL); gegl_operation_class_set_key (operation_class, "categories", "compositors:svgfilter"); }
static void gegl_op_class_init (GeglOpClass *klass) { GeglOperationClass *operation_class; GeglOperationPointComposerClass *point_composer_class; operation_class = GEGL_OPERATION_CLASS (klass); point_composer_class = GEGL_OPERATION_POINT_COMPOSER_CLASS (klass); point_composer_class->process = process; operation_class->process = operation_process; operation_class->prepare = prepare; gegl_operation_class_set_keys (operation_class, "name" , "svg:overlay", "compat-name" , "gegl:overlay", "title" , "Overlay", "reference-hash" , "0148854c1b7d80cca8f015e216ce8fa3", "description" , _("SVG blend operation overlay (<code>if 2 * cB > aB: d = 2 * cA * cB + cA * (1 - aB) + cB * (1 - aA) otherwise: d = aA * aB - 2 * (aB - cB) * (aA - cA) + cA * (1 - aB) + cB * (1 - aA)</code>)"), NULL); gegl_operation_class_set_key (operation_class, "categories", "compositors:svgfilter"); }