Re: Pixel Iterator
Larry Gritz
Not sure if maybe this was meant for the OIIO list rather than OCIO, but if you already have OpenImageIO in the mix, then I think you can very efficiently do this using a combination of ImageBufAlgo.computePixelStats (to find the per-channel min and max values) and ImageBufAlgo.contrast_remap (to stretch the input range to [0,1]).
I guess, actually, I'm not sure from your description whether you want to normalize (stretch or shrink the range to [0,1]) or simply to clamp (make sure no values are outside [0,1] but not change any values that were already ok). If you really meant clamping, then there is also ImageBufAlgo.clamp should do what you want.
|
|