ops: move generated ops to gegl-op.h

parent 00c9ce55
......@@ -24,16 +24,17 @@
#include <glib/gi18n-lib.h>
#ifdef GEGL_CHANT_PROPERTIES
#ifdef GEGL_PROPERTIES
gegl_chant_double (value, _("Value"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, _("global value used if aux doesn't contain data"))
property_double (value, _("Value"), 0.0)
description(_("global value used if aux doesn't contain data"))
#else
#define GEGL_CHANT_TYPE_POINT_COMPOSER
#define GEGL_CHANT_C_FILE "add.c"
#define GEGL_OP_POINT_COMPOSER
#define GEGL_OP_C_FILE "add.c"
#include "gegl-chant.h"
#include "gegl-op.h"
#include <math.h>
#ifdef _MSC_VER
......@@ -51,13 +52,13 @@ static void prepare (GeglOperation *operation)
}
static gboolean
process (GeglOperation *op,
void *in_buf,
void *aux_buf,
void *out_buf,
glong n_pixels,
const GeglRectangle *roi,
gint level)
process (GeglOperation *op,
void *in_buf,
void *aux_buf,
void *out_buf,
glong n_pixels,
const GeglRectangle *roi,
gint level)
{
gfloat * GEGL_ALIGNED in = in_buf;
gfloat * GEGL_ALIGNED out = out_buf;
......@@ -66,7 +67,7 @@ process (GeglOperation *op,
if (aux == NULL)
{
gfloat value = GEGL_CHANT_PROPERTIES (op)->value;
gfloat value = GEGL_PROPERTIES (op)->value;
for (i=0; i<n_pixels; i++)
{
gint j;
......@@ -107,7 +108,7 @@ process (GeglOperation *op,
}
static void
gegl_chant_class_init (GeglChantClass *klass)
gegl_op_class_init (GeglOpClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationPointComposerClass *point_composer_class;
......
......@@ -33,26 +33,23 @@
#include <glib/gi18n-lib.h>
#ifdef GEGL_CHANT_PROPERTIES
#ifdef GEGL_PROPERTIES
gegl_chant_boolean (srgb, _("sRGB"),
FALSE,
_("Use sRGB gamma instead of linear"))
property_boolean (srgb, _("sRGB"), FALSE)
description (_("Use sRGB gamma instead of linear"))
#else
#define GEGL_CHANT_TYPE_POINT_COMPOSER
#define GEGL_CHANT_C_FILE "clear.c"
#define GEGL_OP_POINT_COMPOSER
#define GEGL_OP_C_FILE "clear.c"
#include "gegl-chant.h"
#include "gegl-op.h"
static void prepare (GeglOperation *operation)
{
GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
const Babl *format;
if (o->srgb)
if (GEGL_PROPERTIES (operation))
format = babl_format ("R'aG'aB'aA float");
else
format = babl_format ("RaGaBaA float");
......@@ -64,12 +61,12 @@ static void prepare (GeglOperation *operation)
static gboolean
process (GeglOperation *op,
void *in_buf,
void *aux_buf,
void *out_buf,
glong n_pixels,
const GeglRectangle *roi,
gint level)
void *in_buf,
void *aux_buf,
void *out_buf,
glong n_pixels,
const GeglRectangle *roi,
gint level)
{
gint i;
gfloat * GEGL_ALIGNED in = in_buf;
......@@ -108,7 +105,7 @@ process (GeglOperation *op,
static void
gegl_chant_class_init (GeglChantClass *klass)
gegl_op_class_init (GeglOpClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationPointComposerClass *point_composer_class;
......
......@@ -33,26 +33,23 @@
#include <glib/gi18n-lib.h>
#ifdef GEGL_CHANT_PROPERTIES
#ifdef GEGL_PROPERTIES
gegl_chant_boolean (srgb, _("sRGB"),
FALSE,
_("Use sRGB gamma instead of linear"))
property_boolean (srgb, _("sRGB"), FALSE)
description (_("Use sRGB gamma instead of linear"))
#else
#define GEGL_CHANT_TYPE_POINT_COMPOSER
#define GEGL_CHANT_C_FILE "color-burn.c"
#define GEGL_OP_POINT_COMPOSER
#define GEGL_OP_C_FILE "color-burn.c"
#include "gegl-chant.h"
#include "gegl-op.h"
static void prepare (GeglOperation *operation)
{
GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
const Babl *format;
if (o->srgb)
if (GEGL_PROPERTIES (operation))
format = babl_format ("R'aG'aB'aA float");
else
format = babl_format ("RaGaBaA float");
......@@ -71,7 +68,7 @@ static gboolean operation_process (GeglOperation *operation,
{
GeglOperationClass *operation_class;
gpointer input, aux;
operation_class = GEGL_OPERATION_CLASS (gegl_chant_parent_class);
operation_class = GEGL_OPERATION_CLASS (gegl_op_parent_class);
/* get the raw values this does not increase the reference count */
input = gegl_operation_context_get_object (context, "input");
......@@ -156,7 +153,7 @@ process (GeglOperation *op,
}
static void
gegl_chant_class_init (GeglChantClass *klass)
gegl_op_class_init (GeglOpClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationPointComposerClass *point_composer_class;
......@@ -165,8 +162,8 @@ gegl_chant_class_init (GeglChantClass *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->process = operation_process;
operation_class->prepare = prepare;
gegl_operation_class_set_keys (operation_class,
"name" , "svg:color-burn",
......
......@@ -33,26 +33,23 @@
#include <glib/gi18n-lib.h>
#ifdef GEGL_CHANT_PROPERTIES
#ifdef GEGL_PROPERTIES
gegl_chant_boolean (srgb, _("sRGB"),
FALSE,
_("Use sRGB gamma instead of linear"))
property_boolean (srgb, _("sRGB"), FALSE)
description (_("Use sRGB gamma instead of linear"))
#else
#define GEGL_CHANT_TYPE_POINT_COMPOSER
#define GEGL_CHANT_C_FILE "color-dodge.c"
#define GEGL_OP_POINT_COMPOSER
#define GEGL_OP_C_FILE "color-dodge.c"
#include "gegl-chant.h"
#include "gegl-op.h"
static void prepare (GeglOperation *operation)
{
GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
const Babl *format;
if (o->srgb)
if (GEGL_PROPERTIES (operation))
format = babl_format ("R'aG'aB'aA float");
else
format = babl_format ("RaGaBaA float");
......@@ -71,7 +68,7 @@ static gboolean operation_process (GeglOperation *operation,
{
GeglOperationClass *operation_class;
gpointer input, aux;
operation_class = GEGL_OPERATION_CLASS (gegl_chant_parent_class);
operation_class = GEGL_OPERATION_CLASS (gegl_op_parent_class);
/* get the raw values this does not increase the reference count */
input = gegl_operation_context_get_object (context, "input");
......@@ -156,7 +153,7 @@ process (GeglOperation *op,
}
static void
gegl_chant_class_init (GeglChantClass *klass)
gegl_op_class_init (GeglOpClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationPointComposerClass *point_composer_class;
......@@ -165,8 +162,8 @@ gegl_chant_class_init (GeglChantClass *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->process = operation_process;
operation_class->prepare = prepare;
gegl_operation_class_set_keys (operation_class,
"name" , "svg:color-dodge",
......
......@@ -33,26 +33,23 @@
#include <glib/gi18n-lib.h>
#ifdef GEGL_CHANT_PROPERTIES
#ifdef GEGL_PROPERTIES
gegl_chant_boolean (srgb, _("sRGB"),
FALSE,
_("Use sRGB gamma instead of linear"))
property_boolean (srgb, _("sRGB"), FALSE)
description (_("Use sRGB gamma instead of linear"))
#else
#define GEGL_CHANT_TYPE_POINT_COMPOSER
#define GEGL_CHANT_C_FILE "darken.c"
#define GEGL_OP_POINT_COMPOSER
#define GEGL_OP_C_FILE "darken.c"
#include "gegl-chant.h"
#include "gegl-op.h"
static void prepare (GeglOperation *operation)
{
GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
const Babl *format;
if (o->srgb)
if (GEGL_PROPERTIES (operation))
format = babl_format ("R'aG'aB'aA float");
else
format = babl_format ("RaGaBaA float");
......@@ -71,7 +68,7 @@ static gboolean operation_process (GeglOperation *operation,
{
GeglOperationClass *operation_class;
gpointer input, aux;
operation_class = GEGL_OPERATION_CLASS (gegl_chant_parent_class);
operation_class = GEGL_OPERATION_CLASS (gegl_op_parent_class);
/* get the raw values this does not increase the reference count */
input = gegl_operation_context_get_object (context, "input");
......@@ -153,7 +150,7 @@ process (GeglOperation *op,
}
static void
gegl_chant_class_init (GeglChantClass *klass)
gegl_op_class_init (GeglOpClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationPointComposerClass *point_composer_class;
......@@ -162,8 +159,8 @@ gegl_chant_class_init (GeglChantClass *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->process = operation_process;
operation_class->prepare = prepare;
gegl_operation_class_set_keys (operation_class,
"name" , "svg:darken",
......
......@@ -33,26 +33,23 @@
#include <glib/gi18n-lib.h>
#ifdef GEGL_CHANT_PROPERTIES
#ifdef GEGL_PROPERTIES
gegl_chant_boolean (srgb, _("sRGB"),
FALSE,
_("Use sRGB gamma instead of linear"))
property_boolean (srgb, _("sRGB"), FALSE)
description (_("Use sRGB gamma instead of linear"))
#else
#define GEGL_CHANT_TYPE_POINT_COMPOSER
#define GEGL_CHANT_C_FILE "difference.c"
#define GEGL_OP_POINT_COMPOSER
#define GEGL_OP_C_FILE "difference.c"
#include "gegl-chant.h"
#include "gegl-op.h"
static void prepare (GeglOperation *operation)
{
GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
const Babl *format;
if (o->srgb)
if (GEGL_PROPERTIES (operation))
format = babl_format ("R'aG'aB'aA float");
else
format = babl_format ("RaGaBaA float");
......@@ -71,7 +68,7 @@ static gboolean operation_process (GeglOperation *operation,
{
GeglOperationClass *operation_class;
gpointer input, aux;
operation_class = GEGL_OPERATION_CLASS (gegl_chant_parent_class);
operation_class = GEGL_OPERATION_CLASS (gegl_op_parent_class);
/* get the raw values this does not increase the reference count */
input = gegl_operation_context_get_object (context, "input");
......@@ -153,7 +150,7 @@ process (GeglOperation *op,
}
static void
gegl_chant_class_init (GeglChantClass *klass)
gegl_op_class_init (GeglOpClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationPointComposerClass *point_composer_class;
......@@ -162,8 +159,8 @@ gegl_chant_class_init (GeglChantClass *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->process = operation_process;
operation_class->prepare = prepare;
gegl_operation_class_set_keys (operation_class,
"name" , "svg:difference",
......
......@@ -24,16 +24,17 @@
#include <glib/gi18n-lib.h>
#ifdef GEGL_CHANT_PROPERTIES
#ifdef GEGL_PROPERTIES
gegl_chant_double (value, _("Value"), -G_MAXDOUBLE, G_MAXDOUBLE, 1.0, _("global value used if aux doesn't contain data"))
property_double (value, _("Value"), 1.0)
description(_("global value used if aux doesn't contain data"))
#else
#define GEGL_CHANT_TYPE_POINT_COMPOSER
#define GEGL_CHANT_C_FILE "divide.c"
#define GEGL_OP_POINT_COMPOSER
#define GEGL_OP_C_FILE "divide.c"
#include "gegl-chant.h"
#include "gegl-op.h"
#include <math.h>
#ifdef _MSC_VER
......@@ -51,13 +52,13 @@ static void prepare (GeglOperation *operation)
}
static gboolean
process (GeglOperation *op,
void *in_buf,
void *aux_buf,
void *out_buf,
glong n_pixels,
const GeglRectangle *roi,
gint level)
process (GeglOperation *op,
void *in_buf,
void *aux_buf,
void *out_buf,
glong n_pixels,
const GeglRectangle *roi,
gint level)
{
gfloat * GEGL_ALIGNED in = in_buf;
gfloat * GEGL_ALIGNED out = out_buf;
......@@ -66,7 +67,7 @@ process (GeglOperation *op,
if (aux == NULL)
{
gfloat value = GEGL_CHANT_PROPERTIES (op)->value;
gfloat value = GEGL_PROPERTIES (op)->value;
for (i=0; i<n_pixels; i++)
{
gint j;
......@@ -107,7 +108,7 @@ process (GeglOperation *op,
}
static void
gegl_chant_class_init (GeglChantClass *klass)
gegl_op_class_init (GeglOpClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationPointComposerClass *point_composer_class;
......
......@@ -33,26 +33,23 @@
#include <glib/gi18n-lib.h>
#ifdef GEGL_CHANT_PROPERTIES
#ifdef GEGL_PROPERTIES
gegl_chant_boolean (srgb, _("sRGB"),
FALSE,
_("Use sRGB gamma instead of linear"))
property_boolean (srgb, _("sRGB"), FALSE)
description (_("Use sRGB gamma instead of linear"))
#else
#define GEGL_CHANT_TYPE_POINT_COMPOSER
#define GEGL_CHANT_C_FILE "dst-atop.c"
#define GEGL_OP_POINT_COMPOSER
#define GEGL_OP_C_FILE "dst-atop.c"
#include "gegl-chant.h"
#include "gegl-op.h"
static void prepare (GeglOperation *operation)
{
GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
const Babl *format;
if (o->srgb)
if (GEGL_PROPERTIES (operation))
format = babl_format ("R'aG'aB'aA float");
else
format = babl_format ("RaGaBaA float");
......@@ -64,12 +61,12 @@ static void prepare (GeglOperation *operation)
static gboolean
process (GeglOperation *op,
void *in_buf,
void *aux_buf,
void *out_buf,
glong n_pixels,
const GeglRectangle *roi,
gint level)
void *in_buf,
void *aux_buf,
void *out_buf,
glong n_pixels,
const GeglRectangle *roi,
gint level)
{
gint i;
gfloat * GEGL_ALIGNED in = in_buf;
......@@ -108,7 +105,7 @@ process (GeglOperation *op,
static void
gegl_chant_class_init (GeglChantClass *klass)
gegl_op_class_init (GeglOpClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationPointComposerClass *point_composer_class;
......
......@@ -33,26 +33,23 @@
#include <glib/gi18n-lib.h>
#ifdef GEGL_CHANT_PROPERTIES
#ifdef GEGL_PROPERTIES
gegl_chant_boolean (srgb, _("sRGB"),
FALSE,
_("Use sRGB gamma instead of linear"))
property_boolean (srgb, _("sRGB"), FALSE)
description (_("Use sRGB gamma instead of linear"))
#else
#define GEGL_CHANT_TYPE_POINT_COMPOSER
#define GEGL_CHANT_C_FILE "dst-in.c"
#define GEGL_OP_POINT_COMPOSER
#define GEGL_OP_C_FILE "dst-in.c"
#include "gegl-chant.h"
#include "gegl-op.h"
static void prepare (GeglOperation *operation)
{
GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
const Babl *format;
if (o->srgb)
if (GEGL_PROPERTIES (operation))
format = babl_format ("R'aG'aB'aA float");
else
format = babl_format ("RaGaBaA float");
......@@ -64,12 +61,12 @@ static void prepare (GeglOperation *operation)
static gboolean
process (GeglOperation *op,
void *in_buf,
void *aux_buf,
void *out_buf,
glong n_pixels,
const GeglRectangle *roi,
gint level)
void *in_buf,
void *aux_buf,
void *out_buf,
glong n_pixels,
const GeglRectangle *roi,
gint level)
{
gint i;
gfloat * GEGL_ALIGNED in = in_buf;
......@@ -108,7 +105,7 @@ process (GeglOperation *op,
static void
gegl_chant_class_init (GeglChantClass *klass)
gegl_op_class_init (GeglOpClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationPointComposerClass *point_composer_class;
......
......@@ -33,26 +33,23 @@
#include <glib/gi18n-lib.h>
#ifdef GEGL_CHANT_PROPERTIES
#ifdef GEGL_PROPERTIES
gegl_chant_boolean (srgb, _("sRGB"),
FALSE,
_("Use sRGB gamma instead of linear"))
property_boolean (srgb, _("sRGB"), FALSE)
description (_("Use sRGB gamma instead of linear"))
#else
#define GEGL_CHANT_TYPE_POINT_COMPOSER
#define GEGL_CHANT_C_FILE "dst-out.c"
#define GEGL_OP_POINT_COMPOSER
#define GEGL_OP_C_FILE "dst-out.c"
#include "gegl-chant.h"
#include "gegl-op.h"
static void prepare (GeglOperation *operation)
{
GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
const Babl *format;
if (o->srgb)
if (GEGL_PROPERTIES (operation))
format = babl_format ("R'aG'aB'aA float");
else
format = babl_format ("RaGaBaA float");
......@@ -64,12 +61,12 @@ static void prepare (GeglOperation *operation)
static gboolean
process (GeglOperation *op,
void *in_buf,
void *aux_buf,
void *out_buf,
glong n_pixels,
const GeglRectangle *roi,
gint level)
void *in_buf,
void *aux_buf,
void *out_buf,
glong n_pixels,
const GeglRectangle *roi,
gint level)
{
gint i;
gfloat * GEGL_ALIGNED in = in_buf;
......@@ -130,7 +127,7 @@ process (GeglOperation *op,
static void
gegl_chant_class_init (GeglChantClass *klass)
gegl_op_class_init (GeglOpClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationPointComposerClass *point_composer_class;
......
......@@ -33,26 +33,23 @@
#include <glib/gi18n-lib.h>
#ifdef GEGL_CHANT_PROPERTIES
#ifdef GEGL_PROPERTIES
gegl_chant_boolean (srgb, _("sRGB"),
FALSE,
_("Use sRGB gamma instead of linear"))
property_boolean (srgb, _("sRGB"), FALSE)
description (_("Use sRGB gamma instead of linear"))
#else
#define GEGL_CHANT_TYPE_POINT_COMPOSER
#define GEGL_CHANT_C_FILE "dst-over.c"
#define GEGL_OP_POINT_COMPOSER
#define GEGL_OP_C_FILE "dst-over.c"
#include "gegl-chant.h"
#include "gegl-op.h"
static void prepare (GeglOperation *operation)
{
GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
const Babl *format;
if (o->srgb)
if (GEGL_PROPERTIES (operation))
format = babl_format ("R'aG'aB'aA float");
else
format = babl_format ("RaGaBaA float");
......@@ -64,12 +61,12 @@ static void prepare (GeglOperation *operation)
static gboolean
process (GeglOperation *op,
void *in_buf,
void *aux_buf,
void *out_buf,
glong n_pixels,
const GeglRectangle *roi,
gint level)
void *in_buf,
void *aux_buf,
void *out_buf,
glong n_pixels,
const GeglRectangle *roi,
gint level)
{
gint i;
gfloat * GEGL_ALIGNED in = in_buf;
......@@ -130,7 +127,7 @@ process (GeglOperation *op,
static void
gegl_chant_class_init (GeglChantClass *klass)
gegl_op_class_init (GeglOpClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationPointComposerClass *point_composer_class;
......
......@@ -33,26 +33,23 @@
#include <glib/gi18n-lib.h>
#ifdef GEGL_CHANT_PROPERTIES
#ifdef GEGL_PROPERTIES
gegl_chant_boolean (srgb, _("sRGB"),
FALSE,
_("Use sRGB gamma instead of linear"))
property_boolean (srgb, _("sRGB"), FALSE)
description (_("Use sRGB gamma instead of linear"))
#else
#define GEGL_CHANT_TYPE_POINT_COMPOSER
#define GEGL_CHANT_C_FILE "dst.c"
#define GEGL_OP_POINT_COMPOSER
#define GEGL_OP_C_FILE "dst.c"
#include "gegl-chant.h"
#include "gegl-op.h"
static void prepare (GeglOperation *operation)
{
GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
const Babl *format;
if (o->srgb)
if (GEGL_PROPERTIES (operation))
format = babl_format ("R'aG'aB'aA float");
else
format = babl_format ("RaGaBaA float");
......@@ -64,12 +61,12 @@ static void prepare (GeglOperation *operation)
static gboolean
process (GeglOperation *op,
void *in_buf,
void *aux_buf,
void *out_buf,
glong n_pixels,
const GeglRectangle *roi,
gint level)
void *in_buf,
void *aux_buf,
void *out_buf,
glong n_pixels,
const GeglRectangle *roi,
gint level)
{
gint i;
gfloat * GEGL_ALIGNED in = in_buf;
......@@ -130,7 +127,7 @@ process (GeglOperation *op,
static void
gegl_chant_class_init (GeglChantClass *klass)