app: port GimpConvolve to gimp_gegl_convolve()

This commit is contained in:
Michael Natterer
2012-04-02 00:13:46 +02:00
parent 49dcc3d78a
commit a76f44a9de

View File

@ -21,11 +21,9 @@
#include "paint-types.h" #include "paint-types.h"
#include "base/pixel-region.h"
#include "base/temp-buf.h" #include "base/temp-buf.h"
#include "paint-funcs/paint-funcs.h" #include "gegl/gimp-gegl-loops.h"
#include "gegl/gimp-gegl-utils.h" #include "gegl/gimp-gegl-utils.h"
#include "core/gimp.h" #include "core/gimp.h"
@ -139,8 +137,6 @@ gimp_convolve_motion (GimpPaintCore *paint_core,
gint paint_buffer_x; gint paint_buffer_x;
gint paint_buffer_y; gint paint_buffer_y;
const Babl *format; const Babl *format;
PixelRegion destPR;
PixelRegion tempPR;
TempBuf *convolve_temp; TempBuf *convolve_temp;
GeglBuffer *convolve_buffer; GeglBuffer *convolve_buffer;
gdouble fade_point; gdouble fade_point;
@ -203,23 +199,16 @@ gimp_convolve_motion (GimpPaintCore *paint_core,
convolve_buffer, convolve_buffer,
GIMP_GEGL_RECT (0, 0, 0, 0)); GIMP_GEGL_RECT (0, 0, 0, 0));
/* Convolve the region */ gimp_gegl_convolve (convolve_buffer,
pixel_region_init_temp_buf (&tempPR, convolve_temp, GIMP_GEGL_RECT (0, 0,
0, 0, convolve_temp->width,
convolve_temp->width, convolve_temp->height),
convolve_temp->height); paint_buffer,
GIMP_GEGL_RECT (0, 0,
pixel_region_init_temp_buf (&destPR, gegl_buffer_get_width (paint_buffer),
gimp_gegl_buffer_get_temp_buf (paint_buffer), gegl_buffer_get_height (paint_buffer)),
0, 0, convolve->matrix, 3, convolve->matrix_divisor,
gegl_buffer_get_width (paint_buffer), GIMP_NORMAL_CONVOL, TRUE);
gegl_buffer_get_height (paint_buffer));
convolve_region (&tempPR, &destPR,
convolve->matrix, 3, convolve->matrix_divisor,
GIMP_NORMAL_CONVOL, TRUE);
g_object_unref (convolve_buffer);
gimp_brush_core_replace_canvas (brush_core, drawable, gimp_brush_core_replace_canvas (brush_core, drawable,
coords, coords,