Hello, Andrea.

Aliased rendering is not popular these days (everybody wants maps to be
> pretty).
> That said, I guess having a nicer alternative for those that do can always
> come in handy.
>

It's indeed a nice alternative; I personally consider the default behaviour
flawed. I agree one doesn't need this feature every day though, but it
seems more natural.


> How have you implemented such line rendering?
> A good approach I've seen on the internet is to create a Graphics2D
> wrapper that runs your custom code for the cases you're interested into,
> and falls back on the regular java one for everything else. This is an
> example, taken for a page where the objective was to study higher
> performance rasterization techniques*:
> http://www.randelshofer.ch/oop/graphics/
>

I have now published the code here
https://github.com/MIvanchev/diamond-exit-line. It's an Eclipse project
producing a JAR. The LineRenderer class has a method "render" which takes a
graphics context and the end point coordinates. I agree with you that a
Graphics2D wrapper would be more intuitive to use, if you approve my
addition I will invest some time implementing that. The line rasterizer
uses 34.30 fixed-point arithmetic. The storage type is long. I test every
pixel of the line's bounding rectangle, but I use an early rejection
mechanism. A better solution is to use the Bresenham's algorithm to test
just these pixels which the line really travels through. The license is MIT
which is compatible to LGPL, but I could change it if required.

Regards,
Mihail
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
GeoTools-Devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to