[gegl] sampler: quality over speed



commit 8c9c3b70c528b13d4877d599e864657a1e5e9ad4
Author: Nicolas Robidoux <nrobidoux git gnome org>
Date:   Fri Dec 21 23:54:57 2012 -0500

    sampler: quality over speed

 gegl/buffer/gegl-sampler-lohalo.c |    4 ++--
 gegl/buffer/gegl-sampler.c        |   12 ++++++------
 2 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/gegl/buffer/gegl-sampler-lohalo.c b/gegl/buffer/gegl-sampler-lohalo.c
index d910992..07a04ae 100644
--- a/gegl/buffer/gegl-sampler-lohalo.c
+++ b/gegl/buffer/gegl-sampler-lohalo.c
@@ -390,7 +390,7 @@ gegl_sampler_lohalo_class_init (GeglSamplerLohaloClass *klass)
 /*
  * IMPORTANT: LOHALO_OFFSET_0 SHOULD BE AN INTEGER >= 2.
  */
-#define LOHALO_OFFSET_0 (4)
+#define LOHALO_OFFSET_0 (13)
 #define LOHALO_SIZE_0 (1+2*LOHALO_OFFSET_0)
 
 /*
@@ -403,7 +403,7 @@ gegl_sampler_lohalo_class_init (GeglSamplerLohaloClass *klass)
  * mipmap level's offset should almost never be smaller than half the
  * previous level's offset.
  */
-#define LOHALO_OFFSET_MIPMAP (4)
+#define LOHALO_OFFSET_MIPMAP (13)
 #define LOHALO_SIZE_MIPMAP (1+2*LOHALO_OFFSET_MIPMAP)
 
 #define LOHALO_OFFSET_1 LOHALO_OFFSET_MIPMAP
diff --git a/gegl/buffer/gegl-sampler.c b/gegl/buffer/gegl-sampler.c
index c7973a2..528c60e 100644
--- a/gegl/buffer/gegl-sampler.c
+++ b/gegl/buffer/gegl-sampler.c
@@ -273,10 +273,10 @@ gegl_sampler_get_ptr (GeglSampler *const sampler,
       fetch_rectangle.height = maximum_height;
       fetch_rectangle.x =
         x + sampler->context_rect[0].x -
-        (maximum_width  - sampler->context_rect[0].width ) / (gint) 8;
+        (maximum_width  - sampler->context_rect[0].width ) / (gint) 16;
       fetch_rectangle.y =
         y + sampler->context_rect[0].y -
-        (maximum_height - sampler->context_rect[0].height) / (gint) 4;
+        (maximum_height - sampler->context_rect[0].height) / (gint) 2;
 
       gegl_buffer_get (sampler->buffer,
                        &fetch_rectangle,
@@ -346,9 +346,9 @@ gegl_sampler_get_from_buffer (GeglSampler *const sampler,
       fetch_rectangle.width  = maximum_width;
       fetch_rectangle.height = maximum_height;
       fetch_rectangle.x = x -
-        (maximum_width  - sampler->context_rect[0].width ) / (gint) 8;
+        (maximum_width  - sampler->context_rect[0].width ) / (gint) 16;
       fetch_rectangle.y = y -
-        (maximum_height - sampler->context_rect[0].height) / (gint) 4;
+        (maximum_height - sampler->context_rect[0].height) / (gint) 2;
 
       gegl_buffer_get (sampler->buffer,
                        &fetch_rectangle,
@@ -427,10 +427,10 @@ gegl_sampler_get_from_mipmap (GeglSampler *const sampler,
       fetch_rectangle.height = maximum_height;
       fetch_rectangle.x =
         x + sampler->context_rect[level].x -
-        (maximum_width  - sampler->context_rect[level].width ) / (gint) 8;
+        (maximum_width  - sampler->context_rect[level].width ) / (gint) 16;
       fetch_rectangle.y =
         y + sampler->context_rect[level].y -
-        (maximum_height - sampler->context_rect[level].height) / (gint) 4;
+        (maximum_height - sampler->context_rect[level].height) / (gint) 2;
 
       gegl_buffer_get (sampler->buffer,
                        &fetch_rectangle,



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