Changeset 19828
- Timestamp:
- Oct 2, 2008, 8:18:07 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/libkapa/src/KiiPicture.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/libkapa/src/KiiPicture.c
r16010 r19828 37 37 /* done with the conversion, now send kapa the converted picture */ 38 38 KiiSendMessage (fd, "%8d %8d", image[0].Nx, image[0].Ny); 39 KiiSendMessage (fd, "-32 1 0.0 1.0");40 39 KiiSendMessage (fd, "%f %f %s %s", data[0].zero, data[0].range, data[0].name, data[0].file); 41 40 KiiSendMessage (fd, "%f %f %d ", min, max, size); … … 93 92 /* done with the conversion, now send kapa the converted picture */ 94 93 KiiSendMessage (fd, "%8d %8d", image[0].Nx, image[0].Ny); 95 KiiSendMessage (fd, "8 1 0.0 1.0");96 94 KiiSendMessage (fd, "%f %f %s %s", data[0].zero, data[0].range, data[0].name, data[0].file); 97 95 KiiSendMessage (fd, "%f %f %d ", min, max, size); … … 121 119 KiiScanMessage (fd, "%d", &Ncolors); 122 120 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 151 121 /* these are for a future upgrade */ 152 122 min = max = 0.0; 153 size = Npix*sizeof( char);123 size = Npix*sizeof(float); 154 124 155 125 /* done with the conversion, now send kapa the converted picture */ 156 126 KiiSendMessage (fd, "%8d %8d", image[0].Nx, image[0].Ny); 157 KiiSendMessage (fd, "8 1 0.0 1.0");158 127 KiiSendMessage (fd, "%f %f %s %s", data[0].zero, data[0].range, data[0].name, data[0].file); 159 128 KiiSendMessage (fd, "%f %f %d ", min, max, size); … … 163 132 164 133 /* 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 } 167 138 168 139 KiiWaitAnswer (fd, "DONE");
Note:
See TracChangeset
for help on using the changeset viewer.
