[gegl] Add arguments to prepare GEGL for being aware of scaling down previews.



commit d11473ecc636f6f8c754d84f3ab934e9aa3b28df
Author: Ãyvind KolÃs <pippin gimp org>
Date:   Sat Jun 4 03:42:31 2011 +0100

    Add arguments to prepare GEGL for being aware of scaling down previews.
    
    Ignoring this argument should be valid, since it is added as the last argument
    to all functions where it might be used this is actually not an ABI change.

 gegl/buffer/gegl-buffer-access.c                |    9 +-
 gegl/buffer/gegl-buffer-cl-cache.c              |    8 +-
 gegl/buffer/gegl-buffer-cl-iterator.c           |    8 +-
 gegl/buffer/gegl-buffer-iterator.c              |   24 +-
 gegl/buffer/gegl-buffer-iterator.h              |    8 +-
 gegl/buffer/gegl-buffer-linear.c                |    2 +-
 gegl/buffer/gegl-buffer.h                       |   11 +-
 gegl/buffer/gegl-sampler.c                      |    6 +-
 gegl/gegl-plugin.h                              |    1 +
 gegl/graph/gegl-node.c                          |    4 +-
 gegl/operation/gegl-operation-composer.c        |   14 +-
 gegl/operation/gegl-operation-composer.h        |    3 +-
 gegl/operation/gegl-operation-composer3.c       |    8 +-
 gegl/operation/gegl-operation-composer3.h       |    3 +-
 gegl/operation/gegl-operation-context.c         |    5 +-
 gegl/operation/gegl-operation-context.h         |    7 +
 gegl/operation/gegl-operation-filter.c          |   18 +-
 gegl/operation/gegl-operation-filter.h          |    3 +-
 gegl/operation/gegl-operation-point-composer.c  |   35 ++-
 gegl/operation/gegl-operation-point-composer.h  |   17 +-
 gegl/operation/gegl-operation-point-composer3.c |   24 +-
 gegl/operation/gegl-operation-point-composer3.h |    4 +-
 gegl/operation/gegl-operation-point-filter.c    |   25 +-
 gegl/operation/gegl-operation-point-filter.h    |   15 +-
 gegl/operation/gegl-operation-point-render.c    |   10 +-
 gegl/operation/gegl-operation-point-render.h    |    3 +-
 gegl/operation/gegl-operation-sink.c            |    9 +-
 gegl/operation/gegl-operation-sink.h            |    3 +-
 gegl/operation/gegl-operation-source.c          |   18 +-
 gegl/operation/gegl-operation-source.h          |    3 +-
 gegl/operation/gegl-operation-temporal.c        |    5 +-
 gegl/operation/gegl-operation-temporal.h        |    3 +-
 gegl/operation/gegl-operation.c                 |   11 +-
 gegl/operation/gegl-operation.h                 |   11 +-
 gegl/process/gegl-eval-visitor.c                |    4 +-
 gegl/process/gegl-processor.c                   |    7 +-
 operations/affine/affine.c                      |   46 ++--
 operations/common/bilateral-filter.c            |    7 +-
 operations/common/box-blur.c                    |   11 +-
 operations/common/brightness-contrast.c         |   12 +-
 operations/common/buffer-sink.c                 |    3 +-
 operations/common/buffer-source.c               |    9 +-
 operations/common/c2g.c                         |    7 +-
 operations/common/checkerboard.c                |    3 +-
 operations/common/color-temperature.c           |   12 +-
 operations/common/color.c                       |    3 +-
 operations/common/contrast-curve.c              |    3 +-
 operations/common/display.c                     |    3 +-
 operations/common/edge-laplace.c                |    7 +-
 operations/common/edge-sobel.c                  |    7 +-
 operations/common/exp-combine.c                 |    9 +-
 operations/common/fattal02.c                    |    9 +-
 operations/common/fractal-explorer.c            |    5 +-
 operations/common/gaussian-blur.c               |   19 +-
 operations/common/gegl-buffer-load-op.c         |    3 +-
 operations/common/gegl-buffer-save-op.c         |    3 +-
 operations/common/grey.c                        |    3 +-
 operations/common/grid.c                        |    3 +-
 operations/common/introspect.c                  |    3 +-
 operations/common/invert.c                      |   12 +-
 operations/common/levels.c                      |    3 +-
 operations/common/magick-load.c                 |    9 +-
 operations/common/mantiuk06.c                   |   13 +-
 operations/common/map-absolute.c                |    5 +-
 operations/common/map-relative.c                |    5 +-
 operations/common/matting-global.c              |   10 +-
 operations/common/mblur.c                       |   11 +-
 operations/common/mirrors.c                     |    5 +-
 operations/common/mono-mixer.c                  |    7 +-
 operations/common/motion-blur.c                 |    7 +-
 operations/common/noise-reduction.c             |    7 +-
 operations/common/noise.c                       |    3 +-
 operations/common/opacity.c                     |   20 +-
 operations/common/open-buffer.c                 |    8 +-
 operations/common/over.c                        |   29 +-
 operations/common/pixelise.c                    |    7 +-
 operations/common/raw-load.c                    |   10 +-
 operations/common/reinhard05.c                  |    9 +-
 operations/common/remap.c                       |    3 +-
 operations/common/save.c                        |    3 +-
 operations/common/snn-mean.c                    |    7 +-
 operations/common/stress.c                      |    7 +-
 operations/common/stretch-contrast.c            |   14 +-
 operations/common/svg-huerotate.c               |    3 +-
 operations/common/svg-luminancetoalpha.c        |    3 +-
 operations/common/svg-matrix.c                  |    3 +-
 operations/common/svg-saturate.c                |    3 +-
 operations/common/threshold.c                   |   14 +-
 operations/common/value-invert.c                |   12 +-
 operations/common/vignette.c                    |    3 +-
 operations/common/weighted-blend.c              |    3 +-
 operations/common/whitebalance.c                |   12 +-
 operations/common/write-buffer.c                |    3 +-
 operations/core/clone.c                         |    9 +-
 operations/core/convert-format.c                |    3 +-
 operations/core/crop.c                          |    3 +-
 operations/core/nop.c                           |    3 +-
 operations/external/exr-load.cpp                |   25 +-
 operations/external/exr-save.cc                 |    5 +-
 operations/external/ff-load.c                   |    3 +-
 operations/external/jp2-load.c                  |    3 +-
 operations/external/jpg-load.c                  |    9 +-
 operations/external/jpg-save.c                  |    5 +-
 operations/external/matting-levin.c             |    3 +-
 operations/external/openraw.c                   |    3 +-
 operations/external/path.c                      |    3 +-
 operations/external/pixbuf.c                    |    5 +-
 operations/external/png-load.c                  |    7 +-
 operations/external/png-save.c                  |    5 +-
 operations/external/ppm-load.c                  |   32 +-
 operations/external/ppm-save.c                  |   12 +-
 operations/external/rgbe-load.c                 |    5 +-
 operations/external/rgbe-save.c                 |    5 +-
 operations/external/save-pixbuf.c               |    5 +-
 operations/external/sdl-display.c               |    5 +-
 operations/external/svg-load.c                  |    5 +-
 operations/external/text.c                      |    5 +-
 operations/external/v4l.c                       |    3 +-
 operations/external/vector-fill.c               |    3 +-
 operations/external/vector-stroke.c             |    3 +-
 operations/generated/add.c                      |    3 +-
 operations/generated/clear.c                    |    3 +-
 operations/generated/color-burn.c               |    3 +-
 operations/generated/color-dodge.c              |    3 +-
 operations/generated/darken.c                   |    3 +-
 operations/generated/difference.c               |    3 +-
 operations/generated/divide.c                   |    3 +-
 operations/generated/dst-atop.c                 |    3 +-
 operations/generated/dst-in.c                   |    3 +-
 operations/generated/dst-out.c                  |    3 +-
 operations/generated/dst-over.c                 |    3 +-
 operations/generated/dst.c                      |    3 +-
 operations/generated/exclusion.c                |    3 +-
 operations/generated/gamma.c                    |    3 +-
 operations/generated/hard-light.c               |    3 +-
 operations/generated/lighten.c                  |    3 +-
 operations/generated/math.rb                    |    3 +-
 operations/generated/multiply.c                 |    3 +-
 operations/generated/other-blend.rb             |    3 +-
 operations/generated/overlay.c                  |    3 +-
 operations/generated/plus.c                     |    3 +-
 operations/generated/screen.c                   |    3 +-
 operations/generated/soft-light.c               |    3 +-
 operations/generated/src-atop.c                 |    3 +-
 operations/generated/src-in.c                   |    3 +-
 operations/generated/src-out.c                  |    3 +-
 operations/generated/src-over.c                 |    3 +-
 operations/generated/src.c                      |    3 +-
 operations/generated/subtract.c                 |    3 +-
 operations/generated/svg-12-blend.rb            |    3 +-
 operations/generated/svg-12-porter-duff.rb      |    3 +-
 operations/generated/xor.c                      |    3 +-
 operations/workshop/box-max.c                   |    7 +-
 operations/workshop/box-min.c                   |    7 +-
 operations/workshop/box-percentile.c            |    5 +-
 operations/workshop/color-reduction.c           |   13 +-
 operations/workshop/demosaic-bimedian.c         |    5 +-
 operations/workshop/demosaic-simple.c           |    5 +-
 operations/workshop/disc-percentile.c           |    5 +-
 operations/workshop/external/ff-save.c          |    3 +-
 operations/workshop/external/gluas.c            |    3 +-
 operations/workshop/external/line-profile.c     |    5 +-
 operations/workshop/generated/blend.rb          |    3 +-
 operations/workshop/hstack.c                    |    8 +-
 operations/workshop/kuwahara-max.c              |    5 +-
 operations/workshop/kuwahara-min.c              |    5 +-
 operations/workshop/kuwahara.c                  |    5 +-
 operations/workshop/lens-correct.c              |  408 +++++++++++++++++++++++
 operations/workshop/linear-gradient.c           |    3 +-
 operations/workshop/mandelbrot.c                |    5 +-
 operations/workshop/max-rgb.c                   |    3 +-
 operations/workshop/noise-spread.c              |    5 +-
 operations/workshop/posterize.c                 |    3 +-
 operations/workshop/radial-gradient.c           |    3 +-
 operations/workshop/rawbayer-load.c             |   13 +-
 operations/workshop/snn-percentile.c            |    5 +-
 operations/workshop/unpremul.c                  |    3 +-
 operations/workshop/whirl-pinch.c               |    5 +-
 tests/buffer/buffer-test.c                      |   16 +-
 tests/buffer/tests/test_get_buffer_scaled.c     |    2 +-
 tests/buffer/tests/test_get_buffer_scaled2.c    |    2 +-
 tests/simple/test-change-processor-rect.c       |    2 +-
 182 files changed, 1131 insertions(+), 516 deletions(-)
---
diff --git a/gegl/buffer/gegl-buffer-access.c b/gegl/buffer/gegl-buffer-access.c
index 9631f01..f4ac626 100644
--- a/gegl/buffer/gegl-buffer-access.c
+++ b/gegl/buffer/gegl-buffer-access.c
@@ -598,6 +598,7 @@ gegl_buffer_set_unlocked (GeglBuffer          *buffer,
 void
 gegl_buffer_set (GeglBuffer          *buffer,
                  const GeglRectangle *rect,
+                 gint                 level,
                  const Babl          *format,
                  void                *src,
                  gint                 rowstride)
@@ -1062,8 +1063,8 @@ gegl_buffer_get_unlocked (GeglBuffer          *buffer,
 
 void
 gegl_buffer_get (GeglBuffer          *buffer,
-                 gdouble              scale,
                  const GeglRectangle *rect,
+                 gdouble              scale,
                  const Babl          *format,
                  gpointer             dest_buf,
                  gint                 rowstride)
@@ -1169,7 +1170,7 @@ gegl_buffer_copy (GeglBuffer          *src,
       dest_rect_r.width = src_rect->width;
       dest_rect_r.height = src_rect->height;
 
-      i = gegl_buffer_iterator_new (dst, &dest_rect_r, dst->format, GEGL_BUFFER_WRITE);
+      i = gegl_buffer_iterator_new (dst, &dest_rect_r, dst->format, GEGL_BUFFER_WRITE, 0); /* XXX: is level 0 right? */
       read = gegl_buffer_iterator_add (i, src, src_rect, src->format, GEGL_BUFFER_READ);
       while (gegl_buffer_iterator_next (i))
         babl_process (fish, i->data[read], i->data[0], i->length);
@@ -1201,7 +1202,7 @@ gegl_buffer_clear (GeglBuffer          *dst,
   /* FIXME: this can be even further optimized by special casing it so
    * that fully voided tiles are dropped.
    */
-  i = gegl_buffer_iterator_new (dst, dst_rect, dst->format, GEGL_BUFFER_WRITE);
+  i = gegl_buffer_iterator_new (dst, dst_rect, dst->format, GEGL_BUFFER_WRITE, 0); /* XXX: should level be settable */
   while (gegl_buffer_iterator_next (i))
     {
       memset (((guchar*)(i->data[0])), 0, i->length * pxsize);
@@ -1266,7 +1267,7 @@ void            gegl_buffer_set_color         (GeglBuffer          *dst,
   /* FIXME: this can be even further optimized by special casing it so
    * that fully filled tiles are shared.
    */
-  i = gegl_buffer_iterator_new (dst, dst_rect, dst->format, GEGL_BUFFER_WRITE);
+  i = gegl_buffer_iterator_new (dst, dst_rect, dst->format, GEGL_BUFFER_WRITE, 0);
   while (gegl_buffer_iterator_next (i))
     {
       int j;
diff --git a/gegl/buffer/gegl-buffer-cl-cache.c b/gegl/buffer/gegl-buffer-cl-cache.c
index bfd44fc..9cef900 100644
--- a/gegl/buffer/gegl-buffer-cl-cache.c
+++ b/gegl/buffer/gegl-buffer-cl-cache.c
@@ -102,7 +102,7 @@ gegl_buffer_cl_cache_merge (GeglBuffer          *buffer,
           if (cl_err != CL_SUCCESS) CL_ERROR;
 
           /* tile-ize */
-          gegl_buffer_set (entry->buffer, &entry->roi, entry->buffer->format, data, GEGL_AUTO_ROWSTRIDE);
+          gegl_buffer_set (entry->buffer, &entry->roi, 0, entry->buffer->format, data, GEGL_AUTO_ROWSTRIDE);
 
           cl_err = gegl_clEnqueueUnmapMemObject (gegl_cl_get_command_queue(), entry->tex, data,
                                                  0, NULL, NULL);
@@ -271,8 +271,8 @@ gegl_buffer_cl_cache_from (GeglBuffer          *buffer,
                       gegl_rectangle_contains (&cb->roi, roi))
                     {
                       gegl_buffer_get (cb->buffer,
-                                       1.0,
                                        roi,
+                                       1.0,
                                        format,
                                        dest_buf,
                                        rowstride);
@@ -310,7 +310,7 @@ gegl_buffer_cl_cache_from (GeglBuffer          *buffer,
                                                  0, NULL, NULL, &cl_err);
                   if (cl_err != CL_SUCCESS) CL_ERROR;
 
-                  gegl_buffer_set (cb->buffer, &entry->roi, format, data, GEGL_AUTO_ROWSTRIDE);
+                  gegl_buffer_set (cb->buffer, &entry->roi, 0, format, data, GEGL_AUTO_ROWSTRIDE);
 
                   cl_err = gegl_clEnqueueUnmapMemObject (gegl_cl_get_command_queue(), tex_dest, data,
                                                          0, NULL, NULL);
@@ -320,8 +320,8 @@ gegl_buffer_cl_cache_from (GeglBuffer          *buffer,
                   if (cl_err != CL_SUCCESS) CL_ERROR;
 
                   gegl_buffer_get (cb->buffer,
-                                   1.0,
                                    roi,
+                                   1.0,
                                    format,
                                    dest_buf,
                                    rowstride);
diff --git a/gegl/buffer/gegl-buffer-cl-iterator.c b/gegl/buffer/gegl-buffer-cl-iterator.c
index 864141a..c1d380d 100644
--- a/gegl/buffer/gegl-buffer-cl-iterator.c
+++ b/gegl/buffer/gegl-buffer-cl-iterator.c
@@ -252,7 +252,7 @@ gegl_buffer_cl_iterator_next (GeglBufferClIterator *iterator, gboolean *err)
                       if (cl_err != CL_SUCCESS) CL_ERROR;
 
                       /* color conversion using BABL */
-                      gegl_buffer_set (i->buffer[no], &i->roi[no][j], i->format[no], data, GEGL_AUTO_ROWSTRIDE);
+                      gegl_buffer_set (i->buffer[no], &i->roi[no][j], 0, i->format[no], data, GEGL_AUTO_ROWSTRIDE);
 
                       cl_err = gegl_clEnqueueUnmapMemObject (gegl_cl_get_command_queue(), i->tex_op[no][j], data,
                                                              0, NULL, NULL);
@@ -349,7 +349,7 @@ gegl_buffer_cl_iterator_next (GeglBufferClIterator *iterator, gboolean *err)
                     if (cl_err != CL_SUCCESS) CL_ERROR;
 
                     /* color conversion using BABL */
-                    gegl_buffer_get (i->buffer[no], 1.0, &i->roi[no][j], i->format[no], data, GEGL_AUTO_ROWSTRIDE);
+                    gegl_buffer_get (i->buffer[no], &i->roi[no][j], 1.0, i->format[no], data, GEGL_AUTO_ROWSTRIDE);
 
                     cl_err = gegl_clEnqueueUnmapMemObject (gegl_cl_get_command_queue(), i->tex_op[no][j], data,
                                                                0, NULL, NULL);
@@ -384,7 +384,7 @@ gegl_buffer_cl_iterator_next (GeglBufferClIterator *iterator, gboolean *err)
                         if (cl_err != CL_SUCCESS) CL_ERROR;
 
                         /* color conversion will be performed in the GPU later */
-                        gegl_buffer_get (i->buffer[no], 1.0, &i->roi[no][j], i->buffer[no]->format, data, GEGL_AUTO_ROWSTRIDE);
+                        gegl_buffer_get (i->buffer[no], &i->roi[no][j], 1.0, i->buffer[no]->format, data, GEGL_AUTO_ROWSTRIDE);
 
                         cl_err = gegl_clEnqueueUnmapMemObject (gegl_cl_get_command_queue(), i->tex_buf[no][j], data,
                                                                0, NULL, NULL);
@@ -420,7 +420,7 @@ gegl_buffer_cl_iterator_next (GeglBufferClIterator *iterator, gboolean *err)
                         if (cl_err != CL_SUCCESS) CL_ERROR;
 
                         /* color conversion will be performed in the GPU later */
-                        gegl_buffer_get (i->buffer[no], 1.0, &i->roi[no][j], i->buffer[no]->format, data, GEGL_AUTO_ROWSTRIDE);
+                        gegl_buffer_get (i->buffer[no], &i->roi[no][j], 1.0, i->buffer[no]->format, data, GEGL_AUTO_ROWSTRIDE);
 
                         cl_err = gegl_clEnqueueUnmapMemObject (gegl_cl_get_command_queue(), i->tex_buf[no][j], data,
                                                                0, NULL, NULL);
diff --git a/gegl/buffer/gegl-buffer-iterator.c b/gegl/buffer/gegl-buffer-iterator.c
index 523b918..bb8a58b 100644
--- a/gegl/buffer/gegl-buffer-iterator.c
+++ b/gegl/buffer/gegl-buffer-iterator.c
@@ -54,7 +54,7 @@ typedef struct GeglBufferTileIterator
   GeglRectangle  roi2;     /* the rectangular subregion of data
                             * in the buffer represented by this scan.
                             */
-
+  gint           level;
 } GeglBufferTileIterator;
 
 #define GEGL_BUFFER_SCAN_COMPATIBLE   128   /* should be integrated into enum */
@@ -86,7 +86,8 @@ typedef struct GeglBufferIterators
 static void      gegl_buffer_tile_iterator_init (GeglBufferTileIterator *i,
                                                  GeglBuffer             *buffer,
                                                  GeglRectangle           roi,
-                                                 gboolean                write);
+                                                 gboolean                write,
+                                                 gint                    level);
 static gboolean  gegl_buffer_tile_iterator_next (GeglBufferTileIterator *i);
 
 /*
@@ -118,13 +119,15 @@ static gboolean gegl_buffer_scan_compatible (GeglBuffer *bufferA,
 static void gegl_buffer_tile_iterator_init (GeglBufferTileIterator *i,
                                             GeglBuffer             *buffer,
                                             GeglRectangle           roi,
-                                            gboolean                write)
+                                            gboolean                write,
+                                            gint                    level)
 {
   g_assert (i);
   memset (i, 0, sizeof (GeglBufferTileIterator));
 
   i->buffer = buffer;
   i->roi = roi;
+  i->level = level;
   i->next_row    = 0;
   i->next_col = 0;
   i->tile = NULL;
@@ -282,7 +285,7 @@ gegl_buffer_iterator_add (GeglBufferIterator  *iterator,
   if (self==0) /* The first buffer which is always scan aligned */
     {
       i->flags[self] |= GEGL_BUFFER_SCAN_COMPATIBLE;
-      gegl_buffer_tile_iterator_init (&i->i[self], i->buffer[self], i->rect[self], ((i->flags[self] & GEGL_BUFFER_WRITE) != 0) );
+      gegl_buffer_tile_iterator_init (&i->i[self], i->buffer[self], i->rect[self], ((i->flags[self] & GEGL_BUFFER_WRITE) != 0), iterator->level);
     }
   else
     {
@@ -294,7 +297,7 @@ gegl_buffer_iterator_add (GeglBufferIterator  *iterator,
                                        i->buffer[self], i->rect[self].x, i->rect[self].y))
         {
           i->flags[self] |= GEGL_BUFFER_SCAN_COMPATIBLE;
-          gegl_buffer_tile_iterator_init (&i->i[self], i->buffer[self], i->rect[self], ((i->flags[self] & GEGL_BUFFER_WRITE) != 0));
+          gegl_buffer_tile_iterator_init (&i->i[self], i->buffer[self], i->rect[self], ((i->flags[self] & GEGL_BUFFER_WRITE) != 0), iterator->level);
         }
     }
 
@@ -308,7 +311,7 @@ gegl_buffer_iterator_add (GeglBufferIterator  *iterator,
 }
 
 /* FIXME: we are currently leaking this buf pool, it should be
- * freeing it when gegl is uninitialized
+ * freed when gegl is uninitialized
  */
 
 typedef struct BufInfo {
@@ -448,8 +451,7 @@ gegl_buffer_iterator_next (GeglBufferIterator *iterator)
               if (i->flags[no] & GEGL_BUFFER_SCAN_COMPATIBLE &&
                   i->flags[no] & GEGL_BUFFER_FORMAT_COMPATIBLE &&
                   i->roi[no].width == i->i[no].buffer->tile_storage->tile_width && (i->flags[no] & GEGL_BUFFER_FORMAT_COMPATIBLE))
-                {
-                   /* direct access */
+                { /* direct access, don't need to do anything */
 #if DEBUG_DIRECT
                    direct_write += i->roi[no].width * i->roi[no].height;
 #endif
@@ -465,7 +467,7 @@ gegl_buffer_iterator_next (GeglBufferIterator *iterator)
   /* XXX: should perhaps use _set_unlocked, and keep the lock in the
    * iterator.
    */
-                  gegl_buffer_set (i->buffer[no], &(i->roi[no]), i->format[no], i->buf[no], GEGL_AUTO_ROWSTRIDE);
+                  gegl_buffer_set (i->buffer[no], &(i->roi[no]), 0, i->format[no], i->buf[no], GEGL_AUTO_ROWSTRIDE); /* XXX: use correct level */
                 }
             }
         }
@@ -551,11 +553,13 @@ gegl_buffer_iterator_next (GeglBufferIterator *iterator)
 GeglBufferIterator *gegl_buffer_iterator_new (GeglBuffer          *buffer,
                                               const GeglRectangle *roi,
                                               const Babl          *format,
-                                              guint                flags)
+                                              guint                flags,
+                                              gint                 level)
 {
   GeglBufferIterator *i = (gpointer)g_slice_new0 (GeglBufferIterators);
   /* Because the iterator is nulled above, we can forgo explicitly setting
    * i->is_finished to FALSE. */
+  i->level = level;
   gegl_buffer_iterator_add (i, buffer, roi, format, flags);
   return i;
 }
diff --git a/gegl/buffer/gegl-buffer-iterator.h b/gegl/buffer/gegl-buffer-iterator.h
index 6d2b321..645d425 100644
--- a/gegl/buffer/gegl-buffer-iterator.h
+++ b/gegl/buffer/gegl-buffer-iterator.h
@@ -33,6 +33,7 @@ typedef struct GeglBufferIterator
   gint          length;
   gpointer      data[GEGL_BUFFER_MAX_ITERATORS];
   GeglRectangle roi[GEGL_BUFFER_MAX_ITERATORS];
+  gint          level;
 } GeglBufferIterator;
 
 
@@ -42,6 +43,8 @@ typedef struct GeglBufferIterator
  * @roi: the rectangle to iterate over
  * @format: the format we want to process this buffers data in, pass 0 to use the buffers format.
  * @flags: whether we need reading or writing to this buffer one of GEGL_BUFFER_READ, GEGL_BUFFER_WRITE and GEGL_BUFFER_READWRITE.
+ * @level: the level at which we are iterating, the roi will indicate the
+ * extent at 1:1, x,y,width and height are/(2^level)
  *
  * Create a new buffer iterator, this buffer will be iterated through
  * in linear chunks, some chunks might be full tiles the coordinates, see
@@ -54,7 +57,10 @@ typedef struct GeglBufferIterator
 GeglBufferIterator * gegl_buffer_iterator_new  (GeglBuffer          *buffer,
                                                 const GeglRectangle *roi,
                                                 const Babl          *format,
-                                                guint                flags);
+                                                guint                flags,
+                                                gint                 level);   /* XXX: or encode it in flags? */
+/* should maybe be reporting the roi in process, as base image roi when level != 0 */
+
 
 /**
  * gegl_buffer_iterator_add:
diff --git a/gegl/buffer/gegl-buffer-linear.c b/gegl/buffer/gegl-buffer-linear.c
index a2b5d82..2505a6a 100644
--- a/gegl/buffer/gegl-buffer-linear.c
+++ b/gegl/buffer/gegl-buffer-linear.c
@@ -244,7 +244,7 @@ gegl_buffer_linear_close (GeglBuffer *buffer,
 
               g_mutex_unlock (buffer->tile_storage->mutex);
               /* XXX: potential race */
-              gegl_buffer_set (buffer, &info->extent, info->format, info->buf, 0);
+              gegl_buffer_set (buffer, &info->extent, 0, info->format, info->buf, 0);
 
               gegl_free (info->buf);
               g_free (info);
diff --git a/gegl/buffer/gegl-buffer.h b/gegl/buffer/gegl-buffer.h
index 254cb35..334183e 100644
--- a/gegl/buffer/gegl-buffer.h
+++ b/gegl/buffer/gegl-buffer.h
@@ -217,10 +217,10 @@ gboolean gegl_buffer_set_extent (GeglBuffer          *buffer,
 /**
  * gegl_buffer_get:
  * @buffer: the buffer to retrieve data from.
- * @scale: sampling scale, 1.0 = pixel for pixel 2.0 = magnify, 0.5 scale down.
  * @rect: the coordinates we want to retrieve data from, and width/height of
  * destination buffer, if NULL equal to the extent of the buffer. The
  * coordinates and dimensions are after scale has been applied.
+ * @scale: sampling scale, 1.0 = pixel for pixel 2.0 = magnify, 0.5 scale down.
  * @format: the BablFormat to store in the linear buffer @dest.
  * @dest: the memory destination for a linear buffer for the pixels, the size needed
  * depends on the requested BablFormat.
@@ -233,8 +233,8 @@ gboolean gegl_buffer_set_extent (GeglBuffer          *buffer,
  * the tile structure into a linear buffer.
  */
 void            gegl_buffer_get               (GeglBuffer          *buffer,
-                                               gdouble              scale,
                                                const GeglRectangle *rect,
+                                               gdouble              scale,
                                                const Babl          *format,
                                                gpointer             dest,
                                                gint                 rowstride);
@@ -242,7 +242,11 @@ void            gegl_buffer_get               (GeglBuffer          *buffer,
 /**
  * gegl_buffer_set:
  * @buffer: the buffer to modify.
- * @rect: the coordinates we want to change the data of and the width/height extent, if NULL equal to the extent of the buffer.
+ * @rect: the coordinates we want to change the data of and the width/height of
+ * the linear buffer being set, scale specifies the scaling factor applied to
+ * the data when setting.
+ * @scale_level: the scale level being set, 0 = 1:1 = default = base mipmap level,
+ * 1 = 1:2, 2=1:4, 3=1:8 ..
  * @format: the babl_format the linear buffer @src.
  * @src: linear buffer of image data to be stored in @buffer.
  * @rowstride: rowstride in bytes, or GEGL_AUTO_ROWSTRIDE to compute the
@@ -252,6 +256,7 @@ void            gegl_buffer_get               (GeglBuffer          *buffer,
  */
 void            gegl_buffer_set               (GeglBuffer          *buffer,
                                                const GeglRectangle *rect,
+                                               gint                 scale_level,
                                                const Babl          *format,
                                                void                *src,
                                                gint                 rowstride);
diff --git a/gegl/buffer/gegl-sampler.c b/gegl/buffer/gegl-sampler.c
index 9ab1903..902b680 100644
--- a/gegl/buffer/gegl-sampler.c
+++ b/gegl/buffer/gegl-sampler.c
@@ -277,8 +277,8 @@ gegl_sampler_get_ptr (GeglSampler *const sampler,
         }
 
       gegl_buffer_get (sampler->buffer,
-                       1.0,
                        &fetch_rectangle,
+                       1.0,
                        sampler->interpolate_format,
                        sampler->sampler_buffer[0],
                        GEGL_AUTO_ROWSTRIDE);
@@ -351,8 +351,8 @@ gegl_sampler_get_from_buffer (GeglSampler *const sampler,
         }
 
       gegl_buffer_get (sampler->buffer,
-                       1.0,
                        &fetch_rectangle,
+                       1.0,
                        sampler->interpolate_format,
                        sampler->sampler_buffer[0],
                        GEGL_AUTO_ROWSTRIDE);
@@ -446,8 +446,8 @@ gegl_sampler_get_from_mipmap (GeglSampler *const sampler,
         }
 
       gegl_buffer_get (sampler->buffer,
-                       scale,
                        &fetch_rectangle,
+                       scale,
                        sampler->interpolate_format,
                        sampler->sampler_buffer[level],
                        GEGL_AUTO_ROWSTRIDE);
diff --git a/gegl/gegl-plugin.h b/gegl/gegl-plugin.h
index 0e78be2..c545e73 100644
--- a/gegl/gegl-plugin.h
+++ b/gegl/gegl-plugin.h
@@ -73,6 +73,7 @@ GType gegl_module_register_type (GTypeModule     *module,
                                  const GTypeInfo *type_info,
                                  GTypeFlags       flags);
 
+gint            gegl_operation_context_get_level  (GeglOperationContext *self);
 GeglBuffer     *gegl_operation_context_get_source (GeglOperationContext *self,
                                                    const gchar          *padname);
 GeglBuffer     *gegl_operation_context_get_target (GeglOperationContext *self,
diff --git a/gegl/graph/gegl-node.c b/gegl/graph/gegl-node.c
index 7c31f7d..8546312 100644
--- a/gegl/graph/gegl-node.c
+++ b/gegl/graph/gegl-node.c
@@ -896,7 +896,7 @@ static void spawnrender (gpointer data,
 
   if ((buffer ) && td->destination_buf)
     {
-      gegl_buffer_get (buffer, 1.0, &td->roi, td->format, td->destination_buf, td->rowstride);
+      gegl_buffer_get (buffer, &td->roi, 1.0, td->format, td->destination_buf, td->rowstride);
     }
 
   /* and unrefing to ultimately clean it off from the graph */
@@ -1056,7 +1056,7 @@ gegl_node_blit (GeglNode            *self,
         }
       if (destination_buf && cache)
         {
-          gegl_buffer_get (GEGL_BUFFER (cache), scale, roi,
+          gegl_buffer_get (GEGL_BUFFER (cache), roi, scale,
                            format, destination_buf, rowstride);
         }
     }
diff --git a/gegl/operation/gegl-operation-composer.c b/gegl/operation/gegl-operation-composer.c
index 708a188..bc45bdb 100644
--- a/gegl/operation/gegl-operation-composer.c
+++ b/gegl/operation/gegl-operation-composer.c
@@ -50,7 +50,8 @@ static void     set_property (GObject             *gobject,
 static gboolean gegl_operation_composer_process (GeglOperation       *operation,
                               GeglOperationContext     *context,
                               const gchar         *output_prop,
-                              const GeglRectangle *result);
+                              const GeglRectangle *result,
+                              gint                 level);
 static void     attach       (GeglOperation       *operation);
 static GeglNode*detect       (GeglOperation       *operation,
                               gint                 x,
@@ -144,10 +145,11 @@ set_property (GObject      *object,
 }
 
 static gboolean
-gegl_operation_composer_process (GeglOperation       *operation,
-                        GeglOperationContext     *context,
-                        const gchar         *output_prop,
-                        const GeglRectangle *result)
+gegl_operation_composer_process (GeglOperation        *operation,
+                                 GeglOperationContext *context,
+                                 const gchar          *output_prop,
+                                 const GeglRectangle  *result,
+                                 gint                  level)
 {
   GeglOperationComposerClass *klass   = GEGL_OPERATION_COMPOSER_GET_CLASS (operation);
   GeglBuffer                 *input;
@@ -171,7 +173,7 @@ gegl_operation_composer_process (GeglOperation       *operation,
   if (input != NULL ||
       aux != NULL)
     {
-      success = klass->process (operation, input, aux, output, result);
+      success = klass->process (operation, input, aux, output, result, context->level);
 
       if (output == GEGL_BUFFER (operation->node->cache))
         gegl_cache_computed (operation->node->cache, result);
diff --git a/gegl/operation/gegl-operation-composer.h b/gegl/operation/gegl-operation-composer.h
index 5df284f..812d99a 100644
--- a/gegl/operation/gegl-operation-composer.h
+++ b/gegl/operation/gegl-operation-composer.h
@@ -50,7 +50,8 @@ struct _GeglOperationComposerClass
                         GeglBuffer          *input,
                         GeglBuffer          *aux,
                         GeglBuffer          *output,
-                        const GeglRectangle *result);
+                        const GeglRectangle *result,
+                        gint                 level);
   gpointer              pad[4];
 };
 
diff --git a/gegl/operation/gegl-operation-composer3.c b/gegl/operation/gegl-operation-composer3.c
index ac77094..efacaae 100644
--- a/gegl/operation/gegl-operation-composer3.c
+++ b/gegl/operation/gegl-operation-composer3.c
@@ -52,7 +52,8 @@ static gboolean gegl_operation_composer3_process
                              (GeglOperation        *operation,
                               GeglOperationContext *context,
                               const gchar          *output_prop,
-                              const GeglRectangle  *result);
+                              const GeglRectangle  *result,
+                              gint                  level);
 static void     attach       (GeglOperation        *operation);
 static GeglNode*detect       (GeglOperation        *operation,
                               gint                  x,
@@ -161,7 +162,8 @@ static gboolean
 gegl_operation_composer3_process (GeglOperation        *operation,
                                   GeglOperationContext *context,
                                   const gchar          *output_prop,
-                                  const GeglRectangle  *result)
+                                  const GeglRectangle  *result,
+                                  gint                  level)
 {
   GeglOperationComposer3Class *klass   = GEGL_OPERATION_COMPOSER3_GET_CLASS (operation);
   GeglBuffer                  *input;
@@ -188,7 +190,7 @@ gegl_operation_composer3_process (GeglOperation        *operation,
       aux != NULL ||
       aux2 != NULL)
     {
-      success = klass->process (operation, input, aux, aux2, output, result);
+      success = klass->process (operation, input, aux, aux2, output, result, context->level);
 
       if (output == GEGL_BUFFER (operation->node->cache))
         gegl_cache_computed (operation->node->cache, result);
diff --git a/gegl/operation/gegl-operation-composer3.h b/gegl/operation/gegl-operation-composer3.h
index 6724a56..1ba31a0 100644
--- a/gegl/operation/gegl-operation-composer3.h
+++ b/gegl/operation/gegl-operation-composer3.h
@@ -46,7 +46,8 @@ struct _GeglOperationComposer3Class
                         GeglBuffer          *aux,
                         GeglBuffer          *aux2,
                         GeglBuffer          *output,
-                        const GeglRectangle *result);
+                        const GeglRectangle *result,
+                        gint                 level);
   gpointer              pad[4];
 };
 
diff --git a/gegl/operation/gegl-operation-context.c b/gegl/operation/gegl-operation-context.c
index 076cde2..91e87a5 100644
--- a/gegl/operation/gegl-operation-context.c
+++ b/gegl/operation/gegl-operation-context.c
@@ -396,4 +396,7 @@ gegl_operation_context_get_target (GeglOperationContext *context,
   return output;
 }
 
-
+gint            gegl_operation_context_get_level (GeglOperationContext *ctxt)
+{
+  return ctxt->level;
+}
diff --git a/gegl/operation/gegl-operation-context.h b/gegl/operation/gegl-operation-context.h
index ef50e2a..4561c58 100644
--- a/gegl/operation/gegl-operation-context.h
+++ b/gegl/operation/gegl-operation-context.h
@@ -55,6 +55,11 @@ struct _GeglOperationContext
                                   incorporated into the refcount of
                                   GeglOperationContext?
                                 */
+  gint           level;         /* subdivision level to render at, 0 = 1:1,
+                                                                   1 = 1:2,
+                                                                   2 = 1:4,
+                                                                   4 = 1:8,
+                                                                   6 = 1:16 .. */
 };
 
 GeglBuffer     *gegl_operation_context_get_target      (GeglOperationContext *self,
@@ -89,6 +94,8 @@ GeglRectangle * gegl_operation_context_get_result_rect (GeglOperationContext *no
 void            gegl_operation_context_set_result_rect (GeglOperationContext *node,
                                                         const GeglRectangle  *rect);
 
+gint            gegl_operation_context_get_level (GeglOperationContext *ctxt);
+
 GeglOperationContext *gegl_operation_context_new (void);
 void gegl_operation_context_destroy (GeglOperationContext *opcontext);
 
diff --git a/gegl/operation/gegl-operation-filter.c b/gegl/operation/gegl-operation-filter.c
index b56d3c0..2517006 100644
--- a/gegl/operation/gegl-operation-filter.c
+++ b/gegl/operation/gegl-operation-filter.c
@@ -49,10 +49,11 @@ static void     set_property          (GObject       *gobject,
                                        GParamSpec    *pspec);
 
 static gboolean gegl_operation_filter_process
-                                      (GeglOperation       *operation,
-                                       GeglOperationContext     *context,
-                                       const gchar         *output_prop,
-                                       const GeglRectangle *result);
+                                      (GeglOperation        *operation,
+                                       GeglOperationContext *context,
+                                       const gchar          *output_prop,
+                                       const GeglRectangle  *result,
+                                       gint                  level);
 
 static void     attach                 (GeglOperation *operation);
 static GeglNode *detect                (GeglOperation *operation,
@@ -179,10 +180,11 @@ set_property (GObject      *object,
 }
 
 static gboolean
-gegl_operation_filter_process (GeglOperation   *operation,
+gegl_operation_filter_process (GeglOperation        *operation,
                                GeglOperationContext *context,
-                               const gchar     *output_prop,
-                               const GeglRectangle *result)
+                               const gchar          *output_prop,
+                               const GeglRectangle  *result,
+                               gint                  level)
 {
   GeglOperationFilterClass *klass;
   GeglBuffer               *input;
@@ -202,7 +204,7 @@ gegl_operation_filter_process (GeglOperation   *operation,
   input  = gegl_operation_context_get_source (context, "input");
   output = gegl_operation_context_get_target (context, "output");
 
-  success = klass->process (operation, input, output, result);
+  success = klass->process (operation, input, output, result, context->level);
 
   if (output == GEGL_BUFFER (operation->node->cache))
     gegl_cache_computed (operation->node->cache, result);
diff --git a/gegl/operation/gegl-operation-filter.h b/gegl/operation/gegl-operation-filter.h
index 1d51bb7..52e928a 100644
--- a/gegl/operation/gegl-operation-filter.h
+++ b/gegl/operation/gegl-operation-filter.h
@@ -48,7 +48,8 @@ struct _GeglOperationFilterClass
   gboolean (* process) (GeglOperation       *self,
                         GeglBuffer          *input,
                         GeglBuffer          *output,
-                        const GeglRectangle *roi);
+                        const GeglRectangle *roi,
+                        gint                 level);
   gpointer              pad[4];
 };
 
diff --git a/gegl/operation/gegl-operation-point-composer.c b/gegl/operation/gegl-operation-point-composer.c
index aa33a17..74d74fc 100644
--- a/gegl/operation/gegl-operation-point-composer.c
+++ b/gegl/operation/gegl-operation-point-composer.c
@@ -35,13 +35,15 @@ static gboolean gegl_operation_point_composer_process
                                GeglBuffer          *input,
                                GeglBuffer          *aux,
                                GeglBuffer          *output,
-                               const GeglRectangle *result);
+                               const GeglRectangle *result,
+                               gint                 level);
 
 static gboolean
-gegl_operation_composer_process2 (GeglOperation       *operation,
-                        GeglOperationContext     *context,
-                        const gchar         *output_prop,
-                        const GeglRectangle *result);
+gegl_operation_composer_process2 (GeglOperation        *operation,
+                                  GeglOperationContext *context,
+                                  const gchar          *output_prop,
+                                  const GeglRectangle  *result,
+                                  gint                  level);
 
 G_DEFINE_TYPE (GeglOperationPointComposer, gegl_operation_point_composer, GEGL_TYPE_OPERATION_COMPOSER)
 
@@ -86,7 +88,8 @@ static gboolean
 gegl_operation_composer_process2 (GeglOperation        *operation,
                                   GeglOperationContext *context,
                                   const gchar          *output_prop,
-                                  const GeglRectangle  *result)
+                                  const GeglRectangle  *result,
+                                  gint                  level)
 {
   GeglOperationComposerClass *klass   = GEGL_OPERATION_COMPOSER_GET_CLASS (operation);
   GeglBuffer                 *input;
@@ -121,7 +124,7 @@ gegl_operation_composer_process2 (GeglOperation        *operation,
       success = done;
       if (!done)
         {
-          success = klass->process (operation, input, aux, output, result);
+          success = klass->process (operation, input, aux, output, result, context->level);
 
           if (output == GEGL_BUFFER (operation->node->cache))
             gegl_cache_computed (operation->node->cache, result);
@@ -140,7 +143,8 @@ gegl_operation_point_composer_cl_process (GeglOperation       *operation,
                                           GeglBuffer          *input,
                                           GeglBuffer          *aux,
                                           GeglBuffer          *output,
-                                          const GeglRectangle *result)
+                                          const GeglRectangle *result,
+                                          gint                 level)
 {
   const Babl *in_format  = gegl_operation_get_format (operation, "input");
   const Babl *aux_format = gegl_operation_get_format (operation, "aux");
@@ -175,7 +179,7 @@ gegl_operation_point_composer_cl_process (GeglOperation       *operation,
             for (j=0; j < i->n; j++)
               {
                 cl_err = point_composer_class->cl_process(operation, i->tex[read][j], i->tex[foo][j], i->tex[0][j],
-                                                          i->size[0][j], &i->roi[0][j]);
+                                                          i->size[0][j], &i->roi[0][j], level);
                 if (cl_err != CL_SUCCESS)
                   {
                     GEGL_NOTE (GEGL_DEBUG_OPENCL, "Error in %s [GeglOperationPointComposer] Kernel",
@@ -193,7 +197,7 @@ gegl_operation_point_composer_cl_process (GeglOperation       *operation,
             for (j=0; j < i->n; j++)
               {
                 cl_err = point_composer_class->cl_process(operation, i->tex[read][j], NULL, i->tex[0][j],
-                                                          i->size[0][j], &i->roi[0][j]);
+                                                          i->size[0][j], &i->roi[0][j], level);
                 if (cl_err != CL_SUCCESS)
                   {
                     GEGL_NOTE (GEGL_DEBUG_OPENCL, "Error in %s [GeglOperationPointComposer] Kernel",
@@ -212,7 +216,8 @@ gegl_operation_point_composer_process (GeglOperation       *operation,
                                        GeglBuffer          *input,
                                        GeglBuffer          *aux,
                                        GeglBuffer          *output,
-                                       const GeglRectangle *result)
+                                       const GeglRectangle *result,
+                                       gint                 level)
 {
   GeglOperationPointComposerClass *point_composer_class = GEGL_OPERATION_POINT_COMPOSER_GET_CLASS (operation);
   const Babl *in_format  = gegl_operation_get_format (operation, "input");
@@ -223,12 +228,12 @@ gegl_operation_point_composer_process (GeglOperation       *operation,
     {
       if (gegl_cl_is_accelerated () && point_composer_class->cl_process)
         {
-          if (gegl_operation_point_composer_cl_process (operation, input, aux, output, result))
+          if (gegl_operation_point_composer_cl_process (operation, input, aux, output, result, level))
             return TRUE;
         }
 
       {
-        GeglBufferIterator *i = gegl_buffer_iterator_new (output, result, out_format, GEGL_BUFFER_WRITE);
+        GeglBufferIterator *i = gegl_buffer_iterator_new (output, result, out_format, GEGL_BUFFER_WRITE, level);
         gint read = /*output == input ? 0 :*/ gegl_buffer_iterator_add (i, input,  result, in_format, GEGL_BUFFER_READ);
         /* using separate read and write iterators for in-place ideally a single
          * readwrite indice would be sufficient
@@ -240,14 +245,14 @@ gegl_operation_point_composer_process (GeglOperation       *operation,
 
             while (gegl_buffer_iterator_next (i))
               {
-                 point_composer_class->process (operation, i->data[read], i->data[foo], i->data[0], i->length, &(i->roi[0]));
+                 point_composer_class->process (operation, i->data[read], i->data[foo], i->data[0], i->length, &(i->roi[0]), level);
               }
           }
         else
           {
             while (gegl_buffer_iterator_next (i))
               {
-                 point_composer_class->process (operation, i->data[read], NULL, i->data[0], i->length, &(i->roi[0]));
+                 point_composer_class->process (operation, i->data[read], NULL, i->data[0], i->length, &(i->roi[0]), level);
               }
           }
       }
diff --git a/gegl/operation/gegl-operation-point-composer.h b/gegl/operation/gegl-operation-point-composer.h
index f3d9a2f..9882877 100644
--- a/gegl/operation/gegl-operation-point-composer.h
+++ b/gegl/operation/gegl-operation-point-composer.h
@@ -55,15 +55,16 @@ struct _GeglOperationPointComposerClass
                         void                *aux,
                         void                *out,
                         glong                samples, /* number of samples   */
-                        const GeglRectangle *roi      /* rectangular region in output buffer */
-                        );
+                        const GeglRectangle *roi,     /* rectangular region in output buffer */
+                        gint                 level);
 
-  cl_int   (* cl_process) (GeglOperation      *self,
-                           cl_mem             in_tex,
-                           cl_mem             aux_tex,
-                           cl_mem             out_tex,
-                           size_t             global_worksize,
-                           const GeglRectangle *roi);
+  cl_int   (* cl_process) (GeglOperation       *self,
+                           cl_mem               in_tex,
+                           cl_mem               aux_tex,
+                           cl_mem               out_tex,
+                           size_t               global_worksize,
+                           const GeglRectangle *roi,
+                           gint                 level);
   gpointer                 pad[4];
 };
 
diff --git a/gegl/operation/gegl-operation-point-composer3.c b/gegl/operation/gegl-operation-point-composer3.c
index d3771f0..fd62184 100644
--- a/gegl/operation/gegl-operation-point-composer3.c
+++ b/gegl/operation/gegl-operation-point-composer3.c
@@ -35,13 +35,15 @@ static gboolean gegl_operation_point_composer3_process
                                GeglBuffer          *aux,
                                GeglBuffer          *aux2,
                                GeglBuffer          *output,
-                               const GeglRectangle *result);
+                               const GeglRectangle *result,
+                               gint                 level);
 
 static gboolean
 gegl_operation_composer3_process2 (GeglOperation        *operation,
                                    GeglOperationContext *context,
                                    const gchar          *output_prop,
-                                   const GeglRectangle  *result);
+                                   const GeglRectangle  *result,
+                                   gint                  level);
 
 G_DEFINE_TYPE (GeglOperationPointComposer3, gegl_operation_point_composer3, GEGL_TYPE_OPERATION_COMPOSER3)
 
@@ -80,7 +82,8 @@ static gboolean
 gegl_operation_composer3_process2 (GeglOperation        *operation,
                                    GeglOperationContext *context,
                                    const gchar          *output_prop,
-                                   const GeglRectangle  *result)
+                                   const GeglRectangle  *result,
+                                   gint                  level)
 {
   GeglOperationComposer3Class *klass   = GEGL_OPERATION_COMPOSER3_GET_CLASS (operation);
   GeglBuffer                  *input;
@@ -119,7 +122,7 @@ gegl_operation_composer3_process2 (GeglOperation        *operation,
       success = done;
       if (!done)
         {
-          success = klass->process (operation, input, aux, aux2, output, result);
+          success = klass->process (operation, input, aux, aux2, output, result, context->level);
 
           if (output == GEGL_BUFFER (operation->node->cache))
             gegl_cache_computed (operation->node->cache, result);
@@ -146,7 +149,8 @@ gegl_operation_point_composer3_process (GeglOperation       *operation,
                                         GeglBuffer          *aux,
                                         GeglBuffer          *aux2,
                                         GeglBuffer          *output,
-                                        const GeglRectangle *result)
+                                        const GeglRectangle *result,
+                                        gint                 level)
 {
   GeglOperationPointComposer3Class *point_composer3_class = GEGL_OPERATION_POINT_COMPOSER3_GET_CLASS (operation);
   const Babl *in_format   = gegl_operation_get_format (operation, "input");
@@ -156,7 +160,7 @@ gegl_operation_point_composer3_process (GeglOperation       *operation,
 
   if ((result->width > 0) && (result->height > 0))
     {
-      GeglBufferIterator *i = gegl_buffer_iterator_new (output, result, out_format, GEGL_BUFFER_WRITE);
+      GeglBufferIterator *i = gegl_buffer_iterator_new (output, result, out_format, GEGL_BUFFER_WRITE, level);
       gint read  = gegl_buffer_iterator_add (i, input,  result, in_format, GEGL_BUFFER_READ);
 
       if (aux)
@@ -168,14 +172,14 @@ gegl_operation_point_composer3_process (GeglOperation       *operation,
 
               while (gegl_buffer_iterator_next (i))
                 {
-                   point_composer3_class->process (operation, i->data[read], i->data[foo], i->data[bar], i->data[0], i->length, &(i->roi[0]));
+                   point_composer3_class->process (operation, i->data[read], i->data[foo], i->data[bar], i->data[0], i->length, &(i->roi[0]), level);
                 }
             }
           else
             {
               while (gegl_buffer_iterator_next (i))
                 {
-                   point_composer3_class->process (operation, i->data[read], i->data[foo], NULL, i->data[0], i->length, &(i->roi[0]));
+                   point_composer3_class->process (operation, i->data[read], i->data[foo], NULL, i->data[0], i->length, &(i->roi[0]), level);
                 }
             }
         }
@@ -186,14 +190,14 @@ gegl_operation_point_composer3_process (GeglOperation       *operation,
               gint bar = gegl_buffer_iterator_add (i, aux2,  result, aux2_format, GEGL_BUFFER_READ);
               while (gegl_buffer_iterator_next (i))
                 {
-                   point_composer3_class->process (operation, i->data[read], NULL, i->data[bar], i->data[0], i->length, &(i->roi[0]));
+                   point_composer3_class->process (operation, i->data[read], NULL, i->data[bar], i->data[0], i->length, &(i->roi[0]), level);
                 }
             }
           else
             {
               while (gegl_buffer_iterator_next (i))
                 {
-                   point_composer3_class->process (operation, i->data[read], NULL, NULL, i->data[0], i->length, &(i->roi[0]));
+                   point_composer3_class->process (operation, i->data[read], NULL, NULL, i->data[0], i->length, &(i->roi[0]), level);
                 }
             }
         }
diff --git a/gegl/operation/gegl-operation-point-composer3.h b/gegl/operation/gegl-operation-point-composer3.h
index 057fdb3..2d6a7ad 100644
--- a/gegl/operation/gegl-operation-point-composer3.h
+++ b/gegl/operation/gegl-operation-point-composer3.h
@@ -49,8 +49,8 @@ struct _GeglOperationPointComposer3Class
                         void                *aux2,
                         void                *out,
                         glong                samples, /* number of samples   */
-                        const GeglRectangle *roi      /* rectangular region in output buffer */
-                        );
+                        const GeglRectangle *roi,     /* rectangular region in output buffer */
+                        gint                 level);
 
   gpointer           pad[4];
 };
diff --git a/gegl/operation/gegl-operation-point-filter.c b/gegl/operation/gegl-operation-point-filter.c
index 67a8da1..fb6a48d 100644
--- a/gegl/operation/gegl-operation-point-filter.c
+++ b/gegl/operation/gegl-operation-point-filter.c
@@ -39,13 +39,15 @@ static gboolean gegl_operation_point_filter_process
                               (GeglOperation       *operation,
                                GeglBuffer          *input,
                                GeglBuffer          *output,
-                               const GeglRectangle *result);
+                               const GeglRectangle *result,
+                               gint                 level);
 
 static gboolean gegl_operation_point_filter_op_process
                               (GeglOperation       *operation,
                                GeglOperationContext *context,
                                const gchar          *output_pad,
-                               const GeglRectangle  *roi);
+                               const GeglRectangle  *roi,
+                               gint                  level);
 
 G_DEFINE_TYPE (GeglOperationPointFilter, gegl_operation_point_filter, GEGL_TYPE_OPERATION_FILTER)
 
@@ -77,7 +79,8 @@ static gboolean
 gegl_operation_point_filter_cl_process (GeglOperation       *operation,
                                         GeglBuffer          *input,
                                         GeglBuffer          *output,
-                                        const GeglRectangle *result)
+                                        const GeglRectangle *result,
+                                        gint                 level)
 {
   const Babl *in_format  = gegl_operation_get_format (operation, "input");
   const Babl *out_format = gegl_operation_get_format (operation, "output");
@@ -114,7 +117,7 @@ gegl_operation_point_filter_cl_process (GeglOperation       *operation,
         for (j=0; j < i->n; j++)
           {
             cl_err = point_filter_class->cl_process(operation, i->tex[read][j], i->tex[0][j],
-                                                    i->size[0][j], &i->roi[0][j]);
+                                                    i->size[0][j], &i->roi[0][j], level);
             if (cl_err != CL_SUCCESS)
               {
                 GEGL_NOTE (GEGL_DEBUG_OPENCL, "Error in %s [GeglOperationPointFilter] Kernel",
@@ -131,7 +134,8 @@ static gboolean
 gegl_operation_point_filter_process (GeglOperation       *operation,
                                      GeglBuffer          *input,
                                      GeglBuffer          *output,
-                                     const GeglRectangle *result)
+                                     const GeglRectangle *result,
+                                     gint                 level)
 {
   const Babl *in_format  = gegl_operation_get_format (operation, "input");
   const Babl *out_format = gegl_operation_get_format (operation, "output");
@@ -143,18 +147,18 @@ gegl_operation_point_filter_process (GeglOperation       *operation,
     {
       if (gegl_cl_is_accelerated () && point_filter_class->cl_process)
         {
-          if (gegl_operation_point_filter_cl_process (operation, input, output, result))
+          if (gegl_operation_point_filter_cl_process (operation, input, output, result, level))
             return TRUE;
         }
 
       {
-        GeglBufferIterator *i = gegl_buffer_iterator_new (output, result, out_format, GEGL_BUFFER_WRITE);
+        GeglBufferIterator *i = gegl_buffer_iterator_new (output, result, out_format, GEGL_BUFFER_WRITE, level);
         gint read = /*output == input ? 0 :*/ gegl_buffer_iterator_add (i, input,  result, in_format, GEGL_BUFFER_READ);
         /* using separate read and write iterators for in-place ideally a single
          * readwrite indice would be sufficient
          */
           while (gegl_buffer_iterator_next (i))
-            point_filter_class->process (operation, i->data[read], i->data[0], i->length, &i->roi[0]);
+            point_filter_class->process (operation, i->data[read], i->data[0], i->length, &i->roi[0], level);
       }
     }
   return TRUE;
@@ -185,7 +189,8 @@ static gboolean gegl_operation_point_filter_op_process
                               (GeglOperation       *operation,
                                GeglOperationContext *context,
                                const gchar          *output_pad,
-                               const GeglRectangle  *roi)
+                               const GeglRectangle  *roi,
+                               gint                  level)
 {
   GeglBuffer               *input;
   GeglBuffer               *output;
@@ -203,7 +208,7 @@ static gboolean gegl_operation_point_filter_op_process
       output = gegl_operation_context_get_target (context, "output");
     }
 
-  success = gegl_operation_point_filter_process (operation, input, output, roi);
+  success = gegl_operation_point_filter_process (operation, input, output, roi, context->level);
   if (output == GEGL_BUFFER (operation->node->cache))
     gegl_cache_computed (operation->node->cache, roi);
 
diff --git a/gegl/operation/gegl-operation-point-filter.h b/gegl/operation/gegl-operation-point-filter.h
index 323c5a6..938da7b 100644
--- a/gegl/operation/gegl-operation-point-filter.h
+++ b/gegl/operation/gegl-operation-point-filter.h
@@ -54,16 +54,17 @@ struct _GeglOperationPointFilterClass
                         void               *in_buf,  /* input buffer      */
                         void               *out_buf, /* output buffer     */
                         glong               samples, /* number of samples */
-                        const GeglRectangle *roi);   /* rectangle out_buf spans
+                        const GeglRectangle *roi,    /* rectangle out_buf spans
                                                         in in buffer, see the
                                                         checkerboard op for
                                                         semantics */
-
-  cl_int   (* cl_process) (GeglOperation      *self,
-                           cl_mem             in_tex,
-                           cl_mem             out_tex,
-                           size_t             global_worksize,
-                           const GeglRectangle *roi);
+                        gint                 level);
+  cl_int   (* cl_process) (GeglOperation       *self,
+                           cl_mem               in_tex,
+                           cl_mem               out_tex,
+                           size_t               global_worksize,
+                           const GeglRectangle *roi,
+                           gint                 level);
   gpointer                 pad[4];
 };
 
diff --git a/gegl/operation/gegl-operation-point-render.c b/gegl/operation/gegl-operation-point-render.c
index 74ab9fb..a98aa1f 100644
--- a/gegl/operation/gegl-operation-point-render.c
+++ b/gegl/operation/gegl-operation-point-render.c
@@ -35,7 +35,8 @@
 static gboolean gegl_operation_point_render_process
                               (GeglOperation       *operation,
                                GeglBuffer          *output,
-                               const GeglRectangle *result);
+                               const GeglRectangle *result,
+                               gint                 level);
 
 G_DEFINE_TYPE (GeglOperationPointRender, gegl_operation_point_render, GEGL_TYPE_OPERATION_SOURCE)
 
@@ -77,7 +78,8 @@ gegl_operation_point_render_init (GeglOperationPointRender *self)
 static gboolean
 gegl_operation_point_render_process (GeglOperation       *operation,
                                      GeglBuffer          *output,
-                                     const GeglRectangle *result)
+                                     const GeglRectangle *result,
+                                     gint                 level)
 {
   GeglPad    *pad;
   const Babl *out_format;
@@ -95,10 +97,10 @@ gegl_operation_point_render_process (GeglOperation       *operation,
 
   if ((result->width > 0) && (result->height > 0))
     {
-      GeglBufferIterator *i = gegl_buffer_iterator_new (output, result, out_format, GEGL_BUFFER_WRITE);
+      GeglBufferIterator *i = gegl_buffer_iterator_new (output, result, out_format, GEGL_BUFFER_WRITE, level);
 
       while (gegl_buffer_iterator_next (i))
-          point_render_class->process (operation, i->data[0], i->length, &i->roi[0]);
+          point_render_class->process (operation, i->data[0], i->length, &i->roi[0], level);
     }
   return TRUE;
 }
diff --git a/gegl/operation/gegl-operation-point-render.h b/gegl/operation/gegl-operation-point-render.h
index ba7f79e..24237c3 100644
--- a/gegl/operation/gegl-operation-point-render.h
+++ b/gegl/operation/gegl-operation-point-render.h
@@ -50,7 +50,8 @@ struct _GeglOperationPointRenderClass
   gboolean (* process) (GeglOperation       *self,      /* for parameters    */
                         void                *out_buf,   /* output buffer     */
                         glong                samples,   /* number of samples */
-                        const GeglRectangle *roi);      /* can be used if position is of importance*/
+                        const GeglRectangle *roi,       /* can be used if position is of importance*/
+                        gint                 level);
   gpointer              pad[4];
 };
 
diff --git a/gegl/operation/gegl-operation-sink.c b/gegl/operation/gegl-operation-sink.c
index 7c2b995..fa4e36c 100644
--- a/gegl/operation/gegl-operation-sink.c
+++ b/gegl/operation/gegl-operation-sink.c
@@ -27,6 +27,7 @@
 #include "gegl-operation-sink.h"
 #include "graph/gegl-node.h"
 #include "graph/gegl-pad.h"
+#include "buffer/gegl-buffer-cl-cache.h"
 
 
 enum
@@ -47,7 +48,8 @@ static void          gegl_operation_sink_set_property            (GObject
 static gboolean      gegl_operation_sink_process                 (GeglOperation        *operation,
                                                                   GeglOperationContext *context,
                                                                   const gchar          *output_prop,
-                                                                  const GeglRectangle  *result);
+                                                                  const GeglRectangle  *result,
+                                                                  gint                  level);
 static void          gegl_operation_sink_attach                  (GeglOperation        *operation);
 static GeglRectangle gegl_operation_sink_get_bounding_box        (GeglOperation        *self);
 static GeglRectangle gegl_operation_sink_get_required_for_output (GeglOperation        *operation,
@@ -119,7 +121,8 @@ static gboolean
 gegl_operation_sink_process (GeglOperation        *operation,
                              GeglOperationContext *context,
                              const gchar          *output_prop,
-                             const GeglRectangle  *result)
+                             const GeglRectangle  *result,
+                             gint                  level)
 {
   GeglOperationSinkClass *klass;
   GeglBuffer             *input;
@@ -135,7 +138,7 @@ gegl_operation_sink_process (GeglOperation        *operation,
       if (gegl_cl_is_accelerated ())
         gegl_buffer_cl_cache_invalidate (input, NULL);
 
-      success = klass->process (operation, input, result);
+      success = klass->process (operation, input, result, context->level);
       g_object_unref (input);
     }
 
diff --git a/gegl/operation/gegl-operation-sink.h b/gegl/operation/gegl-operation-sink.h
index 4441f75..7012ec5 100644
--- a/gegl/operation/gegl-operation-sink.h
+++ b/gegl/operation/gegl-operation-sink.h
@@ -53,7 +53,8 @@ struct _GeglOperationSinkClass
 
   gboolean (* process) (GeglOperation       *self,
                         GeglBuffer          *input,
-                        const GeglRectangle *roi);
+                        const GeglRectangle *roi,
+                        gint                 level);
   gpointer              pad[4];
 };
 
diff --git a/gegl/operation/gegl-operation-source.c b/gegl/operation/gegl-operation-source.c
index 8a2332f..72e1150 100644
--- a/gegl/operation/gegl-operation-source.c
+++ b/gegl/operation/gegl-operation-source.c
@@ -44,10 +44,11 @@ static void     set_property (GObject      *gobject,
                               const GValue *value,
                               GParamSpec   *pspec);
 static gboolean gegl_operation_source_process
-                             (GeglOperation *operation,
+                             (GeglOperation        *operation,
                               GeglOperationContext *context,
-                              const gchar   *output_prop,
-                              const GeglRectangle *result);
+                              const gchar          *output_prop,
+                              const GeglRectangle  *result,
+                              gint                  level);
 static void     attach       (GeglOperation *operation);
 
 
@@ -120,10 +121,11 @@ set_property (GObject      *object,
 }
 
 static gboolean
-gegl_operation_source_process (GeglOperation       *operation,
-                               GeglOperationContext     *context,
-                               const gchar         *output_prop,
-                               const GeglRectangle *result)
+gegl_operation_source_process (GeglOperation        *operation,
+                               GeglOperationContext *context,
+                               const gchar          *output_prop,
+                               const GeglRectangle  *result,
+                               gint                  level)
 {
   GeglOperationSourceClass *klass = GEGL_OPERATION_SOURCE_GET_CLASS (operation);
   GeglBuffer               *output;
@@ -137,7 +139,7 @@ gegl_operation_source_process (GeglOperation       *operation,
 
   g_assert (klass->process);
   output = gegl_operation_context_get_target (context, "output");
-  success = klass->process (operation, output, result);
+  success = klass->process (operation, output, result, context->level);
 
   if (output == GEGL_BUFFER (operation->node->cache))
     gegl_cache_computed (operation->node->cache, result);
diff --git a/gegl/operation/gegl-operation-source.h b/gegl/operation/gegl-operation-source.h
index 75a2c5a..a5585c0 100644
--- a/gegl/operation/gegl-operation-source.h
+++ b/gegl/operation/gegl-operation-source.h
@@ -48,7 +48,8 @@ struct _GeglOperationSourceClass
 
   gboolean (* process) (GeglOperation       *self,
                         GeglBuffer          *output,
-                        const GeglRectangle *roi);
+                        const GeglRectangle *roi,
+                        gint                 level);
   gpointer              pad[4];
 };
 
diff --git a/gegl/operation/gegl-operation-temporal.c b/gegl/operation/gegl-operation-temporal.c
index ba5481d..655b6e6 100644
--- a/gegl/operation/gegl-operation-temporal.c
+++ b/gegl/operation/gegl-operation-temporal.c
@@ -89,7 +89,8 @@ gegl_operation_temporal_get_frame (GeglOperation *op,
 static gboolean gegl_operation_temporal_process (GeglOperation       *self,
                                                  GeglBuffer          *input,
                                                  GeglBuffer          *output,
-                                                 const GeglRectangle *result)
+                                                 const GeglRectangle *result,
+                                                 gint                 level)
 {
   GeglOperationTemporal *temporal = GEGL_OPERATION_TEMPORAL (self);
   GeglOperationTemporalPrivate *priv = temporal->priv;
@@ -112,7 +113,7 @@ static gboolean gegl_operation_temporal_process (GeglOperation       *self,
   }
 
  if (temporal_class->process)
-   return temporal_class->process (self, input, output, result);
+   return temporal_class->process (self, input, output, result, level);
  return FALSE;
 }
 
diff --git a/gegl/operation/gegl-operation-temporal.h b/gegl/operation/gegl-operation-temporal.h
index ef23747..d7058ee 100644
--- a/gegl/operation/gegl-operation-temporal.h
+++ b/gegl/operation/gegl-operation-temporal.h
@@ -51,7 +51,8 @@ struct _GeglOperationTemporalClass
   gboolean (* process) (GeglOperation       *self,
                         GeglBuffer          *input,
                         GeglBuffer          *output,
-                        const GeglRectangle *roi);
+                        const GeglRectangle *roi,
+                        gint                 level);
   gpointer              pad[4];
 };
 
diff --git a/gegl/operation/gegl-operation.c b/gegl/operation/gegl-operation.c
index a90460a..95f2e77 100644
--- a/gegl/operation/gegl-operation.c
+++ b/gegl/operation/gegl-operation.c
@@ -105,10 +105,11 @@ void gegl_node_emit_computed (GeglNode *node, const GeglRectangle *rect);
 
 
 gboolean
-gegl_operation_process (GeglOperation       *operation,
-                        GeglOperationContext     *context,
-                        const gchar         *output_pad,
-                        const GeglRectangle *result)
+gegl_operation_process (GeglOperation        *operation,
+                        GeglOperationContext *context,
+                        const gchar          *output_pad,
+                        const GeglRectangle  *result,
+                        gint                  level)
 {
   GeglOperationClass  *klass;
 
@@ -126,7 +127,7 @@ gegl_operation_process (GeglOperation       *operation,
       return TRUE;
     }
 
-  return klass->process (operation, context, output_pad, result);
+  return klass->process (operation, context, output_pad, result, level);
 }
 
 /* Calls an extending class' get_bound_box method if defined otherwise
diff --git a/gegl/operation/gegl-operation.h b/gegl/operation/gegl-operation.h
index 4f157cb..04fce64 100644
--- a/gegl/operation/gegl-operation.h
+++ b/gegl/operation/gegl-operation.h
@@ -64,6 +64,9 @@ struct _GeglOperation
 
 #define MAX_PROCESSOR 4
 
+/* the level at which is being operated is stored in the context,
+*/
+
 void gegl_operation_class_add_processor (GeglOperationClass *cclass,
                                          GCallback           process,
                                          const gchar        *string);
@@ -129,7 +132,8 @@ struct _GeglOperationClass
   gboolean      (*process)                   (GeglOperation        *operation,
                                               GeglOperationContext *context,
                                               const gchar          *output_pad,
-                                              const GeglRectangle  *roi);
+                                              const GeglRectangle  *roi,
+                                              gint                  level);
 
   /* The node providing data for a specific location within the operations
    * output. The node is responsible for delegating blame to one of it's
@@ -183,8 +187,9 @@ void            gegl_operation_attach        (GeglOperation *operation,
 void            gegl_operation_prepare       (GeglOperation *operation);
 gboolean        gegl_operation_process       (GeglOperation *operation,
                                               GeglOperationContext *context,
-                                              const gchar   *output_pad,
-                                              const GeglRectangle *roi);
+                                              const gchar          *output_pad,
+                                              const GeglRectangle  *roi,
+                                              gint                  level);
 
 /* create a pad for a specified property for this operation, this method is
  * to be called from the attach method of operations, most operations do not
diff --git a/gegl/process/gegl-eval-visitor.c b/gegl/process/gegl-eval-visitor.c
index 6ae6e45..92920ae 100644
--- a/gegl/process/gegl-eval-visitor.c
+++ b/gegl/process/gegl-eval-visitor.c
@@ -95,7 +95,7 @@ gegl_eval_visitor_visit_pad (GeglVisitor *self,
                          gegl_pad_get_name (pad), gegl_node_get_debug_name (node),
                          context->result_rect.x, context->result_rect.y, context->result_rect.width, context->result_rect.height);
               gegl_operation_process (operation, context, gegl_pad_get_name (pad),
-                                      &context->result_rect);
+                                      &context->result_rect, context->level);
               time      = gegl_ticks () - time;
 
               gegl_instrument ("process", gegl_node_get_operation (node), time);
@@ -171,7 +171,7 @@ gegl_eval_visitor_visit_pad (GeglVisitor *self,
             {
               GEGL_NOTE (GEGL_DEBUG_PROCESS, "Processing pad '%s' on \"%s\"", gegl_pad_get_name (pad), gegl_node_get_debug_name (node));
               gegl_operation_process (operation, context, "output",
-                &context->result_rect);
+                &context->result_rect, context->level);
             }
         }
     }
diff --git a/gegl/process/gegl-processor.c b/gegl/process/gegl-processor.c
index 1c69be7..772f154 100644
--- a/gegl/process/gegl-processor.c
+++ b/gegl/process/gegl-processor.c
@@ -504,8 +504,8 @@ render_rectangle (GeglProcessor *processor)
 
 
               /* copy the buffer data into the cache */
-              gegl_buffer_set (GEGL_BUFFER (cache), dr, cache->format, buf,
-                               GEGL_AUTO_ROWSTRIDE);
+              gegl_buffer_set (GEGL_BUFFER (cache), dr, 0, cache->format, buf,
+                               GEGL_AUTO_ROWSTRIDE); /* XXX: deal with the level */
 
               /* tells the cache that the rectangle (dr) has been computed */
               gegl_cache_computed (cache, dr);
@@ -784,8 +784,7 @@ gegl_processor_work (GeglProcessor *processor,
       gegl_operation_process (processor->node->operation,
                               processor->context,
                               "output"  /* ignored output_pad */,
-                              &processor->context->result_rect
-                              );
+                              &processor->context->result_rect, processor->context->level);
       gegl_node_remove_context (processor->node, cache);
       processor->context = NULL;
 
diff --git a/operations/affine/affine.c b/operations/affine/affine.c
index e17a8b3..3e1c2d3 100644
--- a/operations/affine/affine.c
+++ b/operations/affine/affine.c
@@ -71,16 +71,11 @@ static GeglRectangle gegl_affine_get_invalidated_by_change (GeglOperation
 static GeglRectangle gegl_affine_get_required_for_output   (GeglOperation        *self,
                                                             const gchar          *input_pad,
                                                             const GeglRectangle  *region);
-#if 0
-static gboolean      gegl_affine_process                   (GeglOperation       *op,
-                                                            GeglBuffer          *input,
-                                                            GeglBuffer          *output,
-                                                            const GeglRectangle *result);
-#endif
 static gboolean      gegl_affine_process                   (GeglOperation        *operation,
                                                             GeglOperationContext *context,
                                                             const gchar          *output_prop,
-                                                            const GeglRectangle  *result);
+                                                            const GeglRectangle  *result,
+                                                            gint                  level);
 static GeglNode    * gegl_affine_detect                    (GeglOperation        *operation,
                                                             gint                  x,
                                                             gint                  y);
@@ -92,11 +87,13 @@ static gboolean      gegl_affine_matrix3_allow_fast_reflect_y      (GeglMatrix3
 static void          gegl_affine_fast_reflect_x            (GeglBuffer           *dest,
                                                             GeglBuffer           *src,
                                                             const GeglRectangle  *dest_rect,
-                                                            const GeglRectangle  *src_rect);
+                                                            const GeglRectangle  *src_rect,
+                                                            gint                  level);
 static void          gegl_affine_fast_reflect_y            (GeglBuffer           *dest,
                                                             GeglBuffer           *src,
                                                             const GeglRectangle  *dest_rect,
-                                                            const GeglRectangle  *src_rect);
+                                                            const GeglRectangle  *src_rect,
+                                                            gint                  level);
 
 
 /* ************************* */
@@ -193,8 +190,6 @@ op_affine_class_init (OpAffineClass *klass)
   op_class->prepare                   = gegl_affine_prepare;
   op_class->no_cache                  = TRUE;
 
-  /*filter_class->process             = gegl_affine_process;*/
-
   klass->create_matrix = NULL;
 
   g_object_class_install_property (gobject_class, PROP_ORIGIN_X,
@@ -647,7 +642,8 @@ static void
 affine_generic (GeglBuffer  *dest,
                 GeglBuffer  *src,
                 GeglMatrix3 *matrix,
-                GeglSampler *sampler)
+                GeglSampler *sampler,
+                gint         level)
 {
   GeglBufferIterator *i;
   const GeglRectangle *dest_extent;
@@ -677,7 +673,7 @@ affine_generic (GeglBuffer  *dest,
   dest_extent = gegl_buffer_get_extent (dest);
 
 
-  i = gegl_buffer_iterator_new (dest, dest_extent, format, GEGL_BUFFER_WRITE);
+  i = gegl_buffer_iterator_new (dest, dest_extent, format, GEGL_BUFFER_WRITE, level);
   while (gegl_buffer_iterator_next (i))
     {
       GeglRectangle *roi = &i->roi[0];
@@ -762,7 +758,8 @@ static void
 gegl_affine_fast_reflect_x (GeglBuffer              *dest,
                             GeglBuffer              *src,
                             const GeglRectangle     *dest_rect,
-                            const GeglRectangle     *src_rect)
+                            const GeglRectangle     *src_rect,
+                            gint                     level)
 {
   const Babl              *format = gegl_buffer_get_format (src);
   const gint               px_size = babl_format_get_bytes_per_pixel (format),
@@ -770,7 +767,7 @@ gegl_affine_fast_reflect_x (GeglBuffer              *dest,
   gint                     i;
   guchar                  *buf = (guchar *) g_malloc (src_rect->height * rowstride);
 
-  gegl_buffer_get (src, 1.0, src_rect, format, buf, GEGL_AUTO_ROWSTRIDE);
+  gegl_buffer_get (src,  src_rect, 1.0, format, buf, GEGL_AUTO_ROWSTRIDE);
 
   for (i = 0; i < src_rect->height / 2; i++)
     {
@@ -790,7 +787,7 @@ gegl_affine_fast_reflect_x (GeglBuffer              *dest,
         }
     }
 
-  gegl_buffer_set (dest, dest_rect, format, buf, GEGL_AUTO_ROWSTRIDE);
+  gegl_buffer_set (dest, dest_rect, 0, format, buf, GEGL_AUTO_ROWSTRIDE);
   g_free (buf);
 }
 
@@ -798,7 +795,8 @@ static void
 gegl_affine_fast_reflect_y (GeglBuffer              *dest,
                             GeglBuffer              *src,
                             const GeglRectangle     *dest_rect,
-                            const GeglRectangle     *src_rect)
+                            const GeglRectangle     *src_rect,
+                            gint                     level)
 {
   const Babl              *format = gegl_buffer_get_format (src);
   const gint               px_size = babl_format_get_bytes_per_pixel (format),
@@ -806,7 +804,7 @@ gegl_affine_fast_reflect_y (GeglBuffer              *dest,
   gint                     i;
   guchar                  *buf = (guchar *) g_malloc (src_rect->height * rowstride);
 
-  gegl_buffer_get (src, 1.0, src_rect, format, buf, GEGL_AUTO_ROWSTRIDE);
+  gegl_buffer_get (src, src_rect, 1.0, format, buf, GEGL_AUTO_ROWSTRIDE);
 
   for (i = 0; i < src_rect->height; i++)
     {
@@ -835,7 +833,7 @@ gegl_affine_fast_reflect_y (GeglBuffer              *dest,
         }
     }
 
-  gegl_buffer_set (dest, dest_rect, format, buf, GEGL_AUTO_ROWSTRIDE);
+  gegl_buffer_set (dest, dest_rect, 0, format, buf, GEGL_AUTO_ROWSTRIDE);
   g_free (buf);
 }
 
@@ -843,7 +841,8 @@ static gboolean
 gegl_affine_process (GeglOperation        *operation,
                      GeglOperationContext *context,
                      const gchar          *output_prop,
-                     const GeglRectangle  *result)
+                     const GeglRectangle  *result,
+                     gint                  level)
 {
   GeglBuffer          *input;
   GeglBuffer          *output;
@@ -922,7 +921,7 @@ gegl_affine_process (GeglOperation        *operation,
       src_rect.width -= context_rect.width;
       src_rect.height -= context_rect.height;
 
-      gegl_affine_fast_reflect_x (output, input, result, &src_rect);
+      gegl_affine_fast_reflect_x (output, input, result, &src_rect, context->level);
       g_object_unref (sampler);
 
       if (input != NULL)
@@ -953,7 +952,7 @@ gegl_affine_process (GeglOperation        *operation,
       src_rect.width -= context_rect.width;
       src_rect.height -= context_rect.height;
 
-      gegl_affine_fast_reflect_y (output, input, result, &src_rect);
+      gegl_affine_fast_reflect_y (output, input, result, &src_rect, context->level);
       g_object_unref (sampler);
 
       if (input != NULL)
@@ -969,7 +968,8 @@ gegl_affine_process (GeglOperation        *operation,
 
       sampler = gegl_buffer_sampler_new (input, babl_format("RaGaBaA float"),
           gegl_sampler_type_from_string (affine->filter));
-      affine_generic (output, input, &matrix, sampler);
+      affine_generic (output, input, &matrix, sampler, context->level);
+
       g_object_unref (sampler);
 
       if (input != NULL)
diff --git a/operations/common/bilateral-filter.c b/operations/common/bilateral-filter.c
index 7ee9cbb..f0128f0 100644
--- a/operations/common/bilateral-filter.c
+++ b/operations/common/bilateral-filter.c
@@ -61,7 +61,8 @@ static gboolean
 process (GeglOperation       *operation,
          GeglBuffer          *input,
          GeglBuffer          *output,
-         const GeglRectangle *result)
+         const GeglRectangle *result,
+         gint                 level)
 {
   GeglChantO   *o = GEGL_CHANT_PROPERTIES (operation);
   GeglRectangle compute;
@@ -102,7 +103,7 @@ bilateral_filter (GeglBuffer          *src,
   src_buf = g_new0 (gfloat, src_rect->width * src_rect->height * 4);
   dst_buf = g_new0 (gfloat, dst_rect->width * dst_rect->height * 4);
 
-  gegl_buffer_get (src, 1.0, src_rect, babl_format ("RGBA float"), src_buf, GEGL_AUTO_ROWSTRIDE);
+  gegl_buffer_get (src, src_rect, 1.0, babl_format ("RGBA float"), src_buf, GEGL_AUTO_ROWSTRIDE);
 
   offset = 0;
 
@@ -157,7 +158,7 @@ bilateral_filter (GeglBuffer          *src,
           dst_buf[offset*4+u] = accumulated[u]/count;
         offset++;
       }
-  gegl_buffer_set (dst, dst_rect, babl_format ("RGBA float"), dst_buf,
+  gegl_buffer_set (dst, dst_rect, 0, babl_format ("RGBA float"), dst_buf,
                    GEGL_AUTO_ROWSTRIDE);
   g_free (src_buf);
   g_free (dst_buf);
diff --git a/operations/common/box-blur.c b/operations/common/box-blur.c
index 21f55d1..e1a0f58 100644
--- a/operations/common/box-blur.c
+++ b/operations/common/box-blur.c
@@ -135,7 +135,7 @@ hor_blur (GeglBuffer          *src,
   src_buf = g_new0 (gfloat, src_rect->width * src_rect->height * 4);
   dst_buf = g_new0 (gfloat, dst_rect->width * dst_rect->height * 4);
 
-  gegl_buffer_get (src, 1.0, src_rect, babl_format ("RaGaBaA float"), src_buf, GEGL_AUTO_ROWSTRIDE);
+  gegl_buffer_get (src, src_rect, 1.0, babl_format ("RaGaBaA float"), src_buf, GEGL_AUTO_ROWSTRIDE);
 
   offset = 0;
   for (v=0; v<dst_rect->height; v++)
@@ -157,7 +157,7 @@ hor_blur (GeglBuffer          *src,
           dst_buf [offset++] = components[i];
       }
 
-  gegl_buffer_set (dst, dst_rect, babl_format ("RaGaBaA float"), dst_buf, GEGL_AUTO_ROWSTRIDE);
+  gegl_buffer_set (dst, dst_rect, 0, babl_format ("RaGaBaA float"), dst_buf, GEGL_AUTO_ROWSTRIDE);
   g_free (src_buf);
   g_free (dst_buf);
 }
@@ -179,7 +179,7 @@ ver_blur (GeglBuffer          *src,
   src_buf = g_new0 (gfloat, src_rect->width * src_rect->height * 4);
   dst_buf = g_new0 (gfloat, dst_rect->width * dst_rect->height * 4);
 
-  gegl_buffer_get (src, 1.0, src_rect, babl_format ("RaGaBaA float"), src_buf, GEGL_AUTO_ROWSTRIDE);
+  gegl_buffer_get (src, src_rect, 1.0, babl_format ("RaGaBaA float"), src_buf, GEGL_AUTO_ROWSTRIDE);
 
   offset=0;
   for (v=0; v<dst_rect->height; v++)
@@ -201,7 +201,7 @@ ver_blur (GeglBuffer          *src,
           dst_buf [offset++] = components[c];
       }
 
-  gegl_buffer_set (dst, dst_rect, babl_format ("RaGaBaA float"), dst_buf, GEGL_AUTO_ROWSTRIDE);
+  gegl_buffer_set (dst, dst_rect, 0, babl_format ("RaGaBaA float"), dst_buf, GEGL_AUTO_ROWSTRIDE);
   g_free (src_buf);
   g_free (dst_buf);
 }
@@ -362,7 +362,8 @@ static gboolean
 process (GeglOperation       *operation,
          GeglBuffer          *input,
          GeglBuffer          *output,
-         const GeglRectangle *result)
+         const GeglRectangle *result,
+         gint                 level)
 {
   GeglRectangle rect;
   GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
diff --git a/operations/common/brightness-contrast.c b/operations/common/brightness-contrast.c
index ce8b207..c3ca018 100644
--- a/operations/common/brightness-contrast.c
+++ b/operations/common/brightness-contrast.c
@@ -75,7 +75,8 @@ process (GeglOperation       *op,
          void                *in_buf,
          void                *out_buf,
          glong                n_pixels,
-         const GeglRectangle *roi)
+         const GeglRectangle *roi,
+         gint                 level)
 {
   /* Retrieve a pointer to GeglChantO structure which contains all the
    * chanted properties
@@ -125,10 +126,11 @@ static gegl_cl_run_data *cl_data = NULL;
 /* OpenCL processing function */
 static cl_int
 cl_process (GeglOperation       *op,
-            cl_mem              in_tex,
-            cl_mem              out_tex,
-            size_t              global_worksize,
-            const GeglRectangle *roi)
+            cl_mem               in_tex,
+            cl_mem               out_tex,
+            size_t               global_worksize,
+            const GeglRectangle *roi,
+            int                  level)
 {
   /* Retrieve a pointer to GeglChantO structure which contains all the
    * chanted properties
diff --git a/operations/common/buffer-sink.c b/operations/common/buffer-sink.c
index c245846..841230e 100644
--- a/operations/common/buffer-sink.c
+++ b/operations/common/buffer-sink.c
@@ -37,7 +37,8 @@ gegl_chant_pointer (format, _("babl format"),
 static gboolean
 process (GeglOperation       *operation,
          GeglBuffer          *input,
-         const GeglRectangle *result)
+         const GeglRectangle *result,
+         gint                 level)
 {
   GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
 
diff --git a/operations/common/buffer-source.c b/operations/common/buffer-source.c
index eb103b0..c6d9304 100644
--- a/operations/common/buffer-source.c
+++ b/operations/common/buffer-source.c
@@ -55,10 +55,11 @@ get_bounding_box (GeglOperation *operation)
 }
 
 static gboolean
-process (GeglOperation       *operation,
-         GeglOperationContext     *context,
-         const gchar         *output_pad,
-         const GeglRectangle *result)
+process (GeglOperation        *operation,
+         GeglOperationContext *context,
+         const gchar          *output_pad,
+         const GeglRectangle  *result,
+         gint                  level)
 {
   GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
 
diff --git a/operations/common/c2g.c b/operations/common/c2g.c
index 093dbbd..1d56c3e 100644
--- a/operations/common/c2g.c
+++ b/operations/common/c2g.c
@@ -67,7 +67,7 @@ static void c2g (GeglBuffer          *src,
   src_buf = g_new0 (gfloat, src_rect->width * src_rect->height * 4);
   dst_buf = g_new0 (gfloat, dst_rect->width * dst_rect->height * 2);
 
-  gegl_buffer_get (src, 1.0, src_rect, babl_format ("RGBA float"), src_buf, GEGL_AUTO_ROWSTRIDE);
+  gegl_buffer_get (src, src_rect, 1.0, babl_format ("RGBA float"), src_buf, GEGL_AUTO_ROWSTRIDE);
 
   for (y=radius; y<dst_rect->height+radius; y++)
     {
@@ -122,7 +122,7 @@ static void c2g (GeglBuffer          *src,
           }
         }
     }
-  gegl_buffer_set (dst, dst_rect, babl_format ("YA float"), dst_buf, GEGL_AUTO_ROWSTRIDE);
+  gegl_buffer_set (dst, dst_rect, 0, babl_format ("YA float"), dst_buf, GEGL_AUTO_ROWSTRIDE);
   g_free (src_buf);
   g_free (dst_buf);
 }
@@ -150,7 +150,8 @@ static gboolean
 process (GeglOperation       *operation,
          GeglBuffer          *input,
          GeglBuffer          *output,
-         const GeglRectangle *result)
+         const GeglRectangle *result,
+         gint                 level)
 {
   GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
   GeglRectangle compute;
diff --git a/operations/common/checkerboard.c b/operations/common/checkerboard.c
index a0f9174..9394b07 100644
--- a/operations/common/checkerboard.c
+++ b/operations/common/checkerboard.c
@@ -58,7 +58,8 @@ static gboolean
 process (GeglOperation       *operation,
          void                *out_buf,
          glong                n_pixels,
-         const GeglRectangle *roi)
+         const GeglRectangle *roi,
+         gint                 level)
 {
   GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
   gfloat     *out_pixel = out_buf;
diff --git a/operations/common/color-temperature.c b/operations/common/color-temperature.c
index c61a9b6..fe9a88a 100644
--- a/operations/common/color-temperature.c
+++ b/operations/common/color-temperature.c
@@ -141,7 +141,8 @@ process (GeglOperation       *op,
          void                *in_buf,
          void                *out_buf,
          glong                n_pixels,
-         const GeglRectangle *roi)
+         const GeglRectangle *roi,
+         gint                 level)
 {
   GeglChantO   *o         = GEGL_CHANT_PROPERTIES (op);
   gfloat       *in_pixel  = in_buf;
@@ -192,10 +193,11 @@ static gegl_cl_run_data *cl_data = NULL;
 /* OpenCL processing function */
 static cl_int
 cl_process (GeglOperation       *op,
-            cl_mem              in_tex,
-            cl_mem              out_tex,
-            size_t              global_worksize,
-            const GeglRectangle *roi)
+            cl_mem               in_tex,
+            cl_mem               out_tex,
+            size_t               global_worksize,
+            const GeglRectangle *roi,
+            int                  level)
 {
   /* Retrieve a pointer to GeglChantO structure which contains all the
    * chanted properties
diff --git a/operations/common/color.c b/operations/common/color.c
index 87c7950..0517d20 100644
--- a/operations/common/color.c
+++ b/operations/common/color.c
@@ -46,7 +46,8 @@ static gboolean
 gegl_color_op_process (GeglOperation       *operation,
                        void                *out_buf,
                        glong                n_pixels,
-                       const GeglRectangle *roi)
+                       const GeglRectangle *roi,
+                       gint                 level)
 {
   GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
   gfloat     *out_pixel = out_buf;
diff --git a/operations/common/contrast-curve.c b/operations/common/contrast-curve.c
index 1dd6bd9..5daaca9 100644
--- a/operations/common/contrast-curve.c
+++ b/operations/common/contrast-curve.c
@@ -46,7 +46,8 @@ process (GeglOperation       *op,
          void                *in_buf,
          void                *out_buf,
          glong                samples,
-         const GeglRectangle *roi)
+         const GeglRectangle *roi,
+         gint                 level)
 {
   GeglChantO *o = GEGL_CHANT_PROPERTIES (op);
   gint        num_sampling_points;
diff --git a/operations/common/display.c b/operations/common/display.c
index 68dd982..b48c4a5 100644
--- a/operations/common/display.c
+++ b/operations/common/display.c
@@ -115,7 +115,8 @@ static gboolean
 process (GeglOperation        *operation,
          GeglOperationContext *context,
          const gchar          *output_pad,
-         const GeglRectangle  *roi)
+         const GeglRectangle  *roi,
+         gint                  level)
 {
   GeglChant   *self = GEGL_CHANT (operation);
 
diff --git a/operations/common/edge-laplace.c b/operations/common/edge-laplace.c
index 3475d0b..9ed9c0e 100644
--- a/operations/common/edge-laplace.c
+++ b/operations/common/edge-laplace.c
@@ -57,7 +57,8 @@ static gboolean
 process (GeglOperation       *operation,
          GeglBuffer          *input,
          GeglBuffer          *output,
-         const GeglRectangle *result)
+         const GeglRectangle *result,
+         gint                 level)
 {
   GeglRectangle compute;
 
@@ -132,7 +133,7 @@ edge_laplace (GeglBuffer          *src,
   temp_buf = g_new0 (gfloat, src_rect->width * src_rect->height * 4);
   dst_buf  = g_new0 (gfloat, dst_rect->width * dst_rect->height * 4);
 
-  gegl_buffer_get (src, 1.0, src_rect,
+  gegl_buffer_get (src, src_rect, 1.0,
                    babl_format ("RGBA float"), src_buf, GEGL_AUTO_ROWSTRIDE);
 
   for (y=0; y<dst_rect->height; y++)
@@ -216,7 +217,7 @@ edge_laplace (GeglBuffer          *src,
         offset++;
       }
 
-  gegl_buffer_set (dst, dst_rect, babl_format ("RGBA float"), dst_buf,
+  gegl_buffer_set (dst, dst_rect, 0, babl_format ("RGBA float"), dst_buf,
                    GEGL_AUTO_ROWSTRIDE);
   g_free (src_buf);
   g_free (temp_buf);
diff --git a/operations/common/edge-sobel.c b/operations/common/edge-sobel.c
index d9f5e22..f8d98be 100644
--- a/operations/common/edge-sobel.c
+++ b/operations/common/edge-sobel.c
@@ -69,7 +69,8 @@ static gboolean
 process (GeglOperation       *operation,
          GeglBuffer          *input,
          GeglBuffer          *output,
-         const GeglRectangle *result)
+         const GeglRectangle *result,
+         gint                 level)
 {
   GeglChantO   *o = GEGL_CHANT_PROPERTIES (operation);
   GeglRectangle compute;
@@ -107,7 +108,7 @@ edge_sobel (GeglBuffer          *src,
   src_buf = g_new0 (gfloat, src_rect->width * src_rect->height * 4);
   dst_buf = g_new0 (gfloat, dst_rect->width * dst_rect->height * 4);
 
-  gegl_buffer_get (src, 1.0, src_rect, babl_format ("RGBA float"), src_buf, GEGL_AUTO_ROWSTRIDE);
+  gegl_buffer_get (src, src_rect, 1.0, babl_format ("RGBA float"), src_buf, GEGL_AUTO_ROWSTRIDE);
 
   offset = 0;
 
@@ -175,7 +176,7 @@ edge_sobel (GeglBuffer          *src,
         offset++;
       }
 
-  gegl_buffer_set (dst, dst_rect, babl_format ("RGBA float"), dst_buf,
+  gegl_buffer_set (dst, dst_rect, 0, babl_format ("RGBA float"), dst_buf,
                    GEGL_AUTO_ROWSTRIDE);
   g_free (src_buf);
   g_free (dst_buf);
diff --git a/operations/common/exp-combine.c b/operations/common/exp-combine.c
index efb36d2..9d7706c 100644
--- a/operations/common/exp-combine.c
+++ b/operations/common/exp-combine.c
@@ -955,7 +955,7 @@ gegl_expcombine_get_exposures (GeglOperation        *operation,
       e->pixels[PIXELS_FULL]   = g_new (gfloat, full_roi->width  *
                                                 full_roi->height *
                                                 components);
-      gegl_buffer_get (buffer, 1.0, full_roi, babl_format (PAD_FORMAT),
+      gegl_buffer_get (buffer, full_roi, 1.0, babl_format (PAD_FORMAT),
                        e->pixels[PIXELS_FULL], GEGL_AUTO_ROWSTRIDE);
 
       g_return_val_if_fail (scale <= 1.0f, NULL);
@@ -967,7 +967,7 @@ gegl_expcombine_get_exposures (GeglOperation        *operation,
                                             (scaled_roi->width  *
                                              scaled_roi->height *
                                              components));
-          gegl_buffer_get (buffer, scale, scaled_roi, babl_format (PAD_FORMAT),
+          gegl_buffer_get (buffer, scaled_roi, scale, babl_format (PAD_FORMAT),
                            e->pixels[PIXELS_SCALED], GEGL_AUTO_ROWSTRIDE);
         }
 
@@ -1058,7 +1058,8 @@ static gboolean
 gegl_expcombine_process (GeglOperation        *operation,
                          GeglOperationContext *context,
                          const gchar          *output_pad,
-                         const GeglRectangle  *full_roi)
+                         const GeglRectangle  *full_roi,
+                         gint                  level)
 {
   GeglChantO *o           = GEGL_CHANT_PROPERTIES (operation);
   GeglBuffer *output      = gegl_operation_context_get_target (context,
@@ -1199,7 +1200,7 @@ gegl_expcombine_process (GeglOperation        *operation,
 #endif
 
   /* Save the HDR components to the output buffer. */
-  gegl_buffer_set (output, full_roi, babl_format (PAD_FORMAT), hdr,
+  gegl_buffer_set (output, full_roi, 0, babl_format (PAD_FORMAT), hdr,
                    GEGL_AUTO_ROWSTRIDE);
   gegl_cache_computed (gegl_node_get_cache (operation->node), full_roi);
 
diff --git a/operations/common/fattal02.c b/operations/common/fattal02.c
index abf172b..52d7931 100644
--- a/operations/common/fattal02.c
+++ b/operations/common/fattal02.c
@@ -1243,7 +1243,8 @@ static gboolean
 fattal02_process (GeglOperation       *operation,
                   GeglBuffer          *input,
                   GeglBuffer          *output,
-                  const GeglRectangle *result)
+                  const GeglRectangle *result,
+                  gint                 level)
 {
   const GeglChantO *o     = GEGL_CHANT_PROPERTIES (operation);
   gfloat            noise;
@@ -1275,11 +1276,11 @@ fattal02_process (GeglOperation       *operation,
   lum_in  = g_new (gfloat, result->width * result->height);
   lum_out = g_new (gfloat, result->width * result->height);
 
-  gegl_buffer_get (input, 1.0, result, babl_format ("Y float"),
+  gegl_buffer_get (input, result, 1.0, babl_format ("Y float"),
                    lum_in, GEGL_AUTO_ROWSTRIDE);
 
   pix = g_new (gfloat, result->width * result->height * pix_stride);
-  gegl_buffer_get (input, 1.0, result, babl_format (OUTPUT_FORMAT),
+  gegl_buffer_get (input, result, 1.0, babl_format (OUTPUT_FORMAT),
                    pix, GEGL_AUTO_ROWSTRIDE);
 
   fattal02_tonemap (lum_in, result, lum_out, o->alpha, o->beta, noise);
@@ -1291,7 +1292,7 @@ fattal02_process (GeglOperation       *operation,
                 lum_out[i / pix_stride]);
     }
 
-  gegl_buffer_set (output, result, babl_format (OUTPUT_FORMAT), pix,
+  gegl_buffer_set (output, result, 0, babl_format (OUTPUT_FORMAT), pix,
                    GEGL_AUTO_ROWSTRIDE);
   g_free (pix);
   g_free (lum_out);
diff --git a/operations/common/fractal-explorer.c b/operations/common/fractal-explorer.c
index 6fe3af6..6cf05cd 100644
--- a/operations/common/fractal-explorer.c
+++ b/operations/common/fractal-explorer.c
@@ -418,7 +418,8 @@ get_bounding_box (GeglOperation *operation)
 static gboolean
 process (GeglOperation       *operation,
          GeglBuffer          *output,
-         const GeglRectangle *result)
+         const GeglRectangle *result,
+         gint                 level)
 {
   GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
   clrmap  colormap;
@@ -444,7 +445,7 @@ process (GeglOperation       *operation,
         }
     }
 
-  gegl_buffer_set (output, NULL, babl_format ("R'G'B' u8"), buf,
+  gegl_buffer_set (output, NULL, 0, babl_format ("R'G'B' u8"), buf,
                    GEGL_AUTO_ROWSTRIDE);
   g_free (buf);
 
diff --git a/operations/common/gaussian-blur.c b/operations/common/gaussian-blur.c
index 57b986b..02aff64 100644
--- a/operations/common/gaussian-blur.c
+++ b/operations/common/gaussian-blur.c
@@ -161,7 +161,7 @@ iir_young_hor_blur (GeglBuffer          *src,
   buf = g_new0 (gfloat, src_rect->height * src_rect->width * 4);
   w   = g_new0 (gfloat, src_rect->width);
 
-  gegl_buffer_get (src, 1.0, src_rect, babl_format ("RaGaBaA float"),
+  gegl_buffer_get (src, src_rect, 1.0, babl_format ("RaGaBaA float"),
                    buf, GEGL_AUTO_ROWSTRIDE);
 
   w_len = src_rect->width;
@@ -179,7 +179,7 @@ iir_young_hor_blur (GeglBuffer          *src,
         }
     }
 
-  gegl_buffer_set (dst, src_rect, babl_format ("RaGaBaA float"),
+  gegl_buffer_set (dst, src_rect, 0.0, babl_format ("RaGaBaA float"),
                    buf, GEGL_AUTO_ROWSTRIDE);
   g_free (buf);
   g_free (w);
@@ -203,7 +203,7 @@ iir_young_ver_blur (GeglBuffer          *src,
   buf = g_new0 (gfloat, src_rect->height * src_rect->width * 4);
   w   = g_new0 (gfloat, src_rect->height);
 
-  gegl_buffer_get (src, 1.0, src_rect, babl_format ("RaGaBaA float"),
+  gegl_buffer_get (src, src_rect, 1.0, babl_format ("RaGaBaA float"),
                    buf, GEGL_AUTO_ROWSTRIDE);
 
   w_len = src_rect->height;
@@ -221,7 +221,7 @@ iir_young_ver_blur (GeglBuffer          *src,
         }
     }
 
-  gegl_buffer_set (dst, src_rect,
+  gegl_buffer_set (dst, src_rect, 0,
                    babl_format ("RaGaBaA float"), buf, GEGL_AUTO_ROWSTRIDE);
   g_free (buf);
   g_free (w);
@@ -323,7 +323,7 @@ fir_hor_blur (GeglBuffer          *src,
   src_buf = g_new0 (gfloat, src_rect->height * src_rect->width * 4);
   dst_buf = g_new0 (gfloat, dst_rect->height * dst_rect->width * 4);
 
-  gegl_buffer_get (src, 1.0, src_rect, babl_format ("RaGaBaA float"),
+  gegl_buffer_get (src, src_rect, 1.0, babl_format ("RaGaBaA float"),
                    src_buf, GEGL_AUTO_ROWSTRIDE);
 
   offset = 0;
@@ -340,7 +340,7 @@ fir_hor_blur (GeglBuffer          *src,
                                                           matrix_length);
       }
 
-  gegl_buffer_set (dst, dst_rect, babl_format ("RaGaBaA float"),
+  gegl_buffer_set (dst, dst_rect, 0.0, babl_format ("RaGaBaA float"),
                    dst_buf, GEGL_AUTO_ROWSTRIDE);
   g_free (src_buf);
   g_free (dst_buf);
@@ -368,7 +368,7 @@ fir_ver_blur (GeglBuffer          *src,
   src_buf = g_new0 (gfloat, src_rect->width * src_rect->height * 4);
   dst_buf = g_new0 (gfloat, dst_rect->width * dst_rect->height * 4);
 
-  gegl_buffer_get (src, 1.0, src_rect, babl_format ("RaGaBaA float"),
+  gegl_buffer_get (src, src_rect, 1.0, babl_format ("RaGaBaA float"),
                    src_buf, GEGL_AUTO_ROWSTRIDE);
 
   offset=0;
@@ -385,7 +385,7 @@ fir_ver_blur (GeglBuffer          *src,
                                                           matrix_length);
       }
 
-  gegl_buffer_set (dst, dst_rect, babl_format ("RaGaBaA float"),
+  gegl_buffer_set (dst, dst_rect, 0, babl_format ("RaGaBaA float"),
                    dst_buf, GEGL_AUTO_ROWSTRIDE);
   g_free (src_buf);
   g_free (dst_buf);
@@ -417,7 +417,8 @@ static gboolean
 process (GeglOperation       *operation,
          GeglBuffer          *input,
          GeglBuffer          *output,
-         const GeglRectangle *result)
+         const GeglRectangle *result,
+         gint                 level)
 {
   GeglRectangle rect;
   GeglBuffer *temp;
diff --git a/operations/common/gegl-buffer-load-op.c b/operations/common/gegl-buffer-load-op.c
index afffdca..7454908 100644
--- a/operations/common/gegl-buffer-load-op.c
+++ b/operations/common/gegl-buffer-load-op.c
@@ -59,7 +59,8 @@ static gboolean
 gegl_buffer_load_op_process (GeglOperation        *operation,
                              GeglOperationContext *context,
                              const gchar          *output_pad,
-                             const GeglRectangle  *result)
+                             const GeglRectangle  *result,
+                             gint                  level)
 {
   GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
 
diff --git a/operations/common/gegl-buffer-save-op.c b/operations/common/gegl-buffer-save-op.c
index 55b88ae..bc7240a 100644
--- a/operations/common/gegl-buffer-save-op.c
+++ b/operations/common/gegl-buffer-save-op.c
@@ -34,7 +34,8 @@ gegl_chant_file_path (path, _("File"), "/tmp/gegl-buffer.gegl", _("Target file p
 static gboolean
 gegl_buffer_save_op_process (GeglOperation       *operation,
                              GeglBuffer          *input,
-                             const GeglRectangle *result)
+                             const GeglRectangle *result,
+                             gint                 level)
 {
   GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
 
diff --git a/operations/common/grey.c b/operations/common/grey.c
index bcda3cc..753ccf2 100644
--- a/operations/common/grey.c
+++ b/operations/common/grey.c
@@ -46,7 +46,8 @@ process (GeglOperation       *op,
          void                *in_buf,
          void                *out_buf,
          glong                samples,
-         const GeglRectangle *roi)
+         const GeglRectangle *roi,
+         gint                 level)
 {
   float *in = in_buf;
   float *out = out_buf;
diff --git a/operations/common/grid.c b/operations/common/grid.c
index 8fe89c2..efa177b 100644
--- a/operations/common/grid.c
+++ b/operations/common/grid.c
@@ -59,7 +59,8 @@ static gboolean
 process (GeglOperation       *operation,
          void                *out_buf,
          glong                n_pixels,
-         const GeglRectangle *roi)
+         const GeglRectangle *roi,
+         gint                 level)
 {
   GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
   gfloat     *out_pixel = out_buf;
diff --git a/operations/common/introspect.c b/operations/common/introspect.c
index ad39a4b..6a75369 100644
--- a/operations/common/introspect.c
+++ b/operations/common/introspect.c
@@ -123,7 +123,8 @@ static gboolean
 gegl_introspect_process (GeglOperation        *operation,
                          GeglOperationContext *context,
                          const gchar          *output_pad,
-                         const GeglRectangle  *result)
+                         const GeglRectangle  *result,
+                         gint                  level)
 {
   GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
 
diff --git a/operations/common/invert.c b/operations/common/invert.c
index 448a45c..f300b85 100644
--- a/operations/common/invert.c
+++ b/operations/common/invert.c
@@ -37,7 +37,8 @@ process (GeglOperation       *op,
          void                *in_buf,
          void                *out_buf,
          glong                samples,
-         const GeglRectangle *roi)
+         const GeglRectangle *roi,
+         gint                 level)
 {
   glong   i;
   gfloat *in  = in_buf;
@@ -79,10 +80,11 @@ static gegl_cl_run_data *cl_data = NULL;
 /* OpenCL processing function */
 static cl_int
 cl_process (GeglOperation       *op,
-            cl_mem              in_tex,
-            cl_mem              out_tex,
-            size_t              global_worksize,
-            const GeglRectangle *roi)
+            cl_mem               in_tex,
+            cl_mem               out_tex,
+            size_t               global_worksize,
+            const GeglRectangle *roi,
+            int                  level)
 {
   cl_int cl_err = 0;
 
diff --git a/operations/common/levels.c b/operations/common/levels.c
index 1ff37fc..0410dc4 100644
--- a/operations/common/levels.c
+++ b/operations/common/levels.c
@@ -47,7 +47,8 @@ process (GeglOperation       *op,
          void                *in_buf,
          void                *out_buf,
          glong                n_pixels,
-         const GeglRectangle *roi)
+         const GeglRectangle *roi,
+         gint                 level)
 {
   GeglChantO *o = GEGL_CHANT_PROPERTIES (op);
   gfloat     *in_pixel;
diff --git a/operations/common/magick-load.c b/operations/common/magick-load.c
index c3caa22..6055410 100644
--- a/operations/common/magick-load.c
+++ b/operations/common/magick-load.c
@@ -87,10 +87,11 @@ get_cached_region (GeglOperation *operation,
 }
 
 static gboolean
-process (GeglOperation       *operation,
-         GeglOperationContext     *context,
-         const gchar         *output_pad,
-         const GeglRectangle *result)
+process (GeglOperation         *operation,
+         GeglOperationContext  *context,
+         const gchar           *output_pad,
+         const GeglRectangle   *result,
+         gint                   level)
 {
   GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
 
diff --git a/operations/common/mantiuk06.c b/operations/common/mantiuk06.c
index 9dc91e8..5d72eed 100644
--- a/operations/common/mantiuk06.c
+++ b/operations/common/mantiuk06.c
@@ -1576,9 +1576,10 @@ mantiuk06_get_cached_region (GeglOperation        *operation,
 
 static gboolean
 mantiuk06_process (GeglOperation       *operation,
-                    GeglBuffer          *input,
-                    GeglBuffer          *output,
-                    const GeglRectangle *result)
+                   GeglBuffer          *input,
+                   GeglBuffer          *output,
+                   const GeglRectangle *result,
+                   gint                 level)
 {
   const GeglChantO *o          = GEGL_CHANT_PROPERTIES (operation);
   const gint        pix_stride = 4; /* RGBA */
@@ -1594,18 +1595,18 @@ mantiuk06_process (GeglOperation       *operation,
 
   /* Obtain the pixel data */
   lum = g_new (gfloat, result->width * result->height),
-  gegl_buffer_get (input, 1.0, result, babl_format ("Y float"),
+  gegl_buffer_get (input, result, 1.0, babl_format ("Y float"),
                    lum, GEGL_AUTO_ROWSTRIDE);
 
   pix = g_new (gfloat, result->width * result->height * pix_stride);
-  gegl_buffer_get (input, 1.0, result, babl_format (OUTPUT_FORMAT),
+  gegl_buffer_get (input, result, 1.0, babl_format (OUTPUT_FORMAT),
                    pix, GEGL_AUTO_ROWSTRIDE);
 
   mantiuk06_contmap (result->width, result->height, pix, lum,
                      o->contrast, o->saturation, FALSE, 200, 1e-3, NULL);
 
   /* Cleanup and set the output */
-  gegl_buffer_set (output, result, babl_format (OUTPUT_FORMAT), pix,
+  gegl_buffer_set (output, result, 0, babl_format (OUTPUT_FORMAT), pix,
                    GEGL_AUTO_ROWSTRIDE);
   g_free (pix);
   g_free (lum);
diff --git a/operations/common/map-absolute.c b/operations/common/map-absolute.c
index 72a9340..736cec3 100644
--- a/operations/common/map-absolute.c
+++ b/operations/common/map-absolute.c
@@ -57,7 +57,8 @@ process (GeglOperation       *operation,
          GeglBuffer          *input,
          GeglBuffer          *aux,
          GeglBuffer          *output,
-         const GeglRectangle *result)
+         const GeglRectangle *result,
+         gint                 level)
 {
   GeglChantO           *o = GEGL_CHANT_PROPERTIES (operation);
   const Babl           *format_io, *format_coords;
@@ -72,7 +73,7 @@ process (GeglOperation       *operation,
 
   if (aux != NULL)
     {
-      it = gegl_buffer_iterator_new (output, result, format_io, GEGL_BUFFER_WRITE);
+      it = gegl_buffer_iterator_new (output, result, format_io, GEGL_BUFFER_WRITE, level);
       index_out = 0;
 
       index_coords = gegl_buffer_iterator_add (it, aux, result, format_coords, GEGL_BUFFER_READ);
diff --git a/operations/common/map-relative.c b/operations/common/map-relative.c
index 0b79845..3d9f436 100644
--- a/operations/common/map-relative.c
+++ b/operations/common/map-relative.c
@@ -61,7 +61,8 @@ process (GeglOperation       *operation,
          GeglBuffer          *input,
          GeglBuffer          *aux,
          GeglBuffer          *output,
-         const GeglRectangle *result)
+         const GeglRectangle *result,
+         gint                 level)
 {
   GeglChantO           *o = GEGL_CHANT_PROPERTIES (operation);
   const Babl           *format_io, *format_coords;
@@ -76,7 +77,7 @@ process (GeglOperation       *operation,
 
   if (aux != NULL)
     {
-      it = gegl_buffer_iterator_new (output, result, format_io, GEGL_BUFFER_WRITE);
+      it = gegl_buffer_iterator_new (output, result, format_io, GEGL_BUFFER_WRITE, level);
       index_out = 0;
 
       index_coords = gegl_buffer_iterator_add (it, aux, result, format_coords, GEGL_BUFFER_READ);
diff --git a/operations/common/matting-global.c b/operations/common/matting-global.c
index 69127b2..96a0837 100644
--- a/operations/common/matting-global.c
+++ b/operations/common/matting-global.c
@@ -372,7 +372,9 @@ matting_process (GeglOperation       *operation,
                  GeglBuffer          *input_buf,
                  GeglBuffer          *aux_buf,
                  GeglBuffer          *output_buf,
-                 const GeglRectangle *result) {
+                 const GeglRectangle *result,
+                 int                  level)
+{
 
   //const GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
   gfloat           *input   = NULL;
@@ -402,8 +404,8 @@ matting_process (GeglOperation       *operation,
   trimap = g_new (guchar, w * h * COMPONENTS_AUX);
   output = g_new0 (gfloat, w * h * COMPONENTS_OUTPUT);
 
-  gegl_buffer_get (input_buf, 1.0, result, babl_format (FORMAT_INPUT), input, GEGL_AUTO_ROWSTRIDE);
-  gegl_buffer_get (  aux_buf, 1.0, result, babl_format (FORMAT_AUX),  trimap, GEGL_AUTO_ROWSTRIDE);
+  gegl_buffer_get (input_buf, result, 1.0, babl_format (FORMAT_INPUT), input, GEGL_AUTO_ROWSTRIDE);
+  gegl_buffer_get (  aux_buf, result, 1.0, babl_format (FORMAT_AUX),  trimap, GEGL_AUTO_ROWSTRIDE);
 
   foreground_samples = g_array_new(FALSE, FALSE, sizeof(ColorSample));
   background_samples = g_array_new(FALSE, FALSE, sizeof(ColorSample));
@@ -521,7 +523,7 @@ matting_process (GeglOperation       *operation,
     }
   }
 
-  gegl_buffer_set (output_buf, result, babl_format (FORMAT_OUTPUT), output,
+  gegl_buffer_set (output_buf, result, 0, babl_format (FORMAT_OUTPUT), output,
                    GEGL_AUTO_ROWSTRIDE);
   success = TRUE;
   g_free (input);
diff --git a/operations/common/mblur.c b/operations/common/mblur.c
index 3f4b774..6464e96 100644
--- a/operations/common/mblur.c
+++ b/operations/common/mblur.c
@@ -61,7 +61,8 @@ static gboolean
 process (GeglOperation       *operation,
          GeglBuffer          *input,
          GeglBuffer          *output,
-         const GeglRectangle *result)
+         const GeglRectangle *result,
+         gint                 level)
 {
   GeglChantO          *o;
   Priv *p;
@@ -83,8 +84,8 @@ process (GeglOperation       *operation,
         gfloat *acc = g_new (gfloat, pixels * 4);
         gfloat dampness;
         gint i;
-        gegl_buffer_get (p->acc, 1.0, result, babl_format ("RGBA float"), acc, GEGL_AUTO_ROWSTRIDE);
-        gegl_buffer_get (temp_in, 1.0, result, babl_format ("RGBA float"), buf, GEGL_AUTO_ROWSTRIDE);
+        gegl_buffer_get (p->acc, result, 1.0, babl_format ("RGBA float"), acc, GEGL_AUTO_ROWSTRIDE);
+        gegl_buffer_get (temp_in, result, 1.0, babl_format ("RGBA float"), buf, GEGL_AUTO_ROWSTRIDE);
         dampness = o->dampness;
         for (i=0;i<pixels;i++)
           {
@@ -92,8 +93,8 @@ process (GeglOperation       *operation,
             for (c=0;c<4;c++)
               acc[i*4+c]=acc[i*4+c]*dampness + buf[i*4+c]*(1.0-dampness);
           }
-        gegl_buffer_set (p->acc, result, babl_format ("RGBA float"), acc, GEGL_AUTO_ROWSTRIDE);
-        gegl_buffer_set (output, result, babl_format ("RGBA float"), acc, GEGL_AUTO_ROWSTRIDE);
+        gegl_buffer_set (p->acc, result, 0, babl_format ("RGBA float"), acc, GEGL_AUTO_ROWSTRIDE);
+        gegl_buffer_set (output, result, 0, babl_format ("RGBA float"), acc, GEGL_AUTO_ROWSTRIDE);
         g_free (buf);
         g_free (acc);
       }
diff --git a/operations/common/mirrors.c b/operations/common/mirrors.c
index 04c6c69..405e2cc 100644
--- a/operations/common/mirrors.c
+++ b/operations/common/mirrors.c
@@ -250,7 +250,7 @@ apply_mirror (double               mirror_angle,
     gegl_buffer_sample_cleanup(src);
 
   /* Store dst pixels. */
-  gegl_buffer_set (dst, roi, format, dst_buf, GEGL_AUTO_ROWSTRIDE);
+  gegl_buffer_set (dst, roi, 0, format, dst_buf, GEGL_AUTO_ROWSTRIDE);
 
   gegl_buffer_flush(dst);
 
@@ -349,7 +349,8 @@ static gboolean
 process (GeglOperation       *operation,
          GeglBuffer          *input,
          GeglBuffer          *output,
-         const GeglRectangle *result)
+         const GeglRectangle *result,
+         gint                 level)
 {
   GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
   GeglRectangle boundary = gegl_operation_get_bounding_box (operation);
diff --git a/operations/common/mono-mixer.c b/operations/common/mono-mixer.c
index 6b29003..2973155 100644
--- a/operations/common/mono-mixer.c
+++ b/operations/common/mono-mixer.c
@@ -45,7 +45,8 @@ static gboolean
 process (GeglOperation       *operation,
          GeglBuffer          *input,
          GeglBuffer          *output,
-         const GeglRectangle *result)
+         const GeglRectangle *result,
+         gint                 level)
 {
   GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
   gfloat      red   = o->red;
@@ -63,7 +64,7 @@ process (GeglOperation       *operation,
      in_buf = g_new (gfloat, 4 * num_pixels);
      out_buf = g_new (gfloat, 2 * num_pixels);
 
-     gegl_buffer_get (input, 1.0, result, babl_format ("RGBA float"), in_buf, GEGL_AUTO_ROWSTRIDE);
+     gegl_buffer_get (input, result, 1.0, babl_format ("RGBA float"), in_buf, GEGL_AUTO_ROWSTRIDE);
 
      in_pixel = in_buf;
      out_pixel = out_buf;
@@ -76,7 +77,7 @@ process (GeglOperation       *operation,
          out_pixel += 2;
      }
 
-     gegl_buffer_set (output, result, babl_format ("YA float"), out_buf,
+     gegl_buffer_set (output, result, 0, babl_format ("YA float"), out_buf,
                       GEGL_AUTO_ROWSTRIDE);
 
      g_free (in_buf);
diff --git a/operations/common/motion-blur.c b/operations/common/motion-blur.c
index 9afb30b..454d8fb 100644
--- a/operations/common/motion-blur.c
+++ b/operations/common/motion-blur.c
@@ -72,7 +72,8 @@ static gboolean
 process (GeglOperation       *operation,
          GeglBuffer          *input,
          GeglBuffer          *output,
-         const GeglRectangle *roi)
+         const GeglRectangle *roi,
+         gint                 level)
 {
   GeglRectangle src_rect;
   GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
@@ -100,7 +101,7 @@ process (GeglOperation       *operation,
   out_buf = g_new0 (gfloat, roi->width * roi->height * 4);
   out_pixel = out_buf;
 
-  gegl_buffer_get (input, 1.0, &src_rect, babl_format ("RaGaBaA float"), in_buf, GEGL_AUTO_ROWSTRIDE);
+  gegl_buffer_get (input, &src_rect, 1.0, babl_format ("RaGaBaA float"), in_buf, GEGL_AUTO_ROWSTRIDE);
 
   for (y=0; y<roi->height; ++y)
     {
@@ -145,7 +146,7 @@ process (GeglOperation       *operation,
         }
     }
 
-  gegl_buffer_set (output, roi, babl_format ("RaGaBaA float"), out_buf, GEGL_AUTO_ROWSTRIDE);
+  gegl_buffer_set (output, roi, 0, babl_format ("RaGaBaA float"), out_buf, GEGL_AUTO_ROWSTRIDE);
 
   g_free (in_buf);
   g_free (out_buf);
diff --git a/operations/common/noise-reduction.c b/operations/common/noise-reduction.c
index 5ef4a52..867eab7 100644
--- a/operations/common/noise-reduction.c
+++ b/operations/common/noise-reduction.c
@@ -150,7 +150,8 @@ static gboolean
 process (GeglOperation       *operation,
          GeglBuffer          *input,
          GeglBuffer          *output,
-         const GeglRectangle *result)
+         const GeglRectangle *result,
+         gint                 level)
 {
   GeglChantO   *o = GEGL_CHANT_PROPERTIES (operation);
   int iteration;
@@ -176,7 +177,7 @@ process (GeglOperation       *operation,
     rect.y      -= o->iterations;
     rect.width  += o->iterations*2;
     rect.height += o->iterations*2;
-    gegl_buffer_get (input, 1.0, &rect, babl_format ("R'G'B'A float"),
+    gegl_buffer_get (input, &rect, 1.0, babl_format ("R'G'B'A float"),
                      src_buf, stride * 4 * 4);
   }
 
@@ -200,7 +201,7 @@ process (GeglOperation       *operation,
 #endif
     }
 
-  gegl_buffer_set (output , result, babl_format ("R'G'B'A float"),
+  gegl_buffer_set (output, result, 0, babl_format ("R'G'B'A float"),
 #ifndef INPLACE
                    src_buf,
 #else
diff --git a/operations/common/noise.c b/operations/common/noise.c
index 26b5f65..a5cedc1 100644
--- a/operations/common/noise.c
+++ b/operations/common/noise.c
@@ -54,7 +54,8 @@ static gboolean
 process (GeglOperation       *operation,
          void                *out_buf,
          glong                n_pixels,
-         const GeglRectangle *roi)
+         const GeglRectangle *roi,
+         gint                 level)
 {
   GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
   gfloat     *out_pixel = out_buf;
diff --git a/operations/common/opacity.c b/operations/common/opacity.c
index 19f5f2a..d9f7a81 100644
--- a/operations/common/opacity.c
+++ b/operations/common/opacity.c
@@ -45,7 +45,8 @@ process (GeglOperation       *op,
          void                *aux_buf,
          void                *out_buf,
          glong                samples,
-         const GeglRectangle *roi)
+         const GeglRectangle *roi,
+         gint                 level)
 {
   gfloat *in = in_buf;
   gfloat *out = out_buf;
@@ -121,11 +122,12 @@ static gegl_cl_run_data *cl_data = NULL;
 /* OpenCL processing function */
 static cl_int
 cl_process (GeglOperation       *op,
-            cl_mem              in_tex,
-            cl_mem              aux_tex,
-            cl_mem              out_tex,
-            size_t              global_worksize,
-            const GeglRectangle *roi)
+            cl_mem               in_tex,
+            cl_mem               aux_tex,
+            cl_mem               out_tex,
+            size_t               global_worksize,
+            const GeglRectangle *roi,
+            gint                 level)
 {
   gfloat value = GEGL_CHANT_PROPERTIES (op)->value;
 
@@ -175,7 +177,8 @@ cl_process (GeglOperation       *op,
 static gboolean operation_process (GeglOperation        *operation,
                                    GeglOperationContext *context,
                                    const gchar          *output_prop,
-                                   const GeglRectangle  *result)
+                                   const GeglRectangle  *result,
+                                   gint                  level)
 {
   GeglOperationClass  *operation_class;
   gpointer in, aux;
@@ -194,7 +197,8 @@ static gboolean operation_process (GeglOperation        *operation,
   /* chain up, which will create the needed buffers for our actual
    * process function
    */
-  return operation_class->process (operation, context, output_prop, result);
+  return operation_class->process (operation, context, output_prop, result, 
+                                  gegl_operation_context_get_level (context));
 }
 
 
diff --git a/operations/common/open-buffer.c b/operations/common/open-buffer.c
index e75105a..2293ece 100644
--- a/operations/common/open-buffer.c
+++ b/operations/common/open-buffer.c
@@ -73,10 +73,10 @@ get_cached_region (GeglOperation       *self,
 }
 
 static gboolean
-process (GeglOperation       *operation,
-         GeglOperationContext     *context,
-         const gchar         *output_pad,
-         const GeglRectangle *result)
+process (GeglOperation           *operation,
+         GeglOperationContext  *context,
+         const gchar           *output_pad,
+         const GeglRectangle   *result)
 {
   GeglBuffer *buffer = ensure_buffer (operation);
 
diff --git a/operations/common/over.c b/operations/common/over.c
index 0e21b40..f0a8f62 100644
--- a/operations/common/over.c
+++ b/operations/common/over.c
@@ -41,12 +41,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)
+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 aux = aux_buf;
@@ -89,11 +90,12 @@ static gegl_cl_run_data *cl_data = NULL;
 
 static cl_int
 cl_process (GeglOperation       *op,
-            cl_mem              in_tex,
-            cl_mem              aux_tex,
-            cl_mem              out_tex,
-            size_t              global_worksize,
-            const GeglRectangle *roi)
+            cl_mem               in_tex,
+            cl_mem               aux_tex,
+            cl_mem               out_tex,
+            size_t               global_worksize,
+            const GeglRectangle *roi,
+            gint                 level)
 {
   /* Retrieve a pointer to GeglChantO structure which contains all the
    * chanted properties
@@ -130,7 +132,8 @@ cl_process (GeglOperation       *op,
 static gboolean operation_process (GeglOperation        *operation,
                                    GeglOperationContext *context,
                                    const gchar          *output_prop,
-                                   const GeglRectangle  *result)
+                                   const GeglRectangle  *result,
+                                   gint                  level)
 {
   GeglOperationClass  *operation_class;
   gpointer input, aux;
@@ -169,7 +172,7 @@ static gboolean operation_process (GeglOperation        *operation,
   /* chain up, which will create the needed buffers for our actual
    * process function
    */
-  return operation_class->process (operation, context, output_prop, result);
+  return operation_class->process (operation, context, output_prop, result, level);
 }
 
 static void
diff --git a/operations/common/pixelise.c b/operations/common/pixelise.c
index 664a41d..610beed 100644
--- a/operations/common/pixelise.c
+++ b/operations/common/pixelise.c
@@ -134,7 +134,8 @@ static gboolean
 process (GeglOperation       *operation,
          GeglBuffer          *input,
          GeglBuffer          *output,
-         const GeglRectangle *roi)
+         const GeglRectangle *roi,
+         gint                 level)
 {
   GeglRectangle src_rect;
   GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
@@ -150,11 +151,11 @@ process (GeglOperation       *operation,
 
   buf = g_new0 (gfloat, src_rect.width * src_rect.height * 4);
 
-  gegl_buffer_get (input, 1.0, &src_rect, babl_format ("RaGaBaA float"), buf, GEGL_AUTO_ROWSTRIDE);
+  gegl_buffer_get (input, &src_rect, 1.0, babl_format ("RaGaBaA float"), buf, GEGL_AUTO_ROWSTRIDE);
 
   pixelise(buf, roi, o->xsize, o->ysize);
 
-  gegl_buffer_set (output, roi, babl_format ("RaGaBaA float"), buf, GEGL_AUTO_ROWSTRIDE);
+  gegl_buffer_set (output, roi, 0, babl_format ("RaGaBaA float"), buf, GEGL_AUTO_ROWSTRIDE);
 
   g_free (buf);
 
diff --git a/operations/common/raw-load.c b/operations/common/raw-load.c
index 334a041..14547bf 100644
--- a/operations/common/raw-load.c
+++ b/operations/common/raw-load.c
@@ -90,6 +90,7 @@ load_buffer (GeglChantO *op_raw_load)
            fread (buf, 1, width * height * 3 * 2, pfp);
            gegl_buffer_set (GEGL_BUFFER (op_raw_load->chant_data),
                             NULL,
+                            0,
                             babl_format_new (
                                         babl_model ("RGB"),
                                         babl_type ("u16"),
@@ -124,10 +125,11 @@ get_bounding_box (GeglOperation *operation)
 }
 
 static gboolean
-process (GeglOperation       *operation,
-         GeglOperationContext     *context,
-         const gchar         *output_pad,
-         const GeglRectangle *result)
+process (GeglOperation         *operation,
+         GeglOperationContext  *context,
+         const gchar           *output_pad,
+         const GeglRectangle   *result,
+         gint                   level)
 {
   GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
   GeglBuffer *output;
diff --git a/operations/common/reinhard05.c b/operations/common/reinhard05.c
index 7b6931e..b2aefa7 100644
--- a/operations/common/reinhard05.c
+++ b/operations/common/reinhard05.c
@@ -120,7 +120,8 @@ static gboolean
 reinhard05_process (GeglOperation       *operation,
                     GeglBuffer          *input,
                     GeglBuffer          *output,
-                    const GeglRectangle *result)
+                    const GeglRectangle *result,
+                    gint                 level)
 {
   const GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
 
@@ -157,11 +158,11 @@ reinhard05_process (GeglOperation       *operation,
 
   /* Obtain the pixel data */
   lum = g_new (gfloat, result->width * result->height),
-  gegl_buffer_get (input, 1.0, result, babl_format ("Y float"),
+  gegl_buffer_get (input, result, 1.0, babl_format ("Y float"),
                    lum, GEGL_AUTO_ROWSTRIDE);
 
   pix = g_new (gfloat, result->width * result->height * pix_stride);
-  gegl_buffer_get (input, 1.0, result, babl_format (OUTPUT_FORMAT),
+  gegl_buffer_get (input, result, 1.0, babl_format (OUTPUT_FORMAT),
                    pix, GEGL_AUTO_ROWSTRIDE);
 
   /* Collect the image stats, averages, etc */
@@ -240,7 +241,7 @@ reinhard05_process (GeglOperation       *operation,
     }
 
   /* Cleanup and set the output */
-  gegl_buffer_set (output, result, babl_format (OUTPUT_FORMAT), pix,
+  gegl_buffer_set (output, result, 0, babl_format (OUTPUT_FORMAT), pix,
                    GEGL_AUTO_ROWSTRIDE);
   g_free (pix);
   g_free (lum);
diff --git a/operations/common/remap.c b/operations/common/remap.c
index beb30cd..7c1ef53 100644
--- a/operations/common/remap.c
+++ b/operations/common/remap.c
@@ -48,7 +48,8 @@ process (GeglOperation        *op,
           void                *max_buf,
           void                *out_buf,
           glong                n_pixels,
-          const GeglRectangle *roi)
+          const GeglRectangle *roi,
+          gint                 level)
 {
   gint i;
   gfloat *in = in_buf;
diff --git a/operations/common/save.c b/operations/common/save.c
index b2fa013..ffb5df0 100644
--- a/operations/common/save.c
+++ b/operations/common/save.c
@@ -146,7 +146,8 @@ static gboolean
 gegl_save_process (GeglOperation        *operation,
                    GeglOperationContext *context,
                    const gchar          *output_pad,
-                   const GeglRectangle  *roi)
+                   const GeglRectangle  *roi,
+                   gint                  level)
 {
   GeglChant *self = GEGL_CHANT (operation);
   gegl_save_set_saver (operation);
diff --git a/operations/common/snn-mean.c b/operations/common/snn-mean.c
index 6d8c57d..1f0ec88 100644
--- a/operations/common/snn-mean.c
+++ b/operations/common/snn-mean.c
@@ -58,7 +58,8 @@ static gboolean
 process (GeglOperation       *operation,
          GeglBuffer          *input,
          GeglBuffer          *output,
-         const GeglRectangle *result)
+         const GeglRectangle *result,
+         gint                 level)
 {
   GeglChantO          *o = GEGL_CHANT_PROPERTIES (operation);
   GeglBuffer          *temp_in;
@@ -122,7 +123,7 @@ snn_mean (GeglBuffer          *src,
   src_buf = g_new0 (gfloat, gegl_buffer_get_pixel_count (src) * 4);
   dst_buf = g_new0 (gfloat, dst_rect->width * dst_rect->height * 4);
 
-  gegl_buffer_get (src, 1.0, NULL, babl_format ("RGBA float"), src_buf, GEGL_AUTO_ROWSTRIDE);
+  gegl_buffer_get (src, NULL, 1.0, babl_format ("RGBA float"), src_buf, GEGL_AUTO_ROWSTRIDE);
 
   offset = 0;
 
@@ -201,7 +202,7 @@ snn_mean (GeglBuffer          *src,
           center_pix += 4;
         }
     }
-  gegl_buffer_set (dst, dst_rect, babl_format ("RGBA float"), dst_buf,
+  gegl_buffer_set (dst, dst_rect, 0, babl_format ("RGBA float"), dst_buf,
                    GEGL_AUTO_ROWSTRIDE);
   g_free (src_buf);
   g_free (dst_buf);
diff --git a/operations/common/stress.c b/operations/common/stress.c
index cd840d4..d052ab2 100644
--- a/operations/common/stress.c
+++ b/operations/common/stress.c
@@ -79,7 +79,7 @@ static void stress (GeglBuffer          *src,
   src_buf = g_new0 (gfloat, src_rect->width * src_rect->height * 4);
   dst_buf = g_new0 (gfloat, dst_rect->width * dst_rect->height * 4);
 
-  gegl_buffer_get (src, 1.0, src_rect, babl_format ("RGBA float"), src_buf, GEGL_AUTO_ROWSTRIDE);
+  gegl_buffer_get (src, src_rect, 1.0, babl_format ("RGBA float"), src_buf, GEGL_AUTO_ROWSTRIDE);
 
   for (y=radius; y<dst_rect->height+radius; y++)
     {
@@ -119,7 +119,7 @@ static void stress (GeglBuffer          *src,
           dst_offset+=4;
         }
     }
-  gegl_buffer_set (dst, dst_rect, babl_format ("RGBA float"), dst_buf, GEGL_AUTO_ROWSTRIDE);
+  gegl_buffer_set (dst, dst_rect, 0, babl_format ("RGBA float"), dst_buf, GEGL_AUTO_ROWSTRIDE);
   g_free (src_buf);
   g_free (dst_buf);
 }
@@ -149,7 +149,8 @@ static gboolean
 process (GeglOperation       *operation,
          GeglBuffer          *input,
          GeglBuffer          *output,
-         const GeglRectangle *result)
+         const GeglRectangle *result,
+         gint                 level)
 {
   GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
   GeglRectangle compute;
diff --git a/operations/common/stretch-contrast.c b/operations/common/stretch-contrast.c
index 78e25de..7383885 100644
--- a/operations/common/stretch-contrast.c
+++ b/operations/common/stretch-contrast.c
@@ -33,7 +33,8 @@ static gboolean
 inner_process (gdouble  min,
                gdouble  max,
                gfloat  *buf,
-               gint     n_pixels)
+               gint     n_pixels,
+               gint     level)
 {
   gint o;
 
@@ -60,7 +61,7 @@ buffer_get_min_max (GeglBuffer *buffer,
 
   gfloat *buf = g_new0 (gfloat, 4 * gegl_buffer_get_pixel_count (buffer));
   gint i;
-  gegl_buffer_get (buffer, 1.0, NULL, babl_format ("RGBA float"), buf, GEGL_AUTO_ROWSTRIDE);
+  gegl_buffer_get (buffer, NULL, 1.0, babl_format ("RGBA float"), buf, GEGL_AUTO_ROWSTRIDE);
   for (i=0;i< gegl_buffer_get_pixel_count (buffer);i++)
     {
       gint component;
@@ -100,7 +101,8 @@ static gboolean
 process (GeglOperation       *operation,
          GeglBuffer          *input,
          GeglBuffer          *output,
-         const GeglRectangle *result)
+         const GeglRectangle *result,
+         gint                 level)
 {
   gdouble  min, max;
 
@@ -123,9 +125,9 @@ process (GeglOperation       *operation,
         line.width = result->width;
         line.height = chunk;
 
-        gegl_buffer_get (input, 1.0, &line, babl_format ("RGBA float"), buf, GEGL_AUTO_ROWSTRIDE);
-        inner_process (min, max, buf, result->width  * chunk);
-        gegl_buffer_set (output, &line, babl_format ("RGBA float"), buf,
+        gegl_buffer_get (input, &line, 1.0, babl_format ("RGBA float"), buf, GEGL_AUTO_ROWSTRIDE);
+        inner_process (min, max, buf, result->width  * chunk, level);
+        gegl_buffer_set (output, &line, 0, babl_format ("RGBA float"), buf,
                          GEGL_AUTO_ROWSTRIDE);
         consumed+=chunk;
       }
diff --git a/operations/common/svg-huerotate.c b/operations/common/svg-huerotate.c
index 8161c94..4824d1e 100644
--- a/operations/common/svg-huerotate.c
+++ b/operations/common/svg-huerotate.c
@@ -48,7 +48,8 @@ process (GeglOperation       *op,
          void                *in_buf,
          void                *out_buf,
          glong                n_pixels,
-         const GeglRectangle *roi)
+         const GeglRectangle *roi,
+         gint                 level)
 {
   GeglChantO *o   = GEGL_CHANT_PROPERTIES (op);
   gfloat     *in  = in_buf;
diff --git a/operations/common/svg-luminancetoalpha.c b/operations/common/svg-luminancetoalpha.c
index c5a37df..1530565 100644
--- a/operations/common/svg-luminancetoalpha.c
+++ b/operations/common/svg-luminancetoalpha.c
@@ -48,7 +48,8 @@ process (GeglOperation       *op,
          void                *in_buf,
          void                *out_buf,
          glong                n_pixels,
-         const GeglRectangle *roi)
+         const GeglRectangle *roi,
+         gint                 level)
 {
   gfloat      *in = in_buf;
   gfloat      *out = out_buf;
diff --git a/operations/common/svg-matrix.c b/operations/common/svg-matrix.c
index 19768d4..c8a220b 100644
--- a/operations/common/svg-matrix.c
+++ b/operations/common/svg-matrix.c
@@ -48,7 +48,8 @@ process (GeglOperation       *op,
          void                *in_buf,
          void                *out_buf,
          glong                n_pixels,
-         const GeglRectangle *roi)
+         const GeglRectangle *roi,
+         gint                 level)
 {
   GeglChantO *o = GEGL_CHANT_PROPERTIES (op);
   gfloat     *in = in_buf;
diff --git a/operations/common/svg-saturate.c b/operations/common/svg-saturate.c
index c9d4b7d..9696508 100644
--- a/operations/common/svg-saturate.c
+++ b/operations/common/svg-saturate.c
@@ -48,7 +48,8 @@ process (GeglOperation       *op,
          void                *in_buf,
          void                *out_buf,
          glong                n_pixels,
-         const GeglRectangle *roi)
+         const GeglRectangle *roi,
+         gint                 level)
 {
   GeglChantO *o = GEGL_CHANT_PROPERTIES (op);
   gfloat     *in = in_buf;
diff --git a/operations/common/threshold.c b/operations/common/threshold.c
index f546c4d..090531b 100644
--- a/operations/common/threshold.c
+++ b/operations/common/threshold.c
@@ -45,7 +45,8 @@ process (GeglOperation       *op,
          void                *aux_buf,
          void                *out_buf,
          glong                n_pixels,
-         const GeglRectangle *roi)
+         const GeglRectangle *roi,
+         gint                 level)
 {
   gfloat *in = in_buf;
   gfloat *out = out_buf;
@@ -121,11 +122,12 @@ static gegl_cl_run_data *cl_data = NULL;
 /* OpenCL processing function */
 static cl_int
 cl_process (GeglOperation       *op,
-            cl_mem              in_tex,
-            cl_mem              aux_tex,
-            cl_mem              out_tex,
-            size_t              global_worksize,
-            const GeglRectangle *roi)
+            cl_mem               in_tex,
+            cl_mem               aux_tex,
+            cl_mem               out_tex,
+            size_t               global_worksize,
+            const GeglRectangle *roi,
+            gint                 level)
 {
   gfloat value = GEGL_CHANT_PROPERTIES (op)->value;
 
diff --git a/operations/common/value-invert.c b/operations/common/value-invert.c
index 7a29df6..2cfcb63 100644
--- a/operations/common/value-invert.c
+++ b/operations/common/value-invert.c
@@ -51,7 +51,8 @@ process (GeglOperation       *op,
          void                *in_buf,
          void                *out_buf,
          glong                samples,
-         const GeglRectangle *roi)
+         const GeglRectangle *roi,
+         gint                 level)
 {
   glong   j;
   gfloat *src  = in_buf;
@@ -164,10 +165,11 @@ static gegl_cl_run_data *cl_data = NULL;
 /* OpenCL processing function */
 static cl_int
 cl_process (GeglOperation       *op,
-            cl_mem              in_tex,
-            cl_mem              out_tex,
-            size_t              global_worksize,
-            const GeglRectangle *roi)
+            cl_mem               in_tex,
+            cl_mem               out_tex,
+            size_t               global_worksize,
+            const GeglRectangle *roi,
+            int                  level)
 {
 
   cl_int cl_err = 0;
diff --git a/operations/common/vignette.c b/operations/common/vignette.c
index 399aa05..d21a979 100644
--- a/operations/common/vignette.c
+++ b/operations/common/vignette.c
@@ -84,7 +84,8 @@ process (GeglOperation       *operation,
          void                *in_buf,
          void                *out_buf,
          glong                n_pixels,
-         const GeglRectangle *roi)
+         const GeglRectangle *roi,
+         gint                 level)
 {
   GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
   gfloat     *in_pixel =  in_buf;
diff --git a/operations/common/weighted-blend.c b/operations/common/weighted-blend.c
index cf41c52..cd9ab05 100644
--- a/operations/common/weighted-blend.c
+++ b/operations/common/weighted-blend.c
@@ -46,7 +46,8 @@ process (GeglOperation       *op,
          void                *aux_buf,
          void                *out_buf,
          glong                n_pixels,
-         const GeglRectangle *roi)
+         const GeglRectangle *roi,
+         gint                 level)
 {
   gfloat *in  = in_buf;
   gfloat *out = out_buf;
diff --git a/operations/common/whitebalance.c b/operations/common/whitebalance.c
index e494d14..a6af68d 100644
--- a/operations/common/whitebalance.c
+++ b/operations/common/whitebalance.c
@@ -50,7 +50,8 @@ process (GeglOperation       *op,
          void                *in_buf,
          void                *out_buf,
          glong                n_pixels,
-         const GeglRectangle *roi)
+         const GeglRectangle *roi,
+         gint                 level)
 {
   GeglChantO *o = GEGL_CHANT_PROPERTIES (op);
   gfloat     *in_pixel;
@@ -111,10 +112,11 @@ static gegl_cl_run_data *cl_data = NULL;
 /* OpenCL processing function */
 static cl_int
 cl_process (GeglOperation       *op,
-            cl_mem              in_tex,
-            cl_mem              out_tex,
-            size_t              global_worksize,
-            const GeglRectangle *roi)
+            cl_mem               in_tex,
+            cl_mem               out_tex,
+            size_t               global_worksize,
+            const GeglRectangle *roi,
+            int                  level)
 {
   /* Retrieve a pointer to GeglChantO structure which contains all the
    * chanted properties
diff --git a/operations/common/write-buffer.c b/operations/common/write-buffer.c
index 8c4da4d..cec4272 100644
--- a/operations/common/write-buffer.c
+++ b/operations/common/write-buffer.c
@@ -36,7 +36,8 @@ gegl_chant_object (buffer, _("Buffer location"),
 static gboolean
 process (GeglOperation       *operation,
          GeglBuffer          *input,
-         const GeglRectangle *result)
+         const GeglRectangle *result,
+         gint                 level)
 {
   GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
 
diff --git a/operations/core/clone.c b/operations/core/clone.c
index c26b455..0d7688a 100644
--- a/operations/core/clone.c
+++ b/operations/core/clone.c
@@ -70,10 +70,11 @@ get_bounding_box (GeglOperation *operation)
 }
 
 static gboolean
-process (GeglOperation       *operation,
-         GeglOperationContext     *context,
-         const gchar         *output_prop,
-         const GeglRectangle *result)
+process (GeglOperation        *operation,
+         GeglOperationContext *context,
+         const gchar          *output_prop,
+         const GeglRectangle  *result,
+         gint                  level)
 {
   GeglBuffer *input;
 
diff --git a/operations/core/convert-format.c b/operations/core/convert-format.c
index 7fe4e81..f3ba46e 100644
--- a/operations/core/convert-format.c
+++ b/operations/core/convert-format.c
@@ -54,7 +54,8 @@ process (GeglOperation       *op,
          void                *in_buf,
          void                *out_buf,
          glong                samples,
-         const GeglRectangle *roi)
+         const GeglRectangle *roi,
+         gint                 level)
 {
 	int bpp = babl_format_get_bytes_per_pixel (gegl_operation_get_format (op, "output"));
 	memcpy(out_buf, in_buf, samples * bpp);
diff --git a/operations/core/crop.c b/operations/core/crop.c
index 1da2ab0..9623520 100644
--- a/operations/core/crop.c
+++ b/operations/core/crop.c
@@ -113,7 +113,8 @@ static gboolean
 gegl_crop_process (GeglOperation        *operation,
                    GeglOperationContext *context,
                    const gchar          *output_prop,
-                   const GeglRectangle  *result)
+                   const GeglRectangle  *result,
+                   gint                  level)
 {
   GeglChantO   *o = GEGL_CHANT_PROPERTIES (operation);
   GeglBuffer   *input;
diff --git a/operations/core/nop.c b/operations/core/nop.c
index c92ee7a..68f78cb 100644
--- a/operations/core/nop.c
+++ b/operations/core/nop.c
@@ -36,7 +36,8 @@ static gboolean
 gegl_nop_process (GeglOperation        *operation,
                   GeglOperationContext *context,
                   const gchar          *output_prop,
-                  const GeglRectangle  *result)
+                  const GeglRectangle  *result,
+                  gint                  level)
 {
   GeglBuffer *input;
 
diff --git a/operations/external/exr-load.cpp b/operations/external/exr-load.cpp
index fcb8787..d31aa30 100644
--- a/operations/external/exr-load.cpp
+++ b/operations/external/exr-load.cpp
@@ -236,7 +236,7 @@ fix_saturation (GeglBuffer       *buf,
   for (y=0; y<2; y++)
     {
       gegl_rectangle_set (&rect, 0,y, gegl_buffer_get_width (buf), 1);
-      gegl_buffer_get (buf, 1.0, &rect, NULL, row[y+1], GEGL_AUTO_ROWSTRIDE);
+      gegl_buffer_get (buf, &rect, 1.0, NULL, row[y+1], GEGL_AUTO_ROWSTRIDE);
     }
 
   fix_saturation_row (row[1], row[1], row[2], yw, gegl_buffer_get_width (buf), nc);
@@ -246,11 +246,11 @@ fix_saturation (GeglBuffer       *buf,
       if (y>1)
         {
           gegl_rectangle_set (&rect, 0, y-2, gegl_buffer_get_width (buf), 1);
-          gegl_buffer_set (buf, &rect, NULL, row[0], GEGL_AUTO_ROWSTRIDE);
+          gegl_buffer_set (buf, &rect, 0, NULL, row[0], GEGL_AUTO_ROWSTRIDE);
         }
 
       gegl_rectangle_set (&rect, 0,y+1, gegl_buffer_get_width (buf), 1);
-      gegl_buffer_get (buf, 1.0, &rect, NULL, row[0], GEGL_AUTO_ROWSTRIDE);
+      gegl_buffer_get (buf, &rect, 1.0, NULL, row[0], GEGL_AUTO_ROWSTRIDE);
 
       tmp = row[0];
       row[0] = row[1];
@@ -265,7 +265,7 @@ fix_saturation (GeglBuffer       *buf,
   for (y=gegl_buffer_get_height (buf)-2; y<gegl_buffer_get_height (buf); y++)
     {
       gegl_rectangle_set (&rect, 0, y, gegl_buffer_get_width (buf), 1);
-      gegl_buffer_set (buf, &rect, NULL, row[y-gegl_buffer_get_height (buf)+2], GEGL_AUTO_ROWSTRIDE);
+      gegl_buffer_set (buf, &rect, 0, NULL, row[y-gegl_buffer_get_height (buf)+2], GEGL_AUTO_ROWSTRIDE);
     }
 
   for (y=0; y<3; y++)
@@ -331,19 +331,19 @@ reconstruct_chroma (GeglBuffer *buf,
   for (i=0; i<gegl_buffer_get_height (buf); i+=2)
     {
       gegl_rectangle_set (&rect, 0, i,  gegl_buffer_get_width (buf), 1);
-      gegl_buffer_get (buf, 1.0, &rect, NULL, pixels, GEGL_AUTO_ROWSTRIDE);
+      gegl_buffer_get (buf, &rect, 1.0, NULL, pixels, GEGL_AUTO_ROWSTRIDE);
 
       reconstruct_chroma_row (pixels, gegl_buffer_get_width (buf), has_alpha, tmp);
-      gegl_buffer_set (buf, &rect, NULL, pixels, GEGL_AUTO_ROWSTRIDE);
+      gegl_buffer_set (buf, &rect, 0, NULL, pixels, GEGL_AUTO_ROWSTRIDE);
     }
 
   for (i=0; i<gegl_buffer_get_width (buf); i++)
     {
       gegl_rectangle_set (&rect, i, 0, 1, gegl_buffer_get_height (buf));
-      gegl_buffer_get (buf, 1.0, &rect, NULL, pixels, GEGL_AUTO_ROWSTRIDE);
+      gegl_buffer_get (buf, &rect, 1.0, NULL, pixels, GEGL_AUTO_ROWSTRIDE);
 
       reconstruct_chroma_row (pixels, gegl_buffer_get_height (buf), has_alpha, tmp);
-      gegl_buffer_set (buf, &rect, NULL, pixels, GEGL_AUTO_ROWSTRIDE);
+      gegl_buffer_set (buf, &rect, 0, NULL, pixels, GEGL_AUTO_ROWSTRIDE);
     }
 
   g_free (tmp);
@@ -368,7 +368,7 @@ convert_yca_to_rgba (GeglBuffer *buf,
   for (row=0; row<gegl_buffer_get_height (buf); row++)
     {
       gegl_rectangle_set (&rect, 0, row, gegl_buffer_get_width (buf), 1);
-      gegl_buffer_get (buf, 1.0, &rect, NULL, pixels, GEGL_AUTO_ROWSTRIDE);
+      gegl_buffer_get (buf, &rect, 1.0, NULL, pixels, GEGL_AUTO_ROWSTRIDE);
       pxl = (gfloat*) pixels;
 
       for (i=0; i<gegl_buffer_get_width (buf); i++)
@@ -388,7 +388,7 @@ convert_yca_to_rgba (GeglBuffer *buf,
           pxl += dx;
         }
 
-      gegl_buffer_set (buf, &rect, NULL, pixels, GEGL_AUTO_ROWSTRIDE);
+      gegl_buffer_set (buf, &rect, 0, NULL, pixels, GEGL_AUTO_ROWSTRIDE);
     }
 
   g_free (pixels);
@@ -480,7 +480,7 @@ import_exr (GeglBuffer  *gegl_buffer,
           {
             gegl_rectangle_set (&rect, 0, i-dw.min.y,gegl_buffer_get_width (gegl_buffer), 1);
             file.readPixels (i);
-            gegl_buffer_set (gegl_buffer, &rect, NULL, pixels, GEGL_AUTO_ROWSTRIDE);
+            gegl_buffer_set (gegl_buffer, &rect, 0, NULL, pixels, GEGL_AUTO_ROWSTRIDE);
           }
       }
 
@@ -618,7 +618,8 @@ get_bounding_box (GeglOperation *operation)
 static gboolean
 process (GeglOperation       *operation,
          GeglBuffer          *output,
-         const GeglRectangle *result)
+         const GeglRectangle *result,
+         int                  level)
 {
   GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
   gint        w,h,ff;
diff --git a/operations/external/exr-save.cc b/operations/external/exr-save.cc
index aa19f91..612f2d2 100644
--- a/operations/external/exr-save.cc
+++ b/operations/external/exr-save.cc
@@ -174,7 +174,8 @@ exr_save_process (const float       *pixels,
 static gboolean
 gegl_exr_save_process (GeglOperation       *operation,
                        GeglBuffer          *input,
-                       const GeglRectangle *rect)
+                       const GeglRectangle *rect,
+                       gint                 level)
 {
   GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
   std::string filename (o->path);
@@ -211,7 +212,7 @@ gegl_exr_save_process (GeglOperation       *operation,
         rect->width, rect->height, depth);
       return FALSE;
     }
-  gegl_buffer_get (input, 1.0, rect, babl_format (output_format.c_str ()),
+  gegl_buffer_get (input, rect, 1.0, babl_format (output_format.c_str ()),
                    pixels, GEGL_AUTO_ROWSTRIDE);
   bool status;
   try
diff --git a/operations/external/ff-load.c b/operations/external/ff-load.c
index b5c735b..ce907e4 100644
--- a/operations/external/ff-load.c
+++ b/operations/external/ff-load.c
@@ -364,7 +364,8 @@ get_bounding_box (GeglOperation *operation)
 static gboolean
 process (GeglOperation       *operation,
          GeglBuffer          *output,
-         const GeglRectangle *result)
+         const GeglRectangle *result,
+         gint                 level)
 {
   GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
   Priv       *p = (Priv*)o->chant_data;
diff --git a/operations/external/jp2-load.c b/operations/external/jp2-load.c
index 5923430..6494d4d 100644
--- a/operations/external/jp2-load.c
+++ b/operations/external/jp2-load.c
@@ -167,7 +167,8 @@ prepare (GeglOperation *operation)
 static gboolean
 process (GeglOperation       *operation,
          GeglBuffer          *output,
-         const GeglRectangle *result)
+         const GeglRectangle *result,
+         gint                 level)
 {
   GeglChantO   *o = GEGL_CHANT_PROPERTIES (operation);
   GeglRectangle rect = {0,0,0,0};
diff --git a/operations/external/jpg-load.c b/operations/external/jpg-load.c
index 90d7286..1f3f8af 100644
--- a/operations/external/jpg-load.c
+++ b/operations/external/jpg-load.c
@@ -123,16 +123,16 @@ gegl_jpg_load_buffer_import_jpg (GeglBuffer  *gegl_buffer,
       switch (cinfo.output_components)
         {
         case 1:
-          gegl_buffer_set (gegl_buffer, &rect,
+          gegl_buffer_set (gegl_buffer, &rect, 0,
                            babl_format ("Y' u8"), buffer[0],
                            GEGL_AUTO_ROWSTRIDE);
           break;
         case 3:
         default:
-          gegl_buffer_set (gegl_buffer, &rect,
+          gegl_buffer_set (gegl_buffer, &rect, 0,
                            babl_format ("R'G'B' u8"), buffer[0],
                            GEGL_AUTO_ROWSTRIDE);
-	}
+	      }
     }
   jpeg_destroy_decompress (&cinfo);
   fclose (infile);
@@ -167,7 +167,8 @@ gegl_jpg_load_get_bounding_box (GeglOperation *operation)
 static gboolean
 gegl_jpg_load_process (GeglOperation       *operation,
                        GeglBuffer          *output,
-                       const GeglRectangle *result)
+                       const GeglRectangle *result,
+                       gint                 level)
 {
   GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
   GeglRectangle        rect={0,0};
diff --git a/operations/external/jpg-save.c b/operations/external/jpg-save.c
index ac0daa6..70bf9ac 100644
--- a/operations/external/jpg-save.c
+++ b/operations/external/jpg-save.c
@@ -139,7 +139,7 @@ gegl_buffer_export_jpg (GeglBuffer  *gegl_buffer,
     rect.width = width;
     rect.height = 1;
 
-    gegl_buffer_get (gegl_buffer, 1.0, &rect, format,
+    gegl_buffer_get (gegl_buffer, &rect, 1.0, format,
                      row_pointer[0], GEGL_AUTO_ROWSTRIDE);
 
     jpeg_write_scanlines (&cinfo, row_pointer, 1);
@@ -159,7 +159,8 @@ gegl_buffer_export_jpg (GeglBuffer  *gegl_buffer,
 static gboolean
 gegl_jpg_save_process (GeglOperation       *operation,
                        GeglBuffer          *input,
-                       const GeglRectangle *result)
+                       const GeglRectangle *result,
+                       int                  level)
 {
   GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
 
diff --git a/operations/external/matting-levin.c b/operations/external/matting-levin.c
index 1eb9e2a..c5f2dfd 100644
--- a/operations/external/matting-levin.c
+++ b/operations/external/matting-levin.c
@@ -1364,7 +1364,8 @@ matting_process (GeglOperation       *operation,
                  GeglBuffer          *input_buf,
                  GeglBuffer          *aux_buf,
                  GeglBuffer          *output_buf,
-                 const GeglRectangle *result)
+                 const GeglRectangle *result,
+                 gint                 level)
 {
   const GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
   gdouble          *input   = NULL,
diff --git a/operations/external/openraw.c b/operations/external/openraw.c
index 4ad1964..277fc7b 100644
--- a/operations/external/openraw.c
+++ b/operations/external/openraw.c
@@ -183,7 +183,8 @@ static gboolean
 process (GeglOperation          *operation,
          GeglOperationContext   *context,
          const gchar            *output_pad,
-         const GeglRectangle    *result)
+         const GeglRectangle    *result,
+         gint                    level)
 {
   GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
   g_assert (g_str_equal (output_pad, "output"));
diff --git a/operations/external/path.c b/operations/external/path.c
index 555be89..0cc1d3d 100644
--- a/operations/external/path.c
+++ b/operations/external/path.c
@@ -358,7 +358,8 @@ static gboolean
 process (GeglOperation       *operation,
          GeglBuffer          *input,
          GeglBuffer          *output,
-         const GeglRectangle *result)
+         const GeglRectangle *result,
+         gint                 level)
 {
   GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
 
diff --git a/operations/external/pixbuf.c b/operations/external/pixbuf.c
index ef99a2b..811f952 100644
--- a/operations/external/pixbuf.c
+++ b/operations/external/pixbuf.c
@@ -61,7 +61,8 @@ static void prepare (GeglOperation *operation)
 static gboolean
 process (GeglOperation       *operation,
          GeglBuffer          *output,
-         const GeglRectangle *result)
+         const GeglRectangle *result,
+         gint                 level)
 {
   GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
 
@@ -74,7 +75,7 @@ process (GeglOperation       *operation,
       extent.width = gdk_pixbuf_get_width (o->pixbuf);
       extent.height = gdk_pixbuf_get_height (o->pixbuf);
 
-      gegl_buffer_set (output, &extent, NULL, gdk_pixbuf_get_pixels (o->pixbuf),
+      gegl_buffer_set (output, &extent, 0, NULL, gdk_pixbuf_get_pixels (o->pixbuf),
                        GEGL_AUTO_ROWSTRIDE);
     }
   return TRUE;
diff --git a/operations/external/png-load.c b/operations/external/png-load.c
index 90a6ab8..ab07878 100644
--- a/operations/external/png-load.c
+++ b/operations/external/png-load.c
@@ -228,10 +228,10 @@ gegl_buffer_import_png (GeglBuffer  *gegl_buffer,
             gegl_rectangle_set (&rect, 0, i, width, 1);
 
             if (pass != 0)
-              gegl_buffer_get (gegl_buffer, 1.0, &rect, format, pixels, GEGL_AUTO_ROWSTRIDE);
+              gegl_buffer_get (gegl_buffer, &rect, 1.0, format, pixels, GEGL_AUTO_ROWSTRIDE);
 
             png_read_rows (load_png_ptr, &pixels, NULL, 1);
-            gegl_buffer_set (gegl_buffer, &rect, format, pixels,
+            gegl_buffer_set (gegl_buffer, &rect, 0, format, pixels,
                              GEGL_AUTO_ROWSTRIDE);
           }
       }
@@ -391,7 +391,8 @@ get_bounding_box (GeglOperation *operation)
 static gboolean
 process (GeglOperation       *operation,
          GeglBuffer          *output,
-         const GeglRectangle *result)
+         const GeglRectangle *result,
+         gint                 level)
 {
   GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
   gint        problem;
diff --git a/operations/external/png-save.c b/operations/external/png-save.c
index a7aee45..b01fad3 100644
--- a/operations/external/png-save.c
+++ b/operations/external/png-save.c
@@ -183,7 +183,7 @@ gegl_buffer_export_png (GeglBuffer  *gegl_buffer,
       rect.width = width;
       rect.height = 1;
 
-      gegl_buffer_get (gegl_buffer, 1.0, &rect, format, pixels, GEGL_AUTO_ROWSTRIDE);
+      gegl_buffer_get (gegl_buffer, &rect, 1.0, babl_format (format_string), pixels, GEGL_AUTO_ROWSTRIDE);
 
       png_write_rows (png, &pixels, 1);
     }
@@ -202,7 +202,8 @@ gegl_buffer_export_png (GeglBuffer  *gegl_buffer,
 static gboolean
 gegl_png_save_process (GeglOperation       *operation,
                        GeglBuffer          *input,
-                       const GeglRectangle *result)
+                       const GeglRectangle *result,
+                       gint                 level)
 {
   GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
 
diff --git a/operations/external/ppm-load.c b/operations/external/ppm-load.c
index 7134de1..32c13e1 100644
--- a/operations/external/ppm-load.c
+++ b/operations/external/ppm-load.c
@@ -57,12 +57,12 @@ ppm_load_read_header(FILE       *fp,
 {
     /* PPM Headers Variable Declaration */
     gchar *ptr;
-    gchar *retval;
+    //gchar *retval;
     gchar  header[MAX_CHARS_IN_ROW];
     gint   maxval;
 
     /* Check the PPM file Type P2 or P5 */
-    retval = fgets (header,MAX_CHARS_IN_ROW,fp);
+    fgets (header,MAX_CHARS_IN_ROW,fp);
 
     if (header[0] != ASCII_P ||
         (header[1] != PIXMAP_ASCII &&
@@ -75,10 +75,10 @@ ppm_load_read_header(FILE       *fp,
     img->type = header[1];
 
     /* Check the Comments */
-    retval = fgets (header,MAX_CHARS_IN_ROW,fp);
+    fgets (header,MAX_CHARS_IN_ROW,fp);
     while(header[0] == '#')
       {
-        retval = fgets (header,MAX_CHARS_IN_ROW,fp);
+        fgets (header,MAX_CHARS_IN_ROW,fp);
       }
 
     /* Get Width and Height */
@@ -86,7 +86,7 @@ ppm_load_read_header(FILE       *fp,
     img->height = atoi (ptr);
     img->numsamples = img->width * img->height * CHANNEL_COUNT;
 
-    retval = fgets (header,MAX_CHARS_IN_ROW,fp);
+    fgets (header,MAX_CHARS_IN_ROW,fp);
     maxval = strtol (header,&ptr,0);
 
     if ((maxval != 255) && (maxval != 65535))
@@ -110,8 +110,6 @@ ppm_load_read_header(FILE       *fp,
     }
 
     return TRUE;
-    if (retval)
-      return TRUE;
 }
 
 static void
@@ -119,11 +117,10 @@ ppm_load_read_image(FILE       *fp,
                     pnm_struct *img)
 {
     guint   i;
-    gint    retval;
 
     if (img->type == PIXMAP_RAW)
       {
-        retval = fread (img->data, img->bpc, img->numsamples, fp);
+        fread (img->data, img->bpc, img->numsamples, fp);
 
         /* Fix endianness if necessary */
         if (img->bpc > 1)
@@ -148,7 +145,7 @@ ppm_load_read_image(FILE       *fp,
             for (i = 0; i < img->numsamples; i++)
               {
                 guint sample;
-                retval = fscanf (fp, " %u", &sample);
+                fscanf (fp, " %u", &sample);
                 *ptr++ = sample;
               }
           }
@@ -159,7 +156,7 @@ ppm_load_read_image(FILE       *fp,
             for (i = 0; i < img->numsamples; i++)
               {
                 guint sample;
-                retval = fscanf (fp, " %u", &sample);
+                fscanf (fp, " %u", &sample);
                 *ptr++ = sample;
               }
           }
@@ -168,8 +165,6 @@ ppm_load_read_image(FILE       *fp,
             g_warning ("%s: Programmer stupidity error", G_STRLOC);
           }
       }
-    if (retval)
-      return;
 }
 
 static GeglRectangle
@@ -217,7 +212,8 @@ get_bounding_box (GeglOperation *operation)
 static gboolean
 process (GeglOperation       *operation,
          GeglBuffer          *output,
-         const GeglRectangle *result)
+         const GeglRectangle *result,
+         gint                 level)
 {
   GeglChantO   *o = GEGL_CHANT_PROPERTIES (operation);
   FILE         *fp;
@@ -242,12 +238,12 @@ process (GeglOperation       *operation,
   switch (img.bpc)
     {
     case 1:
-      gegl_buffer_get (output, 1.0, &rect, babl_format ("R'G'B' u8"), img.data,
+      gegl_buffer_get (output, &rect, 1.0, babl_format ("R'G'B' u8"), img.data,
                        GEGL_AUTO_ROWSTRIDE);
       break;
 
     case 2:
-      gegl_buffer_get (output, 1.0, &rect, babl_format ("R'G'B' u16"), img.data,
+      gegl_buffer_get (output, &rect, 1.0, babl_format ("R'G'B' u16"), img.data,
                        GEGL_AUTO_ROWSTRIDE);
       break;
 
@@ -260,12 +256,12 @@ process (GeglOperation       *operation,
   switch (img.bpc)
     {
     case 1:
-      gegl_buffer_set (output, &rect, babl_format ("R'G'B' u8"), img.data,
+      gegl_buffer_set (output, &rect, 0, babl_format ("R'G'B' u8"), img.data,
                        GEGL_AUTO_ROWSTRIDE);
       break;
 
     case 2:
-      gegl_buffer_set (output, &rect, babl_format ("R'G'B' u16"), img.data,
+      gegl_buffer_set (output, &rect, 0, babl_format ("R'G'B' u16"), img.data,
                        GEGL_AUTO_ROWSTRIDE);
       break;
 
diff --git a/operations/external/ppm-save.c b/operations/external/ppm-save.c
index 6a63709..dc947f9 100644
--- a/operations/external/ppm-save.c
+++ b/operations/external/ppm-save.c
@@ -54,7 +54,6 @@ ppm_save_write(FILE    *fp,
                map_type type)
 {
   guint i;
-  gint retval;
 
   /* Write the header */
   fprintf (fp, "P%c\n%d %d\n", type, width, height );
@@ -75,7 +74,7 @@ ppm_save_write(FILE    *fp,
             }
         }
 
-      retval = fwrite (data, bpc, numsamples, fp);
+      fwrite (data, bpc, numsamples, fp);
     }
   else
     {
@@ -108,14 +107,13 @@ ppm_save_write(FILE    *fp,
           g_warning ("%s: Programmer stupidity error", G_STRLOC);
         }
     }
-  if (retval) /* make gcc shut up*/
-    return;
 }
 
 static gboolean
 process (GeglOperation       *operation,
          GeglBuffer          *input,
-         const GeglRectangle *rect)
+         const GeglRectangle *rect,
+         gint                 level)
 {
   GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
 
@@ -146,12 +144,12 @@ process (GeglOperation       *operation,
   switch (bpc)
     {
     case 1:
-      gegl_buffer_get (input, 1.0, rect, babl_format ("R'G'B' u8"), data,
+      gegl_buffer_get (input, rect, 1.0, babl_format ("R'G'B' u8"), data,
                        GEGL_AUTO_ROWSTRIDE);
       break;
 
     case 2:
-      gegl_buffer_get (input, 1.0, rect, babl_format ("R'G'B' u16"), data,
+      gegl_buffer_get (input, rect, 1.0, babl_format ("R'G'B' u16"), data,
                        GEGL_AUTO_ROWSTRIDE);
       break;
 
diff --git a/operations/external/rgbe-load.c b/operations/external/rgbe-load.c
index c06e71c..6803f57 100644
--- a/operations/external/rgbe-load.c
+++ b/operations/external/rgbe-load.c
@@ -72,7 +72,8 @@ cleanup:
 static gboolean
 gegl_rgbe_load_process (GeglOperation       *operation,
                         GeglBuffer          *output,
-                        const GeglRectangle *result)
+                        const GeglRectangle *result,
+                        gint                 level)
 {
   GeglChantO       *o       = GEGL_CHANT_PROPERTIES (operation);
   gboolean          success = FALSE;
@@ -95,7 +96,7 @@ gegl_rgbe_load_process (GeglOperation       *operation,
   if (!pixels)
     goto cleanup;
 
-  gegl_buffer_set (output, result, babl_format (FORMAT), pixels,
+  gegl_buffer_set (output, result, 0, babl_format (FORMAT), pixels,
                    GEGL_AUTO_ROWSTRIDE);
   success = TRUE;
 
diff --git a/operations/external/rgbe-save.c b/operations/external/rgbe-save.c
index 2f65077..c4f8771 100644
--- a/operations/external/rgbe-save.c
+++ b/operations/external/rgbe-save.c
@@ -41,7 +41,8 @@ static const gchar *FORMAT = "RGB float";
 static gboolean
 gegl_rgbe_save_process (GeglOperation       *operation,
                         GeglBuffer          *input,
-                        const GeglRectangle *rect)
+                        const GeglRectangle *rect,
+                        gint                 level)
 {
   GeglChantO *o       = GEGL_CHANT_PROPERTIES (operation);
   gfloat     *pixels  = NULL;
@@ -53,7 +54,7 @@ gegl_rgbe_save_process (GeglOperation       *operation,
                      sizeof (pixels[0]) *
                      babl_format_get_n_components (babl_format (FORMAT)));
 
-  gegl_buffer_get (input, 1.0, rect, babl_format (FORMAT), pixels,
+  gegl_buffer_get (input, rect, 1.0, babl_format (FORMAT), pixels,
                    GEGL_AUTO_ROWSTRIDE);
 
   if (!rgbe_save_path (o->path, rect->width, rect->height, pixels))
diff --git a/operations/external/save-pixbuf.c b/operations/external/save-pixbuf.c
index cfadc5e..4653ea8 100644
--- a/operations/external/save-pixbuf.c
+++ b/operations/external/save-pixbuf.c
@@ -39,7 +39,8 @@ gegl_chant_pointer (pixbuf, _("Pixbuf location"),
 static gboolean
 process (GeglOperation       *operation,
          GeglBuffer          *input,
-         const GeglRectangle *result)
+         const GeglRectangle *result,
+         gint                 level)
 {
   GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
 
@@ -66,7 +67,7 @@ process (GeglOperation       *operation,
       babl = babl_format (name);
 
       temp = g_malloc (rect->width * rect->height * bps);
-      gegl_buffer_get (input, 1.0, rect, babl, temp, GEGL_AUTO_ROWSTRIDE);
+      gegl_buffer_get (input, rect, 1.0, babl, temp, GEGL_AUTO_ROWSTRIDE);
       if (temp) {
     *pixbuf = gdk_pixbuf_new_from_data (temp,
                         GDK_COLORSPACE_RGB,
diff --git a/operations/external/sdl-display.c b/operations/external/sdl-display.c
index dfde21f..07f31a1 100644
--- a/operations/external/sdl-display.c
+++ b/operations/external/sdl-display.c
@@ -81,7 +81,8 @@ static guint handle = 0;
 static gboolean
 process (GeglOperation       *operation,
          GeglBuffer          *input,
-         const GeglRectangle *result)
+         const GeglRectangle *result,
+         gint                 level)
 {
   GeglChantO   *o = GEGL_CHANT_PROPERTIES (operation);
   GeglBuffer   *source;
@@ -136,8 +137,8 @@ process (GeglOperation       *operation,
    */
   source = gegl_buffer_create_sub_buffer (input, result);
   gegl_buffer_get (source,
-       1.0,
        NULL,
+       1.0,
        babl_format_new (babl_model ("RGBA"),
                         babl_type ("u8"),
                         babl_component ("B"),
diff --git a/operations/external/svg-load.c b/operations/external/svg-load.c
index 75888e3..f1c2693 100644
--- a/operations/external/svg-load.c
+++ b/operations/external/svg-load.c
@@ -96,7 +96,7 @@ instead.
       rect.height = height;
 
       pixeldata = gdk_pixbuf_get_pixels (pixbuf);
-      gegl_buffer_set (gegl_buffer, &rect, babl_format ("R'G'B'A u8"), pixeldata, GEGL_AUTO_ROWSTRIDE);
+      gegl_buffer_set (gegl_buffer, &rect, 0, babl_format ("R'G'B'A u8"), pixeldata, GEGL_AUTO_ROWSTRIDE);
     }
 
     rsvg_term();
@@ -196,7 +196,8 @@ get_bounding_box (GeglOperation *operation)
 static gboolean
 process (GeglOperation       *operation,
          GeglBuffer          *output,
-         const GeglRectangle *result_foo)
+         const GeglRectangle *result_foo,
+         gint                 level)
 {
   GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
   gint        result;
diff --git a/operations/external/text.c b/operations/external/text.c
index 5489589..ef58884 100644
--- a/operations/external/text.c
+++ b/operations/external/text.c
@@ -170,7 +170,8 @@ static void text_layout_text (GeglChant *self,
 static gboolean
 process (GeglOperation       *operation,
          GeglBuffer          *output,
-         const GeglRectangle *result)
+         const GeglRectangle *result,
+         gint                 level)
 {
   GeglChant *self = GEGL_CHANT (operation);
 
@@ -188,7 +189,7 @@ process (GeglOperation       *operation,
   cairo_translate (cr, -result->x, -result->y);
   text_layout_text (self, cr, 0, NULL, NULL);
 
-  gegl_buffer_set (output, result, babl_format ("B'aG'aR'aA u8"), data,
+  gegl_buffer_set (output, result, 0, babl_format ("B'aG'aR'aA u8"), data,
                    GEGL_AUTO_ROWSTRIDE);
 
   cairo_destroy (cr);
diff --git a/operations/external/v4l.c b/operations/external/v4l.c
index 62f7b44..528ad29 100644
--- a/operations/external/v4l.c
+++ b/operations/external/v4l.c
@@ -203,7 +203,8 @@ static gboolean update (gpointer operation)
 static gboolean
 process (GeglOperation       *operation,
          GeglBuffer          *output,
-         const GeglRectangle *result)
+         const GeglRectangle *result,
+         gint                 level)
 {
   GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
   Priv       *p = (Priv*)o->chant_data;
diff --git a/operations/external/vector-fill.c b/operations/external/vector-fill.c
index 9f71166..60a5abf 100644
--- a/operations/external/vector-fill.c
+++ b/operations/external/vector-fill.c
@@ -116,7 +116,8 @@ static gboolean
 process (GeglOperation       *operation,
          GeglBuffer          *input,
          GeglBuffer          *output,
-         const GeglRectangle *result)
+         const GeglRectangle *result,
+         gint                 level)
 {
   GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
   gboolean need_fill = FALSE;
diff --git a/operations/external/vector-stroke.c b/operations/external/vector-stroke.c
index 29e7a04..fcbdeb3 100644
--- a/operations/external/vector-stroke.c
+++ b/operations/external/vector-stroke.c
@@ -143,7 +143,8 @@ static gboolean
 process (GeglOperation       *operation,
          GeglBuffer          *input,
          GeglBuffer          *output,
-         const GeglRectangle *result)
+         const GeglRectangle *result,
+         gint                 level)
 {
   GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
   gboolean need_stroke = FALSE;
diff --git a/operations/generated/add.c b/operations/generated/add.c
index 5ed9b9c..2d10d72 100644
--- a/operations/generated/add.c
+++ b/operations/generated/add.c
@@ -56,7 +56,8 @@ process (GeglOperation        *op,
           void                *aux_buf,
           void                *out_buf,
           glong                n_pixels,
-          const GeglRectangle *roi)
+          const GeglRectangle *roi,
+          gint                 level)
 {
   gfloat * GEGL_ALIGNED in = in_buf;
   gfloat * GEGL_ALIGNED out = out_buf;
diff --git a/operations/generated/clear.c b/operations/generated/clear.c
index f454f8d..4106fbe 100644
--- a/operations/generated/clear.c
+++ b/operations/generated/clear.c
@@ -58,7 +58,8 @@ process (GeglOperation        *op,
           void                *aux_buf,
           void                *out_buf,
           glong                n_pixels,
-          const GeglRectangle *roi)
+          const GeglRectangle *roi,
+          gint                 level)
 {
   gint i;
   gfloat * GEGL_ALIGNED in = in_buf;
diff --git a/operations/generated/color-burn.c b/operations/generated/color-burn.c
index 609a13f..c167a56 100644
--- a/operations/generated/color-burn.c
+++ b/operations/generated/color-burn.c
@@ -58,7 +58,8 @@ process (GeglOperation       *op,
          void                *aux_buf,
          void                *out_buf,
          glong                n_pixels,
-         const GeglRectangle *roi)
+         const GeglRectangle *roi,
+         gint                 level)
 {
   gfloat * GEGL_ALIGNED in = in_buf;
   gfloat * GEGL_ALIGNED aux = aux_buf;
diff --git a/operations/generated/color-dodge.c b/operations/generated/color-dodge.c
index 312d7b9..17ad2a4 100644
--- a/operations/generated/color-dodge.c
+++ b/operations/generated/color-dodge.c
@@ -58,7 +58,8 @@ process (GeglOperation       *op,
          void                *aux_buf,
          void                *out_buf,
          glong                n_pixels,
-         const GeglRectangle *roi)
+         const GeglRectangle *roi,
+         gint                 level)
 {
   gfloat * GEGL_ALIGNED in = in_buf;
   gfloat * GEGL_ALIGNED aux = aux_buf;
diff --git a/operations/generated/darken.c b/operations/generated/darken.c
index 4ea6c1c..61c8fd6 100644
--- a/operations/generated/darken.c
+++ b/operations/generated/darken.c
@@ -58,7 +58,8 @@ process (GeglOperation       *op,
          void                *aux_buf,
          void                *out_buf,
          glong                n_pixels,
-         const GeglRectangle *roi)
+         const GeglRectangle *roi,
+         gint                 level)
 {
   gfloat * GEGL_ALIGNED in = in_buf;
   gfloat * GEGL_ALIGNED aux = aux_buf;
diff --git a/operations/generated/difference.c b/operations/generated/difference.c
index 60ed1e6..b348a5c 100644
--- a/operations/generated/difference.c
+++ b/operations/generated/difference.c
@@ -58,7 +58,8 @@ process (GeglOperation       *op,
          void                *aux_buf,
          void                *out_buf,
          glong                n_pixels,
-         const GeglRectangle *roi)
+         const GeglRectangle *roi,
+         gint                 level)
 {
   gfloat * GEGL_ALIGNED in = in_buf;
   gfloat * GEGL_ALIGNED aux = aux_buf;
diff --git a/operations/generated/divide.c b/operations/generated/divide.c
index 938e0c1..4edafb4 100644
--- a/operations/generated/divide.c
+++ b/operations/generated/divide.c
@@ -56,7 +56,8 @@ process (GeglOperation        *op,
           void                *aux_buf,
           void                *out_buf,
           glong                n_pixels,
-          const GeglRectangle *roi)
+          const GeglRectangle *roi,
+          gint                 level)
 {
   gfloat * GEGL_ALIGNED in = in_buf;
   gfloat * GEGL_ALIGNED out = out_buf;
diff --git a/operations/generated/dst-atop.c b/operations/generated/dst-atop.c
index 66aa14a..78f58ad 100644
--- a/operations/generated/dst-atop.c
+++ b/operations/generated/dst-atop.c
@@ -58,7 +58,8 @@ process (GeglOperation        *op,
           void                *aux_buf,
           void                *out_buf,
           glong                n_pixels,
-          const GeglRectangle *roi)
+          const GeglRectangle *roi,
+          gint                 level)
 {
   gint i;
   gfloat * GEGL_ALIGNED in = in_buf;
diff --git a/operations/generated/dst-in.c b/operations/generated/dst-in.c
index 2ad4497..8051e01 100644
--- a/operations/generated/dst-in.c
+++ b/operations/generated/dst-in.c
@@ -58,7 +58,8 @@ process (GeglOperation        *op,
           void                *aux_buf,
           void                *out_buf,
           glong                n_pixels,
-          const GeglRectangle *roi)
+          const GeglRectangle *roi,
+          gint                 level)
 {
   gint i;
   gfloat * GEGL_ALIGNED in = in_buf;
diff --git a/operations/generated/dst-out.c b/operations/generated/dst-out.c
index 1f15d9c..a455319 100644
--- a/operations/generated/dst-out.c
+++ b/operations/generated/dst-out.c
@@ -58,7 +58,8 @@ process (GeglOperation        *op,
           void                *aux_buf,
           void                *out_buf,
           glong                n_pixels,
-          const GeglRectangle *roi)
+          const GeglRectangle *roi,
+          gint                 level)
 {
   gint i;
   gfloat * GEGL_ALIGNED in = in_buf;
diff --git a/operations/generated/dst-over.c b/operations/generated/dst-over.c
index a78f7c0..1973999 100644
--- a/operations/generated/dst-over.c
+++ b/operations/generated/dst-over.c
@@ -58,7 +58,8 @@ process (GeglOperation        *op,
           void                *aux_buf,
           void                *out_buf,
           glong                n_pixels,
-          const GeglRectangle *roi)
+          const GeglRectangle *roi,
+          gint                 level)
 {
   gint i;
   gfloat * GEGL_ALIGNED in = in_buf;
diff --git a/operations/generated/dst.c b/operations/generated/dst.c
index 5bdc1a3..b1e5ffe 100644
--- a/operations/generated/dst.c
+++ b/operations/generated/dst.c
@@ -58,7 +58,8 @@ process (GeglOperation        *op,
           void                *aux_buf,
           void                *out_buf,
           glong                n_pixels,
-          const GeglRectangle *roi)
+          const GeglRectangle *roi,
+          gint                 level)
 {
   gint i;
   gfloat * GEGL_ALIGNED in = in_buf;
diff --git a/operations/generated/exclusion.c b/operations/generated/exclusion.c
index e31a753..f527183 100644
--- a/operations/generated/exclusion.c
+++ b/operations/generated/exclusion.c
@@ -58,7 +58,8 @@ process (GeglOperation       *op,
          void                *aux_buf,
          void                *out_buf,
          glong                n_pixels,
-         const GeglRectangle *roi)
+         const GeglRectangle *roi,
+         gint                 level)
 {
   gfloat * GEGL_ALIGNED in = in_buf;
   gfloat * GEGL_ALIGNED aux = aux_buf;
diff --git a/operations/generated/gamma.c b/operations/generated/gamma.c
index e9022b2..cfaafcf 100644
--- a/operations/generated/gamma.c
+++ b/operations/generated/gamma.c
@@ -56,7 +56,8 @@ process (GeglOperation        *op,
           void                *aux_buf,
           void                *out_buf,
           glong                n_pixels,
-          const GeglRectangle *roi)
+          const GeglRectangle *roi,
+          gint                 level)
 {
   gfloat * GEGL_ALIGNED in = in_buf;
   gfloat * GEGL_ALIGNED out = out_buf;
diff --git a/operations/generated/hard-light.c b/operations/generated/hard-light.c
index 3572f0e..dd9b5f7 100644
--- a/operations/generated/hard-light.c
+++ b/operations/generated/hard-light.c
@@ -58,7 +58,8 @@ process (GeglOperation       *op,
          void                *aux_buf,
          void                *out_buf,
          glong                n_pixels,
-         const GeglRectangle *roi)
+         const GeglRectangle *roi,
+         gint                 level)
 {
   gfloat * GEGL_ALIGNED in = in_buf;
   gfloat * GEGL_ALIGNED aux = aux_buf;
diff --git a/operations/generated/lighten.c b/operations/generated/lighten.c
index 5acad24..bff48b3 100644
--- a/operations/generated/lighten.c
+++ b/operations/generated/lighten.c
@@ -58,7 +58,8 @@ process (GeglOperation       *op,
          void                *aux_buf,
          void                *out_buf,
          glong                n_pixels,
-         const GeglRectangle *roi)
+         const GeglRectangle *roi,
+         gint                 level)
 {
   gfloat * GEGL_ALIGNED in = in_buf;
   gfloat * GEGL_ALIGNED aux = aux_buf;
diff --git a/operations/generated/math.rb b/operations/generated/math.rb
index 946ff9c..f1e1043 100755
--- a/operations/generated/math.rb
+++ b/operations/generated/math.rb
@@ -85,7 +85,8 @@ process (GeglOperation        *op,
           void                *aux_buf,
           void                *out_buf,
           glong                n_pixels,
-          const GeglRectangle *roi)
+          const GeglRectangle *roi,
+          gint                 level)
 {
   gfloat * GEGL_ALIGNED in = in_buf;
   gfloat * GEGL_ALIGNED out = out_buf;
diff --git a/operations/generated/multiply.c b/operations/generated/multiply.c
index bfc994c..8b5b239 100644
--- a/operations/generated/multiply.c
+++ b/operations/generated/multiply.c
@@ -56,7 +56,8 @@ process (GeglOperation        *op,
           void                *aux_buf,
           void                *out_buf,
           glong                n_pixels,
-          const GeglRectangle *roi)
+          const GeglRectangle *roi,
+          gint                 level)
 {
   gfloat * GEGL_ALIGNED in = in_buf;
   gfloat * GEGL_ALIGNED out = out_buf;
diff --git a/operations/generated/other-blend.rb b/operations/generated/other-blend.rb
index a6eb5dc..a317e2a 100755
--- a/operations/generated/other-blend.rb
+++ b/operations/generated/other-blend.rb
@@ -68,7 +68,8 @@ process (GeglOperation        *op,
           void                *aux_buf,
           void                *out_buf,
           glong                n_pixels,
-          const GeglRectangle *roi)
+          const GeglRectangle *roi,
+          gint                 level)
 {
   gint i;
   gfloat * GEGL_ALIGNED in = in_buf;
diff --git a/operations/generated/overlay.c b/operations/generated/overlay.c
index 32fcbb8..00bf526 100644
--- a/operations/generated/overlay.c
+++ b/operations/generated/overlay.c
@@ -58,7 +58,8 @@ process (GeglOperation       *op,
          void                *aux_buf,
          void                *out_buf,
          glong                n_pixels,
-         const GeglRectangle *roi)
+         const GeglRectangle *roi,
+         gint                 level)
 {
   gfloat * GEGL_ALIGNED in = in_buf;
   gfloat * GEGL_ALIGNED aux = aux_buf;
diff --git a/operations/generated/plus.c b/operations/generated/plus.c
index 614b134..6c7ca18 100644
--- a/operations/generated/plus.c
+++ b/operations/generated/plus.c
@@ -58,7 +58,8 @@ process (GeglOperation       *op,
          void                *aux_buf,
          void                *out_buf,
          glong                n_pixels,
-         const GeglRectangle *roi)
+         const GeglRectangle *roi,
+         gint                 level)
 {
   gfloat * GEGL_ALIGNED in = in_buf;
   gfloat * GEGL_ALIGNED aux = aux_buf;
diff --git a/operations/generated/screen.c b/operations/generated/screen.c
index 06d60e8..aecf914 100644
--- a/operations/generated/screen.c
+++ b/operations/generated/screen.c
@@ -58,7 +58,8 @@ process (GeglOperation       *op,
          void                *aux_buf,
          void                *out_buf,
          glong                n_pixels,
-         const GeglRectangle *roi)
+         const GeglRectangle *roi,
+         gint                 level)
 {
   gfloat * GEGL_ALIGNED in = in_buf;
   gfloat * GEGL_ALIGNED aux = aux_buf;
diff --git a/operations/generated/soft-light.c b/operations/generated/soft-light.c
index cbfdf4f..4e087b7 100644
--- a/operations/generated/soft-light.c
+++ b/operations/generated/soft-light.c
@@ -59,7 +59,8 @@ process (GeglOperation       *op,
          void                *aux_buf,
          void                *out_buf,
          glong                n_pixels,
-         const GeglRectangle *roi)
+         const GeglRectangle *roi,
+         gint                 level)
 {
   gfloat * GEGL_ALIGNED in = in_buf;
   gfloat * GEGL_ALIGNED aux = aux_buf;
diff --git a/operations/generated/src-atop.c b/operations/generated/src-atop.c
index 144325b..12278c0 100644
--- a/operations/generated/src-atop.c
+++ b/operations/generated/src-atop.c
@@ -58,7 +58,8 @@ process (GeglOperation        *op,
           void                *aux_buf,
           void                *out_buf,
           glong                n_pixels,
-          const GeglRectangle *roi)
+          const GeglRectangle *roi,
+          gint                 level)
 {
   gint i;
   gfloat * GEGL_ALIGNED in = in_buf;
diff --git a/operations/generated/src-in.c b/operations/generated/src-in.c
index a2c616c..ee6ec47 100644
--- a/operations/generated/src-in.c
+++ b/operations/generated/src-in.c
@@ -58,7 +58,8 @@ process (GeglOperation        *op,
           void                *aux_buf,
           void                *out_buf,
           glong                n_pixels,
-          const GeglRectangle *roi)
+          const GeglRectangle *roi,
+          gint                 level)
 {
   gint i;
   gfloat * GEGL_ALIGNED in = in_buf;
diff --git a/operations/generated/src-out.c b/operations/generated/src-out.c
index f4e4553..26a649b 100644
--- a/operations/generated/src-out.c
+++ b/operations/generated/src-out.c
@@ -58,7 +58,8 @@ process (GeglOperation        *op,
           void                *aux_buf,
           void                *out_buf,
           glong                n_pixels,
-          const GeglRectangle *roi)
+          const GeglRectangle *roi,
+          gint                 level)
 {
   gint i;
   gfloat * GEGL_ALIGNED in = in_buf;
diff --git a/operations/generated/src-over.c b/operations/generated/src-over.c
index bacae4a..1bddb16 100644
--- a/operations/generated/src-over.c
+++ b/operations/generated/src-over.c
@@ -58,7 +58,8 @@ process (GeglOperation        *op,
           void                *aux_buf,
           void                *out_buf,
           glong                n_pixels,
-          const GeglRectangle *roi)
+          const GeglRectangle *roi,
+          gint                 level)
 {
   gint i;
   gfloat * GEGL_ALIGNED in = in_buf;
diff --git a/operations/generated/src.c b/operations/generated/src.c
index 78a15c7..74dfa22 100644
--- a/operations/generated/src.c
+++ b/operations/generated/src.c
@@ -58,7 +58,8 @@ process (GeglOperation        *op,
           void                *aux_buf,
           void                *out_buf,
           glong                n_pixels,
-          const GeglRectangle *roi)
+          const GeglRectangle *roi,
+          gint                 level)
 {
   gint i;
   gfloat * GEGL_ALIGNED in = in_buf;
diff --git a/operations/generated/subtract.c b/operations/generated/subtract.c
index 34f62d2..43317dc 100644
--- a/operations/generated/subtract.c
+++ b/operations/generated/subtract.c
@@ -56,7 +56,8 @@ process (GeglOperation        *op,
           void                *aux_buf,
           void                *out_buf,
           glong                n_pixels,
-          const GeglRectangle *roi)
+          const GeglRectangle *roi,
+          gint                 level)
 {
   gfloat * GEGL_ALIGNED in = in_buf;
   gfloat * GEGL_ALIGNED out = out_buf;
diff --git a/operations/generated/svg-12-blend.rb b/operations/generated/svg-12-blend.rb
index b6ca188..0e7680f 100755
--- a/operations/generated/svg-12-blend.rb
+++ b/operations/generated/svg-12-blend.rb
@@ -97,7 +97,8 @@ process (GeglOperation       *op,
          void                *aux_buf,
          void                *out_buf,
          glong                n_pixels,
-         const GeglRectangle *roi)
+         const GeglRectangle *roi,
+         gint                 level)
 {
   gfloat * GEGL_ALIGNED in = in_buf;
   gfloat * GEGL_ALIGNED aux = aux_buf;
diff --git a/operations/generated/svg-12-porter-duff.rb b/operations/generated/svg-12-porter-duff.rb
index 8d798dd..811cfd9 100755
--- a/operations/generated/svg-12-porter-duff.rb
+++ b/operations/generated/svg-12-porter-duff.rb
@@ -88,7 +88,8 @@ process (GeglOperation        *op,
           void                *aux_buf,
           void                *out_buf,
           glong                n_pixels,
-          const GeglRectangle *roi)
+          const GeglRectangle *roi,
+          gint                 level)
 {
   gint i;
   gfloat * GEGL_ALIGNED in = in_buf;
diff --git a/operations/generated/xor.c b/operations/generated/xor.c
index 1ee39a9..3eaa86c 100644
--- a/operations/generated/xor.c
+++ b/operations/generated/xor.c
@@ -58,7 +58,8 @@ process (GeglOperation        *op,
           void                *aux_buf,
           void                *out_buf,
           glong                n_pixels,
-          const GeglRectangle *roi)
+          const GeglRectangle *roi,
+          gint                 level)
 {
   gint i;
   gfloat * GEGL_ALIGNED in = in_buf;
diff --git a/operations/workshop/box-max.c b/operations/workshop/box-max.c
index 6d3af64..1bb654b 100644
--- a/operations/workshop/box-max.c
+++ b/operations/workshop/box-max.c
@@ -103,7 +103,7 @@ hor_max (GeglBuffer          *src,
       }
 
   gegl_buffer_set (dst, dst_rect, babl_format ("RGBA float"), dst_buf,
-                   GEGL_AUTO_ROWSTRIDE);
+                   GEGL_AUTO_ROWSTRIDE, 0);
   g_free (src_buf);
   g_free (dst_buf);
 }
@@ -145,7 +145,7 @@ ver_max (GeglBuffer *src,
       }
 
   gegl_buffer_set (dst, dst_rect, babl_format ("RGBA float"), dst_buf,
-                   GEGL_AUTO_ROWSTRIDE);
+                   GEGL_AUTO_ROWSTRIDE, 0);
   g_free (src_buf);
   g_free (dst_buf);
 }
@@ -164,7 +164,8 @@ static gboolean
 process (GeglOperation       *operation,
          GeglBuffer          *input,
          GeglBuffer          *output,
-         const GeglRectangle *result)
+         const GeglRectangle *result,
+         gint                 level)
 {
   GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
   GeglRectangle input_rect = gegl_operation_get_required_for_output (operation, "input", result);
diff --git a/operations/workshop/box-min.c b/operations/workshop/box-min.c
index 78f197c..8b177ee 100644
--- a/operations/workshop/box-min.c
+++ b/operations/workshop/box-min.c
@@ -103,7 +103,7 @@ hor_min (GeglBuffer          *src,
       }
 
   gegl_buffer_set (dst, dst_rect, babl_format ("RGBA float"), dst_buf,
-                   GEGL_AUTO_ROWSTRIDE);
+                   GEGL_AUTO_ROWSTRIDE, 0);
   g_free (src_buf);
   g_free (dst_buf);
 }
@@ -145,7 +145,7 @@ ver_min (GeglBuffer *src,
       }
 
   gegl_buffer_set (dst, dst_rect, babl_format ("RGBA float"), dst_buf,
-                   GEGL_AUTO_ROWSTRIDE);
+                   GEGL_AUTO_ROWSTRIDE, 0);
   g_free (src_buf);
   g_free (dst_buf);
 }
@@ -164,7 +164,8 @@ static gboolean
 process (GeglOperation       *operation,
          GeglBuffer          *input,
          GeglBuffer          *output,
-         const GeglRectangle *result)
+         const GeglRectangle *result,
+         gint                 level)
 {
   GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
   GeglRectangle input_rect = gegl_operation_get_required_for_output (operation, "input", result);
diff --git a/operations/workshop/box-percentile.c b/operations/workshop/box-percentile.c
index bed6768..c4ffee6 100644
--- a/operations/workshop/box-percentile.c
+++ b/operations/workshop/box-percentile.c
@@ -59,7 +59,8 @@ static gboolean
 process (GeglOperation       *operation,
          GeglBuffer          *input,
          GeglBuffer          *output,
-         const GeglRectangle *result)
+         const GeglRectangle *result,
+         gint                 level)
 {
   GeglChantO   *o = GEGL_CHANT_PROPERTIES (operation);
   GeglBuffer   *temp_in;
@@ -203,7 +204,7 @@ median (GeglBuffer *src,
         offset++;
       }
   gegl_buffer_set (dst, NULL, babl_format ("RGBA float"), dst_buf,
-                   GEGL_AUTO_ROWSTRIDE);
+                   GEGL_AUTO_ROWSTRIDE, 0);
   g_free (src_buf);
   g_free (dst_buf);
 }
diff --git a/operations/workshop/color-reduction.c b/operations/workshop/color-reduction.c
index 9153284..6264bd4 100644
--- a/operations/workshop/color-reduction.c
+++ b/operations/workshop/color-reduction.c
@@ -165,7 +165,7 @@ process_floyd_steinberg (GeglBuffer *input,
 
     /* Push output row */
 
-    gegl_buffer_set (output, &line_rect, babl_format ("RGBA u16"), line_buf, GEGL_AUTO_ROWSTRIDE);
+    gegl_buffer_set (output, &line_rect, babl_format ("RGBA u16"), line_buf, GEGL_AUTO_ROWSTRIDE, 0);
     line_rect.y++;
   }
 
@@ -231,7 +231,7 @@ process_bayer (GeglBuffer *input,
       }
     }
 
-    gegl_buffer_set (output, &line_rect, babl_format ("RGBA u16"), line_buf, GEGL_AUTO_ROWSTRIDE);
+    gegl_buffer_set (output, &line_rect, babl_format ("RGBA u16"), line_buf, GEGL_AUTO_ROWSTRIDE, 0);
     line_rect.y++;
   }
 
@@ -284,7 +284,7 @@ process_random_covariant (GeglBuffer *input,
       }
     }
 
-    gegl_buffer_set (output, &line_rect, babl_format ("RGBA u16"), line_buf, GEGL_AUTO_ROWSTRIDE);
+    gegl_buffer_set (output, &line_rect, babl_format ("RGBA u16"), line_buf, GEGL_AUTO_ROWSTRIDE, 0);
     line_rect.y++;
   }
 
@@ -336,7 +336,7 @@ process_random (GeglBuffer *input,
       }
     }
 
-    gegl_buffer_set (output, &line_rect, babl_format ("RGBA u16"), line_buf, GEGL_AUTO_ROWSTRIDE);
+    gegl_buffer_set (output, &line_rect, babl_format ("RGBA u16"), line_buf, GEGL_AUTO_ROWSTRIDE, 0);
     line_rect.y++;
   }
 
@@ -380,7 +380,7 @@ process_no_dither (GeglBuffer *input,
       }
     }
 
-    gegl_buffer_set (output, &line_rect, babl_format ("RGBA u16"), line_buf, GEGL_AUTO_ROWSTRIDE);
+    gegl_buffer_set (output, &line_rect, babl_format ("RGBA u16"), line_buf, GEGL_AUTO_ROWSTRIDE, 0);
     line_rect.y++;
   }
 
@@ -406,7 +406,8 @@ static gboolean
 process (GeglOperation       *operation,
          GeglBuffer          *input,
          GeglBuffer          *output,
-         const GeglRectangle *result)
+         const GeglRectangle *result,
+         gint                 level)
 {
   GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
   guint       channel_bits [4];
diff --git a/operations/workshop/demosaic-bimedian.c b/operations/workshop/demosaic-bimedian.c
index 7841092..34a03ba 100644
--- a/operations/workshop/demosaic-bimedian.c
+++ b/operations/workshop/demosaic-bimedian.c
@@ -167,7 +167,7 @@ demosaic (GeglChantO          *op,
       offset+=2;
     }
 
-  gegl_buffer_set (dst, dst_rect, babl_format ("RGB float"), dst_buf, GEGL_AUTO_ROWSTRIDE);
+  gegl_buffer_set (dst, dst_rect, babl_format ("RGB float"), dst_buf, GEGL_AUTO_ROWSTRIDE, 0);
   g_free (src_buf);
   g_free (dst_buf);
 }
@@ -189,7 +189,8 @@ static gboolean
 process (GeglOperation       *operation,
          GeglBuffer          *input,
          GeglBuffer          *output,
-         const GeglRectangle *result)
+         const GeglRectangle *result,
+         gint                 level)
 {
   GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
   GeglRectangle src_rect = gegl_operation_get_required_for_output (operation, "input", result);
diff --git a/operations/workshop/demosaic-simple.c b/operations/workshop/demosaic-simple.c
index d570e22..539c163 100644
--- a/operations/workshop/demosaic-simple.c
+++ b/operations/workshop/demosaic-simple.c
@@ -103,7 +103,7 @@ demosaic (GeglChantO          *op,
         }
     }
 
-  gegl_buffer_set (dst, dst_rect, babl_format ("RGB float"), dst_buf, GEGL_AUTO_ROWSTRIDE);
+  gegl_buffer_set (dst, dst_rect, babl_format ("RGB float"), dst_buf, GEGL_AUTO_ROWSTRIDE, 0);
   g_free (src_buf);
   g_free (dst_buf);
 }
@@ -120,7 +120,8 @@ static gboolean
 process (GeglOperation       *operation,
          GeglBuffer          *input,
          GeglBuffer          *output,
-         const GeglRectangle *result)
+         const GeglRectangle *result,
+         gint                 level)
 {
   GeglChantO   *o = GEGL_CHANT_PROPERTIES (operation);
   GeglRectangle compute = gegl_operation_get_required_for_output (operation, "input", result);
diff --git a/operations/workshop/disc-percentile.c b/operations/workshop/disc-percentile.c
index 85db564..2884939 100644
--- a/operations/workshop/disc-percentile.c
+++ b/operations/workshop/disc-percentile.c
@@ -173,7 +173,7 @@ median (GeglBuffer *src,
           dst_buf[offset*4+u] = median_pix[u];
         offset++;
       }
-  gegl_buffer_set (dst, NULL, babl_format ("RGBA float"), dst_buf, GEGL_AUTO_ROWSTRIDE);
+  gegl_buffer_set (dst, NULL, babl_format ("RGBA float"), dst_buf, GEGL_AUTO_ROWSTRIDE, 0);
   g_free (src_buf);
   g_free (dst_buf);
 }
@@ -190,7 +190,8 @@ static gboolean
 process (GeglOperation       *operation,
          GeglBuffer          *input,
          GeglBuffer          *output,
-         const GeglRectangle *result)
+         const GeglRectangle *result,
+         gint                 level)
 {
   GeglChantO   *o = GEGL_CHANT_PROPERTIES (operation);
   GeglBuffer   *temp_in;
diff --git a/operations/workshop/external/ff-save.c b/operations/workshop/external/ff-save.c
index 68acf53..cedf3bf 100644
--- a/operations/workshop/external/ff-save.c
+++ b/operations/workshop/external/ff-save.c
@@ -805,7 +805,8 @@ filechanged (GeglChantOperation *op, const char *att)
 static gboolean
 process (GeglOperation       *operation,
          GeglBuffer          *input,
-         const GeglRectangle *result)
+         const GeglRectangle *result,
+         gint                 level)
 {
   static gint inited = 0;
   GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
diff --git a/operations/workshop/external/gluas.c b/operations/workshop/external/gluas.c
index 43754b7..ebc5bf1 100644
--- a/operations/workshop/external/gluas.c
+++ b/operations/workshop/external/gluas.c
@@ -937,7 +937,8 @@ process (GeglOperation       *operation,
          GeglBuffer          *input,
          GeglBuffer          *aux,
          GeglBuffer          *output,
-         const GeglRectangle *result)
+         const GeglRectangle *result,
+         gint                 level)
 {
   GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
 
diff --git a/operations/workshop/external/line-profile.c b/operations/workshop/external/line-profile.c
index 583c11b..b477013 100644
--- a/operations/workshop/external/line-profile.c
+++ b/operations/workshop/external/line-profile.c
@@ -56,7 +56,8 @@ static gboolean
 process (GeglOperation       *operation,
          GeglBuffer          *input,
          GeglBuffer          *output,
-         const GeglRectangle *result)
+         const GeglRectangle *result,
+         gint                 level)
 {
   GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
   gint        width = MAX(MAX (o->width, o->x0), o->x1);
@@ -131,7 +132,7 @@ process (GeglOperation       *operation,
    cairo_line_to (cr, o->x1, o->y1);
    cairo_stroke (cr);
 
-    gegl_buffer_set (output, NULL, babl_format ("B'aG'aR'aA u8"), buf, GEGL_AUTO_ROWSTRIDE);
+    gegl_buffer_set (output, NULL, babl_format ("B'aG'aR'aA u8"), buf, GEGL_AUTO_ROWSTRIDE, 0);
   }
 
   return TRUE;
diff --git a/operations/workshop/generated/blend.rb b/operations/workshop/generated/blend.rb
index 60108fc..dcda16b 100755
--- a/operations/workshop/generated/blend.rb
+++ b/operations/workshop/generated/blend.rb
@@ -92,7 +92,8 @@ process (GeglOperation       *op,
          void                *aux_buf,
          void                *out_buf,
          glong                n_pixels,
-         const GeglRectangle *roi)
+         const GeglRectangle *roi,
+         gint                 level)
 {
   gfloat *in  = in_buf;
   gfloat *aux = aux_buf;
diff --git a/operations/workshop/hstack.c b/operations/workshop/hstack.c
index 084336c..4cd1a46 100644
--- a/operations/workshop/hstack.c
+++ b/operations/workshop/hstack.c
@@ -106,14 +106,12 @@ process (GeglOperation       *operation,
          GeglBuffer          *input,
          GeglBuffer          *aux,
          GeglBuffer          *output,
-         const GeglRectangle *result)
+         const GeglRectangle *result,
+         gint                 level)
 {
-  GeglOperationComposer *composer;
   GeglBuffer            *temp_in;
   GeglBuffer            *temp_aux;
 
-  composer = GEGL_OPERATION_COMPOSER (operation);
-
   /* FIXME: just pass the originals buffers if the result rectangle does not
    * include both input buffers
    */
@@ -144,7 +142,7 @@ process (GeglOperation       *operation,
               }
         }
       gegl_buffer_set (output, NULL, babl_format ("RGBA float"), buf,
-                       GEGL_AUTO_ROWSTRIDE);
+                       GEGL_AUTO_ROWSTRIDE, 0);
 
       g_free (buf);
       g_free (bufB);
diff --git a/operations/workshop/kuwahara-max.c b/operations/workshop/kuwahara-max.c
index a00bc4f..c12470e 100644
--- a/operations/workshop/kuwahara-max.c
+++ b/operations/workshop/kuwahara-max.c
@@ -190,7 +190,7 @@ kuwahara (GeglBuffer *src,
           offset++;
       }
 
-  gegl_buffer_set (dst, NULL, babl_format ("RGBA float"), dst_buf, GEGL_AUTO_ROWSTRIDE);
+  gegl_buffer_set (dst, NULL, babl_format ("RGBA float"), dst_buf, GEGL_AUTO_ROWSTRIDE, 0);
   g_free (src_buf);
   g_free (dst_buf);
 }
@@ -208,7 +208,8 @@ static gboolean
 process (GeglOperation       *operation,
          GeglBuffer          *input,
          GeglBuffer          *output,
-         const GeglRectangle *result)
+         const GeglRectangle *result,
+         gint                 level)
 {
   GeglChantO   *o = GEGL_CHANT_PROPERTIES (operation);
   GeglBuffer   *temp_in;
diff --git a/operations/workshop/kuwahara-min.c b/operations/workshop/kuwahara-min.c
index 520df23..116e016 100644
--- a/operations/workshop/kuwahara-min.c
+++ b/operations/workshop/kuwahara-min.c
@@ -190,7 +190,7 @@ kuwahara (GeglBuffer *src,
           offset++;
       }
 
-  gegl_buffer_set (dst, NULL, babl_format ("RGBA float"), dst_buf, GEGL_AUTO_ROWSTRIDE);
+  gegl_buffer_set (dst, NULL, babl_format ("RGBA float"), dst_buf, GEGL_AUTO_ROWSTRIDE, 0);
   g_free (src_buf);
   g_free (dst_buf);
 }
@@ -208,7 +208,8 @@ static gboolean
 process (GeglOperation       *operation,
          GeglBuffer          *input,
          GeglBuffer          *output,
-         const GeglRectangle *result)
+         const GeglRectangle *result,
+         gint                 level)
 {
   GeglChantO   *o = GEGL_CHANT_PROPERTIES (operation);
   GeglBuffer   *temp_in;
diff --git a/operations/workshop/kuwahara.c b/operations/workshop/kuwahara.c
index 7d0baa7..09ab5a3 100644
--- a/operations/workshop/kuwahara.c
+++ b/operations/workshop/kuwahara.c
@@ -190,7 +190,7 @@ kuwahara (GeglBuffer *src,
           offset++;
       }
 
-  gegl_buffer_set (dst, NULL, babl_format ("RGBA float"), dst_buf, GEGL_AUTO_ROWSTRIDE);
+  gegl_buffer_set (dst, NULL, babl_format ("RGBA float"), dst_buf, GEGL_AUTO_ROWSTRIDE, 0);
   g_free (src_buf);
   g_free (dst_buf);
 }
@@ -208,7 +208,8 @@ static gboolean
 process (GeglOperation       *operation,
          GeglBuffer          *input,
          GeglBuffer          *output,
-         const GeglRectangle *result)
+         const GeglRectangle *result,
+         gint                 level)
 {
   GeglChantO   *o = GEGL_CHANT_PROPERTIES (operation);
   GeglBuffer   *temp_in;
diff --git a/operations/workshop/lens-correct.c b/operations/workshop/lens-correct.c
new file mode 100644
index 0000000..41b6c5d
--- /dev/null
+++ b/operations/workshop/lens-correct.c
@@ -0,0 +1,408 @@
+/* This file is an image processing operation for GEGL
+ *
+ * GEGL is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * GEGL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GEGL; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright 2006 Ãyvind KolÃs <pippin gimp org>
+ * Copyright 2008 Bradley Broom <bmbroom gmail com>
+ */
+
+#include "config.h"
+#include <glib/gi18n-lib.h>
+
+
+#ifdef GEGL_CHANT_PROPERTIES
+
+gegl_chant_pointer (lens_info_pointer, _("Model"),
+                    _("Pointer to LensCorrectionModel"))
+
+#else
+
+#define GEGL_CHANT_TYPE_FILTER
+#define GEGL_CHANT_C_FILE       "lens-correct.c"
+
+#include "gegl-chant.h"
+#include <math.h>
+#include "lens-correct.h"
+
+#if 0
+#define TRACE       /* Define this to see basic tracing info. */
+#endif
+
+/* Find the src pixel that maps to the destination pixel passed as parameters x and y.
+ */
+static void
+find_src_pixel (LensCorrectionModel *lcip, ChannelCorrectionModel *pp,
+                gfloat x, gfloat y, gfloat *srcx, gfloat *srcy)
+{
+  double r, radj;
+
+  r = hypot (x - lcip->cx, y - lcip->cy) / lcip->rscale;
+  radj = (((pp->a*r+pp->b)*r+pp->c)*r+pp->d);
+  *srcx = (x - lcip->cx) * radj + lcip->cx;
+  *srcy = (y - lcip->cy) * radj + lcip->cy;
+}
+
+/* Find dst pixel that comes from the source pixel passed as parameters x and y.
+ */
+static void
+find_dst_pixel (LensCorrectionModel *lcip, ChannelCorrectionModel *pp,
+        gfloat x, gfloat y, gfloat *dstx, gfloat *dsty)
+{
+    /* Compute scaled distance of pixel from image center. */
+    gfloat srcr = hypot (x - lcip->cx, y - lcip->cy) / lcip->rscale;
+
+    /* Main path doesn't work for srcr == 0, but no need if pixel is close
+     * to image center.
+     */
+    if (srcr < 0.01/lcip->rscale) {
+        *dstx = x;
+    *dsty = y;
+    }
+    else {
+    gfloat dstr = srcr;
+        gfloat r;
+    #ifdef COUNT_IT
+      int it = 0;
+    #endif
+
+    /* Adjust dstr until r is within about one hundred of a pixel of srcr.
+     * Usually, one iteration is enough.
+     */
+    r = (((pp->a*dstr+pp->b)*dstr+pp->c)*dstr+pp->d) * dstr;
+    while (fabs (r - srcr) > 0.01/lcip->rscale) {
+        /* Compute derivative of lens distortion function at dstr. */
+            gfloat dr = ((4.0*pp->a*dstr+3.0*pp->b)*dstr+2.0*pp->c)*dstr+pp->d;
+        if (fabs(dr) < 1.0e-5) {
+        /* In theory, the derivative of a quartic function can have zeros,
+         * but I don't think any valid lens correction model will.
+         * Still, we check to avoid an infinite loop if the ChannelCorrectionModel is broken.
+         */
+            g_warning ("find_dst_pixel: x=%g y=%g found zero slope, bailing out", x, y);
+        break;
+        }
+        /* Adjust dstr based on error distance and current derivative. */
+        dstr += (srcr-r)/dr;
+        #ifdef COUNT_IT
+          it++;
+        #endif
+            r = (((pp->a*dstr+pp->b)*dstr+pp->c)*dstr+pp->d) * dstr;
+    }
+    #ifdef COUNT_IT
+      g_warning ("find_dst_pixel: iterations == %d", it);
+    #endif
+
+    /* Compute dst x,y coords from change in radial distance from image center. */
+    *dstx = (x - lcip->cx) * (dstr/srcr) + lcip->cx;
+    *dsty = (y - lcip->cy) * (dstr/srcr) + lcip->cy;
+    }
+}
+
+/* Define the type of the above two functions.
+ */
+typedef void pixel_map_func (LensCorrectionModel *lcip, ChannelCorrectionModel *pp,
+                 gfloat x, gfloat y, gfloat *dstx, gfloat *dsty);
+
+/* Compute the bounding box of the GeglRectangle, *in_rect,
+ * when passed through the pixel mapping function given by *mappix,
+ * using the LensCorrectionModel *lcip.
+ *
+ * The implementation assumes that the LensCorrectionModel is monotonic.
+ */
+static GeglRectangle
+map_region (const GeglRectangle *in_rect, LensCorrectionModel *lcip, pixel_map_func *mappix)
+{
+  GeglRectangle result = *in_rect;
+
+  #ifdef TRACE
+    g_warning ("> map_region in_rect=%dx%d+%d+%d", in_rect->width, in_rect->height, in_rect->x, in_rect->y);
+  #endif
+
+  if (result.width != 0 && result.height != 0)
+    {
+      gint ii;
+      gfloat x, y;
+      gfloat minx, miny, maxx, maxy;
+
+      /* To find the bounding box of the mapped pixels, we go around the
+       * perimeter of in_rect mapping each pixel.  By keeping track of
+       * the min/max x/y coordinates thus obtained, we compute the bounding box.
+       */
+      (*mappix) (lcip, &lcip->green, in_rect->x, in_rect->y, &minx, &miny);
+      maxx = minx; maxy = miny;
+      for (ii = 0; ii < 2*(in_rect->width+in_rect->height); ii++) {
+    /* Compute srcx,srcy coordinate for this point on the perimeter. */
+    gint srcx = in_rect->x;
+    gint srcy = in_rect->y;
+    if (ii < in_rect->width)
+      {
+        srcx += ii;
+      }
+    else if (ii < in_rect->width + in_rect->height)
+      {
+        srcx += in_rect->width;
+        srcy += (ii - in_rect->width);
+      }
+    else if (ii < 2*in_rect->width + in_rect->height)
+      {
+        srcy += in_rect->height;
+        srcx += 2*in_rect->width + in_rect->height - ii;
+      }
+    else
+      {
+        srcy += 2*(in_rect->width + in_rect->height) - ii;
+      }
+    /* Find dst pixels for each color channel. */
+        (*mappix) (lcip, &lcip->green, srcx, srcy, &x, &y);
+    if (x < minx) minx = x;
+    else if (x > maxx) maxx = x;
+    if (y < miny) miny = y;
+    else if (y > maxy) maxy = y;
+        (*mappix) (lcip, &lcip->red, srcx, srcy, &x, &y);
+    if (x < minx) minx = x;
+    else if (x > maxx) maxx = x;
+    if (y < miny) miny = y;
+    else if (y > maxy) maxy = y;
+        (*mappix) (lcip, &lcip->blue, srcx, srcy, &x, &y);
+    if (x < minx) minx = x;
+    else if (x > maxx) maxx = x;
+    if (y < miny) miny = y;
+    else if (y > maxy) maxy = y;
+      }
+      result.x = minx;
+      result.y = miny;
+      result.width = maxx - minx + 1;
+      result.height = maxy - miny + 1;
+    }
+  #ifdef TRACE
+    g_warning ("< map_region result=%dx%d+%d+%d", result.width, result.height, result.x, result.y);
+  #endif
+  return result;
+}
+
+/* We expect src_extent to include all pixels required to form the
+ * pixels of dst_extent.
+ */
+#define ROW src_extent->width
+#define COL 1
+static void
+copy_through_lens (LensCorrectionModel *oip,
+                   GeglBuffer *src,
+                   GeglBuffer *dst)
+{
+  const GeglRectangle *src_extent;
+  const GeglRectangle *dst_extent;
+  gfloat *src_buf;
+  gfloat *dst_buf;
+  gint x,y;             /* Coordinate of current dst pixel. */
+  gint rgb;             /* Color channel of dst pixel being processed. */
+  gint doffset;             /* Buffer offset of current dst pixel. */
+  gint tmpx, tmpy, toff;
+  ChannelCorrectionModel *ccm[3];   /* Allow access to red,green,blue models in loop. */
+
+  src_extent = gegl_buffer_get_extent (src);
+  #ifdef TRACE
+    g_warning ("> copy_through_lens src_extent = %dx%d+%d+%d",
+                 src_extent->width, src_extent->height, src_extent->x,src_extent->y);
+  #endif
+  if (dst == NULL)
+    {
+      #ifdef TRACE
+        g_warning ("  dst is NULL");
+        g_warning ("< copy_through_lens");
+      #endif
+      return;
+    }
+  dst_extent = gegl_buffer_get_extent (dst);
+  if (dst_extent == NULL) {
+      #ifdef TRACE
+        g_warning ("  dst_extent is NULL");
+        g_warning ("< copy_through_lens");
+      #endif
+      return;
+  }
+
+  /* Get src pixels. */
+  src_buf = g_new0 (gfloat, gegl_buffer_get_pixel_count (src) * 3);
+  gegl_buffer_get (src, 1.0, NULL, babl_format ("RGB float"), src_buf, GEGL_AUTO_ROWSTRIDE);
+
+  /* Get buffer in which to place dst pixels. */
+  dst_buf = g_new0 (gfloat, gegl_buffer_get_pixel_count (dst) * 3);
+
+  /* Compute each dst pixel in turn and store into dst buffer. */
+  ccm[0] = &oip->red;
+  ccm[1] = &oip->green;
+  ccm[2] = &oip->blue;
+  doffset = 0;
+  for (y=dst_extent->y; y<dst_extent->height + dst_extent->y; y++)
+    {
+      for (x=dst_extent->x; x<dst_extent->width + dst_extent->x; x++)
+    {
+      for (rgb = 0; rgb < 3; rgb++)
+        {
+          gfloat gx, gy;
+          gfloat val = 0.0;
+          gint xx, yy;
+          gfloat wx[2], wy[2], wt = 0.0;
+
+          find_src_pixel (oip, ccm[rgb], (gfloat)x, (gfloat)y, &gx, &gy);
+          tmpx = gx;
+          tmpy = gy;
+          wx[1] = gx - tmpx;
+          wx[0] = 1.0 - wx[1];
+          wy[1] = gy - tmpy;
+          wy[0] = 1.0 - wy[1];
+          tmpx -= src_extent->x;
+          tmpy -= src_extent->y;
+          toff = (tmpy * ROW + tmpx) * 3;
+          for (xx = 0; xx < 2; xx++)
+            {
+          for (yy = 0; yy < 2; yy++)
+            {
+              if (tmpx+xx >= 0 && tmpx+xx < src_extent->width &&
+                  tmpy+yy >= 0 && tmpy+yy < src_extent->height)
+                {
+              val += src_buf[toff+(yy*ROW+xx)*3+rgb] * wx[xx] * wy[yy];
+              wt += wx[xx] * wy[yy];
+            }
+            }
+        }
+          if (wt <= 0)
+        {
+          g_warning ("gegl_lens_correct: mapped pixel %g,%g not in %dx%d+%d+%d", gx, gy,
+                 src_extent->width, src_extent->height, src_extent->x, src_extent->y);
+          g_warning ("                   dst = %dx%d+%d+%d", dst_extent->width, dst_extent->height, dst_extent->x,dst_extent->y);
+          dst_buf [doffset+rgb] = 0.0;
+        }
+          else
+        {
+          dst_buf [doffset+rgb] = val / wt;
+        }
+        }
+      doffset+=3;
+    }
+    }
+
+  /* Store dst pixels. */
+  gegl_buffer_set (dst, NULL, babl_format ("RGB float"), dst_buf, GEGL_AUTO_ROWSTRIDE, 0);
+
+  /* Free acquired storage. */
+  g_free (src_buf);
+  g_free (dst_buf);
+
+  #ifdef TRACE
+    g_warning ("< copy_through_lens");
+  #endif
+}
+
+/*****************************************************************************/
+
+/* Compute the region for which this operation is defined.
+ */
+static GeglRectangle
+get_bounding_box (GeglOperation *operation)
+{
+  GeglRectangle  result = {0,0,0,0};
+  GeglRectangle *in_rect = gegl_operation_source_get_bounding_box (operation, "input");
+  GeglChantO    *area = GEGL_CHANT_PROPERTIES (operation);
+
+  #ifdef TRACE
+    g_warning ("> get_bounding_box pointer == 0x%x in_rect == 0x%x", area->lens_info_pointer, in_rect);
+  #endif
+  if (in_rect && area->lens_info_pointer)
+    result = map_region (in_rect, area->lens_info_pointer, find_dst_pixel);
+
+  #ifdef TRACE
+    g_warning ("< get_bounding_box result = %dx%d+%d+%d", result.width, result.height, result.x, result.y);
+  #endif
+  return result;
+}
+
+/* Compute the input rectangle required to compute the specified region of interest (roi).
+ */
+static GeglRectangle
+get_required_for_output (GeglOperation        *operation,
+                         const gchar         *input_pad,
+                         const GeglRectangle *roi)
+{
+  GeglChantO   *area = GEGL_CHANT_PROPERTIES (operation);
+  GeglRectangle result = *gegl_operation_source_get_bounding_box (operation, "input");
+  #ifdef TRACE
+    g_warning ("> get_required_for_output src=%dx%d+%d+%d", result.width, result.height, result.x, result.y);
+    if (roi)
+      g_warning ("  ROI == %dx%d+%d+%d", roi->width, roi->height, roi->x, roi->y);
+  #endif
+  if (roi && area->lens_info_pointer) {
+    result = map_region (roi, area->lens_info_pointer, find_src_pixel);
+    result.width++;
+    result.height++;
+  }
+  #ifdef TRACE
+    g_warning ("< get_required_for_output res=%dx%d+%d+%d", result.width, result.height, result.x, result.y);
+  #endif
+  return result;
+}
+
+/* Specify the input and output buffer formats.
+ */
+static void
+prepare (GeglOperation *operation)
+{
+  #ifdef TRACE
+    g_warning ("> prepare");
+  #endif
+  gegl_operation_set_format (operation, "input", babl_format ("RGB float"));
+  gegl_operation_set_format (operation, "output", babl_format ("RGB float"));
+  #ifdef TRACE
+    g_warning ("< prepare");
+  #endif
+}
+
+/* Perform the specified operation.
+ */
+static gboolean
+process (GeglOperation       *operation,
+         GeglBuffer          *input,
+         GeglBuffer          *output,
+         const GeglRectangle *result,
+         gint                 level)
+{
+  GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
+
+  copy_through_lens (o->lens_info_pointer, input, output);
+
+  return TRUE;
+}
+
+
+static void
+gegl_chant_class_init (GeglChantClass *klass)
+{
+  GeglOperationClass       *operation_class;
+  GeglOperationFilterClass *filter_class;
+
+  operation_class = GEGL_OPERATION_CLASS (klass);
+  filter_class    = GEGL_OPERATION_FILTER_CLASS (klass);
+
+  filter_class->process = process;
+  operation_class->prepare = prepare;
+  operation_class->get_bounding_box = get_bounding_box;
+  operation_class->get_required_for_output = get_required_for_output;
+
+  operation_class->name        = "gegl:lens-correct";
+  operation_class->categories  = "blur";
+  operation_class->description =
+        _("Copies image performing lens distortion correction.");
+}
+
+#endif
diff --git a/operations/workshop/linear-gradient.c b/operations/workshop/linear-gradient.c
index 4fe71d9..6bc289d 100644
--- a/operations/workshop/linear-gradient.c
+++ b/operations/workshop/linear-gradient.c
@@ -61,7 +61,8 @@ static gboolean
 process (GeglOperation       *operation,
          void                *out_buf,
          glong                n_pixels,
-         const GeglRectangle *roi)
+         const GeglRectangle *roi,
+         gint                 level)
 {
   GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
   gfloat     *out_pixel = out_buf;
diff --git a/operations/workshop/mandelbrot.c b/operations/workshop/mandelbrot.c
index e5df9d7..9b012f8 100644
--- a/operations/workshop/mandelbrot.c
+++ b/operations/workshop/mandelbrot.c
@@ -82,7 +82,8 @@ get_bounding_box (GeglOperation *operation)
 static gboolean
 process (GeglOperation       *operation,
          GeglBuffer          *output,
-         const GeglRectangle *result)
+         const GeglRectangle *result,
+         gint                 level)
 {
   GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
   gfloat     *buf;
@@ -117,7 +118,7 @@ process (GeglOperation       *operation,
     }
 
   gegl_buffer_set (output, NULL, babl_format ("Y float"), buf,
-                   GEGL_AUTO_ROWSTRIDE);
+                   GEGL_AUTO_ROWSTRIDE, 0);
   g_free (buf);
 
   return  TRUE;
diff --git a/operations/workshop/max-rgb.c b/operations/workshop/max-rgb.c
index a8a952e..802cbec 100644
--- a/operations/workshop/max-rgb.c
+++ b/operations/workshop/max-rgb.c
@@ -49,7 +49,8 @@ process (GeglOperation       *op,
          void                *in_buf,
          void                *out_buf,
          glong                n_pixels,
-         const GeglRectangle *roi)
+         const GeglRectangle *roi,
+         gint                 level)
 {
   GeglChantO *o = GEGL_CHANT_PROPERTIES (op);
   gfloat     * GEGL_ALIGNED in_pixel;
diff --git a/operations/workshop/noise-spread.c b/operations/workshop/noise-spread.c
index caeea4c..e02bda4 100644
--- a/operations/workshop/noise-spread.c
+++ b/operations/workshop/noise-spread.c
@@ -99,7 +99,7 @@ apply_spread (gint                 x_amount,
   gegl_buffer_sample_cleanup (src);
 
   /* Store dst pixels. */
-  gegl_buffer_set (dst, roi, format, dst_buf, GEGL_AUTO_ROWSTRIDE);
+  gegl_buffer_set (dst, roi, format, dst_buf, GEGL_AUTO_ROWSTRIDE, 0);
 
   gegl_buffer_flush(dst);
 
@@ -133,7 +133,8 @@ static gboolean
 process (GeglOperation       *operation,
          GeglBuffer          *input,
          GeglBuffer          *output,
-         const GeglRectangle *result)
+         const GeglRectangle *result,
+         gint                 level)
 {
   GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
   GeglRectangle boundary = gegl_operation_get_bounding_box (operation);
diff --git a/operations/workshop/posterize.c b/operations/workshop/posterize.c
index bd16361..d97dc07 100644
--- a/operations/workshop/posterize.c
+++ b/operations/workshop/posterize.c
@@ -42,7 +42,8 @@ static gboolean process (GeglOperation       *operation,
                          void                *in_buf,
                          void                *out_buf,
                          glong                samples,
-                         const GeglRectangle *roi)
+                         const GeglRectangle *roi,
+                         gint                 level)
 {
   GeglChantO *o      = GEGL_CHANT_PROPERTIES (operation);
   gfloat     *src    = in_buf;
diff --git a/operations/workshop/radial-gradient.c b/operations/workshop/radial-gradient.c
index a23045f..5713836 100644
--- a/operations/workshop/radial-gradient.c
+++ b/operations/workshop/radial-gradient.c
@@ -61,7 +61,8 @@ static gboolean
 process (GeglOperation       *operation,
          void                *out_buf,
          glong                n_pixels,
-         const GeglRectangle *roi)
+         const GeglRectangle *roi,
+         gint                 level)
 {
   GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
   gfloat     *out_pixel = out_buf;
diff --git a/operations/workshop/rawbayer-load.c b/operations/workshop/rawbayer-load.c
index 8a95adc..e9b5041 100644
--- a/operations/workshop/rawbayer-load.c
+++ b/operations/workshop/rawbayer-load.c
@@ -88,7 +88,7 @@ load_buffer (GeglChantO *op_raw_load)
                                  babl_component ("B"),
                                  NULL),
                             buf,
-                            GEGL_AUTO_ROWSTRIDE);
+                            GEGL_AUTO_ROWSTRIDE, 0);
            g_free (buf);
          }
        fclose (pfp);
@@ -109,11 +109,10 @@ get_bounding_box (GeglOperation *operation)
 }
 
 static gboolean
-process (GeglOperation       *operation,
-         GeglOperationContext     *context,
-         const gchar         *output_pad,
-         const GeglRectangle *result)
-
+process (GeglOperation        *operation,
+         GeglOperationContext *context,
+         const gchar          *output_pad,
+         const GeglRectangle  *result)
 {
   GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
 #if 1
@@ -140,10 +139,8 @@ static void
 gegl_chant_class_init (GeglChantClass *klass)
 {
   GeglOperationClass       *operation_class;
-  GeglOperationSourceClass *source_class;
 
   operation_class = GEGL_OPERATION_CLASS (klass);
-  source_class    = GEGL_OPERATION_SOURCE_CLASS (klass);
 
   operation_class->process = process;
   operation_class->get_bounding_box = get_bounding_box;
diff --git a/operations/workshop/snn-percentile.c b/operations/workshop/snn-percentile.c
index cafe0bf..8372340 100644
--- a/operations/workshop/snn-percentile.c
+++ b/operations/workshop/snn-percentile.c
@@ -212,7 +212,7 @@ snn_percentile (GeglBuffer *src,
         }
         offset++;
       }
-  gegl_buffer_set (dst, NULL, babl_format ("RGBA float"), dst_buf, GEGL_AUTO_ROWSTRIDE);
+  gegl_buffer_set (dst, NULL, babl_format ("RGBA float"), dst_buf, GEGL_AUTO_ROWSTRIDE, 0);
   g_free (src_buf);
   g_free (dst_buf);
 }
@@ -229,7 +229,8 @@ static gboolean
 process (GeglOperation       *operation,
          GeglBuffer          *input,
          GeglBuffer          *output,
-         const GeglRectangle *result)
+         const GeglRectangle *result,
+         gint                 level)
 {
   GeglChantO   *o = GEGL_CHANT_PROPERTIES (operation);
   GeglBuffer   *temp_in;
diff --git a/operations/workshop/unpremul.c b/operations/workshop/unpremul.c
index 6d6883b..e463286 100644
--- a/operations/workshop/unpremul.c
+++ b/operations/workshop/unpremul.c
@@ -33,7 +33,8 @@ process (GeglOperation       *op,
          void                *in_buf,
          void                *out_buf,
          glong                samples,
-         const GeglRectangle *roi)
+         const GeglRectangle *roi,
+         gint                 level)
 {
   glong   i;
   gfloat *in  = in_buf;
diff --git a/operations/workshop/whirl-pinch.c b/operations/workshop/whirl-pinch.c
index 7967674..a954fc2 100644
--- a/operations/workshop/whirl-pinch.c
+++ b/operations/workshop/whirl-pinch.c
@@ -163,7 +163,7 @@ apply_whirl_pinch (gdouble whirl, gdouble pinch, gdouble radius,
   } /* for */
 
   /* Store dst pixels. */
-  gegl_buffer_set (dst, roi, format, dst_buf, GEGL_AUTO_ROWSTRIDE);
+  gegl_buffer_set (dst, roi, format, dst_buf, GEGL_AUTO_ROWSTRIDE, 0);
 
   gegl_buffer_flush(dst);
 
@@ -215,7 +215,8 @@ static gboolean
 process (GeglOperation       *operation,
          GeglBuffer          *input,
          GeglBuffer          *output,
-         const GeglRectangle *result)
+         const GeglRectangle *result,
+         gint                 level)
 {
   GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
   GeglRectangle boundary = gegl_operation_get_bounding_box (operation);
diff --git a/tests/buffer/buffer-test.c b/tests/buffer/buffer-test.c
index 4a612ba..9a01846 100644
--- a/tests/buffer/buffer-test.c
+++ b/tests/buffer/buffer-test.c
@@ -149,7 +149,7 @@ print_buffer_internal (GString    *gstring,
                         "height", &height,
                         NULL);
   buf = g_malloc (width*height*sizeof(gfloat));
-  gegl_buffer_get (buffer, 1.0, NULL, babl_format ("Y float"), buf, 0);
+  gegl_buffer_get (buffer, NULL, 1.0, babl_format ("Y float"), buf, 0);
   print_linear_buffer_internal_float (gstring, width, height, buf);
   g_free (buf);
 }
@@ -168,7 +168,7 @@ fill (GeglBuffer *buffer,
                         "height", &height,
                         NULL);
   buf = g_malloc (width*height*sizeof(gfloat));
-  gegl_buffer_get (buffer, 1.0, NULL, babl_format ("Y float"), buf, 0);
+  gegl_buffer_get (buffer, NULL, 1.0, babl_format ("Y float"), buf, 0);
 
   i=0;
   for (y=0;y<height;y++)
@@ -178,7 +178,7 @@ fill (GeglBuffer *buffer,
           buf[i++]=value;
         }
     }
-  gegl_buffer_set (buffer, NULL, babl_format ("Y float"), buf, GEGL_AUTO_ROWSTRIDE);
+  gegl_buffer_set (buffer, NULL, 0, babl_format ("Y float"), buf, GEGL_AUTO_ROWSTRIDE);
   g_free (buf);
 }
 
@@ -197,7 +197,7 @@ static void checkerboard          (GeglBuffer *buffer,
                         "height", &height,
                         NULL);
   buf = g_malloc (width*height*sizeof(gfloat));
-  gegl_buffer_get (buffer, 1.0, NULL, babl_format ("Y float"), buf, 0);
+  gegl_buffer_get (buffer, NULL, 1.0, babl_format ("Y float"), buf, 0);
 
   i=0;
   for (y=0;y<height;y++)
@@ -223,7 +223,7 @@ static void checkerboard          (GeglBuffer *buffer,
         }
     }
 
-  gegl_buffer_set (buffer, NULL, babl_format ("Y float"), buf, GEGL_AUTO_ROWSTRIDE);
+  gegl_buffer_set (buffer, NULL, 0, babl_format ("Y float"), buf, GEGL_AUTO_ROWSTRIDE);
 
   g_free (buf);
 }
@@ -240,7 +240,7 @@ static void vgrad (GeglBuffer *buffer)
                         "height", &height,
                         NULL);
   buf = g_malloc (width*height*sizeof(gfloat));
-  gegl_buffer_get (buffer, 1.0, NULL, babl_format ("Y float"), buf, 0);
+  gegl_buffer_get (buffer, NULL, 1.0, babl_format ("Y float"), buf, 0);
 
   i=0;
   for (y=0;y<height;y++)
@@ -250,7 +250,7 @@ static void vgrad (GeglBuffer *buffer)
           buf[i++]= (1.0*y)/height;
         }
     }
-  gegl_buffer_set (buffer, NULL, babl_format ("Y float"), buf, GEGL_AUTO_ROWSTRIDE);
+  gegl_buffer_set (buffer, NULL, 0, babl_format ("Y float"), buf, GEGL_AUTO_ROWSTRIDE);
   g_free (buf);
 }
 
@@ -260,7 +260,7 @@ static void fill_rect (GeglBuffer          *buffer,
                        )
 {
   GeglBufferIterator *gi;
-  gi = gegl_buffer_iterator_new (buffer, roi, NULL, GEGL_BUFFER_WRITE);
+  gi = gegl_buffer_iterator_new (buffer, roi, NULL, GEGL_BUFFER_WRITE, 0);
   while (gegl_buffer_iterator_next (gi))
     {
       gfloat *buf = gi->data[0];
diff --git a/tests/buffer/tests/test_get_buffer_scaled.c b/tests/buffer/tests/test_get_buffer_scaled.c
index da16119..0b8da49 100644
--- a/tests/buffer/tests/test_get_buffer_scaled.c
+++ b/tests/buffer/tests/test_get_buffer_scaled.c
@@ -18,7 +18,7 @@ TEST ()
         {
           getrect.x=i;
           /*getrect.y=i;*/
-          gegl_buffer_get (buffer, 1.2, &getrect, babl_format ("Y u8"), buf, 0);
+          gegl_buffer_get (buffer, &getrect, 1.2, babl_format ("Y u8"), buf, 0);
           print_linear_buffer_u8 (getrect.width, getrect.height, buf);
         }
     }
diff --git a/tests/buffer/tests/test_get_buffer_scaled2.c b/tests/buffer/tests/test_get_buffer_scaled2.c
index b737ab7..ab4da47 100644
--- a/tests/buffer/tests/test_get_buffer_scaled2.c
+++ b/tests/buffer/tests/test_get_buffer_scaled2.c
@@ -11,7 +11,7 @@ TEST ()
   checkerboard (buffer, 2, 0.0, 1.0);
   buf = g_malloc (getrect.width*getrect.height*sizeof(gfloat));
 
-  gegl_buffer_get (buffer, 0.66, &getrect, babl_format ("Y u8"), buf, 0);
+  gegl_buffer_get (buffer, &getrect, 0.66, babl_format ("Y u8"), buf, 0);
 
 
   print_linear_buffer_u8 (getrect.width, getrect.height, buf);
diff --git a/tests/simple/test-change-processor-rect.c b/tests/simple/test-change-processor-rect.c
index 3769362..b1268a9 100644
--- a/tests/simple/test-change-processor-rect.c
+++ b/tests/simple/test-change-processor-rect.c
@@ -47,8 +47,8 @@ test_change_processor_rect_do_test (GeglProcessor       *processor,
   while (gegl_processor_work (processor, NULL));
 
   gegl_buffer_get (buffer,
-                   1.0,
                    rect,
+                   1.0,
                    babl_format ("RGBA float"),
                    result_buffer,
                    GEGL_AUTO_ROWSTRIDE);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]