GRASS GIS 7 Programmer's Manual  7.9.dev(2021)-e5379bbd7
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)
 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 187 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 164 of file r_raster.c.

References COM_Graph_close(), and getenv().

◆ 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_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_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_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_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_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_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_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_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.

◆ 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 22 of file psdriver/driver.c.

Variable Documentation

◆ b

◆ l

◆ r

◆ t