This repository has been archived by the owner on Feb 14, 2023. It is now read-only.
forked from omniscale/go-mapnik
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mapnik_c_api.h
98 lines (69 loc) · 3.69 KB
/
mapnik_c_api.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#ifndef MAPNIK_C_API_H
#define MAPNIK_C_API_H
#if defined(WIN32) || defined(WINDOWS) || defined(_WIN32) || defined(_WINDOWS)
# define MAPNIKCAPICALL __declspec(dllexport)
#else
# define MAPNIKCAPICALL
#endif
#ifdef __cplusplus
extern "C"
{
#endif
#include "stdint.h"
#include "stdlib.h"
MAPNIKCAPICALL int mapnik_register_datasources(const char* path);
MAPNIKCAPICALL int mapnik_register_fonts(const char* path);
const int MAPNIKLOG_NONE = 0;
const int MAPNIKLOG_DEBUG = 1;
const int MAPNIKLOG_WARN = 2;
const int MAPNIKLOG_ERROR = 3;
MAPNIKCAPICALL void mapnik_logging_set_severity(int);
MAPNIKCAPICALL const char * mapnik_register_last_error();
// BBOX
typedef struct _mapnik_bbox_t mapnik_bbox_t;
MAPNIKCAPICALL mapnik_bbox_t * mapnik_bbox(double minx, double miny, double maxx, double maxy);
MAPNIKCAPICALL void mapnik_bbox_free(mapnik_bbox_t * b);
// Image
MAPNIKCAPICALL typedef struct _mapnik_image_t mapnik_image_t;
MAPNIKCAPICALL void mapnik_image_free(mapnik_image_t * i);
MAPNIKCAPICALL const char * mapnik_image_last_error(mapnik_image_t * i);
typedef struct _mapnik_image_blob_t {
char *ptr;
unsigned int len;
} mapnik_image_blob_t;
MAPNIKCAPICALL void mapnik_image_blob_free(mapnik_image_blob_t * b);
MAPNIKCAPICALL mapnik_image_blob_t * mapnik_image_to_blob(mapnik_image_t * i, const char * format);
MAPNIKCAPICALL const uint8_t * mapnik_image_to_raw(mapnik_image_t * i, size_t *size);
MAPNIKCAPICALL mapnik_image_t * mapnik_image_from_raw(const uint8_t * raw, int width, int height);
// Map
typedef struct _mapnik_map_t mapnik_map_t;
MAPNIKCAPICALL mapnik_map_t * mapnik_map( unsigned int width, unsigned int height );
MAPNIKCAPICALL void mapnik_map_free(mapnik_map_t * m);
MAPNIKCAPICALL const char * mapnik_map_last_error(mapnik_map_t * m);
MAPNIKCAPICALL int mapnik_map_load(mapnik_map_t * m, const char* stylesheet);
MAPNIKCAPICALL const char * mapnik_map_get_srs(mapnik_map_t * m);
MAPNIKCAPICALL int mapnik_map_set_srs(mapnik_map_t * m, const char* srs);
MAPNIKCAPICALL void mapnik_map_resize(mapnik_map_t * m, unsigned int width, unsigned int height);
MAPNIKCAPICALL double mapnik_map_get_scale_denominator(mapnik_map_t * m);
MAPNIKCAPICALL void mapnik_map_set_buffer_size(mapnik_map_t * m, int buffer_size);
MAPNIKCAPICALL int mapnik_map_background(mapnik_map_t * m, uint8_t *r, uint8_t *g, uint8_t *b, uint8_t *a);
MAPNIKCAPICALL void mapnik_map_set_background(mapnik_map_t * m, uint8_t r, uint8_t g, uint8_t b, uint8_t a);
MAPNIKCAPICALL int mapnik_map_zoom_all(mapnik_map_t * m);
MAPNIKCAPICALL void mapnik_map_zoom_to_box(mapnik_map_t * m, mapnik_bbox_t * b);
MAPNIKCAPICALL void mapnik_map_set_maximum_extent(mapnik_map_t * m, double x0, double y0, double x1, double y1);
MAPNIKCAPICALL void mapnik_map_reset_maximum_extent(mapnik_map_t * m);
MAPNIKCAPICALL int mapnik_map_render_to_file(mapnik_map_t * m, const char* filepath, double scale, double scale_factor, const char *format);
MAPNIKCAPICALL mapnik_image_t * mapnik_map_render_to_image(mapnik_map_t * m, double scale, double scale_factor);
MAPNIKCAPICALL int mapnik_map_layer_count(mapnik_map_t * m);
MAPNIKCAPICALL const char * mapnik_map_layer_name(mapnik_map_t * m, size_t idx);
MAPNIKCAPICALL int mapnik_map_layer_is_active(mapnik_map_t * m, size_t idx);
MAPNIKCAPICALL void mapnik_map_layer_set_active(mapnik_map_t * m, size_t idx, int active);
//Vector data
typedef struct _mapnik_vector_data_t mapnik_vector_data_t;
MAPNIKCAPICALL mapnik_vector_data_t * mapnik_vector_data(const char * data, int len, int x, int y, int z);
MAPNIKCAPICALL void mapnik_map_set_vector_data(mapnik_map_t * m, mapnik_vector_data_t * vd);
MAPNIKCAPICALL void mapnik_vector_data_free(mapnik_vector_data_t * vd);
#ifdef __cplusplus
}
#endif
#endif // MAPNIK_C_API_H