Krita UI and tool interaction

Boudewijn Rempt boud at valdyas.org
Sun Oct 12 22:43:04 CEST 2003


On Sunday 12 October 2003 17:49, Patrick Julien wrote:

>
> Why?  The same code appeared over and over again in plugins, not only, but
> the idea of centralizing in KisPainter doesn't actually prevent you from
> actually what you are talking about...
>

Well, a paint tool takes a mask, subsamples it and then asks the painter to 
composite the result with the existing layer data. A smear brush takes the 
existing data and applies an algorithm to it. And so on; advanced tools use 
the existing data and their specific algorithms to achieve a certain result, 
which is then composited with the existing data.

I was rather afraid that I would have to add code for all the various kinds of 
painting, smearing, chalking, convolving, cloning etc. to the painter -- 
which would make the painter class very large, and make it more difficult to 
write a certain tool. After all, all the tool needs to know is what's there 
in the layer (and possibly in the underlying layers), and compute a result 
that should be composited with the existing data.

> > -- but who should get the brush shape,
> > the pattern, the colour? The tool, or the painter.
>
> I'm sorry, I'm not sure what you're asking me here.
>

Well, I've got what's technically called a pen tool -- non-subsampled, hard 
pixel painting. This can be done in various thicknesses, with various colour, 
with various brush masks, even. Did you intend for the KisPainter to get that 
data from KisView, or for the tool to be notified of changes in those 
aspects, and to call KisPainter with brush shape, colour, gradient etc.?

> > Finally -- where do the tools get their icons from? For the life of me, I
> > cannot figure that out...
>
> It's in there, it's when creating a KAction.
>

I still cannot find that code -- but I'll look again. No doubt I'll find it...
-- 
Boudewijn Rempt | http://www.valdyas.org/index2.html


More information about the kimageshop mailing list