[GRASS-dev] [GRASS GIS] #2009: thumbnails.py failure
GRASS GIS
trac at osgeo.org
Wed Jun 19 04:14:30 PDT 2013
#2009: thumbnails.py failure
--------------------------------+-------------------------------------------
Reporter: neteler | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Compiling | Version: svn-trunk
Keywords: r.colors, v.colors | Platform: All
Cpu: Unspecified |
--------------------------------+-------------------------------------------
Comment(by glynn):
Replying to [comment:4 hamish]:
> I note in trunk there is some rendering error in the top-left corners of
all the image boxes, manifested as a missing pixel. (in GRASS 6 there
was/is a similar bug in d.barscale + Xdriver)
> Finally, this is a clear case where the Xdriver does a better job than
the Cairo driver, compare the thumbnails in trunk with the crispness of
the devbr6 versions:
> source:grass/branches/develbranch_6/raster/r.colors/thumbnails
> ... sometimes you want 1px lines to be exactly 1px wide, and no anti-
aliasing.
Both of these are a result of the d.* modules having been "minimally
ported" from the 6.x display API.
Closed paths should be closed with D_close() rather than by
D_cont_{abs,rel} back to the starting point. The latter will result in the
path being treated as open and thus having end caps.
Single-pixel lines should be drawn along the centre-line of a pixel row or
column, not along the boundary between rows/columns. IOW, the vertices
should have coordinates which are offset from an integer value by 0.5,
rather than being integers.
The display API can't realistically do this automatically because it can't
easily and reliably determine when it needs to "fix" the coordinates and
when it should use them verbatim. E.g. d.vect shouldn't fix boundaries
which happen to be axis-aligned rectangles because they'll be misaligned
with the rest of the data.
OTOH, if you have a 200-dpi display, single-pixel lines may as well just
not be drawn, because you probably won't be able to see them. For a quick
fix, setting the line width to 2 pixels is probably simpler than changing
the coordinates.
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2009#comment:5>
GRASS GIS <http://grass.osgeo.org>
More information about the grass-dev
mailing list