Changeset 40707
- Timestamp:
- May 3, 2019, 11:04:45 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ohana.20190329/src/kapa2/src/SetColormap.c
r40627 r40707 72 72 } 73 73 } 74 fprintf (stderr, "ruff Npix: %d vs %d\n", i, graphic[0].Npixels);74 // fprintf (stderr, "ruff Npix: %d vs %d\n", i, graphic[0].Npixels); 75 75 76 76 // all other modes are 1D: set the flag: … … 217 217 !strncmp (graphic->colormapName, "lgcy:", 5) || 218 218 !strncmp (graphic->colormapName, "cetf:", 5) || 219 !strncmp (graphic->colormapName, "cetr:", 5) || 219 220 !strncmp (graphic->colormapName, "csvf:", 5)) { 220 221 … … 233 234 int isCSV = !strncmp (graphic->colormapName, "csvf:", 5); 234 235 int isCET = !strncmp (graphic->colormapName, "cetf:", 5); 236 int isCETRev = !strncmp (graphic->colormapName, "cetr:", 5); 235 237 int isLegacy = !strncmp (graphic->colormapName, "lgcy:", 5); 236 238 237 239 float fracIndex, fracRed, fracBlue, fracGreen; 238 240 239 if (isCET ) fracIndex = 0.0;241 if (isCET || isCETRev) fracIndex = 0.0; 240 242 241 243 while (scan_line_maxlen (f, line, 1024) != EOF) { … … 247 249 if (Nscan != 4) continue; 248 250 } 249 if (isCET ) {251 if (isCET || isCETRev) { 250 252 Nscan = sscanf (line, "%f,%f,%f", &fracRed, &fracGreen, &fracBlue); 251 253 fracIndex += 1.0 / 256.0; … … 256 258 if (Nscan != 4) continue; 257 259 } 258 if (!isCSV && !isLegacy && !isCET ) {260 if (!isCSV && !isLegacy && !isCET && !isCETRev) { 259 261 Nscan = sscanf (line, "%f %f %f %f", &fracIndex, &fracRed, &fracGreen, &fracBlue); 260 262 if (Nscan != 4) continue; … … 299 301 } 300 302 } 303 304 // reverse the color sequence: 305 if (isCETRev) { 306 for (i = 0; i < MaxValue / 2; i++) { 307 unsigned short tmp; 308 // fprintf (stderr, "swap: %d %d\n", graphic[0].cmap[i].red, graphic[0].cmap[MaxValue - 1 - i].red); 309 tmp = graphic[0].cmap[i].red; graphic[0].cmap[i].red = graphic[0].cmap[MaxValue - 1 - i].red; graphic[0].cmap[MaxValue - 1 - i].red = tmp; 310 tmp = graphic[0].cmap[i].blue; graphic[0].cmap[i].blue = graphic[0].cmap[MaxValue - 1 - i].blue; graphic[0].cmap[MaxValue - 1 - i].blue = tmp; 311 tmp = graphic[0].cmap[i].green; graphic[0].cmap[i].green = graphic[0].cmap[MaxValue - 1 - i].green; graphic[0].cmap[MaxValue - 1 - i].green = tmp; 312 } 313 } 314 301 315 goto store_colors; 302 316 }
Note:
See TracChangeset
for help on using the changeset viewer.
