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

removed #include "vector.h"

* operations/workshop/c2g.c: removed #include "vector.h"

svn path=/trunk/; revision=1504
parent 6de01242
2007-05-24 Øyvind Kolås <pippin@gimp.org>
* operations/workshop/c2g.c: removed #include "vector.h"
2007-05-24 Øyvind Kolås <pippin@gimp.org>
* operations/workshop/bilateral-filter.c:
* operations/workshop/box-max.c:
* operations/workshop/box-min.c:
* operations/workshop/box-percentile.c:
* operations/workshop/c2g.c:
* operations/workshop/demosaic-simple.c:
* operations/workshop/disc-percentile.c:
* operations/workshop/hstack.c:
* operations/workshop/kuwahara-max.c:
* operations/workshop/kuwahara-min.c:
* operations/workshop/kuwahara-switch.c:
* operations/workshop/kuwahara.c:
* operations/workshop/max-envelope.c:
* operations/workshop/mblur.c:
* operations/workshop/min-envelope.c:
* operations/workshop/snn-mean.c:
* operations/workshop/snn-percentile.c:
* operations/workshop/stress.c:
2007-05-24 Øyvind Kolås <pippin@gimp.org>
* operations/blur/box-blur.c: use GeglOperationAreaFilter as base.
......
......@@ -33,8 +33,7 @@ gegl_chant_double (gamma, 0.0, 10.0, 1.6, "post correction gamma.")
#define GEGL_CHANT_DESCRIPTION "Color to grayscale conversion that uses, spatial color differences to perform local grayscale contrast enhancement."
#define GEGL_CHANT_CATEGORIES "enhance"
#define GEGL_CHANT_FILTER
#define GEGL_CHANT_CLASS_INIT
#define GEGL_CHANT_AREA_FILTER
#include "gegl-chant.h"
#include <math.h>
......@@ -48,9 +47,6 @@ static void c2g (GeglBuffer *src,
gfloat strength,
gfloat gamma);
static GeglRectangle get_source_rect (GeglOperation *self,
gpointer context_id);
static void compute_luts(void);
#include <stdlib.h>
......@@ -71,29 +67,23 @@ process (GeglOperation *operation,
input = GEGL_BUFFER (gegl_operation_get_data (operation, context_id, "input"));
{
GeglRectangle *result = gegl_operation_result_rect (operation, context_id);
GeglRectangle need = *result;
GeglRectangle *need = gegl_operation_need_rect (operation, context_id);
GeglBuffer *temp_in;
need.x-=self->radius;
need.y-=self->radius;
need.width +=self->radius*2;
need.height +=self->radius*2;
temp_in = g_object_new (GEGL_TYPE_BUFFER,
"source", input,
"x", need.x,
"y", need.y,
"width", need.width,
"height", need.height,
"x", need->x,
"y", need->y,
"width", need->width,
"height", need->height,
NULL);
output = g_object_new (GEGL_TYPE_BUFFER,
"format", babl_format ("RGBA float"),
"x", need.x,
"y", need.y,
"width", need.width,
"height", need.height,
"x", need->x,
"y", need->y,
"width", need->width,
"height", need->height,
NULL);
c2g (temp_in, output, self->radius, self->samples, self->iterations, self->strength, self->gamma);
......@@ -197,87 +187,12 @@ static void c2g (GeglBuffer *src,
g_free (dst_buf);
}
static GeglRectangle
get_defined_region (GeglOperation *operation)
{
GeglRectangle result = {0,0,0,0};
GeglRectangle *in_rect = gegl_operation_source_get_defined_region (operation,
"input");
GeglChantOperation *blur = GEGL_CHANT_OPERATION (operation);
gint radius = ceil(blur->radius);
if (!in_rect)
return result;
result = *in_rect;
if(0)if (result.width != 0 &&
result.height != 0)
{
result.x-=radius;
result.y-=radius;
result.width +=radius*2;
result.height +=radius*2;
}
return result;
}
static GeglRectangle get_source_rect (GeglOperation *self,
gpointer context_id)
{
GeglChantOperation *blur = GEGL_CHANT_OPERATION (self);
GeglRectangle rect;
gint radius;
radius = ceil(blur->radius);
rect = *gegl_operation_get_requested_region (self, context_id);
if (rect.width != 0 &&
rect.height != 0)
{
rect.x -= radius;
rect.y -= radius;
rect.width += radius*2;
rect.height += radius*2;
}
return rect;
}
static gboolean
calc_source_regions (GeglOperation *self,
gpointer context_id)
{
GeglRectangle need = get_source_rect (self, context_id);
gegl_operation_set_source_region (self, context_id, "input", &need);
return TRUE;
}
static GeglRectangle
get_affected_region (GeglOperation *self,
const gchar *input_pad,
GeglRectangle region)
{
GeglChantOperation *blur = GEGL_CHANT_OPERATION (self);
gint radius;
radius = ceil(blur->radius);
region.x -= radius;
region.y -= radius;
region.width += radius*2;
region.height += radius*2;
return region;
}
static void class_init (GeglOperationClass *operation_class)
static void tickle (GeglOperation *operation)
{
operation_class->get_defined_region = get_defined_region;
operation_class->get_affected_region = get_affected_region;
operation_class->calc_source_regions = calc_source_regions;
GeglOperationAreaFilter *area = GEGL_OPERATION_AREA_FILTER (operation);
GeglChantOperation *filter = GEGL_CHANT_OPERATION (operation);
area->left = area->right = area->top = area->bottom =
ceil (filter->radius);
}
#endif
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