GRASS GIS 8 Programmer's Manual  8.5.0dev(2024)-d6dec75dd4
r_raster.c File Reference

Display Library - Raster graphics subroutines. More...

#include <grass/config.h>
#include <errno.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <grass/gis.h>
#include <grass/glocale.h>
#include <grass/display.h>
#include <grass/spawn.h>
#include "driver.h"
Include dependency graph for r_raster.c:

Go to the source code of this file.

Functions

const struct driverPNG_Driver (void)
 Initialize display driver. More...
 
const struct driverPS_Driver (void)
 
const struct driverHTML_Driver (void)
 
int D_open_driver (void)
 Open display driver. More...
 
void D_close_driver (void)
 Close display driver. More...
 
int D_save_command (const char *cmd UNUSED)
 Append command to the cmd file (unused) More...
 
void D__erase (void)
 Erase display (internal use only) More...
 
void D_text_size (double width, double height)
 Set text size (width and height) More...
 
void D_text_rotation (double rotation)
 Set text rotation. More...
 
void D_text (const char *text)
 Draw text. More...
 
void D_font (const char *name)
 Choose font. More...
 
void D_encoding (const char *name)
 Set encoding. More...
 
void D_font_list (char ***list, int *count)
 Get font list. More...
 
void D_font_info (char ***list, int *count)
 Get font info. More...
 
void D_get_clip_window (double *t, double *b, double *l, double *r)
 get graphical clipping window More...
 
void D_set_clip_window (double t, double b, double l, double r)
 set graphical clipping window More...
 
void D_get_frame (double *t, double *b, double *l, double *r)
 get graphical window (frame) More...
 
void D_get_screen (double *t, double *b, double *l, double *r)
 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...
 

Detailed Description

Display Library - Raster graphics subroutines.

(C) 2001-2015 by the GRASS Development Team

This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.

Author
Original author CERL
Monitors support by Martin Landa <landa.martin gmail.com>

Definition in file r_raster.c.

Function Documentation

◆ D__erase()

void D__erase ( void  )

Erase display (internal use only)

Definition at line 186 of file r_raster.c.

References COM_Erase().

◆ D_close_driver()

void D_close_driver ( void  )

Close display driver.

If GRASS_NOTIFY is defined, run notifier.

Definition at line 163 of file r_raster.c.

References _, COM_Graph_close(), and G_warning().

◆ D_encoding()

void D_encoding ( const char *  name)

Set encoding.

Parameters
nameencoding name

Definition at line 242 of file r_raster.c.

References COM_Set_encoding(), and name.

◆ D_font()

void D_font ( const char *  name)

Choose font.

Set current font to font name.

Parameters
namefont name

Definition at line 232 of file r_raster.c.

References COM_Set_font(), and name.

◆ 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 264 of file r_raster.c.

References COM_Font_info(), and count.

◆ 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 253 of file r_raster.c.

References COM_Font_list(), and count.

◆ 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 281 of file r_raster.c.

References b, COM_Get_window(), l, r, and t.

◆ 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 325 of file r_raster.c.

References t.

Referenced by D_setup2(), and D_setup_unity().

◆ 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 345 of file r_raster.c.

References t.

◆ 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 82 of file r_raster.c.

◆ D_save_command()

int D_save_command ( const char *cmd  UNUSED)

Append command to the cmd file (unused)

Todo:
To be removed

Definition at line 178 of file r_raster.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 299 of file r_raster.c.

References t.

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 363 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_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 379 of file r_raster.c.

References COM_Set_window().

Referenced by D_setup2(), and D_setup_unity().

◆ 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 220 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 207 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 197 of file r_raster.c.

◆ HTML_Driver()

const struct driver* HTML_Driver ( void  )

Definition at line 20 of file htmldriver/driver.c.

◆ PNG_Driver()

const struct driver* PNG_Driver ( void  )

Initialize display driver.

Returns
pointer driver structure

Definition at line 21 of file pngdriver/driver.c.

◆ PS_Driver()

const struct driver* PS_Driver ( void  )

Definition at line 21 of file psdriver/driver.c.

Variable Documentation

◆ b

◆ l

◆ r

◆ t

double t

Definition at line 39 of file r_raster.c.

Referenced by Cairo_Set_window(), Cdhc_dmax_exp(), COM_Get_text_box(), D_clip_to_map(), D_erase(), D_get_clip_window(), D_get_dst(), D_get_frame(), D_get_grid(), D_get_screen(), D_get_src(), D_get_text_box(), D_set_clip(), D_set_clip_window(), db__recv_datetime(), db__send_datetime(), DGL_DEL_NODE_INEDGE_FUNC(), DGL_DEL_NODE_OUTEDGE_FUNC(), dig_prune(), dig_Rd_spidx_head(), dig_read_cidx_head(), dig_set_distance_to_line_tolerance(), dig_Wr_spidx_head(), dig_write_cidx_head(), G_set_distance_to_line_tolerance(), G_setup_plot(), G_srand48_auto(), gsd_getimage(), gsd_viewport(), kdtree_clear(), kdtree_create(), kdtree_destroy(), Nviz_del_texture(), PNG_Set_window(), PS_Set_window(), Rast3d_extern_length(), Rast3d_length(), RayCvxPolyhedronInt(), RTreeAddBranch(), RTreeAddNodePos(), RTreeAllocBoundary(), RTreeAllocNode(), RTreeAllocRect(), RTreeCombineRect(), RTreeCopyBranch(), RTreeCopyNode(), RTreeDeleteRect(), RTreeDestroyTree(), RTreeDisconnectBranch(), RTreeExpandRect(), RTreeFlushBuffer(), RTreeGetLeafMax(), RTreeGetNode(), RTreeGetNodeMax(), RTreeGetNodePos(), RTreeInitPVars(), RTreeInitRect(), RTreeInsertRect(), RTreeInsertRectF(), RTreeInsertRectM(), RTreeNodeChanged(), RTreeNodeCover(), RTreeNullRect(), RTreeReadBranch(), RTreeReadNode(), RTreeRectMargin(), RTreeRectSphericalVolume(), RTreeRectSurfaceArea(), RTreeRectVolume(), RTreeRewriteNode(), RTreeSearch(), RTreeSearch2(), RTreeSetOverflow(), RTreeSetRect1D(), RTreeSetRect2D(), RTreeSetRect3D(), RTreeSetRect4D(), RTreeWriteBranch(), RTreeWriteNode(), sort_intersection_list(), and Vect_net_ttb_shortest_path().