IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 19828


Ignore:
Timestamp:
Oct 2, 2008, 8:18:07 AM (18 years ago)
Author:
eugene
Message:

update the KiiLoadPicture2D to match kapa 32bit upgrade

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/libkapa/src/KiiPicture.c

    r16010 r19828  
    3737  /* done with the conversion, now send kapa the converted picture */
    3838  KiiSendMessage (fd, "%8d %8d", image[0].Nx, image[0].Ny);
    39   KiiSendMessage (fd, "-32 1 0.0 1.0");
    4039  KiiSendMessage (fd, "%f %f %s %s", data[0].zero, data[0].range, data[0].name, data[0].file);
    4140  KiiSendMessage (fd, "%f %f %d ", min, max, size);
     
    9392  /* done with the conversion, now send kapa the converted picture */
    9493  KiiSendMessage (fd, "%8d %8d", image[0].Nx, image[0].Ny);
    95   KiiSendMessage (fd, "8 1 0.0 1.0");
    9694  KiiSendMessage (fd, "%f %f %s %s", data[0].zero, data[0].range, data[0].name, data[0].file);
    9795  KiiSendMessage (fd, "%f %f %d ", min, max, size);
     
    121119  KiiScanMessage (fd, "%d", &Ncolors);
    122120
    123   ALLOCATE (outbuffer, char, Npix);
    124   out = outbuffer;
    125 
    126   /* need to invert the logic if range < 0 */
    127 
    128   /* define color table, */
    129   NNcolors = Ncolors - 1;
    130   if (data[0].logflux) {
    131     data[0].range = MAX (2, data[0].range);
    132     a1 = Ncolors / log10 (data[0].range);
    133     a2 = data[0].zero;
    134     for (j = 0; j < image[0].Ny; j++) {
    135       in = image[0].data2d[j];
    136       for (i = 0; i < image[0].Nx; i++, in++, out++) {
    137         *out = (char) MIN (a1 * log10 (MAX (*in - a2, 1.0)), NNcolors);
    138       }
    139     }
    140   } else {
    141     a1 = Ncolors / data[0].range;
    142     a2 = Ncolors * data[0].zero / data[0].range;
    143     for (j = 0; j < image[0].Ny; j++) {
    144       in = image[0].data2d[j];
    145       for (i = 0; i < image[0].Nx; i++, in++, out++) {
    146         *out = (char) MIN (MAX (a1 * *in - a2, 0), NNcolors);
    147       }
    148     }
    149   }
    150  
    151121  /* these are for a future upgrade */
    152122  min = max = 0.0;
    153   size = Npix*sizeof(char);
     123  size = Npix*sizeof(float);
    154124
    155125  /* done with the conversion, now send kapa the converted picture */
    156126  KiiSendMessage (fd, "%8d %8d", image[0].Nx, image[0].Ny);
    157   KiiSendMessage (fd, "8 1 0.0 1.0");
    158127  KiiSendMessage (fd, "%f %f %s %s", data[0].zero, data[0].range, data[0].name, data[0].file);
    159128  KiiSendMessage (fd, "%f %f %d ", min, max, size);
     
    163132
    164133  /* send the image data */
    165   write (fd, outbuffer, size);
    166   free (outbuffer);
     134
     135  for (j = 0; j < image[0].Ny; j++) {
     136      write (fd, image[0].data2d[j], image[0].Nx*sizeof(float));
     137  }
    167138
    168139  KiiWaitAnswer (fd, "DONE");
Note: See TracChangeset for help on using the changeset viewer.