clipper2c-sys 0.2.0

Rust FFI bindings to Clipper2 — 2D polygon boolean clipping (intersection, union, difference, XOR), offsetting (inflate/deflate), area, and point-in-polygon.
Documentation
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
/* automatically generated by rust-bindgen 0.72.1 */

#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ClipperClipper64 {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ClipperClipperD {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ClipperClipperOffset {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ClipperPath64 {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ClipperPathD {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ClipperPaths64 {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ClipperPathsD {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ClipperPolyTree64 {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ClipperPolyTreeD {
    _unused: [u8; 0],
}
#[doc = " Coordinate pair in floating-point (f64) space. The clipping engine\n  itself runs on integers; ClipperClipperD multiplies each component\n  by its scale factor (s = 128 at the default precision = 2) and\n  rounds to ClipperPoint64 before feeding the engine, so |x × s| and\n  |y × s| must fit ClipperPoint64's range. Outputs are divided back\n  and quantised to the scaling grid."]
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, PartialEq)]
pub struct ClipperPointD {
    pub x: f64,
    pub y: f64,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of ClipperPointD"][::std::mem::size_of::<ClipperPointD>() - 16usize];
    ["Alignment of ClipperPointD"][::std::mem::align_of::<ClipperPointD>() - 8usize];
    ["Offset of field: ClipperPointD::x"][::std::mem::offset_of!(ClipperPointD, x) - 0usize];
    ["Offset of field: ClipperPointD::y"][::std::mem::offset_of!(ClipperPointD, y) - 8usize];
};
#[doc = " Coordinate pair in the engine's native integer (i64) space. Each\n  component must satisfy |c| ≤ INT64_MAX/4 (~2.3 × 10¹⁸); values\n  outside this range produce a range error during a clipping\n  operation."]
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)]
#[cfg_attr(
	feature = "serde",
	derive(serde::Serialize, serde::Deserialize)
)]
pub struct ClipperPoint64 {
    pub x: i64,
    pub y: i64,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of ClipperPoint64"][::std::mem::size_of::<ClipperPoint64>() - 16usize];
    ["Alignment of ClipperPoint64"][::std::mem::align_of::<ClipperPoint64>() - 8usize];
    ["Offset of field: ClipperPoint64::x"][::std::mem::offset_of!(ClipperPoint64, x) - 0usize];
    ["Offset of field: ClipperPoint64::y"][::std::mem::offset_of!(ClipperPoint64, y) - 8usize];
};
pub const ClipperFillRule_EVEN_ODD: ClipperFillRule = 0;
pub const ClipperFillRule_NON_ZERO: ClipperFillRule = 1;
pub const ClipperFillRule_POSITIVE: ClipperFillRule = 2;
pub const ClipperFillRule_NEGATIVE: ClipperFillRule = 3;
#[doc = " Determines which subregions are 'inside' when paths self-intersect\n  or overlap. EVEN_ODD toggles inside/outside on every edge crossing.\n  NON_ZERO uses the winding-number sign — the conventional rule for\n  polygons-with-holes data where holes wind opposite to their outer\n  contour. POSITIVE and NEGATIVE only count windings of the matching\n  sign, useful when direction has been baked into the input."]
pub type ClipperFillRule = ::std::os::raw::c_uint;
pub const ClipperClipType_NONE: ClipperClipType = 0;
pub const ClipperClipType_INTERSECTION: ClipperClipType = 1;
pub const ClipperClipType_UNION: ClipperClipType = 2;
pub const ClipperClipType_DIFFERENCE: ClipperClipType = 3;
pub const ClipperClipType_XOR: ClipperClipType = 4;
#[doc = " Boolean operation kind. NONE is the sentinel default for an\n  unconfigured engine — passing it to clipper_*_execute is undefined.\n  Use INTERSECTION / UNION / DIFFERENCE / XOR for the standard four\n  set operations."]
pub type ClipperClipType = ::std::os::raw::c_uint;
pub const ClipperPathType_SUBJECT: ClipperPathType = 0;
pub const ClipperPathType_CLIP: ClipperPathType = 1;
#[doc = " Subject paths are the input geometry being clipped. Clip paths are\n  the mask. The clipping engine combines the two sets according to\n  the chosen ClipperClipType and ClipperFillRule."]
pub type ClipperPathType = ::std::os::raw::c_uint;
pub const ClipperJoinType_SQUARE_JOIN: ClipperJoinType = 0;
pub const ClipperJoinType_BEVEL_JOIN: ClipperJoinType = 1;
pub const ClipperJoinType_ROUND_JOIN: ClipperJoinType = 2;
pub const ClipperJoinType_MITER_JOIN: ClipperJoinType = 3;
#[doc = " Corner-handling style for ClipperOffset; same shapes as SVG and\n  Cairo stroke joins. SQUARE squares off perpendicular to the\n  corner. BEVEL flattens the corner with a straight cut. ROUND\n  replaces it with a circular arc. MITER extends the offset edges\n  to their intersection, clipped at the configured miter limit."]
pub type ClipperJoinType = ::std::os::raw::c_uint;
pub const ClipperEndType_POLYGON_END: ClipperEndType = 0;
pub const ClipperEndType_JOINED_END: ClipperEndType = 1;
pub const ClipperEndType_BUTT_END: ClipperEndType = 2;
pub const ClipperEndType_SQUARE_END: ClipperEndType = 3;
pub const ClipperEndType_ROUND_END: ClipperEndType = 4;
#[doc = " Open-path endpoint handling for ClipperOffset. POLYGON_END is the\n  closed-polygon case — no endpoints to inflate. The other variants\n  decide how the start and end of a polyline are extended (listed in\n  enum order): JOINED keeps polylines connected to neighbouring\n  segments, BUTT keeps the line flat at the original endpoint,\n  SQUARE extends one delta past it, ROUND adds a half-circle cap."]
pub type ClipperEndType = ::std::os::raw::c_uint;
pub const ClipperPointInPolygonResult_IS_ON: ClipperPointInPolygonResult = 0;
pub const ClipperPointInPolygonResult_IS_INSIDE: ClipperPointInPolygonResult = 1;
pub const ClipperPointInPolygonResult_IS_OUTSIDE: ClipperPointInPolygonResult = 2;
pub type ClipperPointInPolygonResult = ::std::os::raw::c_uint;
unsafe extern "C" {
    #[doc = " Path Offsetting"]
    pub fn clipper_paths64_inflate(
        mem: *mut ::std::os::raw::c_void,
        paths: *mut ClipperPaths64,
        delta: f64,
        jt: ClipperJoinType,
        et: ClipperEndType,
        miter_limit: f64,
    ) -> *mut ClipperPaths64;
}
unsafe extern "C" {
    pub fn clipper_pathsd_inflate(
        mem: *mut ::std::os::raw::c_void,
        paths: *mut ClipperPathsD,
        delta: f64,
        jt: ClipperJoinType,
        et: ClipperEndType,
        miter_limit: f64,
        precision: ::std::os::raw::c_int,
    ) -> *mut ClipperPathsD;
}
unsafe extern "C" {
    #[doc = " Path Constructors"]
    pub fn clipper_path64(mem: *mut ::std::os::raw::c_void) -> *mut ClipperPath64;
}
unsafe extern "C" {
    pub fn clipper_pathd(mem: *mut ::std::os::raw::c_void) -> *mut ClipperPathD;
}
unsafe extern "C" {
    pub fn clipper_path64_of_points(
        mem: *mut ::std::os::raw::c_void,
        pts: *mut ClipperPoint64,
        len_pts: usize,
    ) -> *mut ClipperPath64;
}
unsafe extern "C" {
    pub fn clipper_pathd_of_points(
        mem: *mut ::std::os::raw::c_void,
        pts: *mut ClipperPointD,
        len_pts: usize,
    ) -> *mut ClipperPathD;
}
unsafe extern "C" {
    pub fn clipper_path64_add_point(path: *mut ClipperPath64, pt: ClipperPoint64);
}
unsafe extern "C" {
    pub fn clipper_pathd_add_point(path: *mut ClipperPathD, pt: ClipperPointD);
}
unsafe extern "C" {
    pub fn clipper_paths64(mem: *mut ::std::os::raw::c_void) -> *mut ClipperPaths64;
}
unsafe extern "C" {
    pub fn clipper_pathsd(mem: *mut ::std::os::raw::c_void) -> *mut ClipperPathsD;
}
unsafe extern "C" {
    pub fn clipper_paths64_of_paths(
        mem: *mut ::std::os::raw::c_void,
        paths: *mut *mut ClipperPath64,
        len_paths: usize,
    ) -> *mut ClipperPaths64;
}
unsafe extern "C" {
    pub fn clipper_pathsd_of_paths(
        mem: *mut ::std::os::raw::c_void,
        paths: *mut *mut ClipperPathD,
        len_paths: usize,
    ) -> *mut ClipperPathsD;
}
unsafe extern "C" {
    pub fn clipper_paths64_add_path(paths: *mut ClipperPaths64, p: *mut ClipperPath64);
}
unsafe extern "C" {
    pub fn clipper_pathsd_add_path(paths: *mut ClipperPathsD, p: *mut ClipperPathD);
}
unsafe extern "C" {
    pub fn clipper_paths64_add_paths(a: *mut ClipperPaths64, b: *mut ClipperPaths64);
}
unsafe extern "C" {
    pub fn clipper_pathsd_add_paths(a: *mut ClipperPathsD, b: *mut ClipperPathsD);
}
unsafe extern "C" {
    #[doc = " Path Conversions (to C)"]
    pub fn clipper_path64_length(path: *mut ClipperPath64) -> usize;
}
unsafe extern "C" {
    pub fn clipper_pathd_length(path: *mut ClipperPathD) -> usize;
}
unsafe extern "C" {
    pub fn clipper_path64_get_point(
        path: *mut ClipperPath64,
        idx: ::std::os::raw::c_int,
    ) -> ClipperPoint64;
}
unsafe extern "C" {
    pub fn clipper_pathd_get_point(
        path: *mut ClipperPathD,
        idx: ::std::os::raw::c_int,
    ) -> ClipperPointD;
}
unsafe extern "C" {
    pub fn clipper_paths64_length(paths: *mut ClipperPaths64) -> usize;
}
unsafe extern "C" {
    pub fn clipper_pathsd_length(paths: *mut ClipperPathsD) -> usize;
}
unsafe extern "C" {
    pub fn clipper_paths64_path_length(
        paths: *mut ClipperPaths64,
        idx: ::std::os::raw::c_int,
    ) -> usize;
}
unsafe extern "C" {
    pub fn clipper_pathsd_path_length(
        paths: *mut ClipperPathsD,
        idx: ::std::os::raw::c_int,
    ) -> usize;
}
unsafe extern "C" {
    pub fn clipper_paths64_get_path(
        mem: *mut ::std::os::raw::c_void,
        paths: *mut ClipperPaths64,
        idx: ::std::os::raw::c_int,
    ) -> *mut ClipperPath64;
}
unsafe extern "C" {
    pub fn clipper_pathsd_get_path(
        mem: *mut ::std::os::raw::c_void,
        paths: *mut ClipperPathsD,
        idx: ::std::os::raw::c_int,
    ) -> *mut ClipperPathD;
}
unsafe extern "C" {
    pub fn clipper_paths64_get_point(
        paths: *mut ClipperPaths64,
        path_idx: ::std::os::raw::c_int,
        point_idx: ::std::os::raw::c_int,
    ) -> ClipperPoint64;
}
unsafe extern "C" {
    pub fn clipper_pathsd_get_point(
        paths: *mut ClipperPathsD,
        path_idx: ::std::os::raw::c_int,
        point_idx: ::std::os::raw::c_int,
    ) -> ClipperPointD;
}
unsafe extern "C" {
    pub fn clipper_path64_simplify(
        mem: *mut ::std::os::raw::c_void,
        path: *mut ClipperPath64,
        epsilon: f64,
        is_open_path: ::std::os::raw::c_int,
    ) -> *mut ClipperPath64;
}
unsafe extern "C" {
    pub fn clipper_pathd_simplify(
        mem: *mut ::std::os::raw::c_void,
        path: *mut ClipperPathD,
        epsilon: f64,
        is_open_path: ::std::os::raw::c_int,
    ) -> *mut ClipperPathD;
}
unsafe extern "C" {
    pub fn clipper_paths64_simplify(
        mem: *mut ::std::os::raw::c_void,
        paths: *mut ClipperPaths64,
        epsilon: f64,
        is_open_paths: ::std::os::raw::c_int,
    ) -> *mut ClipperPaths64;
}
unsafe extern "C" {
    pub fn clipper_pathsd_simplify(
        mem: *mut ::std::os::raw::c_void,
        paths: *mut ClipperPathsD,
        epsilon: f64,
        is_open_paths: ::std::os::raw::c_int,
    ) -> *mut ClipperPathsD;
}
unsafe extern "C" {
    #[doc = " Path Conversions"]
    pub fn clipper_path64_to_pathd(
        mem: *mut ::std::os::raw::c_void,
        path: *mut ClipperPath64,
    ) -> *mut ClipperPathD;
}
unsafe extern "C" {
    pub fn clipper_pathd_to_path64(
        mem: *mut ::std::os::raw::c_void,
        path: *mut ClipperPathD,
    ) -> *mut ClipperPath64;
}
unsafe extern "C" {
    pub fn clipper_paths64_to_pathsd(
        mem: *mut ::std::os::raw::c_void,
        paths: *mut ClipperPaths64,
    ) -> *mut ClipperPathsD;
}
unsafe extern "C" {
    pub fn clipper_pathsd_to_paths64(
        mem: *mut ::std::os::raw::c_void,
        paths: *mut ClipperPathsD,
    ) -> *mut ClipperPaths64;
}
unsafe extern "C" {
    #[doc = " Minkowski sum: sweep the `pattern` polygon along `path`, returning\n the union of all translated copies of `pattern` placed at every\n vertex of `path`. Geometrically this is { a + b | a in pattern, b\n in path } — useful when you need to grow a shape by an arbitrary\n polygonal kernel rather than the radius-only kernel that\n clipper_paths64_inflate offers.\n\n Set `is_closed` to non-zero when `path` is a closed polygon (the\n usual case for boundary growth, configuration-space obstacles,\n tool-clearance regions); set it to 0 when `path` is an open\n polyline (drag-knife / profile-cutter centerlines, stroke\n generation).\n\n The returned ClipperPaths64 is placement-new constructed into `mem`\n (allocate via clipper_allocate(clipper_paths64_size())) and must be\n released with clipper_delete_paths64. Multi-path output is normal:\n the result can include holes (an outer ring plus inner rings) when\n the swept region encloses a non-swept interior."]
    pub fn clipper_path64_minkowski_sum(
        mem: *mut ::std::os::raw::c_void,
        pattern: *mut ClipperPath64,
        path: *mut ClipperPath64,
        is_closed: ::std::os::raw::c_int,
    ) -> *mut ClipperPaths64;
}
unsafe extern "C" {
    #[doc = " Decimal-coordinate version of clipper_path64_minkowski_sum. The\n `precision` argument selects how many fractional digits are\n preserved when Clipper2 internally scales to integers, runs the\n algorithm, and scales back; see the crate-level \"_64 (i64) vs _D\n (f64) variants\" documentation for the precision / range / quantisation\n tradeoffs. Two decimal places is upstream's default."]
    pub fn clipper_pathd_minkowski_sum(
        mem: *mut ::std::os::raw::c_void,
        pattern: *mut ClipperPathD,
        path: *mut ClipperPathD,
        is_closed: ::std::os::raw::c_int,
        precision: ::std::os::raw::c_int,
    ) -> *mut ClipperPathsD;
}
unsafe extern "C" {
    #[doc = " Minkowski difference: like clipper_path64_minkowski_sum but\n translates `pattern` by -p instead of +p at each vertex of `path`.\n For a pattern that is symmetric about the origin (e.g. a centred\n disc or square) sum and difference produce the same result; the\n distinction matters as soon as the pattern is asymmetric, where\n difference is the operation you want for \"set of points x such\n that x + pattern is contained in path\" intuitions (robot-footprint\n configuration space, tool-reachability inside a pocket).\n\n Same memory contract as clipper_path64_minkowski_sum."]
    pub fn clipper_path64_minkowski_diff(
        mem: *mut ::std::os::raw::c_void,
        pattern: *mut ClipperPath64,
        path: *mut ClipperPath64,
        is_closed: ::std::os::raw::c_int,
    ) -> *mut ClipperPaths64;
}
unsafe extern "C" {
    #[doc = " Decimal-coordinate version of clipper_path64_minkowski_diff. See\n  clipper_pathd_minkowski_sum for the meaning of `precision`."]
    pub fn clipper_pathd_minkowski_diff(
        mem: *mut ::std::os::raw::c_void,
        pattern: *mut ClipperPathD,
        path: *mut ClipperPathD,
        is_closed: ::std::os::raw::c_int,
        precision: ::std::os::raw::c_int,
    ) -> *mut ClipperPathsD;
}
unsafe extern "C" {
    #[doc = " Multi-path variant of clipper_path64_minkowski_sum. The pattern is\n a single path applied to every input path in `paths`; the per-path\n results are unioned with `fillrule`, so this is exactly equivalent\n to running clipper_path64_minkowski_sum once per input path and\n unioning the outputs — provided here for the common case of a\n scene-wide kernel sweep over many polygons.\n\n Same memory contract as clipper_path64_minkowski_sum."]
    pub fn clipper_paths64_minkowski_sum(
        mem: *mut ::std::os::raw::c_void,
        pattern: *mut ClipperPath64,
        paths: *mut ClipperPaths64,
        is_closed: ::std::os::raw::c_int,
        fillrule: ClipperFillRule,
    ) -> *mut ClipperPaths64;
}
unsafe extern "C" {
    #[doc = " Decimal-coordinate version of clipper_paths64_minkowski_sum. See\n  clipper_pathd_minkowski_sum for the meaning of `precision`."]
    pub fn clipper_pathsd_minkowski_sum(
        mem: *mut ::std::os::raw::c_void,
        pattern: *mut ClipperPathD,
        paths: *mut ClipperPathsD,
        is_closed: ::std::os::raw::c_int,
        precision: ::std::os::raw::c_int,
        fillrule: ClipperFillRule,
    ) -> *mut ClipperPathsD;
}
unsafe extern "C" {
    #[doc = " Multi-path variant of clipper_path64_minkowski_diff; same shape as\n  clipper_paths64_minkowski_sum."]
    pub fn clipper_paths64_minkowski_diff(
        mem: *mut ::std::os::raw::c_void,
        pattern: *mut ClipperPath64,
        paths: *mut ClipperPaths64,
        is_closed: ::std::os::raw::c_int,
        fillrule: ClipperFillRule,
    ) -> *mut ClipperPaths64;
}
unsafe extern "C" {
    #[doc = " Decimal-coordinate version of clipper_paths64_minkowski_diff. See\n  clipper_pathd_minkowski_sum for the meaning of `precision`."]
    pub fn clipper_pathsd_minkowski_diff(
        mem: *mut ::std::os::raw::c_void,
        pattern: *mut ClipperPathD,
        paths: *mut ClipperPathsD,
        is_closed: ::std::os::raw::c_int,
        precision: ::std::os::raw::c_int,
        fillrule: ClipperFillRule,
    ) -> *mut ClipperPathsD;
}
unsafe extern "C" {
    pub fn clipper_pathd_area(path: *mut ClipperPathD) -> f64;
}
unsafe extern "C" {
    pub fn clipper_path64_area(path: *mut ClipperPath64) -> f64;
}
unsafe extern "C" {
    pub fn clipper_pathsd_area(paths: *mut ClipperPathsD) -> f64;
}
unsafe extern "C" {
    pub fn clipper_paths64_area(paths: *mut ClipperPaths64) -> f64;
}
unsafe extern "C" {
    pub fn clipper_point_in_path64(
        path: *mut ClipperPath64,
        pt: ClipperPoint64,
    ) -> ClipperPointInPolygonResult;
}
unsafe extern "C" {
    pub fn clipper_point_in_pathd(
        path: *mut ClipperPathD,
        pt: ClipperPointD,
    ) -> ClipperPointInPolygonResult;
}
unsafe extern "C" {
    #[doc = " PolyTree Constructors"]
    pub fn clipper_polytree64(
        mem: *mut ::std::os::raw::c_void,
        parent: *mut ClipperPolyTree64,
    ) -> *mut ClipperPolyTree64;
}
unsafe extern "C" {
    pub fn clipper_polytreed(
        mem: *mut ::std::os::raw::c_void,
        parent: *mut ClipperPolyTreeD,
    ) -> *mut ClipperPolyTreeD;
}
unsafe extern "C" {
    #[doc = " PolyTree64 Methods"]
    pub fn clipper_polytree64_parent(pt: *mut ClipperPolyTree64) -> *const ClipperPolyTree64;
}
unsafe extern "C" {
    pub fn clipper_polytree64_get_child(
        pt: *mut ClipperPolyTree64,
        idx: usize,
    ) -> *const ClipperPolyTree64;
}
unsafe extern "C" {
    pub fn clipper_polytree64_add_child(
        pt: *mut ClipperPolyTree64,
        path: *mut ClipperPath64,
    ) -> *mut ClipperPolyTree64;
}
unsafe extern "C" {
    pub fn clipper_polytree64_count(pt: *mut ClipperPolyTree64) -> usize;
}
unsafe extern "C" {
    pub fn clipper_polytree64_is_hole(pt: *mut ClipperPolyTree64) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn clipper_polytree64_polygon(
        mem: *mut ::std::os::raw::c_void,
        pt: *mut ClipperPolyTree64,
    ) -> *mut ClipperPath64;
}
unsafe extern "C" {
    pub fn clipper_polytree64_area(pt: *mut ClipperPolyTree64) -> f64;
}
unsafe extern "C" {
    pub fn clipper_polytree64_to_paths(
        mem: *mut ::std::os::raw::c_void,
        pt: *mut ClipperPolyTree64,
    ) -> *mut ClipperPaths64;
}
unsafe extern "C" {
    #[doc = " PolyTreeD Methods"]
    pub fn clipper_polytreed_parent(pt: *mut ClipperPolyTreeD) -> *const ClipperPolyTreeD;
}
unsafe extern "C" {
    pub fn clipper_polytreed_get_child(
        pt: *mut ClipperPolyTreeD,
        idx: usize,
    ) -> *const ClipperPolyTreeD;
}
unsafe extern "C" {
    pub fn clipper_polytreed_set_inv_scale(pt: *mut ClipperPolyTreeD, value: f64);
}
unsafe extern "C" {
    pub fn clipper_polytreed_inv_scale(pt: *mut ClipperPolyTreeD) -> f64;
}
unsafe extern "C" {
    pub fn clipper_polytreed_add_child(
        pt: *mut ClipperPolyTreeD,
        path: *mut ClipperPath64,
    ) -> *mut ClipperPolyTreeD;
}
unsafe extern "C" {
    pub fn clipper_polytreed_count(pt: *mut ClipperPolyTreeD) -> usize;
}
unsafe extern "C" {
    pub fn clipper_polytreed_is_hole(pt: *mut ClipperPolyTreeD) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn clipper_polytreed_polygon(
        mem: *mut ::std::os::raw::c_void,
        pt: *mut ClipperPolyTreeD,
    ) -> *mut ClipperPathD;
}
unsafe extern "C" {
    pub fn clipper_polytreed_area(pt: *mut ClipperPolyTreeD) -> f64;
}
unsafe extern "C" {
    pub fn clipper_polytreed_to_paths(
        mem: *mut ::std::os::raw::c_void,
        pt: *mut ClipperPolyTreeD,
    ) -> *mut ClipperPathsD;
}
unsafe extern "C" {
    #[doc = " Clipper Contsructors"]
    pub fn clipper_clipper64(mem: *mut ::std::os::raw::c_void) -> *mut ClipperClipper64;
}
unsafe extern "C" {
    pub fn clipper_clipperd(
        mem: *mut ::std::os::raw::c_void,
        precision: ::std::os::raw::c_int,
    ) -> *mut ClipperClipperD;
}
unsafe extern "C" {
    #[doc = " Clipper64 Setters / Getters"]
    pub fn clipper_clipper64_set_preserve_collinear(
        c: *mut ClipperClipper64,
        t: ::std::os::raw::c_int,
    );
}
unsafe extern "C" {
    pub fn clipper_clipper64_set_reverse_solution(
        c: *mut ClipperClipper64,
        t: ::std::os::raw::c_int,
    );
}
unsafe extern "C" {
    pub fn clipper_clipper64_get_preserve_collinear(
        c: *mut ClipperClipper64,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn clipper_clipper64_get_reverse_solution(
        c: *mut ClipperClipper64,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn clipper_clipper64_clear(c: *mut ClipperClipper64);
}
unsafe extern "C" {
    #[doc = " ClipperD Setters / Getters\n"]
    pub fn clipper_clipperd_set_preserve_collinear(
        c: *mut ClipperClipperD,
        t: ::std::os::raw::c_int,
    );
}
unsafe extern "C" {
    pub fn clipper_clipperd_set_reverse_solution(c: *mut ClipperClipperD, t: ::std::os::raw::c_int);
}
unsafe extern "C" {
    pub fn clipper_clipperd_get_preserve_collinear(
        c: *mut ClipperClipperD,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn clipper_clipperd_get_reverse_solution(c: *mut ClipperClipperD) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn clipper_clipperd_clear(c: *mut ClipperClipperD);
}
unsafe extern "C" {
    #[doc = " Clipper64 Methods"]
    pub fn clipper_clipper64_add_subject(c: *mut ClipperClipper64, subjects: *mut ClipperPaths64);
}
unsafe extern "C" {
    pub fn clipper_clipper64_add_open_subject(
        c: *mut ClipperClipper64,
        open_subjects: *mut ClipperPaths64,
    );
}
unsafe extern "C" {
    pub fn clipper_clipper64_add_clip(c: *mut ClipperClipper64, clips: *mut ClipperPaths64);
}
unsafe extern "C" {
    #[doc = " Run the configured boolean operation. Closed-path output is written\n to `closed`; if open-path subjects were added via\n clipper_clipper64_add_open_subject, their offset/intersected portions\n land in `open`. Returns 1 on success, 0 on failure.\n\n For hierarchical (PolyTree) output preserving solid/hole nesting,\n see clipper_clipper64_execute_tree_with_open."]
    pub fn clipper_clipper64_execute(
        c64: *mut ClipperClipper64,
        ct: ClipperClipType,
        fr: ClipperFillRule,
        closed: *mut ClipperPaths64,
        open: *mut ClipperPaths64,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    #[doc = " Run the configured boolean operation, writing closed-path output as\n a hierarchical ClipperPolyTree64 and open-path output (from\n clipper_clipper64_add_open_subject) into the separate ClipperPaths64\n `open`. Use this when you need to know which contours are holes\n inside which solids — that nesting is lost in the flat output of\n clipper_clipper64_execute."]
    pub fn clipper_clipper64_execute_tree_with_open(
        c64: *mut ClipperClipper64,
        ct: ClipperClipType,
        fr: ClipperFillRule,
        tree: *mut ClipperPolyTree64,
        open: *mut ClipperPaths64,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    #[doc = " ClipperD Methods"]
    pub fn clipper_clipperd_add_subject(c: *mut ClipperClipperD, subjects: *mut ClipperPathsD);
}
unsafe extern "C" {
    pub fn clipper_clipperd_add_open_subject(
        c: *mut ClipperClipperD,
        open_subjects: *mut ClipperPathsD,
    );
}
unsafe extern "C" {
    pub fn clipper_clipperd_add_clip(c: *mut ClipperClipperD, clips: *mut ClipperPathsD);
}
unsafe extern "C" {
    #[doc = " Decimal-coordinate version of clipper_clipper64_execute."]
    pub fn clipper_clipperd_execute(
        cD: *mut ClipperClipperD,
        ct: ClipperClipType,
        fr: ClipperFillRule,
        closed: *mut ClipperPathsD,
        open: *mut ClipperPathsD,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    #[doc = " Decimal-coordinate version of clipper_clipper64_execute_tree_with_open."]
    pub fn clipper_clipperd_execute_tree_with_open(
        cD: *mut ClipperClipperD,
        ct: ClipperClipType,
        fr: ClipperFillRule,
        tree: *mut ClipperPolyTreeD,
        open: *mut ClipperPathsD,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    #[doc = " ClipperOffset Constructors"]
    pub fn clipper_clipperoffset(
        mem: *mut ::std::os::raw::c_void,
        miter_limit: f64,
        arc_tolerance: f64,
        preserve_collinear: ::std::os::raw::c_int,
        reverse_solution: ::std::os::raw::c_int,
    ) -> *mut ClipperClipperOffset;
}
unsafe extern "C" {
    #[doc = " ClipperOffset Setters / Getters"]
    pub fn clipper_clipperoffset_set_miter_limit(c: *mut ClipperClipperOffset, l: f64);
}
unsafe extern "C" {
    pub fn clipper_clipperoffset_set_arc_tolerance(c: *mut ClipperClipperOffset, t: f64);
}
unsafe extern "C" {
    pub fn clipper_clipperoffset_set_preserve_collinear(
        c: *mut ClipperClipperOffset,
        t: ::std::os::raw::c_int,
    );
}
unsafe extern "C" {
    pub fn clipper_clipperoffset_set_reverse_solution(
        c: *mut ClipperClipperOffset,
        t: ::std::os::raw::c_int,
    );
}
unsafe extern "C" {
    pub fn clipper_clipperoffset_get_miter_limit(c: *mut ClipperClipperOffset) -> f64;
}
unsafe extern "C" {
    pub fn clipper_clipperoffset_get_arc_tolerance(c: *mut ClipperClipperOffset) -> f64;
}
unsafe extern "C" {
    pub fn clipper_clipperoffset_get_preserve_collinear(
        c: *mut ClipperClipperOffset,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn clipper_clipperoffset_get_reverse_solution(
        c: *mut ClipperClipperOffset,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn clipper_clipperoffset_error_code(c: *mut ClipperClipperOffset) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn clipper_clipperoffset_clear(c: *mut ClipperClipperOffset);
}
unsafe extern "C" {
    #[doc = " ClipperOffset Methods"]
    pub fn clipper_clipperoffset_add_path64(
        c: *mut ClipperClipperOffset,
        p: *mut ClipperPath64,
        jt: ClipperJoinType,
        et: ClipperEndType,
    );
}
unsafe extern "C" {
    pub fn clipper_clipperoffset_add_paths64(
        c: *mut ClipperClipperOffset,
        p: *mut ClipperPaths64,
        jt: ClipperJoinType,
        et: ClipperEndType,
    );
}
unsafe extern "C" {
    pub fn clipper_clipperoffset_execute(
        mem: *mut ::std::os::raw::c_void,
        c: *mut ClipperClipperOffset,
        delta: f64,
    ) -> *mut ClipperPaths64;
}
unsafe extern "C" {
    #[doc = " Bytes required for placement-new construction of a ClipperPath64.\n\n The full clipper_X_size() family follows this pattern: allocate this\n many bytes via clipper_allocate, hand the buffer to a constructor\n like clipper_path64(mem) (which placement-news the C++ object — no\n extra allocation), use the resulting handle, free with the matching\n clipper_delete_path64. See the crate-level \"Memory model\" section\n for the full lifecycle."]
    pub fn clipper_path64_size() -> usize;
}
unsafe extern "C" {
    pub fn clipper_pathd_size() -> usize;
}
unsafe extern "C" {
    pub fn clipper_paths64_size() -> usize;
}
unsafe extern "C" {
    pub fn clipper_pathsd_size() -> usize;
}
unsafe extern "C" {
    pub fn clipper_polytree64_size() -> usize;
}
unsafe extern "C" {
    pub fn clipper_polytreed_size() -> usize;
}
unsafe extern "C" {
    pub fn clipper_clipper64_size() -> usize;
}
unsafe extern "C" {
    pub fn clipper_clipperd_size() -> usize;
}
unsafe extern "C" {
    pub fn clipper_clipperoffset_size() -> usize;
}
unsafe extern "C" {
    #[doc = " Allocator paired with the clipper_delete_X / clipper_destruct_X\n family. Returns raw bytes that must then be placement-new\n constructed by a clipper_X(mem, ...) call before use.\n\n Memory from clipper_allocate must only be released through:\n   - clipper_delete_X(handle): runs the C++ destructor and frees the\n     allocation; the most common path.\n   - clipper_destruct_X(handle) followed by your own free of the same\n     pointer through this same allocator (advanced).\n\n Mixing with libc free or a different allocator is undefined\n behaviour; the C++ side may use a non-system allocator."]
    pub fn clipper_allocate(size: usize) -> *mut ::std::os::raw::c_void;
}
unsafe extern "C" {
    pub fn clipper_delete_path64(p: *mut ClipperPath64);
}
unsafe extern "C" {
    pub fn clipper_delete_pathd(p: *mut ClipperPathD);
}
unsafe extern "C" {
    pub fn clipper_delete_paths64(p: *mut ClipperPaths64);
}
unsafe extern "C" {
    pub fn clipper_delete_pathsd(p: *mut ClipperPathsD);
}
unsafe extern "C" {
    pub fn clipper_delete_polytree64(p: *mut ClipperPolyTree64);
}
unsafe extern "C" {
    pub fn clipper_delete_polytreed(p: *mut ClipperPolyTreeD);
}
unsafe extern "C" {
    pub fn clipper_delete_clipper64(p: *mut ClipperClipper64);
}
unsafe extern "C" {
    pub fn clipper_delete_clipperd(p: *mut ClipperClipperD);
}
unsafe extern "C" {
    pub fn clipper_delete_clipperoffset(p: *mut ClipperClipperOffset);
}