GRASS GIS 7 Programmer's Manual  7.9.dev(2021)-e5379bbd7
display/window.c
Go to the documentation of this file.
1 /*
2  * D_erase()
3  * Erases the window on scree. Does not affect window contents list.
4  */
5 
6 #include <string.h>
7 #include <grass/colors.h>
8 #include <grass/gis.h>
9 #include <grass/display.h>
10 #include "driver.h"
11 
12 void D_erase(const char *color)
13 {
14  double t, b, l, r;
15  int colorindex;
16 
17  D_get_dst(&t, &b, &l, &r);
18 
19  /* Parse and select background color */
20  colorindex = D_parse_color(color, 0);
21  D_use_color(colorindex);
22 
23  /* Do the plotting */
24  COM_Begin();
25  COM_Move(l, b);
26  COM_Cont(r, b);
27  COM_Cont(r, t);
28  COM_Cont(l, t);
29  COM_Close();
30  COM_Fill();
31 }
32 
void D_erase(const char *color)
void COM_Cont(double x, double y)
Definition: driver/draw.c:23
int D_use_color(int)
draw with a color from D_parse_color
Definition: tran_colr.c:143
void COM_Fill(void)
Definition: driver/draw.c:41
double l
Definition: r_raster.c:39
double t
Definition: r_raster.c:39
double b
Definition: r_raster.c:39
void COM_Close(void)
Definition: driver/draw.c:29
int D_parse_color(const char *, int)
color option text to usable color number
Definition: tran_colr.c:101
void D_get_dst(double *, double *, double *, double *)
returns frame bounds in destination coordinate system
Definition: cnversions.c:274
void COM_Move(double x, double y)
Definition: driver/draw.c:17
void COM_Begin(void)
Definition: driver/draw.c:11
double r
Definition: r_raster.c:39