[Bf-python] get/setPixelF

Stephen Swaney sswaney at centurytel.net
Tue Mar 11 03:30:22 CET 2008


On Mon, Mar 10, 2008 at 03:57:28PM -0600, Chris Want wrote:
> 
> I can't say I fully understand the scope of this modification, but I
> would lean towards compatibility with published documentation
> (especially since you can't overload based on return value,
> as Stephen mentions). I also think it's best to have these kinds
> of discussions *before* committing.
> 
> Having said that, it would probably be better to get the opinion
> of somebody who has actually used this API routine...

in a nutshell:

we have some functions in the Image class for getting and setting pixels.

example:

  getPixelI() returns values as ints range 0-255
  getPixelF() returns values as normalized floats 0.0-1.0

Pretty standard 8 bit image processing stuff.

Blender now has float buffers.  Patch 7076 adds the getPixel/setPixel
methods.  These methods operate with full range floats.

The Problem: rather than creating a new name (like getPixelFullFloat
or such) for the new methods, the patch rewrites the existing
getPixelF method.

Resolution: give the new methods names that do not step on existing
methods.  There is no reason to break the api here.  The new methods
operate on different datatypes so they should be treated as new
methods.

-- 
Stephen Swaney			
sswaney at centurytel.net
231-271-7371



More information about the Bf-python mailing list