[gegl] sampler.c: / 8 -> >> 3 B/C always non negative numerator



commit 8ef12c12eb48f5de8b4dfe2b7892b27a591f0651
Author: Nicolas Robidoux <nicolas robidoux gmail com>
Date:   Thu Jun 30 09:32:08 2011 -0400

    sampler.c: / 8 -> >> 3 B/C always non negative numerator

 gegl/buffer/gegl-sampler.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/gegl/buffer/gegl-sampler.c b/gegl/buffer/gegl-sampler.c
index 24a1de9..3a2f491 100644
--- a/gegl/buffer/gegl-sampler.c
+++ b/gegl/buffer/gegl-sampler.c
@@ -277,10 +277,10 @@ gegl_sampler_get_ptr (GeglSampler *const sampler,
        */
       fetch_rectangle.x =
         x + sampler->context_rect[0].x
-        - ( maximum_width_and_height - sampler->context_rect[0].width  ) / 8;
+        - ( maximum_width_and_height - sampler->context_rect[0].width  ) >> 3;
       fetch_rectangle.y =
         y + sampler->context_rect[0].y
-        - ( maximum_width_and_height - sampler->context_rect[0].height ) / 8;
+        - ( maximum_width_and_height - sampler->context_rect[0].height ) >> 3;
 
       fetch_rectangle.width  = maximum_width_and_height;
       fetch_rectangle.height = maximum_width_and_height;
@@ -352,9 +352,9 @@ gegl_sampler_get_from_buffer (GeglSampler *const sampler,
       GeglRectangle fetch_rectangle;
 
       fetch_rectangle.x =
-        x - ( maximum_width_and_height - sampler->context_rect[0].width  ) / 8;
+        x - ( maximum_width_and_height - sampler->context_rect[0].width  ) >> 3;
       fetch_rectangle.y =
-        y - ( maximum_width_and_height - sampler->context_rect[0].height ) / 8;
+        y - ( maximum_width_and_height - sampler->context_rect[0].height ) >> 3;
 
       fetch_rectangle.width  = maximum_width_and_height;
       fetch_rectangle.height = maximum_width_and_height;
@@ -446,10 +446,10 @@ gegl_sampler_get_from_mipmap (GeglSampler *const sampler,
        */
       fetch_rectangle.x =
         x + sampler->context_rect[level].x
-        - ( maximum_width_and_height - sampler->context_rect[level].width  ) / 8;
+        - ( maximum_width_and_height - sampler->context_rect[level].width  ) >> 3;
       fetch_rectangle.y =
         y + sampler->context_rect[level].y
-        - ( maximum_width_and_height - sampler->context_rect[level].height ) / 8;
+        - ( maximum_width_and_height - sampler->context_rect[level].height ) >> 3;
 
       fetch_rectangle.width  = maximum_width_and_height;
       fetch_rectangle.height = maximum_width_and_height;



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