panolib.c: Implemented bilinear interpolation.
[libopano.git] / src / viewer.c
index 3494d19..8967b9c 100644 (file)
@@ -286,7 +286,7 @@ int main( int argc, char** argv )
        1);
   visual_g  = DefaultVisual(disp_g, screen_g);
 
-  pl_extract_view (view, pano, pitch, yaw, fov);
+  pl_extract_view (view, pano, pitch, yaw, fov, BILINEAR);
   draw_window (view);
 
   done = 0;
@@ -341,8 +341,6 @@ int main( int argc, char** argv )
       case ConfigureNotify:
        {
          XConfigureEvent *cev = (XConfigureEvent *) &event;
-         printf ("XConfigureEvent received: width = %i; height = %i;\n",
-             cev->width, cev->height);
 
          ui_destroy (view);
          view = ui_create (cev->width, cev->height);
@@ -434,6 +432,9 @@ int main( int argc, char** argv )
 
       case ButtonRelease:
        btn_current_pressed = 0;
+       /* Re-draw the image (when no button is pressed better interpolation is
+        * used. */
+       isChanged = 1;
        break;
 
       case MotionNotify:
@@ -495,7 +496,8 @@ int main( int argc, char** argv )
 
     if (isChanged != 0)
     {
-      pl_extract_view (view, pano, pitch, yaw, fov);
+      pl_extract_view (view, pano, pitch, yaw, fov,
+         (btn_current_pressed == 0) ? BILINEAR : NNEIGHBOUR);
       draw_window (view);
     }
   } /* while (done == 0) */