[Bf-python] Blender.Image Function

Stephen Swaney sswaney at centurytel.net
Mon Feb 21 01:57:36 CET 2005


On Sun, Feb 20, 2005 at 05:01:21PM -0700, Austin Benesh wrote:
> I am writing a patch that many people say is needed – it adds three new
> functions to Blender.Image: 
> 
> getPixelColor_G(x, y)
> 
> getPixelColor_R(x, y)
> 
> getPixelColor_B(x, y)

In my not-so-humble opinion, a nicer and slightly more OO
interface would be to provide a single method that returns
a list of the values:

r,g,b = getPixelColor( x, y )

This would be nicer for treating the pixel as a vector in color
space.  And much less typing and overhead than:

r = getP_R..
g = getP_G..
b = getP_B..

If you don't want the extra values, you can always toss
them:

junk, g, junk = getPixelColor()

But opinions may vary.  Let the debate begin!

-- 
Stephen Swaney			
sswaney at centurytel.net




More information about the Bf-python mailing list