ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/falsecolor.c
(Generate patch)

Comparing ray/src/common/falsecolor.c (file contents):
Revision 3.2 by greg, Tue Nov 15 06:52:38 2005 UTC vs.
Revision 3.3 by greg, Tue Nov 15 20:04:50 2005 UTC

# Line 49 | Line 49 | fcFixedLinear(FCstruct *fcs, double Lwmax)
49                  return(TM_E_NOMEM);
50          mult = 255.999/tmLuminance(fcs->mbrmax);
51          for (i = fcs->mbrmin; i <= fcs->mbrmax; i++)
52 <                fcs->lumap[i] = (int)(mult * tmLuminance(i));
52 >                fcs->lumap[i - fcs->mbrmin] = (int)(mult * tmLuminance(i));
53          returnOK;
54   }
55  
# Line 68 | Line 68 | fcFixedLog(FCstruct *fcs, double Lwmin, double Lwmax)
68          fcs->lumap = (BYTE *)malloc(sizeof(BYTE)*(fcs->mbrmax - fcs->mbrmin + 1));
69          if (fcs->lumap == NULL)
70                  return(TM_E_NOMEM);
71 <        for (i = fcs->mbrmin; i <= fcs->mbrmax; i++)
72 <                fcs->lumap[i] = 256*(i - fcs->mbrmin) /
73 <                                        (fcs->mbrmax - fcs->mbrmin + 1);
71 >        for (i = fcs->mbrmax - fcs->mbrmin; i >= 0; i--)
72 >                fcs->lumap[i] = 256L * i / (fcs->mbrmax - fcs->mbrmin + 1);
73          returnOK;
74   }
75  
76   /* Compute linear false color map */
77   int
78 < fcLinearMapping(FCstruct *fcs, TMstruct *tms, int pctile)
78 > fcLinearMapping(FCstruct *fcs, TMstruct *tms, double pctile)
79   {
80          int             i;
81          int32           histot, cnt;
82          TMbright        wbrmin, wbrmax;
83  
84          if ((fcs == NULL) | (tms == NULL) || (tms->histo == NULL) |
85 <                        (0 > pctile) | (pctile >= 100))
85 >                        (0 > pctile) | (pctile >= 50))
86                  return(TM_E_ILLEGAL);
87          histot = 0;
88          for (i = tms->hbrmax - tms->hbrmin; i >= 0; )
# Line 99 | Line 98 | fcLinearMapping(FCstruct *fcs, TMstruct *tms, int pcti
98  
99   /* Compute logarithmic false color map */
100   int
101 < fcLogMapping(FCstruct *fcs, TMstruct *tms, int pctile)
101 > fcLogMapping(FCstruct *fcs, TMstruct *tms, double pctile)
102   {
103          int             i;
104          int32           histot, cnt;
105          TMbright        wbrmin, wbrmax;
106  
107          if ((fcs == NULL) | (tms == NULL) || (tms->histo == NULL) |
108 <                        (0 > pctile) | (pctile >= 100))
108 >                        (0 > pctile) | (pctile >= 50))
109                  return(TM_E_ILLEGAL);
110          histot = 0;
111          for (i = tms->hbrmax - tms->hbrmin; i >= 0; )
# Line 199 | Line 198 | fcDone(FCstruct *fcs)
198   }
199  
200   BYTE    fcDefaultScale[256][3] = {      /* default false color scale */
201 <        48,0,68, 45,0,70, 42,0,72, 39,0,74, 36,0,76, 33,0,78, 30,0,81,
202 <        27,0,83, 24,0,85, 21,0,87, 18,0,89, 15,0,91, 13,0,94, 12,0,96,
203 <        11,0,99, 9,0,101, 8,0,104, 7,0,106, 6,0,109, 5,0,111, 4,0,114,
204 <         2,0,116, 1,0,119, 0,0,121, 0,0,122, 0,1,123, 0,1,124, 0,2,125,
205 <         0,2,125, 0,3,126, 0,4,127, 0,4,128, 0,5,129, 0,5,129, 0,6,130,
206 <         0,7,131, 0,9,131, 0,11,132, 0,13,133, 0,16,133, 0,18,134,
207 <         0,20,134, 0,22,135, 0,24,135, 0,26,136, 0,29,136, 0,31,137,
208 <         0,34,137, 0,37,136, 0,41,136, 0,45,135, 0,48,135, 0,52,135,
209 <         0,55,134, 0,59,134, 0,62,134, 0,66,133, 0,69,133, 0,73,132,
210 <         0,76,130, 0,79,127, 0,82,125, 0,85,123, 0,88,120, 0,91,118,
211 <         0,94,115, 0,97,113, 0,101,110, 0,104,108, 0,107,106, 0,109,102,
212 <         0,110,97, 0,111,91, 0,112,86, 0,113,81, 0,115,76, 0,116,71,
213 <         0,117,65, 0,118,60, 0,119,55, 0,120,50, 0,122,45, 0,121,42,
214 <         1,120,39, 1,119,36, 1,119,34, 1,118,31, 2,117,28, 2,116,26,
215 <         2,115,23, 2,115,20, 3,114,18, 3,113,15, 3,112,13, 4,110,13,
216 <         5,108,13, 6,106,13, 7,104,12, 9,102,12, 10,100,12, 11,98,12,
217 <        12,97,12, 13,95,12, 14,93,11, 15,91,11, 17,89,12, 19,86,12,
218 <        22,83,12, 24,81,13, 26,78,13, 29,76,14, 31,73,14, 34,70,15,
219 <        36,68,15, 39,65,16, 41,63,16, 44,60,17, 46,58,17, 49,56,17,
220 <        51,54,17, 54,52,17, 57,50,17, 59,48,17, 62,45,17, 64,43,17,
221 <        67,41,17, 70,39,17, 72,37,17, 74,35,17, 75,34,16, 76,33,16,
222 <        77,32,16, 79,31,15, 80,30,15, 81,29,14, 82,28,14, 83,26,13,
223 <        84,25,13, 85,24,13, 87,23,12, 87,22,12, 88,21,11, 89,20,11,
224 <        90,19,10, 91,18,10, 92,17,9, 93,16,9, 94,15,8, 95,14,8,
225 <        95,13,7, 96,12,7, 97,11,7, 98,11,6, 99,10,6, 99,9,5, 100,9,5,
226 <       101,8,5, 102,8,4, 102,7,4, 103,6,4, 104,6,3, 104,5,3, 105,4,2,
227 <       106,4,2, 107,4,2, 107,3,2, 108,3,2, 109,3,2, 109,2,1, 110,2,1,
228 <       111,2,1, 112,1,1, 112,1,1, 113,1,0, 114,1,0, 115,0,0, 116,0,0,
229 <       117,0,0, 118,0,0, 119,0,0, 121,0,0, 122,0,0, 123,0,0, 124,0,0,
230 <       125,0,0, 126,0,0, 128,0,0, 131,0,0, 134,0,0, 137,0,0, 140,0,0,
231 <       144,0,0, 147,0,0, 150,0,0, 153,0,0, 156,0,0, 159,0,0, 162,0,0,
232 <       165,0,0, 168,0,0, 171,0,0, 174,0,0, 177,0,0, 180,1,0, 183,1,0,
233 <       186,1,0, 189,1,0, 192,1,0, 195,2,0, 198,2,0, 201,5,0, 204,7,0,
234 <       207,9,0, 210,11,0, 213,13,0, 216,15,0, 219,17,0, 222,19,0,
235 <       225,21,0, 228,23,0, 230,25,0, 233,29,0, 235,34,0, 237,39,0,
236 <       239,43,0, 241,48,0, 243,52,0, 245,57,0, 247,61,0, 250,66,0,
237 <       252,71,0, 254,75,0, 255,80,0, 255,88,0, 255,95,1, 255,103,1,
238 <       255,110,1, 255,117,1, 255,125,1, 255,132,2, 255,139,2, 255,147,2,
239 <       255,154,2, 255,162,2, 255,169,3, 255,176,3, 255,183,3, 254,190,4,
240 <       254,198,4, 254,205,4, 254,212,4, 253,219,5, 253,226,5, 253,234,5,
241 <       252,241,6, 252,248,6
201 >       119,10,140,
202 >       116,10,142,
203 >       112,10,144,
204 >       109,9,146,
205 >       105,9,148,
206 >       101,8,150,
207 >        97,7,151,
208 >        92,7,153,
209 >        88,6,155,
210 >        83,5,157,
211 >        77,4,158,
212 >        72,2,160,
213 >        67,2,162,
214 >        64,4,164,
215 >        61,5,166,
216 >        58,6,168,
217 >        55,6,170,
218 >        51,7,171,
219 >        47,8,173,
220 >        43,8,175,
221 >        38,9,177,
222 >        33,9,179,
223 >        25,10,180,
224 >        14,10,182,
225 >        10,17,183,
226 >        10,22,183,
227 >         9,27,184,
228 >         9,30,184,
229 >         8,33,185,
230 >         8,36,185,
231 >         7,39,186,
232 >         6,41,187,
233 >         5,43,187,
234 >         4,45,188,
235 >         3,47,188,
236 >         0,50,189,
237 >         0,57,189,
238 >         0,62,189,
239 >         0,67,190,
240 >         0,72,190,
241 >         0,77,190,
242 >         0,81,191,
243 >         0,84,191,
244 >         1,88,191,
245 >         1,92,192,
246 >         1,95,192,
247 >         1,98,192,
248 >         2,102,192,
249 >         3,107,192,
250 >         3,112,192,
251 >         4,116,191,
252 >         5,120,191,
253 >         5,124,191,
254 >         5,128,191,
255 >         6,131,191,
256 >         6,135,190,
257 >         7,138,190,
258 >         7,141,190,
259 >         7,145,189,
260 >         8,147,188,
261 >         8,150,186,
262 >         9,153,185,
263 >         9,155,183,
264 >        10,158,181,
265 >        10,160,180,
266 >        11,163,178,
267 >        11,165,176,
268 >        11,167,175,
269 >        12,170,173,
270 >        12,172,171,
271 >        13,173,168,
272 >        13,174,164,
273 >        14,175,160,
274 >        14,176,156,
275 >        15,177,152,
276 >        15,178,147,
277 >        16,178,143,
278 >        16,179,138,
279 >        17,180,133,
280 >        17,181,127,
281 >        18,182,122,
282 >        18,182,116,
283 >        20,182,112,
284 >        22,181,109,
285 >        24,181,105,
286 >        26,180,102,
287 >        27,180,98,
288 >        29,179,94,
289 >        30,179,90,
290 >        32,178,86,
291 >        33,177,81,
292 >        34,177,77,
293 >        35,176,71,
294 >        37,176,67,
295 >        42,174,67,
296 >        46,173,66,
297 >        49,171,66,
298 >        52,170,65,
299 >        55,169,65,
300 >        58,167,65,
301 >        61,166,64,
302 >        64,164,64,
303 >        66,163,63,
304 >        68,161,63,
305 >        71,160,63,
306 >        75,158,63,
307 >        79,156,64,
308 >        84,154,65,
309 >        88,151,66,
310 >        92,149,68,
311 >        95,147,69,
312 >        99,145,70,
313 >       102,142,71,
314 >       105,140,71,
315 >       109,137,72,
316 >       112,135,73,
317 >       115,132,74,
318 >       118,130,74,
319 >       121,128,74,
320 >       123,126,74,
321 >       126,124,74,
322 >       129,121,75,
323 >       132,119,75,
324 >       134,117,75,
325 >       137,114,75,
326 >       139,112,75,
327 >       142,109,75,
328 >       144,106,75,
329 >       146,104,75,
330 >       147,103,74,
331 >       148,101,73,
332 >       149,100,72,
333 >       150,98,71,
334 >       151,96,70,
335 >       152,95,70,
336 >       152,93,69,
337 >       153,91,68,
338 >       154,90,67,
339 >       155,88,66,
340 >       156,86,65,
341 >       157,84,64,
342 >       158,83,63,
343 >       158,81,62,
344 >       159,79,60,
345 >       160,77,59,
346 >       161,75,58,
347 >       161,73,57,
348 >       162,71,55,
349 >       163,69,54,
350 >       163,67,52,
351 >       164,65,51,
352 >       165,63,49,
353 >       165,61,48,
354 >       166,60,47,
355 >       166,58,46,
356 >       167,56,44,
357 >       167,55,43,
358 >       168,53,42,
359 >       169,51,40,
360 >       169,49,39,
361 >       170,46,37,
362 >       170,44,35,
363 >       171,42,33,
364 >       171,40,32,
365 >       172,39,31,
366 >       172,37,30,
367 >       173,36,29,
368 >       173,34,28,
369 >       174,33,27,
370 >       174,31,25,
371 >       175,29,24,
372 >       175,27,22,
373 >       176,25,21,
374 >       176,23,19,
375 >       177,21,17,
376 >       178,20,16,
377 >       179,19,16,
378 >       179,18,15,
379 >       180,17,14,
380 >       181,16,13,
381 >       182,15,13,
382 >       182,13,12,
383 >       183,12,11,
384 >       184,10,9,
385 >       185,8,8,
386 >       185,5,6,
387 >       187,3,5,
388 >       189,3,5,
389 >       191,3,5,
390 >       193,3,6,
391 >       195,3,6,
392 >       197,2,6,
393 >       198,2,6,
394 >       200,2,6,
395 >       202,2,6,
396 >       204,1,6,
397 >       206,1,6,
398 >       208,0,6,
399 >       209,9,7,
400 >       211,13,7,
401 >       213,15,8,
402 >       214,18,8,
403 >       216,20,9,
404 >       218,21,9,
405 >       219,23,9,
406 >       221,24,10,
407 >       223,26,10,
408 >       224,27,10,
409 >       226,28,11,
410 >       228,33,11,
411 >       229,43,11,
412 >       231,50,11,
413 >       232,56,11,
414 >       234,61,11,
415 >       235,66,11,
416 >       237,71,11,
417 >       238,75,11,
418 >       239,79,11,
419 >       241,83,11,
420 >       242,86,11,
421 >       244,90,11,
422 >       245,96,11,
423 >       246,102,12,
424 >       247,108,12,
425 >       248,114,13,
426 >       249,119,13,
427 >       250,124,13,
428 >       251,129,14,
429 >       252,134,14,
430 >       253,138,15,
431 >       254,143,15,
432 >       255,147,15,
433 >       255,151,16,
434 >       255,157,18,
435 >       255,163,20,
436 >       255,169,22,
437 >       255,174,24,
438 >       255,179,25,
439 >       255,184,26,
440 >       255,189,28,
441 >       255,194,29,
442 >       255,199,30,
443 >       255,203,31,
444 >       255,207,32,
445 >       255,212,34,
446 >       255,216,35,
447 >       255,220,37,
448 >       255,224,38,
449 >       255,227,40,
450 >       255,231,41,
451 >       255,235,42,
452 >       254,238,43,
453 >       254,242,44,
454 >       254,245,46,
455 >       254,249,47,
456 >       254,252,48,
457   };

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines