GRASS GIS 8 Programmer's Manual  8.2.1dev(2022)-31a672db8
defs/display.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void D_update_conversions (void)
 
void D_fit_d_to_u (void)
 
void D_fit_u_to_d (void)
 
void D_show_conversions (void)
 
void D_do_conversions (const struct Cell_head *, double, double, double, double)
 initialize conversions More...
 
int D_is_lat_lon (void)
 
double D_get_d_to_a_xconv (void)
 
double D_get_d_to_a_yconv (void)
 
double D_get_d_to_u_xconv (void)
 
double D_get_d_to_u_yconv (void)
 
double D_get_a_to_u_xconv (void)
 
double D_get_a_to_u_yconv (void)
 
double D_get_a_to_d_xconv (void)
 
double D_get_a_to_d_yconv (void)
 
double D_get_u_to_d_xconv (void)
 
double D_get_u_to_d_yconv (void)
 
double D_get_u_to_a_xconv (void)
 
double D_get_u_to_a_yconv (void)
 
double D_get_ns_resolution (void)
 
double D_get_ew_resolution (void)
 
double D_get_u_west (void)
 
double D_get_u_east (void)
 
double D_get_u_north (void)
 
double D_get_u_south (void)
 
double D_get_a_west (void)
 
double D_get_a_east (void)
 
double D_get_a_north (void)
 
double D_get_a_south (void)
 
double D_get_d_west (void)
 
double D_get_d_east (void)
 
double D_get_d_north (void)
 
double D_get_d_south (void)
 
void D_set_region (const struct Cell_head *)
 
void D_set_src (double, double, double, double)
 
void D_get_src (double *, double *, double *, double *)
 returns frame bounds in source coordinate system More...
 
void D_set_grid (int, int, int, int)
 
void D_get_grid (int *, int *, int *, int *)
 
void D_set_dst (double, double, double, double)
 
void D_get_dst (double *, double *, double *, double *)
 returns frame bounds in destination coordinate system More...
 
void D_get_u (double [2][2])
 
void D_get_a (int [2][2])
 
void D_get_d (double [2][2])
 
double D_d_to_a_row (double)
 screen to array (y) More...
 
double D_d_to_a_col (double)
 screen to array (x) More...
 
double D_d_to_u_row (double)
 screen to earth (y) More...
 
double D_d_to_u_col (double)
 screen to earth (x) More...
 
double D_a_to_u_row (double)
 array to earth (row) More...
 
double D_a_to_u_col (double)
 array to earth (column) More...
 
double D_a_to_d_row (double)
 array to screen (row) More...
 
double D_a_to_d_col (double)
 array to screen (column) More...
 
double D_u_to_d_row (double)
 earth to screen (north) More...
 
double D_u_to_d_col (double)
 earth to screen (east) More...
 
double D_u_to_a_row (double)
 earth to array (north) More...
 
double D_u_to_a_col (double)
 earth to array (east More...
 
void D_set_clip (double, double, double, double)
 set clipping window More...
 
void D_clip_to_map (void)
 set clipping window to map window More...
 
void D_set_clip_mode (int)
 
void D_set_reduction (double)
 
void D_line_width (double)
 
void D_get_text_box (const char *, double *, double *, double *, double *)
 
void D_pos_abs (double, double)
 
void D_pos_rel (double, double)
 
void D_move_abs (double, double)
 
void D_move_rel (double, double)
 
void D_cont_abs (double, double)
 
void D_cont_rel (double, double)
 
void D_line_abs (double, double, double, double)
 
void D_line_rel (double, double, double, double)
 
void D_polydots_abs (const double *, const double *, int)
 
void D_polydots_rel (const double *, const double *, int)
 
void D_polyline_abs (const double *, const double *, int)
 
void D_polyline_rel (const double *, const double *, int)
 
void D_polygon_abs (const double *, const double *, int)
 
void D_polygon_rel (const double *, const double *, int)
 
void D_box_abs (double, double, double, double)
 
void D_box_rel (double, double)
 
void D_begin (void)
 
void D_end (void)
 
void D_close (void)
 
void D_stroke (void)
 
void D_fill (void)
 
void D_dots (void)
 
void D_plot_icon (double, double, int, double, double)
 Plot icon. More...
 
int D_draw_raster (int, const void *, struct Colors *, RASTER_MAP_TYPE)
 Draw raster row. More...
 
int D_draw_d_raster (int, const DCELL *, struct Colors *)
 Draw raster row (DCELL) More...
 
int D_draw_f_raster (int, const FCELL *, struct Colors *)
 Draw raster row (FCELL) More...
 
int D_draw_c_raster (int, const CELL *, struct Colors *)
 Draw raster row (CELL) More...
 
void D_raster_draw_begin (void)
 Prepare for raster graphic. More...
 
int D_draw_raster_RGB (int, const void *, const void *, const void *, struct Colors *, struct Colors *, struct Colors *, RASTER_MAP_TYPE, RASTER_MAP_TYPE, RASTER_MAP_TYPE)
 Draw raster row in RGB mode. More...
 
void D_raster_draw_end (void)
 Finish raster rendering. More...
 
int D_set_overlay_mode (int)
 Configure raster overlay mode. More...
 
int D_color (CELL, struct Colors *)
 
int D_c_color (CELL, struct Colors *)
 
int D_d_color (DCELL, struct Colors *)
 Same functionality as D_color() except that the value is type DCELL. This implies that the floating-point interfaces to the colors are used by this routine. More...
 
int D_f_color (FCELL, struct Colors *)
 Same functionality as D_color() except that the value is type FCELL. This implies that the floating-point interfaces to the colors are used by this routine. More...
 
int D_color_of_type (const void *, struct Colors *, RASTER_MAP_TYPE)
 If the data_type is CELL_TYPE, calls D_color((CELL *value, colors); If the data_type is FCELL_TYPE, calls D_f_color((FCELL *value, colors); If the data_type is DCELL_TYPE, calls D_d_color((DCELL *value, colors);. More...
 
void D_setup (int)
 Graphics frame setup. More...
 
void D_setup_unity (int)
 Graphics frame setup. More...
 
void D_setup2 (int, int, double, double, double, double)
 Sets source coordinate system. More...
 
void D_symbol (const SYMBOL *, double, double, const RGBA_Color *, const RGBA_Color *)
 draw a symbol at pixel coordinates More...
 
void D_symbol2 (const SYMBOL *, double, double, const RGBA_Color *, const RGBA_Color *)
 draw a symbol at pixel coordinates (alternate) More...
 
int D_translate_color (const char *)
 color name to number More...
 
int D_parse_color (const char *, int)
 color option text to usable color number More...
 
int D_use_color (int)
 draw with a color from D_parse_color More...
 
int D_color_number_to_RGB (int, int *, int *, int *)
 get RGB values from color number More...
 
void D_RGB_color (int, int, int)
 
void D_erase (const char *)
 
int D_open_driver (void)
 Open display driver. More...
 
void D_close_driver (void)
 Close display driver. More...
 
int D_save_command (const char *)
 Append command to the cmd file (unused) More...
 
void D__erase (void)
 Erase display (internal use only) More...
 
void D_text_size (double, double)
 Set text size (width and height) More...
 
void D_text_rotation (double)
 Set text rotation. More...
 
void D_text (const char *)
 Draw text. More...
 
void D_font (const char *)
 Choose font. More...
 
void D_encoding (const char *)
 Set encoding. More...
 
void D_font_list (char ***, int *)
 Get font list. More...
 
void D_font_info (char ***, int *)
 Get font info. More...
 
void D_get_clip_window (double *, double *, double *, double *)
 get graphical clipping window More...
 
void D_set_clip_window (double, double, double, double)
 set graphical clipping window More...
 
void D_get_frame (double *, double *, double *, double *)
 get graphical window (frame) More...
 
void D_get_screen (double *, double *, double *, double *)
 get screen bounds More...
 
void D_set_clip_window_to_map_window (void)
 set graphical clipping window to map window More...
 
void D_set_clip_window_to_screen_window (void)
 set clipping window to screen window More...
 
const char * D_get_file (void)
 Get driver output file. More...
 

Function Documentation

◆ D__erase()

void D__erase ( void  )

Erase display (internal use only)

Definition at line 187 of file r_raster.c.

References COM_Erase().

◆ D_a_to_d_col()

double D_a_to_d_col ( double  A_col)

array to screen (column)

Returns an x value in the screen coordinate system when provided the corresponding column value in the array coordinate system.

Parameters
A_colcolumn
Returns
double

Definition at line 430 of file cnversions.c.

◆ D_a_to_d_row()

double D_a_to_d_row ( double  A_row)

array to screen (row)

Returns a y value in the screen coordinate system when provided the corresponding row value in the array coordinate system.

Parameters
A_rowrow
Returns
double

Definition at line 413 of file cnversions.c.

◆ D_a_to_u_col()

double D_a_to_u_col ( double  A_col)

array to earth (column)

Returns an x value in the earth coordinate system when provided the corresponding column value in the array coordinate system.

Parameters
A_colcolumn
Returns
double

Definition at line 397 of file cnversions.c.

◆ D_a_to_u_row()

double D_a_to_u_row ( double  A_row)

array to earth (row)

Returns a y value in the earth coordinate system when provided the corresponding row value in the array coordinate system.

Parameters
A_rowrow
Returns
double

Definition at line 380 of file cnversions.c.

◆ D_begin()

void D_begin ( void  )

Definition at line 291 of file draw2.c.

References path_begin().

◆ D_box_abs()

void D_box_abs ( double  ,
double  ,
double  ,
double   
)

Definition at line 408 of file draw2.c.

◆ D_box_rel()

void D_box_rel ( double  ,
double   
)

Definition at line 485 of file draw2.c.

◆ D_c_color()

int D_c_color ( CELL  ,
struct Colors  
)

Definition at line 74 of file raster2.c.

◆ D_clip_to_map()

void D_clip_to_map ( void  )

set clipping window to map window

Sets the clipping window to the pixel window that corresponds to the current database region. This is the default.

Parameters
~

Definition at line 171 of file draw2.c.

References b, D_get_src(), D_set_clip(), l, r, and t.

◆ D_close()

void D_close ( void  )

Definition at line 318 of file draw2.c.

References path_close().

◆ D_close_driver()

void D_close_driver ( void  )

Close display driver.

If GRASS_NOTIFY is defined, run notifier.

Definition at line 164 of file r_raster.c.

References COM_Graph_close(), and getenv().

◆ D_color()

int D_color ( CELL  ,
struct Colors  
)

Definition at line 68 of file raster2.c.

◆ D_color_number_to_RGB()

int D_color_number_to_RGB ( int  color,
int *  r,
int *  g,
int *  b 
)

get RGB values from color number

Translates the color number provided by D_parse_color into 0-255 RGB values.

Returns 1 if color can be used to draw (is good and isn't 'none'), 0 otherwise.

Parameters
color_number
red
green
blue
Returns
int

Definition at line 180 of file tran_colr.c.

◆ D_color_of_type()

int D_color_of_type ( const void *  raster,
struct Colors colors,
RASTER_MAP_TYPE  data_type 
)

If the data_type is CELL_TYPE, calls D_color((CELL *value, colors); If the data_type is FCELL_TYPE, calls D_f_color((FCELL *value, colors); If the data_type is DCELL_TYPE, calls D_d_color((DCELL *value, colors);.

Parameters
value
colors
data_type
Returns
int

Definition at line 134 of file raster2.c.

◆ D_cont_abs()

void D_cont_abs ( double  ,
double   
)

Definition at line 310 of file draw2.c.

References path_cont().

Referenced by D_cont_rel().

◆ D_cont_rel()

void D_cont_rel ( double  ,
double   
)

Definition at line 444 of file draw2.c.

References D_cont_abs().

◆ D_d_color()

int D_d_color ( DCELL  val,
struct Colors colors 
)

Same functionality as D_color() except that the value is type DCELL. This implies that the floating-point interfaces to the colors are used by this routine.

Parameters
value
colors
Returns
int

Definition at line 93 of file raster2.c.

◆ D_d_to_a_col()

double D_d_to_a_col ( double  D_col)

screen to array (x)

Returns a column value in the array coordinate system when provided the corresponding x value in the screen coordinate system.

Parameters
D_colx
Returns
double

Definition at line 332 of file cnversions.c.

◆ D_d_to_a_row()

double D_d_to_a_row ( double  D_row)

screen to array (y)

Returns a row value in the array coordinate system when provided the corresponding y value in the screen coordinate system.

Parameters
D_rowy
Returns
double

Definition at line 316 of file cnversions.c.

◆ D_d_to_u_col()

double D_d_to_u_col ( double  D_col)

screen to earth (x)

Returns an east value in the earth coordinate system when provided the corresponding x value in the screen coordinate system.

Parameters
D_colx
Returns
double

Definition at line 364 of file cnversions.c.

Referenced by D_get_text_box().

◆ D_d_to_u_row()

double D_d_to_u_row ( double  D_row)

screen to earth (y)

Returns a north value in the earth coordinate system when provided the corresponding y value in the screen coordinate system.

Parameters
D_rowy
Returns
double

Definition at line 348 of file cnversions.c.

Referenced by D_get_text_box().

◆ D_do_conversions()

void D_do_conversions ( const struct Cell_head window,
double  t,
double  b,
double  l,
double  r 
)

initialize conversions

The relationship between the earth region and the top, bottom, left, and right screen coordinates is established, which then allows conversions between all three coordinate systems to be performed. Note this routine is called by D_setup.

Parameters
windowregion
ttop
bbottom
lleft
rright
Returns
none

Definition at line 152 of file cnversions.c.

Referenced by D_setup().

◆ D_dots()

void D_dots ( void  )

Definition at line 335 of file draw2.c.

◆ D_draw_c_raster()

int D_draw_c_raster ( int  A_row,
const CELL carray,
struct Colors colors 
)

Draw raster row (CELL)

The row gives the map array row. The carray array provides the categories for each raster value in that row. This routine is called consecutively with the information necessary to draw a raster image from north to south. No rows can be skipped. All screen pixel rows which represent the current map array row are rendered. The routine returns the map array row which is needed to draw the next screen pixel row.

Parameters
A_rowrow number (starts at 0)
carraydata buffer
colorspointer to Colors structure
Returns
row number needed for next pixel row
-1 nothing to draw (on error or end of raster)

Definition at line 105 of file display/raster.c.

◆ D_draw_d_raster()

int D_draw_d_raster ( int  A_row,
const DCELL darray,
struct Colors colors 
)

Draw raster row (DCELL)

Parameters
A_rowrow number (starts at 0)
darraydata buffer
colorspointer to Colors structure
Returns

Definition at line 67 of file display/raster.c.

◆ D_draw_f_raster()

int D_draw_f_raster ( int  A_row,
const FCELL farray,
struct Colors colors 
)

Draw raster row (FCELL)

Parameters
A_rowrow number (starts at 0)
farraydata buffer
colorspointer to Colors structure
Returns
row number needed for next pixel row
-1 nothing to draw (on error or end of raster)

Definition at line 82 of file display/raster.c.

◆ D_draw_raster()

int D_draw_raster ( int  A_row,
const void *  array,
struct Colors colors,
RASTER_MAP_TYPE  data_type 
)

Draw raster row.

  • determine which pixel row gets the data
  • resamples the data to create a pixel array
  • determines best way to draw the array a - for single cat array, a move and a draw b - otherwise, a call to D_raster()

Presumes the map is drawn from north to south.

If overlay mode is desired, then call D_set_overlay_mode() first.

Parameters
A_rowrow number (starts at 0)
arraydata buffer
colorspointer to Colors structure
data_typeraster type (CELL, FCELL, DCELL)
Returns
row number needed for next pixel row
-1 nothing to draw (on error or end of raster)

Definition at line 51 of file display/raster.c.

◆ D_draw_raster_RGB()

int D_draw_raster_RGB ( int  A_row,
const void *  r_raster,
const void *  g_raster,
const void *  b_raster,
struct Colors r_colors,
struct Colors g_colors,
struct Colors b_colors,
RASTER_MAP_TYPE  r_type,
RASTER_MAP_TYPE  g_type,
RASTER_MAP_TYPE  b_type 
)

Draw raster row in RGB mode.

Parameters
A_rowrow number (starts at 0)
r_rasterred data buffer
g_rastergreen data buffer
b_rasterblue data buffer
r_colorscolors used for red channel
g_colorscolors used for green channel
b_colorscolors used for blue channel
r_typeraster type used for red channel
g_typeraster type used for red channel
b_typeraster type used for red channel
Returns
row number needed for next pixel row
-1 nothing to draw (on error or end of raster)

Definition at line 177 of file display/raster.c.

◆ D_encoding()

void D_encoding ( const char *  name)

Set encoding.

Parameters
nameencoding name

Definition at line 243 of file r_raster.c.

References COM_Set_encoding().

◆ D_end()

void D_end ( void  )

Definition at line 296 of file draw2.c.

◆ D_erase()

void D_erase ( const char *  )

◆ D_f_color()

int D_f_color ( FCELL  val,
struct Colors colors 
)

Same functionality as D_color() except that the value is type FCELL. This implies that the floating-point interfaces to the colors are used by this routine.

Parameters
value
colors
Returns
int

Definition at line 112 of file raster2.c.

◆ D_fill()

void D_fill ( void  )

Definition at line 329 of file draw2.c.

◆ D_fit_d_to_u()

void D_fit_d_to_u ( void  )

Definition at line 100 of file cnversions.c.

Referenced by D_setup2().

◆ D_fit_u_to_d()

void D_fit_u_to_d ( void  )

Definition at line 105 of file cnversions.c.

◆ D_font()

void D_font ( const char *  name)

Choose font.

Set current font to font name.

Parameters
namefont name

Definition at line 233 of file r_raster.c.

References COM_Set_font().

◆ D_font_info()

void D_font_info ( char ***  list,
int *  count 
)

Get font info.

Parameters
[out]listlist of font info
[out]numberof items in the list

Definition at line 265 of file r_raster.c.

References COM_Font_info().

◆ D_font_list()

void D_font_list ( char ***  list,
int *  count 
)

Get font list.

Parameters
[out]listlist of font names
[out]numberof items in the list

Definition at line 254 of file r_raster.c.

References COM_Font_list().

◆ D_get_a()

void D_get_a ( int  [2][2])

Definition at line 290 of file cnversions.c.

Referenced by D_raster_draw_begin().

◆ D_get_a_east()

double D_get_a_east ( void  )

Definition at line 189 of file cnversions.c.

◆ D_get_a_north()

double D_get_a_north ( void  )

Definition at line 190 of file cnversions.c.

◆ D_get_a_south()

double D_get_a_south ( void  )

Definition at line 191 of file cnversions.c.

◆ D_get_a_to_d_xconv()

double D_get_a_to_d_xconv ( void  )

Definition at line 173 of file cnversions.c.

◆ D_get_a_to_d_yconv()

double D_get_a_to_d_yconv ( void  )

Definition at line 174 of file cnversions.c.

◆ D_get_a_to_u_xconv()

double D_get_a_to_u_xconv ( void  )

Definition at line 171 of file cnversions.c.

Referenced by D_get_ew_resolution().

◆ D_get_a_to_u_yconv()

double D_get_a_to_u_yconv ( void  )

Definition at line 172 of file cnversions.c.

Referenced by D_get_ns_resolution().

◆ D_get_a_west()

double D_get_a_west ( void  )

Definition at line 188 of file cnversions.c.

◆ D_get_clip_window()

void D_get_clip_window ( double *  t,
double *  b,
double *  l,
double *  r 
)

get graphical clipping window

Queries the graphical clipping window (origin is top right)

Parameters
[out]ttop edge of clip window
[out]bbottom edge of clip window
[out]lleft edge of clip window
[out]rright edge of clip window
Returns
~

Definition at line 282 of file r_raster.c.

References COM_Get_window().

◆ D_get_d()

void D_get_d ( double  [2][2])

Definition at line 298 of file cnversions.c.

◆ D_get_d_east()

double D_get_d_east ( void  )

Definition at line 194 of file cnversions.c.

Referenced by D_set_clip_window_to_map_window().

◆ D_get_d_north()

double D_get_d_north ( void  )

Definition at line 195 of file cnversions.c.

Referenced by D_set_clip_window_to_map_window().

◆ D_get_d_south()

double D_get_d_south ( void  )

Definition at line 196 of file cnversions.c.

Referenced by D_set_clip_window_to_map_window().

◆ D_get_d_to_a_xconv()

double D_get_d_to_a_xconv ( void  )

Definition at line 167 of file cnversions.c.

◆ D_get_d_to_a_yconv()

double D_get_d_to_a_yconv ( void  )

Definition at line 168 of file cnversions.c.

◆ D_get_d_to_u_xconv()

double D_get_d_to_u_xconv ( void  )

Definition at line 169 of file cnversions.c.

◆ D_get_d_to_u_yconv()

double D_get_d_to_u_yconv ( void  )

Definition at line 170 of file cnversions.c.

◆ D_get_d_west()

double D_get_d_west ( void  )

Definition at line 193 of file cnversions.c.

Referenced by D_set_clip_window_to_map_window().

◆ D_get_dst()

void D_get_dst ( double *  t,
double *  b,
double *  l,
double *  r 
)

returns frame bounds in destination coordinate system

D_get_dst() returns the frame bounds in the destination coordinate system (used by R_* commands). The various D_setup() commands all set the destination coordinate system to the current frame reported by R_get_window().

Parameters
ttop
bbottom
lleft
rright
Returns
none

Definition at line 274 of file cnversions.c.

Referenced by D_erase().

◆ D_get_ew_resolution()

double D_get_ew_resolution ( void  )

Definition at line 181 of file cnversions.c.

References D_get_a_to_u_xconv().

◆ D_get_file()

const char* D_get_file ( void  )

Get driver output file.

Returns
file name or NULL if not defined

Definition at line 141 of file display/setup.c.

References COM_Graph_get_file().

◆ D_get_frame()

void D_get_frame ( double *  t,
double *  b,
double *  l,
double *  r 
)

get graphical window (frame)

Queries the graphical frame (origin is top right)

Parameters
[out]ttop edge of frame
[out]bbottom edge of frame
[out]lleft edge of frame
[out]rright edge of frame
Returns
~

Definition at line 322 of file r_raster.c.

Referenced by D_setup(), D_setup2(), and D_setup_unity().

◆ D_get_grid()

void D_get_grid ( int *  ,
int *  ,
int *  ,
int *   
)

Definition at line 243 of file cnversions.c.

◆ D_get_ns_resolution()

double D_get_ns_resolution ( void  )

Definition at line 180 of file cnversions.c.

References D_get_a_to_u_yconv().

◆ D_get_screen()

void D_get_screen ( double *  t,
double *  b,
double *  l,
double *  r 
)

get screen bounds

Queries the screen bounds (origin is top right)

Parameters
[out]ttop edge of screen
[out]bbottom edge of screen
[out]lleft edge of screen
[out]rright edge of screen
Returns
~

Definition at line 342 of file r_raster.c.

◆ D_get_src()

void D_get_src ( double *  t,
double *  b,
double *  l,
double *  r 
)

returns frame bounds in source coordinate system

D_get_src() returns the frame bounds in the source coordinate system (used by D_* functions)

Parameters
ttop
bbottom
lleft
rright
Returns
void

Definition at line 226 of file cnversions.c.

Referenced by D_clip_to_map().

◆ D_get_text_box()

void D_get_text_box ( const char *  ,
double *  ,
double *  ,
double *  ,
double *   
)

Definition at line 194 of file draw2.c.

References COM_Get_text_box(), D_d_to_u_col(), and D_d_to_u_row().

◆ D_get_u()

void D_get_u ( double  [2][2])

Definition at line 282 of file cnversions.c.

◆ D_get_u_east()

double D_get_u_east ( void  )

Definition at line 184 of file cnversions.c.

◆ D_get_u_north()

double D_get_u_north ( void  )

Definition at line 185 of file cnversions.c.

◆ D_get_u_south()

double D_get_u_south ( void  )

Definition at line 186 of file cnversions.c.

◆ D_get_u_to_a_xconv()

double D_get_u_to_a_xconv ( void  )

Definition at line 177 of file cnversions.c.

◆ D_get_u_to_a_yconv()

double D_get_u_to_a_yconv ( void  )

Definition at line 178 of file cnversions.c.

◆ D_get_u_to_d_xconv()

double D_get_u_to_d_xconv ( void  )

Definition at line 175 of file cnversions.c.

◆ D_get_u_to_d_yconv()

double D_get_u_to_d_yconv ( void  )

Definition at line 176 of file cnversions.c.

◆ D_get_u_west()

double D_get_u_west ( void  )

Definition at line 183 of file cnversions.c.

◆ D_is_lat_lon()

int D_is_lat_lon ( void  )

Definition at line 165 of file cnversions.c.

◆ D_line_abs()

void D_line_abs ( double  ,
double  ,
double  ,
double   
)

Definition at line 399 of file draw2.c.

◆ D_line_rel()

void D_line_rel ( double  ,
double  ,
double  ,
double   
)

Definition at line 468 of file draw2.c.

◆ D_line_width()

void D_line_width ( double  )

Definition at line 189 of file draw2.c.

◆ D_move_abs()

void D_move_abs ( double  ,
double   
)

Definition at line 302 of file draw2.c.

References path_move().

Referenced by D_move_rel().

◆ D_move_rel()

void D_move_rel ( double  ,
double   
)

Definition at line 439 of file draw2.c.

References D_move_abs().

◆ D_open_driver()

int D_open_driver ( void  )

Open display driver.

Default display driver is Cairo, if not available PNG is used.

Returns
0 on success

Definition at line 81 of file r_raster.c.

◆ D_parse_color()

int D_parse_color ( const char *  str,
int  none_acceptable 
)

color option text to usable color number

Converts or looks up the color provided in the string. Returns a color number usable by D_use_color. If the color does not exist exits with a fatal error and message. If the color is none and none_acceptable is not true exits with a fatal error and message.

Parameters
name_or_code
none_acceptable
Returns
int

Definition at line 101 of file tran_colr.c.

Referenced by D_erase(), and D_translate_color().

◆ D_plot_icon()

void D_plot_icon ( double  xc,
double  yc,
int  type,
double  angle,
double  scale 
)

Plot icon.

Supported types:

  • G_ICON_CROSS
  • G_ICON_BOX
  • G_ICON_ARROW
Parameters
xc,ycicon coordinates
typeicon type
anglerotation angle [rad]
scalescale factor

Definition at line 43 of file icon.c.

◆ D_polydots_abs()

void D_polydots_abs ( const double *  ,
const double *  ,
int   
)

Definition at line 393 of file draw2.c.

◆ D_polydots_rel()

void D_polydots_rel ( const double *  ,
const double *  ,
int   
)

Definition at line 449 of file draw2.c.

◆ D_polygon_abs()

void D_polygon_abs ( const double *  ,
const double *  ,
int   
)

Definition at line 386 of file draw2.c.

◆ D_polygon_rel()

void D_polygon_rel ( const double *  ,
const double *  ,
int   
)

Definition at line 461 of file draw2.c.

◆ D_polyline_abs()

void D_polyline_abs ( const double *  ,
const double *  ,
int   
)

Definition at line 380 of file draw2.c.

◆ D_polyline_rel()

void D_polyline_rel ( const double *  ,
const double *  ,
int   
)

Definition at line 455 of file draw2.c.

◆ D_pos_abs()

void D_pos_abs ( double  ,
double   
)

Definition at line 218 of file draw2.c.

Referenced by D_pos_rel().

◆ D_pos_rel()

void D_pos_rel ( double  ,
double   
)

Definition at line 229 of file draw2.c.

References D_pos_abs().

◆ D_raster_draw_begin()

void D_raster_draw_begin ( void  )

Prepare for raster graphic.

The raster display subsystem establishes conversion parameters based on the screen extent defined by top, bottom, left, and right, all of which are obtainable from D_get_dst() for the current frame.

Definition at line 152 of file display/raster.c.

References D_get_a().

◆ D_raster_draw_end()

void D_raster_draw_end ( void  )

Finish raster rendering.

Definition at line 231 of file display/raster.c.

References COM_end_raster().

◆ D_RGB_color()

void D_RGB_color ( int  ,
int  ,
int   
)

Definition at line 214 of file tran_colr.c.

References COM_Color_RGB().

◆ D_save_command()

int D_save_command ( const char *  cmd)

Append command to the cmd file (unused)

Todo:
To be removed

Definition at line 179 of file r_raster.c.

◆ D_set_clip()

void D_set_clip ( double  t,
double  b,
double  l,
double  r 
)

set clipping window

Sets the clipping window to the pixel window that corresponds to the current database region. This is the default.

Parameters
ttop
bbottom
lleft
rright

Definition at line 152 of file draw2.c.

References max, min, and clip::top.

Referenced by D_clip_to_map().

◆ D_set_clip_mode()

void D_set_clip_mode ( int  )

Definition at line 179 of file draw2.c.

◆ D_set_clip_window()

void D_set_clip_window ( double  t,
double  b,
double  l,
double  r 
)

set graphical clipping window

Sets the graphical clipping window to the specified rectangle (origin is top right)

Parameters
ttop edge of clip window
bbottom edge of clip window
lleft edge of clip window
rright edge of clip window
Returns
~

Definition at line 300 of file r_raster.c.

Referenced by D_set_clip_window_to_map_window().

◆ D_set_clip_window_to_map_window()

void D_set_clip_window_to_map_window ( void  )

set graphical clipping window to map window

Sets the graphical clipping window to the pixel window that corresponds to the current database region.

Parameters
~
Returns
~

Definition at line 360 of file r_raster.c.

References D_get_d_east(), D_get_d_north(), D_get_d_south(), D_get_d_west(), and D_set_clip_window().

Referenced by D_setup(), D_setup2(), and D_setup_unity().

◆ D_set_clip_window_to_screen_window()

void D_set_clip_window_to_screen_window ( void  )

set clipping window to screen window

Sets the clipping window to the pixel window that corresponds to the full screen window. Off screen rendering is still clipped.

Parameters
~
Returns
~

Definition at line 377 of file r_raster.c.

References COM_Set_window().

Referenced by D_setup(), D_setup2(), and D_setup_unity().

◆ D_set_dst()

void D_set_dst ( double  ,
double  ,
double  ,
double   
)

Definition at line 251 of file cnversions.c.

Referenced by D_setup2(), and D_setup_unity().

◆ D_set_grid()

void D_set_grid ( int  ,
int  ,
int  ,
int   
)

Definition at line 234 of file cnversions.c.

◆ D_set_overlay_mode()

int D_set_overlay_mode ( int  n)

Configure raster overlay mode.

This routine determines if D_draw_raster() draws in overlay mode (locations with category 0 are left untouched) or not (colored with the color for category 0).

Parameters
n1 (TRUE) for overlay mode; 0 (FALSE) otherwise
Returns
0

Definition at line 50 of file raster2.c.

References D__overlay_mode.

◆ D_set_reduction()

void D_set_reduction ( double  )

Definition at line 184 of file draw2.c.

◆ D_set_region()

void D_set_region ( const struct Cell_head )

Definition at line 198 of file cnversions.c.

◆ D_set_src()

void D_set_src ( double  ,
double  ,
double  ,
double   
)

Definition at line 205 of file cnversions.c.

Referenced by D_setup2(), and D_setup_unity().

◆ D_setup()

void D_setup ( int  clear)

Graphics frame setup.

This is a high level D call. It does a full setup for the current graphics frame.

Note: Connection to driver must already be made.

Sets the source coordinate system to the current region, and adjusts the destination coordinate system to preserve the aspect ratio.

Performs a full setup for the current graphics frame:

  • Makes sure there is a current graphics frame (will create a full-screen one, if not);
  • Sets the region coordinates so that the graphics frame and the active module region agree (may change active module region to do this); and
  • Performs graphic frame/region coordinate conversion initialization.

If clear is true, the frame is cleared (same as running d.erase.) Otherwise, it is not cleared.

Parameters
clear1 to clear frame (visually and coordinates)

Definition at line 46 of file display/setup.c.

References D_do_conversions(), D_erase(), D_get_frame(), D_set_clip_window_to_map_window(), D_set_clip_window_to_screen_window(), DEFAULT_BG_COLOR, G_get_set_window(), and Rast_set_window().

◆ D_setup2()

void D_setup2 ( int  clear,
int  fit,
double  st,
double  sb,
double  sl,
double  sr 
)

Sets source coordinate system.

Sets the source coordinate system to its arguments, and if the fit argument is non-zero, adjusts the destination coordinate system to preserve the aspect ratio.

If clear is true, the frame is cleared (same as running d.erase). Otherwise, it is not cleared.

Parameters
clearnon-zero code to clear the frame
fitnon-zero code to adjust destination coordinate system
s_top
s_bottom
s_left
s_right

Definition at line 114 of file display/setup.c.

References D_erase(), D_fit_d_to_u(), D_get_frame(), D_set_clip_window_to_map_window(), D_set_clip_window_to_screen_window(), D_set_dst(), D_set_src(), D_update_conversions(), and DEFAULT_BG_COLOR.

◆ D_setup_unity()

void D_setup_unity ( int  clear)

Graphics frame setup.

Sets the source coordinate system to match the destination coordinate system, so that D_* functions use the same coordinate system as R_* functions.

If clear is true, the frame is cleared (same as running d.erase). Otherwise, it is not cleared.

Parameters
clearnon-zero code to clear the frame

Definition at line 78 of file display/setup.c.

References D_erase(), D_get_frame(), D_set_clip_window_to_map_window(), D_set_clip_window_to_screen_window(), D_set_dst(), D_set_src(), D_update_conversions(), and DEFAULT_BG_COLOR.

◆ D_show_conversions()

void D_show_conversions ( void  )

Definition at line 110 of file cnversions.c.

◆ D_stroke()

void D_stroke ( void  )

Definition at line 323 of file draw2.c.

◆ 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 );
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 153 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 177 of file symbol.c.

◆ D_text()

void D_text ( const char *  text)

Draw text.

Writes text in the current color and font, at the current text width and height, starting at the current screen location.

Parameters
texttext to be drawn

Definition at line 221 of file r_raster.c.

References COM_Text().

◆ D_text_rotation()

void D_text_rotation ( double  rotation)

Set text rotation.

Parameters
rotationvalue

Definition at line 208 of file r_raster.c.

References COM_Text_rotation().

◆ D_text_size()

void D_text_size ( double  width,
double  height 
)

Set text size (width and height)

Parameters
widthtext pixel width
heighttext pixel height

Definition at line 198 of file r_raster.c.

◆ D_translate_color()

int D_translate_color ( const char *  str)

color name to number

Takes a color name in ascii and returns the color number for that color. Returns 0 if color is not known. The color number returned is for lines and text, not raster graphics.

Parameters
name
Returns
int

Definition at line 126 of file tran_colr.c.

References D_parse_color().

◆ D_u_to_a_col()

double D_u_to_a_col ( double  U_col)

earth to array (east

Returns a column value in the array coordinate system when provided the corresponding east value in the earth coordinate system.

Parameters
U_coleast
Returns
double

Definition at line 494 of file cnversions.c.

◆ D_u_to_a_row()

double D_u_to_a_row ( double  U_row)

earth to array (north)

Returns a row value in the array coordinate system when provided the corresponding north value in the earth coordinate system.

Parameters
U_rownorth
Returns
double

Definition at line 478 of file cnversions.c.

◆ D_u_to_d_col()

double D_u_to_d_col ( double  U_col)

earth to screen (east)

Returns an x value in the screen coordinate system when provided the corresponding east value in the earth coordinate system.

Parameters
U_coleast
Returns
double

Definition at line 462 of file cnversions.c.

◆ D_u_to_d_row()

double D_u_to_d_row ( double  U_row)

earth to screen (north)

Returns a y value in the screen coordinate system when provided the corresponding north value in the earth coordinate system.

Parameters
U_rownorth
Returns
double

Definition at line 446 of file cnversions.c.

◆ D_update_conversions()

void D_update_conversions ( void  )

Definition at line 93 of file cnversions.c.

Referenced by D_setup2(), and D_setup_unity().

◆ D_use_color()

int D_use_color ( int  color)

draw with a color from D_parse_color

Calls R_color or R_standard_color to use the color provided by D_parse_color. Returns 1 if color can be used to draw (is good and isn't none), 0 otherwise.

Parameters
color
Returns
int

Definition at line 143 of file tran_colr.c.

References COM_Standard_color(), and G_num_standard_colors().

Referenced by D_erase().