« Return to Thread: Problems with outline rasterizer

Re: Problems with outline rasterizer

by pierre.arnaud :: Rate this Message:

Reply to Author | View in Thread

Your changes seem reasonable. A zero height or zero width rectangle should
indeed have an outline, even if it has no surface and filling it should not
draw anything...

I've no idea why Maxim chose the "1.5 times the subpixel scale"; I'd advise
to be cautious. Does anybody have a large set of tests based on the outline
rasterizer, so that we could check if applying your changes breaks anything?


> -----Original Message-----
> From: Jim Barry [mailto:jim@...]
> Sent: Wednesday, June 10, 2009 3:30 PM
> To: Anti-Grain Geometry
> Subject: [AGG] Problems with outline rasterizer
>
> Hi Folks,
>
> I noticed that the outline rasterizer fails to draw empty (or nearly-
> empty) rectangles. For example, consider a rectangle with vertices ABCD
> and zero height. The sequence of events goes like this:
>
[...]

>
> Now the zero-height rectangle will be drawn as a line. Does this seem
> like a reasonable fix, or might it cause other problems?
>
> Also, the outline rasterizer will "optimize" away rectangles with
> single-pixel width/height, because it considers points at a distance of
> 1.5 times the subpixel scale or closer to be coincident. Presumably
> Maxim had a reason for choosing this threshold, but I propose changing
> line_aa_vertex::operator() from this:
>
>   bool operator () (const line_aa_vertex& val)
>   {
>     float_type dx = val.x - x;
>     float_type dy = val.y - y;
>     return (len = uround(sqrt(dx * dx + dy * dy))) >
>       (line_subpixel_scale + line_subpixel_scale / 2);
>   }
>
> to this:
>
>   bool operator () (const line_aa_vertex& val)
>   {
>     float_type dx = val.x - x;
>     float_type dy = val.y - y;
>     return (len = uround(sqrt(dx * dx + dy * dy))) >=
> line_subpixel_scale;
>   }
>
> Comments?
>
> - Jim


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Vector-agg-general mailing list
Vector-agg-general@...
https://lists.sourceforge.net/lists/listinfo/vector-agg-general

 « Return to Thread: Problems with outline rasterizer