blend function urgently needed in kdelibs

Matthew Woehlke mw_triad at users.sourceforge.net
Wed May 23 17:47:44 BST 2007


Tobias G. Pfeiffer wrote:
> On Wednesday 23 May 2007, 00:40, Matthew Woehlke wrote:
>> Firstly: I don't even want to /contemplate/ a three-way blend, at least,
>> not further than blend( blend( a, b ), c ). 
> 
> I doubt this would give the same results. If you want a, b and c to be equally 
> represented in the result, this will definitely not do it, as it would 
> probably be doing 0.5*(0.5*a+0.5*b) + 0.5*c = 0.25*a + 0.25*b + 0.5*c

You want blend( blend( a, b ), c, 2.0/3.0 ) :-).

2/3*(0.5*a + 0.5*b) + 1/3*c = 1/3*a + 1/3*b + 1/3*c.

-- 
Matthew
"I can hear you / just barely hear you / I can just barely hear you"
   -- "I Can Hear You", by They Might Be Giants





More information about the kde-core-devel mailing list