koffice/krita/tools

Boudewijn Rempt boud at valdyas.org
Thu Aug 26 09:03:40 CEST 2004


On Thursday 26 August 2004 00:31, Adrian Page wrote:
> On Wednesday 25 August 2004 12:17 pm, Boudewijn Rempt wrote:
> > If there's a selection, first create a temporary layer as big as the
> > selected area, and either simply composit the pattern in a loop into the
> > area, or use KisPainters rectangular fill. Then apply the selection mask
> > -- this is still slow because of pixel/setPixel, but that's something we
> > should improve -- and bitBlt the temporary layer with the specified
> > opacity onto the target layer.
> >
> > If there isn't a selection, follow the old code path to flood fill.
>
> There's an advantage to always using a temporary layer rather than writing
> to the target layer directly, and that's that you can use the bitblt to
> perform the composite op and opacity setting that all of the paint tools
> should support. In fact, that seems to be the only practical way of
> supporting these options.
>

Maybe it's even easier to do the following if there's no selection yet:

create temporary selection
floodfill the selection according to the outlines in the parent layer (that 
makes things easier, I guess, because you don't have to take pattern/color 
fill into account.)

then the code paths for filling selection/filling outline join, and do what 
you suggested:

create temporary layer as big as the selected rect (working on that one...)
fill the layer with color (KisPainter::fill) or pattern or masked pattern

compose layer & selection

blit the temporary layer on the target layer

remove temporary selection, if exists.
-- 
Boudewijn Rempt | http://www.valdyas.org/fading/index.cgi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kimageshop/attachments/20040826/26490902/attachment.pgp


More information about the kimageshop mailing list