Select-by-color range and .isSelected()

Casper Boemann cbr at boemann.dk
Fri Apr 1 15:02:27 CEST 2005


On Friday 01 April 2005 14:45, Boudewijn Rempt wrote:
> I already do that -- witness the comments in kis_selection.cc:
>
> // CBR this is wrong only first byte is inverted
> // BSAR: But we have always only one byte in this color model :-).
> *(it.rawData()) = QUANTUM_MAX - *(it.rawData());

Ok that's settled then :-)

> > No, that is something I have puzzeled with too. For cutting I think we
> > should manipulate the src and dst pixels according to selectedness.
>
> The not completely selected pixels should have the selectedness subtracted
> from their opacity -- making them more transparent, or perhaps even
> completely transparent.
well new_alpha= old_alpha*(1-selectedness)
alpha_in_clipboard = old_alpha*(selectedness)

both places assuming selectedness value is 0-1.0 though in reality 0-255

>
> > > Desaturate is easy: just halve the saturation in the hsv representation
> > > of a pixel. But oilpaint? Sharpen? What would be the meaning of 69%
> > > selected there? Blit the sharpened pixel with 69% opacity over its
> > > original?
> >
> > yes over 31% original
>
> You mean modify the original to 31% of its original transparency and
> COMPOSITE_OVER the sharpened pixel at 69% of its transparency?
result should be 31% unsharpend + 69% sharpend

so yes like that.
-- 
best regards / venlig hilsen
Casper Boemann


More information about the kimageshop mailing list