Pressure sensitivity

Boudewijn Rempt boud at
Mon Jan 19 22:44:21 CET 2004

On Monday 19 January 2004 22:36, Patrick Julien wrote:

> What do you mean replacing the bitBlt code with a more direct alpha mask?

Well, not obviously replacing the code as such: it's necessary for a lot of 

What I do now is create a temporary layer in which I combine the brush shape 
and a colour; this layer is bitBlted onto the current layer. This gets 
tiresome pretty soon when you realize that there can be up to 255 sizes of 
each brush if you consider pressure sensitivity (Qt provides 255 levels). 
Caching that amount of masks is just about doable (in fact, I cache only half 
that), but caching that amount of pre-combined dabs is a bit much. (Or 
perhaps not, I haven't tried it yet -- but you need to create a dab for every 
colour you paint with, and then there's the problem of gradients.)

What I am going to try is to add something like as maskBlt that uses the
brush mask as an alpha control for selecting between the current color (with 
100% opacity) and the existing contents of the layer. I.e, take mask and 
current colour to the colour strategy and do the combining there.

That should give a speed-up, and make it easier to work with gradients, too.

Boudewijn Rempt |

More information about the kimageshop mailing list