paintops

Boudewijn Rempt boud at valdyas.org
Wed May 30 10:56:01 CEST 2007


On Tuesday 29 May 2007, Cyrille Berger wrote:

> First, I think I had rather see, Freehand tool call KisPainter::paintLine
> call KisPaintOp::paintLine call KisPaintOp::paintAt, that way all the
> current code using KisPainter will benefit from the improvement.

Bart brought that up, too, on irc. I simply hadn't thought of that -- I hadn't 
realized that the basic line drawing code could be shared by the KisPaintop 
superclass. That's an easy thing to do anyway -- I'll start with that.
>
> Then back to the question, there are three solutions:
> - paintAt(x,y, info) like currently
> - paintLine(point1, info1, point2, info2) (or paintLine(point1, point2,
> info), but if the pressure is different at the beginning of the line, no
> reason why not to benefit from it to draw a "gradient" of pressure, if you
> see what I mean)
> - paintCurve(point1, tangeant1, info1, point2, tangeant2, info2)

What is a tangeant?

> I did not find that any solution was giving me full satisfaction. I will
> give the few thoughts that are tourmenting me on the subject. Lets start
> with the last solution, it add a lot of complexity, but having the
> tangeants might give better control on how the bristles flow.
> On the other hand, if you consider the paintAt as way points, it can
> allready do what we want without changing the API, and tangeants
> information can be added throught the KisPaintInformation.

Well, the computation of the points where we have to call paintAt need to be 
done by the paintop because those are different for every paintop. I've also 
considered adding something like a QPointF KisPaintop::nextPos() which could 
then be used from KisPaintop, but that seemed more complicated to me.

> paintLine appears like a balance between the two extrem solution, so maybe
> it's good enought, but I don't think that for the bristles it is that
> usefull. As in fact, at least in the dynamic paint op, for them, I draw a
> line from the last point to the new point (line that might change in the
> future to something more complicated, but somehow the starting point will
> allways be the last position), and the way point system ala pointAt is not
> that bad.

That's what I do in the chinese brush paintop, too. I wasn't really satisfied, 
though.

-- 
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: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/kimageshop/attachments/20070530/ec086e50/attachment.pgp 


More information about the kimageshop mailing list