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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#ifndef MltEncoderOptions_D_HPP
#define MltEncoderOptions_D_HPP
#include "diplomat_runtime.hpp"
#include <cstdlib>
#include <functional>
#include <memory>
#include <optional>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
class MltWireVersion;
namespace diplomat {
namespace capi {
struct MltEncoderOptions;
} // namespace capi
} // namespace diplomat
/**
* Encoder options controlling which optimisations are attempted for
* MVT -> MLT conversion.
*
* Construct with {@link new}(MltEncoderOptions::new) (FSST, `FastPFOR` and shared
* dictionaries enabled, no sorting and no tessellation) and toggle individual flags with the
* setter methods.
*/
class MltEncoderOptions {
public:
/**
* Create encoder options with the default configuration.
*/
inline static std::unique_ptr<MltEncoderOptions> new_();
/**
* Generate tessellation data for polygons and multi-polygons.
*/
inline void set_tessellate(bool enabled);
/**
* Try sorting features by the Z-order (Morton) curve index.
*/
inline void set_attempt_spatial_morton_sort(bool enabled);
/**
* Try sorting features by the Hilbert curve index.
*/
inline void set_attempt_spatial_hilbert_sort(bool enabled);
/**
* Try sorting features by their feature ID in ascending order.
*/
inline void set_attempt_id_sort(bool enabled);
/**
* Allow FSST string compression.
*/
inline void set_allow_fsst(bool enabled);
/**
* Allow `FastPFOR` integer compression.
*/
inline void set_allow_fastpfor(bool enabled);
/**
* Allow string grouping into shared dictionaries.
*/
inline void set_allow_shared_dict(bool enabled);
/**
* Select the wire format to encode to.
* Every setter marked v2 only has no effect on a v1 layer.
*/
inline void set_wire_version(MltWireVersion version);
/**
* v2 only: let a tessellated all-polygon layer store its triangles without the outlines.
* Each polygon then decodes as the triangles it was cut into.
* Requires tessellation.
*/
inline void set_allow_triangles_only(bool enabled);
/**
* v2 only: allow integer and vertex streams to store the deltas of their deltas.
*/
inline void set_allow_delta2(bool enabled);
/**
* v2 only: allow float columns to store one code per value into a dictionary.
*/
inline void set_allow_float_dict(bool enabled);
/**
* v2 only: allow float columns to store each value as a decimal-scaled integer (ALP).
*/
inline void set_allow_float_alp(bool enabled);
/**
* v2 only: allow dictionary code streams to be bit-packed.
*/
inline void set_allow_packed_dict_codes(bool enabled);
/**
* v2 only: allow plain vertex streams to be rANS-coded.
*/
inline void set_allow_rans_vertices(bool enabled);
/**
* v2 only: let a nested struct or map code its row shapes instead of per-field presence.
*/
inline void set_allow_row_shapes(bool enabled);
inline const diplomat::capi::MltEncoderOptions* AsFFI() const;
inline diplomat::capi::MltEncoderOptions* AsFFI();
inline static const MltEncoderOptions* FromFFI(const diplomat::capi::MltEncoderOptions* ptr);
inline static MltEncoderOptions* FromFFI(diplomat::capi::MltEncoderOptions* ptr);
inline static void operator delete(void* ptr);
private:
MltEncoderOptions() = delete;
MltEncoderOptions(const MltEncoderOptions&) = delete;
MltEncoderOptions(MltEncoderOptions&&) noexcept = delete;
MltEncoderOptions operator=(const MltEncoderOptions&) = delete;
MltEncoderOptions operator=(MltEncoderOptions&&) noexcept = delete;
static void operator delete[](void*, size_t) = delete;
};
#endif // MltEncoderOptions_D_HPP