IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 17120


Ignore:
Timestamp:
Mar 24, 2008, 6:19:27 PM (18 years ago)
Author:
eugene
Message:

use Image_to_Screen to follow parity flips

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/kapa2/src/PaintOverlay.c

    r16255 r17120  
    55  int i;
    66  int dX, dY, dx, dy;
    7   int x, y, X, Y, Xmin, Ymin, Xmax, Ymax, Xrange, Yrange;
    8   double t, expand, X0, Y0;
     7  int x, y, Xmin, Ymin, Xmax, Ymax, Xrange, Yrange;
     8  double t, expand, X, Y;
    99 
    1010  XSetForeground (graphic[0].display, graphic[0].gc, image[0].overlay[N].color);
     
    1212  expand = 1.0;
    1313  if (image[0].picture.expand > 0) {
    14     expand = 1 / (1.0*image[0].picture.expand);
     14    expand = image[0].picture.expand;
    1515  }
    1616  if (image[0].picture.expand < 0) {
    17     expand = fabs((double)image[0].picture.expand);
     17    expand = 1.0 / fabs((double)image[0].picture.expand);
    1818  }
    19 
    20   Image_to_Screen (&X0, &Y0, 0.0, 0.0, &image[0].picture);
    2119
    2220  Xmin = image[0].picture.x;
     
    2826
    2927  for (i = 0; i < image[0].overlay[N].Nobjects; i++) {
    30     X  = image[0].overlay[N].objects[i].x/expand + X0;
    31     Y =  image[0].overlay[N].objects[i].y/expand + Y0;
    32     dX = image[0].overlay[N].objects[i].dx/expand;
    33     dY = image[0].overlay[N].objects[i].dy/expand;
    34     if ((X + dX < Xmin) || (X - dX > Xmax) ||
    35         (Y + dY < Ymin) || (Y - dY > Ymax)) {
    36       continue;
    37     }
     28    Image_to_Screen (&X, &Y, image[0].overlay[N].objects[i].x, image[0].overlay[N].objects[i].y, &image[0].picture);
     29    dX = image[0].overlay[N].objects[i].dx * expand;
     30    dY = image[0].overlay[N].objects[i].dy * expand;
     31    if (image[0].picture.flipx) dX *= -1;
     32    if (image[0].picture.flipy) dY *= -1;
     33
     34    if (X + dX < Xmin) continue;
     35    if (X - dX > Xmax) continue;
     36    if (Y + dY < Ymin) continue;
     37    if (Y - dY > Ymax);
    3838
    3939    /* for a LINE, (x, y) is the start, (dx, dy) is the distance to end
Note: See TracChangeset for help on using the changeset viewer.