-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathheader.h
51 lines (45 loc) · 1.42 KB
/
header.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
/* Generated with cbindgen:0.24.5 */
/* Warning, this file is autogenerated by cbindgen. Don't modify this manually. */
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
/**
* FFI struct for returned optimum Polygon label position
*/
typedef struct Position {
double x_pos;
double y_pos;
} Position;
/**
* Wrapper for a void pointer to a sequence of 2-element arrays representing points, and the sequence length. Used for FFI.
*
* Used for the outer Polygon shell. `data` is a `Vec<[c_double; 2]>`.
*/
typedef struct Array {
const void *data;
size_t len;
} Array;
/**
* Wrapper for a void pointer to a sequence of [`Array`](struct.Array.html)s, and the sequence length. Used for FFI.
*
* Each sequence entry represents an inner Polygon ring.
*/
typedef struct WrapperArray {
const struct Array *data;
size_t len;
} WrapperArray;
/**
* FFI access to the [`polylabel`](fn.polylabel.html) function
*
* Accepts three arguments:
*
* - an exterior ring representing a Polygon shell or closed LineString
* - zero or more interior rings representing Polygon holes
* - a tolerance `c_double`.
* If an error occurs while attempting to calculate the label position, the resulting point coordinates
* will be `NaN, NaN`.
*/
struct Position polylabel_ffi(struct Array outer,
struct WrapperArray inners,
double tolerance);