OpenImageIO/oiio — pull request #507 by lgritz (2013-02-05 07:16:04+00:00)
Title: IBA::mul() and oiiotool --cmul

IBA::mul() multiplies all pixels in a region by a scalar constant or per-channel constant. (Not now, but perhaps in the future, there may also be a mul() variety that is a pixel-by-pixel multiplication of two images.)

oiiotool --cmul wraps this. Examples:

oiiotool a.exr --cmul 0.5 -o out.exr # same constant for all channels

oiiotool a.exr --cmul 0.5,0.5,0.25,1 -o out.exr # channel vector of constants

Why "cmul"? Because "oiiotool --add" and "--sub" are pixel-by-pixel combinations of two images, so I'm reserving "mul" to be the analogous multiplicative operation, and using "cmul" to mean multiplication by a constant (or per-channel constant). I'm more than willing to entertain alternative naming ideas.