Re: [LIBART] problem with art_rgb_svp_alpha



On Thu, Apr 26, 2001 at 04:42:13PM +0100, Robin Becker wrote:
> I'm trying to understand how and why art_rgb_svp_alpha should give such
> different results for reflected vector paths
> 
> I have two paths 0 and 1 which are y symmetric around y=128 (They are
> actually letter A from Adobe's Times-Roman font (as rendered by libgt1)
> 
> to each I'm doing
> 
>         svp = art_svp_from_vpath(vpath);
> 
>         art_rgb_svp_alpha(svp,
>                         0,0,
>                         width, height,
>                         _RGBA(self->fillColor.value, self->fillOpacity),
>                         buf,
>                         rowstride,
>                         NULL);
> 
> one appears to come out nicely aliased and the other appears completely
> unaliased and horrible. Clearly this is something to do with winding
> numbers or some such, but why and what can I do to get my characters to
> go the right way up on my pixmaps and get the correct angular behaviour.

Yeah, this is like the number one libart FAQ. art_rgb_svp_alpha only
accepts paths with 0/1 winding numbers. If you reflect it, it will have
-1/0 winding numbers. The art_svp_rewind functions can change an
arbitrary path into one with 0/1 winding, but are right now fairly
buggy.

In the meantime, if you know that the path is either 0/1 or -1/0, then
you can compute the area of the path, then if it's negative, reflect
it. You can take a look at compute_area in gill's svg.c for an example
implementation. It will need to be adapted slightly to work with vpath.

Hope this helps,

Raph





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]