297
297
for (i = 0; i <= bvalue-1; ++i)
300
301
/* Map the middle intensities to 0..maxval */
303
308
/* The following for loop is a hand optimization of this one:
304
309
for (i = bvalue; i <= wvalue; ++i)
305
310
newIntensity[i] = (i-bvalue)*maxval/range);
311
319
newIntensity[i] = val / range;
313
322
/* Map the highest intensities to maxval */
314
323
for (i = wvalue+1; i <= maxval; ++i)
315
324
newIntensity[i] = maxval;