Solution for the grayscale selections

Boudewijn Rempt boud at valdyas.org
Tue Sep 25 09:23:16 UTC 2012


On Tue, 25 Sep 2012, Cyrille Berger wrote:

> That does not require to use premultiplied alpha. In that case it is just
> assumed that alpha = 255.

Okay, that's even easier.

> Right now, composite op assumes that source colour space == destination
> colour space. But there is no reason why we can't change that specific
> behaviour. I would do the following:
>
> * in KoCompositeOp, add an optional parameter for a destination colour
> space
> * in KoColorSpace::bitBlt, if source colour space != destination, check if
> there is a composite op that can work across those two colour spaces
> * implement a "gray" only colour space, and a GRAYA on GRAY composite op,
> that assumes that GRAY's alpha channel is set to 255 all the time.

But all that is not necessary, I think. We create dabs in the colorspace 
of the target device, so no conversion is needed, nor is it needed to have 
a composite op that can handle two different colorspaces.

The only thing we need to do is make sure that the dab is created 
correctly and that the gray colorspace can properly compose the dab's 
pixels with the target pixels.

Boudewijn


More information about the kimageshop mailing list