IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 24, 2010, 11:22:25 AM (16 years ago)
Author:
eugene
Message:

large update merging in changes for Ohana to support large files

Location:
trunk/Ohana
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana

  • trunk/Ohana/src/kapa2/src/Image.c

    r25757 r27435  
    1111
    1212  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 */
    1414  ALLOCATE (channel->matrix.buffer, char, 1);  /* allocate so later free will not crash! */
    1515
  • trunk/Ohana/src/kapa2/src/LoadPicture.c

    r26891 r27435  
    55  Header header;
    66  char *buff;
    7   int status, bytes_left;
     7  off_t status, bytes_left;
    88  Section *section;
    99  KapaImageWidget *image;
     
    2424  Xoffset = 0.0;
    2525  Yoffset = 0.0;
    26   if (image[0].image[0].matrix.size) {
     26  if (image[0].image[0].matrix.datasize) {
    2727    // XXX enforce int center here?
    2828    Xoffset = image[0].picture.Xc - 0.5*image[0].image[0].matrix.Naxis[0];
     
    3232  gfits_init_header (&header);
    3333  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]);
    3535
    3636  // internal image are 32 bit floats; sender must send in this format
     
    4141
    4242  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);
    4444  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);
    4545  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);
     
    6767  status = 1;
    6868  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;
    7171  while (bytes_left > 0) {
    7272    status = read (sock, buff, bytes_left);
     
    7777    }
    7878    if (status != -1) { /* pipe has data */
    79       image[0].image[0].matrix.size += status;
     79      image[0].image[0].matrix.datasize += status;
    8080      bytes_left -= status;
    8181      buff = (char *)(buff + status);
     
    8585  fcntl (sock, F_SETFL, !O_NONBLOCK); 
    8686
    87   if (DEBUG) fprintf (stderr, "read %d bytes\n", image[0].image[0].matrix.size);
    88   /* it it not obvious this condition should kill kii, 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);
    9191    return (FALSE);
    9292  }
  • trunk/Ohana/src/kapa2/src/PNGit.c

    r26891 r27435  
    99  int Npalette;
    1010  char filename[1024];
    11   int Nbytes, status;
    1211  bDrawBuffer *buffer;
    1312  Graphic *graphic;
  • trunk/Ohana/src/kapa2/src/PPMit.c

    r26891 r27435  
    55  FILE *f;
    66  char *line, filename[1024];
    7   int Nbytes, status, dx, dy, i, j, Npalette, color;
     7  int dx, dy, i, j, Npalette, color;
    88  png_color *palette;
    99  bDrawBuffer *buffer;
  • trunk/Ohana/src/kapa2/src/Relocate.c

    r25757 r27435  
    44int Relocate (int sock) {
    55 
    6   int i, Nsection;
    76  int x, y, dX, dY;
    87  Graphic *graphic;
    9   Section *section;
    108
    119  graphic = GetGraphic();
  • trunk/Ohana/src/kapa2/src/SetImageData.c

    r16256 r27435  
    1717 
    1818  // get image data from client
    19   KiiScanMessage (sock, "%lf %lf %s",
     19  KiiScanMessage (sock, "%lf %lf %s %s",
    2020                  &image[0].image[0].zero,
    2121                  &image[0].image[0].range,
Note: See TracChangeset for help on using the changeset viewer.