Changeset 27435 for trunk/Ohana/src/kapa2
- Timestamp:
- Mar 24, 2010, 11:22:25 AM (16 years ago)
- Location:
- trunk/Ohana
- Files:
-
- 7 edited
-
. (modified) (1 prop)
-
src/kapa2/src/Image.c (modified) (1 diff)
-
src/kapa2/src/LoadPicture.c (modified) (7 diffs)
-
src/kapa2/src/PNGit.c (modified) (1 diff)
-
src/kapa2/src/PPMit.c (modified) (1 diff)
-
src/kapa2/src/Relocate.c (modified) (1 diff)
-
src/kapa2/src/SetImageData.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana
-
Property svn:mergeinfo
set to
/branches/eam_branches/20091201/Ohana merged eligible /branches/eam_branches/largefiles.20100314/Ohana merged eligible
-
Property svn:mergeinfo
set to
-
trunk/Ohana/src/kapa2/src/Image.c
r25757 r27435 11 11 12 12 channel->coords.Npolyterms = 0; 13 channel->matrix. size = 0; /* a flag to show there is no data in the matrix */13 channel->matrix.datasize = 0; /* a flag to show there is no data in the matrix */ 14 14 ALLOCATE (channel->matrix.buffer, char, 1); /* allocate so later free will not crash! */ 15 15 -
trunk/Ohana/src/kapa2/src/LoadPicture.c
r26891 r27435 5 5 Header header; 6 6 char *buff; 7 int status, bytes_left;7 off_t status, bytes_left; 8 8 Section *section; 9 9 KapaImageWidget *image; … … 24 24 Xoffset = 0.0; 25 25 Yoffset = 0.0; 26 if (image[0].image[0].matrix. size) {26 if (image[0].image[0].matrix.datasize) { 27 27 // XXX enforce int center here? 28 28 Xoffset = image[0].picture.Xc - 0.5*image[0].image[0].matrix.Naxis[0]; … … 32 32 gfits_init_header (&header); 33 33 header.Naxes = 2; 34 KiiScanMessage (sock, "% d %d", &header.Naxis[0],&header.Naxis[1]);34 KiiScanMessage (sock, "%lld %lld", (long long *) &header.Naxis[0], (long long *) &header.Naxis[1]); 35 35 36 36 // internal image are 32 bit floats; sender must send in this format … … 41 41 42 42 KiiScanMessage (sock, "%lf %lf %s %s", &image[0].image[0].zero, &image[0].image[0].range, image[0].image[0].name, image[0].image[0].file); 43 KiiScanMessage (sock, "%lf %lf % d", &image[0].image[0].min, &image[0].image[0].max, &header.size);43 KiiScanMessage (sock, "%lf %lf %lld", &image[0].image[0].min, &image[0].image[0].max, (long long *) &header.datasize); 44 44 KiiScanMessage (sock, "%lf %f %f %f %f", &image[0].image[0].coords.crval1, &image[0].image[0].coords.crpix1, &image[0].image[0].coords.cdelt1, &image[0].image[0].coords.pc1_1, &image[0].image[0].coords.pc1_2); 45 45 KiiScanMessage (sock, "%lf %f %f %f %f", &image[0].image[0].coords.crval2, &image[0].image[0].coords.crpix2, &image[0].image[0].coords.cdelt2, &image[0].image[0].coords.pc2_1, &image[0].image[0].coords.pc2_2); … … 67 67 status = 1; 68 68 buff = image[0].image[0].matrix.buffer; 69 bytes_left = header. size;70 image[0].image[0].matrix. size = 0;69 bytes_left = header.datasize; 70 image[0].image[0].matrix.datasize = 0; 71 71 while (bytes_left > 0) { 72 72 status = read (sock, buff, bytes_left); … … 77 77 } 78 78 if (status != -1) { /* pipe has data */ 79 image[0].image[0].matrix. size += status;79 image[0].image[0].matrix.datasize += status; 80 80 bytes_left -= status; 81 81 buff = (char *)(buff + status); … … 85 85 fcntl (sock, F_SETFL, !O_NONBLOCK); 86 86 87 if (DEBUG) fprintf (stderr, "read % d bytes\n", image[0].image[0].matrix.size);88 /* it it not obvious this condition should kill k ii, but ... */89 if (image[0].image[0].matrix. size != header.size) {90 fprintf (stderr, "error: expected % d bytes, but got only %d\n", header.size, image[0].image[0].matrix.size);87 if (DEBUG) fprintf (stderr, "read %lld bytes\n", (long long) image[0].image[0].matrix.datasize); 88 /* it it not obvious this condition should kill kapa, but ... */ 89 if (image[0].image[0].matrix.datasize != header.datasize) { 90 fprintf (stderr, "error: expected %lld bytes, but got only %lld\n", (long long) header.datasize, (long long) image[0].image[0].matrix.datasize); 91 91 return (FALSE); 92 92 } -
trunk/Ohana/src/kapa2/src/PNGit.c
r26891 r27435 9 9 int Npalette; 10 10 char filename[1024]; 11 int Nbytes, status;12 11 bDrawBuffer *buffer; 13 12 Graphic *graphic; -
trunk/Ohana/src/kapa2/src/PPMit.c
r26891 r27435 5 5 FILE *f; 6 6 char *line, filename[1024]; 7 int Nbytes, status,dx, dy, i, j, Npalette, color;7 int dx, dy, i, j, Npalette, color; 8 8 png_color *palette; 9 9 bDrawBuffer *buffer; -
trunk/Ohana/src/kapa2/src/Relocate.c
r25757 r27435 4 4 int Relocate (int sock) { 5 5 6 int i, Nsection;7 6 int x, y, dX, dY; 8 7 Graphic *graphic; 9 Section *section;10 8 11 9 graphic = GetGraphic(); -
trunk/Ohana/src/kapa2/src/SetImageData.c
r16256 r27435 17 17 18 18 // get image data from client 19 KiiScanMessage (sock, "%lf %lf %s ",19 KiiScanMessage (sock, "%lf %lf %s %s", 20 20 &image[0].image[0].zero, 21 21 &image[0].image[0].range,
Note:
See TracChangeset
for help on using the changeset viewer.
