GRASS GIS 7 Programmer's Manual  7.7.svn(2018)-r73570
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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

struct driverPNG_Driver (void)
 Initialize display driver. More...
 
struct driverPS_Driver (void)
 
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

void D__erase ( void  )

Erase display (internal use only)

Definition at line 187 of file r_raster.c.

References COM_Erase().

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().

void D_encoding ( const char *  name)

Set encoding.

Parameters
nameencoding name

Definition at line 243 of file r_raster.c.

References COM_Set_encoding().

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().

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().

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().

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().

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().

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.

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.

References _, Cairo_Driver(), G_debug(), G_fatal_error(), G_file_name(), G_free(), G_getenv_nofatal(), G_mapset(), G_recreate_command(), G_spawn_ex(), G_strcasecmp(), G_temp_element(), G_verbose_message(), G_warning(), getenv(), GPATH_MAX, HTML_Driver(), init(), LIB_init(), driver::name, NULL, PNG_Driver(), and PS_Driver().

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.

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.

References COM_Set_window().

Referenced by 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().

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().

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().

void D_text_rotation ( double  rotation)

Set text rotation.

Parameters
rotationvalue

Definition at line 208 of file r_raster.c.

References COM_Text_rotation().

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.

References COM_Text_size().

struct driver* HTML_Driver ( void  )

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

Referenced by D_open_driver().

struct driver* PNG_Driver ( void  )

Initialize display driver.

Returns
pointer driver structure

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

Referenced by D_open_driver().

struct driver* PS_Driver ( void  )

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

Referenced by D_open_driver().

Variable Documentation

double b

Definition at line 39 of file r_raster.c.

Referenced by Cairo_raster(), cairo_read_ppm(), cairo_write_ppm(), Cdhc_durbins_exact(), Cdhc_ppnd7(), Cdhc_shapiro_wilk_exp(), cmattr(), COM_Set_window(), create_raster(), D_clip_to_map(), D_color_of_type(), D_erase(), D_get_text_box(), D_set_dst(), D_set_grid(), D_set_src(), datetime_is_between(), db__recv_string_array(), db_strip(), dig__frealloc(), dig_x_intersect(), edge_order(), G_read_compressed(), G_remove_commas(), G_setup_plot(), G_strip(), Gs_build_256lookup(), gs_get_databounds_planes(), GS_get_val_at_xy(), gs_los_intersect(), gs_los_intersect1(), Gs_pack_colors(), Gs_pack_colors_float(), gs_put_label(), GS_write_ppm(), GS_write_zoom(), gsd_color_func(), gsd_getimage(), Gvl_get_color_for_value(), gvld_isosurf(), I_alloc_double2(), I_alloc_int2(), I_iclass_add_signature(), I_iclass_create_raster(), I_malloc(), I_realloc(), IL_crst(), IL_interp_segments_2d(), IL_interp_segments_2d_parallel(), IL_resample_interp_segments_2d(), link__set_next(), make_all_statistics(), make_statistics(), mattr(), mc33_test_interior(), N_calc_arith_mean(), N_calc_harmonic_mean(), Nviz_set_light_bright(), Nviz_set_light_color(), PNG_draw_bitmap(), ppnd16(), BasicMinMaxHeap< T >::print_range(), pqheap_t1< T >::print_range(), qrbdi(), qrbdu1(), qrbdv(), Rast__lookup_colors(), Rast_get_color(), Rast_print_colors(), Rast_read_color_rules(), Rast_sort_histogram(), read_bmp(), read_png(), read_ppm(), S_read(), Vect__intersect_x_line_with_poly(), Vect__intersect_y_line_with_poly(), Vect_set_constraint_region(), Vect_tin_get_z(), write_bmp(), write_pgm(), write_png(), and write_ppm().