GRASS GIS 8 Programmer's Manual  8.5.0dev(2024)-d6dec75dd4
symbol.c File Reference
#include <grass/gis.h>
#include <grass/display.h>
#include <grass/symbol.h>
#include <grass/glocale.h>
Include dependency graph for symbol.c:

Go to the source code of this file.

Functions

void D_symbol (const SYMBOL *Symb, double x0, double y0, const RGBA_Color *line_color, const RGBA_Color *fill_color)
 draw a symbol at pixel coordinates More...
 
void D_symbol2 (const SYMBOL *Symb, double x0, double y0, const RGBA_Color *primary_color, const RGBA_Color *secondary_color)
 draw a symbol at pixel coordinates (alternate) More...
 

Function Documentation

◆ D_symbol()

void D_symbol ( const SYMBOL Symb,
double  x0,
double  y0,
const RGBA_Color line_color,
const RGBA_Color fill_color 
)

draw a symbol at pixel coordinates

Draws a symbol (one of $GISBASE/etc/symbols/) to the active display. The starting x0,y0 coordinate corresponds to the center of the icon. The symbol must be pre-processed with S_stroke() before being sent to this function.

Example
#include <grass/display.h>
#include <grass/symbol.h>
...
SYMBOL *Symb;
Symb = S_read( symbol_name );
S_stroke( Symb, size, rotation, tolerance );
D_symbol( Symb, x0, y0, line_color, fill_color );
void D_symbol(const SYMBOL *, double, double, const RGBA_Color *, const RGBA_Color *)
draw a symbol at pixel coordinates
Definition: symbol.c:150
void S_stroke(SYMBOL *symb, double size, double rotation, int tolerance)
Stroke symbol to form used for Xdriver.
Definition: stroke.c:158
SYMBOL * S_read(const char *sname)
Definition: symbol/read.c:231
Parameters
SymbThe symbol name (e.g. basic/circle)
x0The starting x display coordinate (pixel)
y0The starting y display coordinate (pixel)
line_colorOutline color
fill_colorFill color
Returns
void

Definition at line 150 of file symbol.c.

◆ D_symbol2()

void D_symbol2 ( const SYMBOL Symb,
double  x0,
double  y0,
const RGBA_Color primary_color,
const RGBA_Color secondary_color 
)

draw a symbol at pixel coordinates (alternate)

Draws a symbol (one of $GISBASE/etc/symbols/) to the active display. The same as D_symbol(), but it uses a primary and secondary color instead of line and fill color. The primary color is used to draw stroke lines (STRINGs) and as the fill color for polygons. The secondary color is used for polygon outlines.

Parameters
SymbThe symbol name (e.g. basic/circle)
x0The starting x display coordinate (pixel)
y0The starting y display coordinate (pixel)
primary_colorPrimary draw color
secondary_colorSecondary draw color
Returns
void

Definition at line 172 of file symbol.c.