[GRASS-CVS] hamish: grass6/display/drivers/cairo description.html, NONE, 1.1

grass at intevation.de grass at intevation.de
Fri Nov 23 21:45:15 EST 2007

Author: hamish

Update of /grassrepository/grass6/display/drivers/cairo
In directory doto:/tmp/cvs-serv2790/grass6/display/drivers/cairo

Added Files:
Log Message:
add user help page (from Lars Ahlzen)

--- NEW FILE: description.html ---
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 <TITLE>Cairo driver</TITLE>
 <META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
 <link rel="stylesheet" href="grassdocs.css" type="text/css">
<BODY bgColor=white>

<img src="grass_logo.png" alt="GRASS logo"><hr align=center size=6 noshade>

<EM><B>Cairo driver</B></EM> - driver for bitmap or vector output using
the Cairo graphics library
The Cairo driver generates PNG, BMP, PPM, PS, PDF or SVG images from GRASS
display commands, using the
<A HREF="http://www.cairographics.org/">Cairo graphics library</A>.
The image format is selected from the extension of the output file.
It is started as 'pseudo' monitor (output to an image file) and when
stopped, all output from previously used display commands are written to
the output file.

<H3>Environment variables</H3>
Several environment variables affect the operation of the Cairo driver:
     the width of the image.<BR><BR>
    the height of the image.<BR><BR>
     the name and format of the resulting image file, default is
     The image format is determined from the file extension.<BR>
     Supported bitmap formats:
     <LI><B>.png</B> - Portable Network Graphics (PNG)
     <LI><B>.bmp</B> - Windows Bitmap (BMP)
     <LI><B>.ppm</B> - Portable Pixmap (PPM)
     Supported vector formats:
     <LI><B>.pdf</B> - Portable Document Format (PDF)
     <LI><B>.ps</B> - PostScript (PS)
     <LI><B>.svg</B> - Scalable Vector Graphics (SVG)
     (Note: Some formats may not be available, depending on your platform and
     the Cairo library that GRASS was built with.)
     specifies the background color to use in RGB
     notation (hex values). Default is <b>FFFFFF</b> (white).<br><br>
    sets transparent background on (TRUE) or off (FALSE, default).<BR><BR>
     if set to "TRUE", the image file will be written after each 
     operation (i.e. whenever a client disconnects), rather than
     only being written out when the driver terminates.<BR>
     (Note: This only applies to bitmap formats - vector formats
     are always written directly to file)<BR><BR>
     if "TRUE", the Cairo driver will initialize the image from
     the contents of $GRASS_CAIROFILE.<BR>
     (Note: This is only supported for bitmap formats)<BR><BR>
     if "TRUE", the Cairo driver will map $GRASS_CAIROFILE as its framebuffer,
     rather than using memory. This only works with BMP files.<BR><BR>

Example using the driver directly (bash-syntax):
<div class="code"><PRE>
export GRASS_CAIROFILE=spearfish.png
export GRASS_WIDTH=800
export GRASS_HEIGHT=800

d.mon start=cairo
d.rast map=elevation.10m
d.vect map=streams width=1 color=blue fcolor=aqua type=area,line
d.vect map=roads width=2
d.mon stop=cairo

Example using <I>d.out.file</I>:
<div class="code"><PRE>
d.mon x0
d.rast map=elevation.10m
d.vect map=streams width=1 color=blue fcolor=aqua type=area,line
d.vect map=roads width=2

d.out.file -c sf_cairo format=png size=800,800

A more complicated example using <I>d.out.file</I>:
<div class="code"><PRE>
r.shaded.relief map=elevation.dem
r.watershed elev=elevation.dem basin=watershed.basin thresh=10000

d.mon x1
d.shadedmap rel=elevation.dem.shade drape=watershed.basin bright=30
d.vect streams color=aqua fcolor=aqua type=area,line
d.vect roads where="label ~ 'light-duty road'" color=grey
d.vect roads where="label ~ 'unimproved'" color=orange
d.vect roads where="label ~ 'secondary highway'" color=100:100:100 width=2
d.vect roads where="label ~ 'primary highway'" color=50:50:50 width=2
d.vect railroads col=red width=2
d.vect roads where="label = 'interstate'" color=black width=3

d.vect archsites icon=basic/star size=25 fcolor=yellow

d.font Andale_Mono
echo "Spearfish, SD" | d.text color=black at=28,53 -b

d.out.file -c sf_cairo2 format=png


<P>To enable Cairo driver support, build grass with
<div class="code"><PRE>
make USE_CAIRO=1
This requires a reasonably recent version of the cairo libraries (cairo.h).

<P>Antialiasing is enabled by default for bitmap formats. There is
currently no way of disabling this.</P>

<P>Cairo supports true vector format output whenever possible. However,
if the selected format doesn't support a necessary feature, Cairo may
fall back on rendering a bitmap representation of the image wrapped in
the selected vector format.</P>

<P>Cairo driver output via <A HREF="d.out.file.html">d.out.file</A>
is supported via the -c flag.</P>

<h2>SEE ALSO</h2>
<A HREF="htmlmapdriver.html">HTML map driver</A>,
<A HREF="pngdriver.html">PNG driver</A>,
<A HREF="psdriver.html">PostScript driver</A>,
<A href="xdriver.html">XDRIVER</A>
<A HREF="d.frame.html">d.frame</A>,
<A href="d.mon.html">d.mon</A>,
<A href="d.rast.html">d.rast</A>,
<A href="d.vect.html">d.vect</A>
<A href="d.out.file.html">d.out.file</A>

Lars Ahlzen &lt;<I>lars (at) ahlzen.com</I>&gt;<BR>
and the GRASS Development Team.

More information about the grass-commit mailing list