GRASS GIS 7 Programmer's Manual
7.8.3(2020)-exported
|
Go to the documentation of this file.
19 #include <sys/types.h>
27 #include <grass/gis.h>
28 #include <grass/colors.h>
29 #include <grass/glocale.h>
34 static void map_file(
void)
45 png.handle = CreateFileMapping((HANDLE) _get_osfhandle(fd),
50 ptr = MapViewOfFile(
png.handle, FILE_MAP_WRITE, 0, 0, size);
54 ptr = mmap(
NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, (off_t) 0);
55 if (ptr == MAP_FAILED)
84 unsigned int red, grn, blu;
89 G_gisinit(
"PNG driver");
91 p = getenv(
"GRASS_RENDER_FILE");
92 if (!p || strlen(p) == 0)
94 G_debug(1,
"png: GRASS_RENDER_FILE: %s", p);
98 p = getenv(
"GRASS_RENDER_TRUECOLOR");
104 p = getenv(
"GRASS_RENDER_FILE_MAPPED");
105 do_map = p && strcmp(p,
"TRUE") == 0;
114 p = getenv(
"GRASS_RENDER_FILE_READ");
115 do_read = p && strcmp(p,
"TRUE") == 0;
128 p = getenv(
"GRASS_RENDER_TRANSPARENT");
133 p = getenv(
"GRASS_RENDER_BACKGROUNDCOLOR");
135 (sscanf(p,
"%02x%02x%02x", &red, &grn, &blu) == 3 ||
141 if (strcmp(DEFAULT_FG_COLOR,
"white") == 0)
153 if (do_read && do_map)
int G_strcasecmp(const char *x, const char *y)
String compare ignoring case (upper or lower)
void G_verbose_message(const char *msg,...)
Print a message to stderr but only if module is in verbose mode.
void png_init_color_table(void)
int G_str_to_color(const char *str, int *red, int *grn, int *blu)
Parse color string and set red,green,blue.
void G_free(void *buf)
Free allocated memory.
const char * PNG_Graph_get_file(void)
Get render file.
unsigned int png_get_color(int r, int g, int b, int a)
int PNG_Graph_set(void)
Start up graphics processing.
void PNG_Erase(void)
Erase screen.
int G_debug(int level, const char *msg,...)
Print debugging message.
GRASS png display driver - header file.