[gimp/goat-invasion: 251/526] app: clean up the new shrink op
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/goat-invasion: 251/526] app: clean up the new shrink op
- Date: Sun, 22 Apr 2012 13:20:22 +0000 (UTC)
commit 31ca5b022c35787c9782ad262f51911406531c56
Author: Michael Natterer <mitch gimp org>
Date: Sun Mar 25 23:41:14 2012 +0200
app: clean up the new shrink op
app/gegl/gimpoperationshrink.c | 44 +++++++++++++++++++--------------------
1 files changed, 21 insertions(+), 23 deletions(-)
---
diff --git a/app/gegl/gimpoperationshrink.c b/app/gegl/gimpoperationshrink.c
index 8be8717..fd99a95 100644
--- a/app/gegl/gimpoperationshrink.c
+++ b/app/gegl/gimpoperationshrink.c
@@ -244,28 +244,24 @@ gimp_operation_shrink_process (GeglOperation *operation,
const GeglRectangle *roi,
gint level)
{
+ /* pretty much the same as fatten_region only different blame all
+ * bugs in this function on jaycox gimp org
+ *
+ * If edge_lock is true we assume that pixels outside the region we
+ * are passed are identical to the edge pixels. If edge_lock is
+ * false, we assume that pixels outside the region are 0
+ */
GimpOperationShrink *self = GIMP_OPERATION_SHRINK (operation);
const Babl *input_format = babl_format ("Y u8");
const Babl *output_format = babl_format ("Y u8");
- /*
- pretty much the same as fatten_region only different
- blame all bugs in this function on jaycox gimp org
- */
- /* If edge_lock is true we assume that pixels outside the region
- we are passed are identical to the edge pixels.
- If edge_lock is false, we assume that pixels outside the region are 0
- */
- gint32 i, j, x, y;
- guchar **buf; /* caches the the region's pixels */
- guchar *out; /* holds the new scan line we are computing */
- guchar **max; /* caches the smallest values for each column */
- gint16 *circ; /* holds the y coords of the filter's mask */
- gint16 last_max, last_index;
-
- guchar *buffer;
- gint buffer_size;
-
- g_printerr ("roi: %d %d %d %d\n", roi->x, roi->y, roi->width, roi->height);
+ gint32 i, j, x, y;
+ guchar **buf; /* caches the the region's pixels */
+ guchar *out; /* holds the new scan line we are computing */
+ guchar **max; /* caches the smallest values for each column */
+ gint16 *circ; /* holds the y coords of the filter's mask */
+ gint16 last_max, last_index;
+ guchar *buffer;
+ gint buffer_size;
max = g_new (guchar *, roi->width + 2 * self->radius_x);
buf = g_new (guchar *, self->radius_y + 1);
@@ -307,8 +303,9 @@ gimp_operation_shrink_process (GeglOperation *operation,
for (j = 0 ; j < self->radius_x + 1; j++)
max[0][j] = 0;
- /* offset the max pointer by xradius so the range of the array
- is [-xradius] to [region->w + xradius] */
+ /* offset the max pointer by self->radius_x so the range of the
+ * array is [-self->radius_x] to [roi->width + self->radius_x]
+ */
max += self->radius_x;
out = g_new (guchar, roi->width);
@@ -316,8 +313,9 @@ gimp_operation_shrink_process (GeglOperation *operation,
circ = g_new (gint16, 2 * self->radius_x + 1);
compute_border (circ, self->radius_x, self->radius_y);
- /* offset the circ pointer by xradius so the range of the array
- is [-xradius] to [xradius] */
+ /* offset the circ pointer by self->radius_x so the range of the
+ * array is [-self->radius_x] to [self->radius_x]
+ */
circ += self->radius_x;
for (i = 0; i < self->radius_y && i < roi->height; i++) /* load top of image */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]