Changeset 3393 for trunk/Ohana/src/opihi/dvo/ImageOps.c
- Timestamp:
- Mar 7, 2005, 10:21:59 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/dvo/ImageOps.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/dvo/ImageOps.c
r2598 r3393 9 9 int *subset; 10 10 int N, n, npts; 11 double r, d, x[4], y[4], Rmin, Rmax, Rmid; 12 double X[8], Y[8]; 11 double r, d, X, Y, x[4], y[4], Rmin, Rmax, Rmid; 13 12 14 13 if (RegionSelect) { … … 16 15 Rmax = graph[0].coords.crval1 + 182.0; 17 16 Rmid = 0.5*(Rmin + Rmax); 17 BuildChipMatch (image, Nimage); 18 18 } 19 19 … … 22 22 trange = fabs (trange); 23 23 } 24 status = InPic = TRUE; 24 25 25 npts = 200; 26 26 ALLOCATE (subset, int, npts); … … 29 29 if (TimeSelect && ((image[i].tzero < tzero) || (image[i].tzero+image[i].trate*image[i].NY > tzero + trange))) continue; 30 30 if (RegionSelect) { 31 if (!FindMosaicForImage (image, Nimage, i)) continue; 31 32 /* project this image to screen display coords */ 32 33 x[0] = 0; y[0] = 0; … … 34 35 x[2] = image[i].NX; y[2] = image[i].NY; 35 36 x[3] = 0; y[3] = image[i].NY; 36 status = FALSE; 37 flipped = FALSE; 37 InPic = flipped = FALSE; 38 38 for (j = 0; j < 4; j++) { 39 39 XY_to_RD (&r, &d, x[j], y[j], &image[i].coords); 40 while ((j == 0) && (r < Rmin)) { flipped = TRUE; r += 360.0; } 41 while ((j == 0) && (r > Rmax)) { flipped = TRUE; r -= 360.0; } 42 if ((j > 0) && flipped) { 43 while (r < Rmid) r+= 360.0; 44 while (r > Rmid) r-= 360.0; 40 /* use same side of 0,360 boundary for all corners */ 41 if ((j == 0) && (r < Rmin)) flipped = TRUE; 42 if ((j == 0) && (r > Rmax)) flipped = TRUE; 43 while (flipped && (r < Rmid)) r+= 360.0; 44 while (flipped && (r > Rmid)) r-= 360.0; 45 status = RD_to_XY (&X, &Y, r, d, &graph[0].coords); 46 47 if (!status) continue; 48 if (X < graph[0].xmin) continue; 49 if (X > graph[0].xmax) continue; 50 if (Y < graph[0].ymin) continue; 51 if (Y > graph[0].ymax) continue; 52 subset[n] = i; 53 n++; 54 if (n > npts - 1) { 55 npts += 200; 56 REALLOCATE (subset, int, npts); 45 57 } 46 status |= RD_to_XY (&X[2*j], &Y[2*j], r, d, &graph[0].coords); 47 if (j > 0) { 48 X[2*j - 1] = X[2*j]; 49 Y[2*j - 1] = Y[2*j]; 50 } 58 break; 51 59 } 52 X[7] = X[0]; 53 Y[7] = Y[0]; 54 InPic = FALSE; 55 for (j = 0; status && (j < 8); j+=2) { 56 if ((X[j] >= graph[0].xmin) && 57 (X[j] <= graph[0].xmax) && 58 (Y[j] >= graph[0].ymin) && 59 (Y[j] <= graph[0].ymax)) 60 InPic = TRUE; 61 } 62 } 63 if (InPic && status) { 64 subset[n] = i; 65 n++; 66 if (n > npts - 1) { 67 npts += 200; 68 REALLOCATE (subset, int, npts); 69 } 60 /** we miss any images which surround the region. we are also 61 missing the DIS images for which the corners don't touch 62 the region, but which are needed for WRP images with 63 corners touching the region **/ 70 64 } 71 65 }
Note:
See TracChangeset
for help on using the changeset viewer.
