OpenImageIO/oiio — pull request #400 by rmv (2012-07-12 13:26:18+00:00)
Title: Fix for quantize

Some Arnold users had noticed problems when resizing textures with maketx. This showed as quantization errors where instead of an expected constant field of 255s, some 254s would be sprinkled in.

The problem was coming from quantize. Quantize was calling int Imath::lerp(int, int, float), returning a truncated integer, instead of a float. for instance, 0.999999 would lerp to 254

Changing that call to float Imath::lerp(float, float, float) preserves precision before the final quantization step.

r