bltSelection

Adrian Page adrian at pagenet.plus.com
Tue Jun 14 21:49:51 CEST 2005


Boudewijn Rempt wrote:
> On Tuesday 14 June 2005 15:30, Casper Boemann wrote:
> 
>>Hi
>>
>>I suggest changing bitBlt (and all composite operations) to take an alpha
>>mask into consideration)
>>
>>This is because currently bltSelection is flawed:
>> - it's colorspace dependent. It assumes channels are 1 byte
>> - it applies the selection to the source.
>> - it uses "alpha" as MIN(sel,alpha).
>> - it blits 1 pixel at a time
>>
>>Every composite op needs to be changed though to take a Q_UINT8 *sel
>>pointer and if the pointer is !=0 use it
>>
>>bitBlt would then pass NULL as the pointer
>>bltSelection would pass a pointer to the selection data.
>>bltExtSelection would pass a pointer to the external selection data.
> 
> 
> I think I agree. The alpha mask is indeed the third chunk of raster data that 
> is involved in blitting. Maybe not call it *sel, but *srcMask or something 
> like that -- it is, after all, a mask that masks the source pixels.

It may be intentional the way it's done at the moment, but I would 
multiply the source alpha by the mask value rather than use thresholds. 
That way anti-aliased selections work perfectly, 'selecting' the correct 
amount of the pixel in question, whatever its alpha is.

Adrian


More information about the kimageshop mailing list