GRASS Programmer's Manual
6.5.svn(2014)-r66266
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
pngdriver/Graph_close.c
Go to the documentation of this file.
1
/*
2
* Close down the graphics processing. This gets called only at driver
3
* termination time.
4
*/
5
6
#ifndef __MINGW32__
7
#include <unistd.h>
8
#include <fcntl.h>
9
#include <sys/types.h>
10
#include <sys/stat.h>
11
#include <sys/mman.h>
12
#endif
13
14
#include <grass/gis.h>
15
#include "
pngdriver.h
"
16
17
static
void
unmap_file(
void
)
18
{
19
#ifndef __MINGW32__
20
size_t
size
=
HEADER_SIZE
+
width
*
height
*
sizeof
(
unsigned
int
);
21
void
*ptr = (
char
*)
grid
-
HEADER_SIZE
;
22
23
if
(!
mapped
)
24
return
;
25
26
munmap(ptr, size);
27
28
mapped
= 0;
29
#endif
30
}
31
32
void
PNG_Graph_close
(
void
)
33
{
34
write_image
();
35
36
if
(
mapped
)
37
unmap_file();
38
else
39
G_free
(
grid
);
40
}
G_free
void G_free(void *buf)
Free allocated memory.
Definition:
gis/alloc.c:142
HEADER_SIZE
#define HEADER_SIZE
Definition:
cairodriver.h:17
pngdriver.h
PNG_Graph_close
void PNG_Graph_close(void)
Definition:
pngdriver/Graph_close.c:32
dialogs.width
tuple width
Definition:
psmap/dialogs.py:2959
grid
unsigned char * grid
Definition:
cairodriver/Graph.c:50
tools.size
tuple size
value.Bind(wx.EVT_TEXT, self.OnVolumeIsosurfMap)
Definition:
tools.py:2334
write_image
void write_image(void)
Definition:
cairodriver/write.c:8
int
int
Definition:
g3dcolor.c:48
mapped
int mapped
Definition:
cairodriver/Graph.c:53
height
int height
Definition:
cairodriver/Graph.c:49
lib
pngdriver
Graph_close.c
Generated on Sat Jan 2 2016 01:46:48 for GRASS Programmer's Manual by
1.8.5