IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 25291


Ignore:
Timestamp:
Sep 8, 2009, 4:24:06 PM (17 years ago)
Author:
eugene
Message:

fix calculation of start and stop pixels to display all pixels consistently between zoom factors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20090715/Ohana/src/kapa2/src/JPEGit24.c

    r19833 r25291  
    2222  int ii, i, j;
    2323  int i_start, i_end, j_start, j_end;
     24  int I_start, J_start;
    2425  int dropback;  /* this is a bit of a kludge... */
    2526  int dx, dy, DX, DY, inDX, inDY;
     
    9596  DY = image[0].image[0].matrix.Naxis[1];
    9697
    97   // x, y are the closest lit screen pixel to 0,0
    98   Picture_Lower (&i_start, &j_start, &image[0].image[0].matrix, &image[0].picture);
    99 
    100   // x, y are the closest lit screen pixel to dx, dy
    101   Picture_Upper (&i_end, &j_end, &image[0].image[0].matrix, &image[0].picture);
    102 
    103   if (i_end < i_start) MY_SWAP_INT (i_start, i_end);
    104   if (j_end < j_start) MY_SWAP_INT (j_start, j_end);
    105 
    106   // Ix,Iy are the first displayed image pixel
    107   Picture_to_Image (&Ix, &Iy, i_start, j_start, &image[0].picture);
    108   Ix = MIN (MAX (0, Ix), DX - 1);
    109   Iy = MIN (MAX (0, Iy), DY - 1);
     98  // i_start, j_start are the closest lit screen pixel to 0,0
     99  // I_start, J_start are the image pixel corresponding to i_start, j_start
     100  Picture_Lower (&i_start, &j_start, &I_start, &J_start, &image[0].image[0].matrix, &image[0].picture);
     101
     102  // i_end, j_end are the closest lit screen pixel to dx, dy
     103  // I_end, J_end are the image pixel corresponding to i_end, j_end
     104  Picture_Upper (&i_end, &j_end, i_start, j_start, &image[0].image[0].matrix, &image[0].picture);
     105
     106  assert (i_start <= i_end);
     107  assert (j_start <= j_end);
     108
     109  Ix = image[0].picture.flipx ? I_start - 1 : I_start;
     110  Iy = image[0].picture.flipy ? J_start - 1 : J_start;
    110111
    111112  inDX = image[0].picture.flipx ? -1 : +1;
Note: See TracChangeset for help on using the changeset viewer.