From kde-kimageshop Thu Jun 21 06:06:50 2007 From: Boudewijn Rempt Date: Thu, 21 Jun 2007 06:06:50 +0000 To: kde-kimageshop Subject: Re: smooth painting (was: Re: Filters "dialog" in 2.0) Message-Id: <200706210806.50280.boud () valdyas ! org> X-MARC-Message: https://marc.info/?l=kde-kimageshop&m=118240606701810 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--===============0343088264==" --===============0343088264== Content-Type: multipart/signed; boundary="nextPart2250685.RmmtAJ5Hbv"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit --nextPart2250685.RmmtAJ5Hbv Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Wednesday 20 June 2007, Cyrille Berger wrote: > Yes and the problem I have met to get a better result is that currently t= he > stroke is rendered on the final canvas without the possibility to know the > full path. So a few possibility are available : > - delay the drawing until the next point is available and hope the user > won't notice (and paint with a null tangent when the cursor don't move for > more than a second) > - keep the bezier curve (using for instance Emanuele's last year google > soc), but the main problem is then performance when rendering the curve ( > maybe some optimization can be done by just rerendering part of the curve > thought) - the worse is to try to guess the next move of the user (which = is > what we do currently :) ) but that's still give good enought results The way Inkscape works is by having the line divided into two segments: a=20 provisional part and a finished part. The provisional part is shown red, an= d=20 changes as you continue drawing to its final form. The results are nice and= =20 smooth, but it's disconcerting to see that the line moves to where you=20 definitely didn't draw. What we could try is to keep the control points for the duration of the=20 stroke, and on mouse-up render the whole stroke once again but this time=20 smoothed out. Only then would the stroke be composited onto the layer. This= =20 would mean, though, that we get rid of the direct painting mode, but that's= =20 not a terrible hardship. That said, your code indeed gives quite nice results already :-) =2D-=20 Boudewijn Rempt=20 http://www.valdyas.org/fading/index.cgi --nextPart2250685.RmmtAJ5Hbv Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQBGehV6daCcgCmN5d8RAjLWAJ9WtRWn96ZnU0vfdDCV6kn2Wps/kgCgqwn9 1kerOyhtNacncTMqKApGxJ0= =s3Js -----END PGP SIGNATURE----- --nextPart2250685.RmmtAJ5Hbv-- --===============0343088264== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ kimageshop mailing list kimageshop@kde.org https://mail.kde.org/mailman/listinfo/kimageshop --===============0343088264==--