[gegl] lohalo.c: clearer comments



commit 6d276f216c14c497f472d55a2eefa935c7627b38
Author: Nicolas Robidoux <nrobidoux git gnome org>
Date:   Fri Nov 23 07:53:39 2012 -0500

    lohalo.c: clearer comments

 gegl/buffer/gegl-sampler-lohalo.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/gegl/buffer/gegl-sampler-lohalo.c b/gegl/buffer/gegl-sampler-lohalo.c
index dd7e75d..8796b9d 100644
--- a/gegl/buffer/gegl-sampler-lohalo.c
+++ b/gegl/buffer/gegl-sampler-lohalo.c
@@ -1297,6 +1297,12 @@ gegl_sampler_lohalo_get (      GeglSampler*    restrict  self,
    * from the anchor pixel location. That is: This computes the index
    * of the closest pixel center (one of the closest when there are
    * ties) within the GIMP convention.
+   *
+   * The reason why floor gives the index of the closest pixel center
+   * is that absolute positions are corner-based, meaning that the
+   * absolute position of the center of the pixel indexed (0,0) is
+   * (.5,.5) instead of (0,0), as it would be if absolute positions
+   * were center-based.
    */
   const gint ix_0 = floor ((double) absolute_x);
   const gint iy_0 = floor ((double) absolute_y);



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