On Sun, May 26, 2013 at 3:59 PM, Mihail Ivanchev <[email protected]> wrote:
> Hello GeoTools!
>
> For my research work I am drawing aliased lines of thickness 1 with the
> requirement that coincident line segments should be drawn using the same
> set of pixels in the common region. Sadly, this is not provided by the
> standard JRE implementations which use the Bresenham's algorithm or one of
> it's derivates. To remedy this, I wrote my own line renderer, based on the
> diamond exit rasterization strategy used by 3D APIs as OpenGL and DirectX.
> You can see the difference in this screenshot:
>
> http://i.imgur.com/bvKwUG9.png
>
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.
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/
>
>
> Perhaps it's a good idea to use this line renderer in GeoTools whenever
> possible (lines of width 1, solid color, aliased), because of the stability
> of the "diamond exit" rule. I can provide the code upon request.
>
Why don't you make it available on github as an open source library?
If you apply it into a Graphics2D wrapper like Randelshofer did
it might be of general use outside of GeoTools, thus probably making it
more popular
Cheers
Andrea
*: note for those that might get overly excited about faster rendering, I
did talk a bit with Randelshofer, the
rasterizers there are specific, and they are generally speaking not high
quality (in terms of how the rasterized
output looks), plus the license chosen is incompatible with the *GPL family
AFAIK.
--
==
GeoServer training in Milan, 6th & 7th June 2013! Visit
http://geoserver.geo-solutions.it for more information.
==
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549
http://www.geo-solutions.it
http://twitter.com/geosolutions_it
-------------------------------------------------------
------------------------------------------------------------------------------
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