Changeset 3402 for trunk/Ohana/src/opihi
- Timestamp:
- Mar 9, 2005, 9:23:49 PM (21 years ago)
- Location:
- trunk/Ohana/src/opihi/dvo
- Files:
-
- 3 edited
-
ImageOps.c (modified) (2 diffs)
-
LoadImages.c (modified) (3 diffs)
-
images.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/dvo/ImageOps.c
r3393 r3402 44 44 while (flipped && (r > Rmid)) r-= 360.0; 45 45 status = RD_to_XY (&X, &Y, r, d, &graph[0].coords); 46 47 46 if (!status) continue; 48 47 if (X < graph[0].xmin) continue; … … 50 49 if (Y < graph[0].ymin) continue; 51 50 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); 57 } 58 break; 51 goto in_region; 52 /** we miss any images which surround the region. we are also 53 missing the DIS images for which the corners don't touch 54 the region, but which are needed for WRP images with 55 corners touching the region **/ 59 56 } 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 **/ 57 continue; 58 } 59 in_region: 60 subset[n] = i; 61 n++; 62 if (n > npts - 1) { 63 npts += 200; 64 REALLOCATE (subset, int, npts); 64 65 } 65 66 } -
trunk/Ohana/src/opihi/dvo/LoadImages.c
r3393 r3402 1 1 # include "dvo.h" 2 2 3 Image *LoadImages (int * Nimage) {3 Image *LoadImages (int *nimage) { 4 4 5 5 char filename[256]; 6 int nimage, NIMAGE;6 int Nimage, NIMAGE; 7 7 FILE *f; 8 8 Header header; … … 11 11 VarConfig ("IMAGE_CATALOG", "%s", filename); 12 12 13 *nimage = 0; 13 14 NIMAGE = 0; 14 15 Nimage = 0; … … 37 38 ALLOCATE (image, Image, NIMAGE); 38 39 fseek (f, header.size, SEEK_SET); 39 nimage = Fread (image, sizeof(Image), NIMAGE, f, "image");40 if ( nimage != NIMAGE) {41 fprintf (stderr, "failed to read in all images (%d of %d)\n", nimage, NIMAGE);40 Nimage = Fread (image, sizeof(Image), NIMAGE, f, "image"); 41 if (Nimage != NIMAGE) { 42 fprintf (stderr, "failed to read in all images (%d of %d)\n", Nimage, NIMAGE); 42 43 } 43 44 44 45 fclose (f); 45 * Nimage = nimage;46 *nimage = Nimage; 46 47 return (image); 47 48 } -
trunk/Ohana/src/opihi/dvo/images.c
r3393 r3402 86 86 87 87 /* project this image to screen display coords */ 88 x[0] = 0; y[0] = 0; 89 x[1] = image[i].NX; y[1] = 0; 90 x[2] = image[i].NX; y[2] = image[i].NY; 91 x[3] = 0; y[3] = image[i].NY; 88 /* DIS images represent a field, not a chip */ 89 if (!strcmp(&image[i].coords.ctype[4], "-DIS")) { 90 x[0] = -0.5*image[i].NX; y[0] = -0.5*image[i].NY; 91 x[1] = +0.5*image[i].NX; y[1] = -0.5*image[i].NY; 92 x[2] = +0.5*image[i].NX; y[2] = +0.5*image[i].NY; 93 x[3] = -0.5*image[i].NX; y[3] = +0.5*image[i].NY; 94 } else { 95 x[0] = 0; y[0] = 0; 96 x[1] = image[i].NX; y[1] = 0; 97 x[2] = image[i].NX; y[2] = image[i].NY; 98 x[3] = 0; y[3] = image[i].NY; 99 } 92 100 status = FALSE; 93 101
Note:
See TracChangeset
for help on using the changeset viewer.
