]> Pileus Git - ~andy/gtk/commitdiff
Really fix the math to make the vectors sum up to 1, making
authorMatthias Clasen <mclasen@redhat.com>
Sun, 2 Jan 2005 07:10:30 +0000 (07:10 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Sun, 2 Jan 2005 07:10:30 +0000 (07:10 +0000)
2005-01-02  Matthias Clasen  <mclasen@redhat.com>

* pixops/pixops.c (bilinear_box_make_weights): Really fix the
math to make the vectors sum up to 1, making GDK_INTERP_HYPER
work again. (#162703, Dennis Nezic)

gdk-pixbuf/ChangeLog
gdk-pixbuf/pixops/pixops.c

index 2b453a37bc3463cbf51d4446cd750fd2890891ec..215b28320a8afedc1827c64fd662e6fa8fb11ee7 100644 (file)
@@ -1,3 +1,9 @@
+2005-01-02  Matthias Clasen  <mclasen@redhat.com>
+
+       * pixops/pixops.c (bilinear_box_make_weights): Really fix the
+       math to make the vectors sum up to 1, making GDK_INTERP_HYPER
+       work again. (#162703, Dennis Nezic)
+
 2004-12-27  Matthias Clasen  <mclasen@redhat.com>
 
        * gdk-pixbuf-animation.c (gdk_pixbuf_animation_new_from_file) 
index e263c13d16652752a1d7df5ff767007d3c2d60e6..cd7f493f79cba50bed21ebe879f16e8d25f64e22 100644 (file)
@@ -1313,7 +1313,7 @@ static void
 bilinear_box_make_weights (PixopsFilterDimension *dim,
                           double                 scale)
 {
-  int n = ceil (1/scale + 2.0);
+  int n = ceil (1/scale + 3.0);
   double *pixel_weights = g_new (double, SUBSAMPLE * n);
   double w;
   int offset, i;
@@ -1330,7 +1330,7 @@ bilinear_box_make_weights (PixopsFilterDimension *dim,
       for (i = 0; i < n; i++)
         {
           w  = linear_box_half (0.5 + i - a, 0.5 + i - x);
-          w += linear_box_half (0.5 + x - i, 0.5 + a - i);
+          w += linear_box_half (1.5 + x - i, 1.5 + a - i);
       
           *(pixel_weights++) = w * scale;
         }