[GRASS-dev] PNG driver - slow?
Glynn Clements
glynn at gclements.plus.com
Fri Apr 6 11:14:10 EDT 2007
Glynn Clements wrote:
> > export GRASS_PNGFILE=/tmp/pokus.png
> > export GRASS_RENDER_IMMEDIATE=TRUE
> >
> > time d.vect map=soils at PERMANENT
> > real 0m0.197s
> > user 0m0.166s
> > sys 0m0.019s
> >
> > time d.vect map=soils at PERMANENT color=yellow fcolor=yellow cats=32 width=3
> > real 0m13.767s
> > user 0m13.611s
> > sys 0m0.098s
> >
> >
> > Why is the second case so slow? Is it a bug in PNG driver? What can I
> > do, so it is rendered faster?
>
> My guess is the width=3.
>
> The "thick line" code in the PNG driver is a truly awful hack (see
> store_xy() in lib/pngdriver/Draw_line.c).
I've replaced this with a more reasonable implementation.
However, note that the PNG driver doesn't have a proper polyline
implementation; it just draws each segment as a separate line. This is
fine for single-pixel lines, but for thicker lines the lack of proper
joins may be noticeable.
--
Glynn Clements <glynn at gclements.plus.com>
More information about the grass-dev
mailing list