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
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
#[repr(C)]
pub struct std__Vector_base {
    pub _M_impl: std__Vector_base__Vector_impl,
}
#[repr(C)]
pub struct std__Vector_base__Vector_impl_data {
    pub _M_start: usize,
    pub _M_finish: usize,
    pub _M_end_of_stor11age: usize,
}
#[repr(C)]
pub struct std__Vector_base__Vector_impl {
    pub _base_1: std__Vector_base__Vector_impl_data,
}
#[repr(C)]
pub struct std_vector {
    pub _base: std__Vector_base,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct std_tuple {
    pub _address: u8,
}
#[repr(C)]
#[derive(Debug)]
pub struct std_unique_ptr {
    pub _M_t: u8,
}
#[repr(C)]
#[derive(Debug)]
pub struct std_shared_ptr {
    pub _address: u8,
}

#[doc = " @brief The rgba struct is a helper for manipulating RGBA8888 color data.\n @author Sam Twidale (https://samcodes.co.uk/)"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct geometrize_rgba {
    pub r: u8,
    #[doc = "> The red component (0-255)."]
    pub g: u8,
    #[doc = "> The green component (0-255)."]
    pub b: u8,
    #[doc = "> The blue component (0-255)."]
    pub a: u8,
}

extern "C" {
    #[doc = " @brief seedRandomGenerator Seeds the (thread-local) random number generators.\n @param seed The random seed."]
    #[link_name = "\u{1}_ZN10geometrize10commonutil19seedRandomGeneratorEj"]
    pub fn geometrize_commonutil_seedRandomGenerator(seed: ::std::os::raw::c_uint);
}
extern "C" {
    #[doc = " @brief randomRange Returns a random integer in the range, inclusive. Uses thread-local random number generators under the hood.\n To ensure deterministic shape generation that can be repeated for different seeds, this should be used for shape mutation, but nothing else.\n @param min The lower bound.\n @param max The upper bound.\n @return The random integer in the range."]
    #[link_name = "\u{1}_ZN10geometrize10commonutil11randomRangeEii"]
    pub fn geometrize_commonutil_randomRange(
        min: ::std::os::raw::c_int,
        max: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = " @brief getAverageImageColor Computes the average RGB color of the pixels in the bitmap.\n @param image The image whose average color will be calculated.\n @return The average RGB color of the image, RGBA8888 format. Alpha is set to opaque (255)."]
    #[link_name = "\u{1}_ZN10geometrize10commonutil20getAverageImageColorERKNS_6BitmapE"]
    pub fn geometrize_commonutil_getAverageImageColor(
        image: *const geometrize_Bitmap,
    ) -> geometrize_rgba;
}

#[repr(C)]
pub struct bounds {
	min_x: i32,
	min_y: i32,
	max_x: i32,
	max_y: i32,
}

extern "C" {
    #[doc = " @brief mapShapeBoundsToImage Maps the given shape bound percentages to the given image, returning a bounding rectangle, or the whole image if the bounds were invalid\n @param The options to map to the image\n @param The image to map the options around\n @return The mapped shape bounds (xMin, yMin, xMax, yMax)"]
    #[link_name = "\u{1}_ZN10geometrize10commonutil21mapShapeBoundsToImageERKNS_29ImageRunnerShapeBoundsOptionsERKNS_6BitmapE"]
    pub fn geometrize_commonutil_mapShapeBoundsToImage(
        options: *const geometrize_ImageRunnerShapeBoundsOptions,
        image: *const geometrize_Bitmap,
    ) -> bounds;
}
#[doc = " @brief The ShapeResult struct is a container for info about a shape added to the model.\n @author Sam Twidale (https://samcodes.co.uk/)"]
#[repr(C)]
#[derive(Debug)]
pub struct geometrize_ShapeResult {
    pub score: f64,
    pub color: geometrize_rgba,
    pub shape: std_shared_ptr,
}
#[doc = " @brief The Bitmap class is a helper class for working with bitmap data.\n @author Sam Twidale (https://samcodes.co.uk/)"]
#[repr(C)]
pub struct geometrize_Bitmap {
    #[doc = "< The width of the bitmap."]
    pub m_width: ::std::os::raw::c_uint,
    #[doc = "< The height of the bitmap."]
    pub m_height: ::std::os::raw::c_uint,
    #[doc = "< The bitmap data."]
    pub m_data: *mut u8,
}
extern "C" {
    #[doc = " @brief getWidth Gets the width of the bitmap."]
    #[link_name = "\u{1}_ZNK10geometrize6Bitmap8getWidthEv"]
    pub fn geometrize_Bitmap_getWidth(this: *const geometrize_Bitmap) -> ::std::os::raw::c_uint;
}
extern "C" {
    #[doc = " @brief getHeight Gets the height of the bitmap."]
    #[link_name = "\u{1}_ZNK10geometrize6Bitmap9getHeightEv"]
    pub fn geometrize_Bitmap_getHeight(this: *const geometrize_Bitmap) -> ::std::os::raw::c_uint;
}
extern "C" {
    #[doc = " @brief getPixel Gets a pixel color value.\n @param x The x-coordinate of the pixel.\n @param y The y-coordinate of the pixel.\n @return The pixel RGBA color value."]
    #[link_name = "\u{1}_ZNK10geometrize6Bitmap8getPixelEjj"]
    pub fn geometrize_Bitmap_getPixel(
        this: *const geometrize_Bitmap,
        x: ::std::os::raw::c_uint,
        y: ::std::os::raw::c_uint,
    ) -> geometrize_rgba;
}
extern "C" {
    #[doc = " @brief setPixel Sets a pixel color value.\n @param x The x-coordinate of the pixel.\n @param y The y-coordinate of the pixel.\n @param color The pixel RGBA color value."]
    #[link_name = "\u{1}_ZN10geometrize6Bitmap8setPixelEjjNS_4rgbaE"]
    pub fn geometrize_Bitmap_setPixel(
        this: *mut geometrize_Bitmap,
        x: ::std::os::raw::c_uint,
        y: ::std::os::raw::c_uint,
        color: geometrize_rgba,
    );
}
extern "C" {
    #[doc = " @brief fill Fills the bitmap with the given color.\n @param color The color to fill the bitmap with."]
    #[link_name = "\u{1}_ZN10geometrize6Bitmap4fillENS_4rgbaE"]
    pub fn geometrize_Bitmap_fill(this: *mut geometrize_Bitmap, color: geometrize_rgba);
}
extern "C" {
    #[doc = " @brief Bitmap Creates a new bitmap.\n @param width The width of the bitmap.\n @param height The height of the bitmap.\n @param color The starting color of the bitmap (RGBA format)."]
    #[link_name = "\u{1}_ZN10geometrize6BitmapC1EjjNS_4rgbaE"]
    pub fn geometrize_Bitmap_Bitmap(
        this: *mut geometrize_Bitmap,
        width: ::std::os::raw::c_uint,
        height: ::std::os::raw::c_uint,
        color: geometrize_rgba,
    );
}
extern "C" {
    #[doc = " @brief Bitmap Creates a new bitmap from the supplied byte data.\n @param width The width of the bitmap.\n @param height The height of the bitmap.\n @param data The byte data to fill the bitmap with, must be width * height * depth (4) long."]
    #[link_name = "\u{1}_ZN10geometrize6BitmapC1EjjRKSt6vectorIhSaIhEE"]
    pub fn geometrize_Bitmap_Bitmap1(
        this: *mut geometrize_Bitmap,
        width: ::std::os::raw::c_uint,
        height: ::std::os::raw::c_uint,
        data: *const u8,
    );
}
impl geometrize_Bitmap {
    #[inline]
    pub unsafe fn getWidth(&self) -> ::std::os::raw::c_uint {
        geometrize_Bitmap_getWidth(self)
    }
    #[inline]
    pub unsafe fn getHeight(&self) -> ::std::os::raw::c_uint {
        geometrize_Bitmap_getHeight(self)
    }
    #[inline]
    pub unsafe fn getPixel(
        &self,
        x: ::std::os::raw::c_uint,
        y: ::std::os::raw::c_uint,
    ) -> geometrize_rgba {
        geometrize_Bitmap_getPixel(self, x, y)
    }
    #[inline]
    pub unsafe fn setPixel(
        &mut self,
        x: ::std::os::raw::c_uint,
        y: ::std::os::raw::c_uint,
        color: geometrize_rgba,
    ) {
        geometrize_Bitmap_setPixel(self, x, y, color)
    }
    #[inline]
    pub unsafe fn fill(&mut self, color: geometrize_rgba) {
        geometrize_Bitmap_fill(self, color)
    }
    #[inline]
    pub unsafe fn new(
        width: ::std::os::raw::c_uint,
        height: ::std::os::raw::c_uint,
        color: geometrize_rgba,
    ) -> Self {
        let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
        geometrize_Bitmap_Bitmap(__bindgen_tmp.as_mut_ptr(), width, height, color);
        __bindgen_tmp.assume_init()
    }
    #[inline]
    pub unsafe fn new1(
        width: ::std::os::raw::c_uint,
        height: ::std::os::raw::c_uint,
        data: *const u8,
    ) -> Self {
        let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
        geometrize_Bitmap_Bitmap1(__bindgen_tmp.as_mut_ptr(), width, height, data);
        __bindgen_tmp.assume_init()
    }
}
#[doc = " @brief The Scanline class represents a scanline, a row of pixels running across a bitmap.\n @author Sam Twidale (https://samcodes.co.uk/)"]
#[repr(C)]
#[derive(Debug)]
pub struct geometrize_Scanline {
    #[doc = "< The y-coordinate of the scanline."]
    pub y: ::std::os::raw::c_int,
    #[doc = "< The leftmost x-coordinate of the scanline."]
    pub x1: ::std::os::raw::c_int,
    #[doc = "< The rightmost x-coordinate of the scanline."]
    pub x2: ::std::os::raw::c_int,
}
extern "C" {
    #[doc = " @brief Scanline Creates a new scanline.\n @param y The y-coordinate.\n @param x1 The leftmost x-coordinate.\n @param x2 The rightmost x-coordinate."]
    #[link_name = "\u{1}_ZN10geometrize8ScanlineC1Eiii"]
    pub fn geometrize_Scanline_Scanline(
        this: *mut geometrize_Scanline,
        y: ::std::os::raw::c_int,
        x1: ::std::os::raw::c_int,
        x2: ::std::os::raw::c_int,
    );
}
impl geometrize_Scanline {
    #[inline]
    pub unsafe fn new(
        y: ::std::os::raw::c_int,
        x1: ::std::os::raw::c_int,
        x2: ::std::os::raw::c_int,
    ) -> Self {
        let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
        geometrize_Scanline_Scanline(__bindgen_tmp.as_mut_ptr(), y, x1, x2);
        __bindgen_tmp.assume_init()
    }
}
extern "C" {
    #[doc = " @brief trimScanlines Crops the scanning width of an array of scanlines so they do not scan outside of the given area.\n @param scanlines The scanlines to crop.\n @param minX The minimum x value to crop to.\n @param minY The minimum y value to crop to.\n @param maxX The maximum x value to crop to.\n @param maxY The maximum y value to crop to.\n @return A new vector of cropped scanlines."]
    #[link_name = "\u{1}_ZN10geometrize13trimScanlinesERKSt6vectorINS_8ScanlineESaIS1_EEiiii"]
    pub fn geometrize_trimScanlines(
        scanlines: *const std_vector,
        minX: ::std::os::raw::c_int,
        minY: ::std::os::raw::c_int,
        maxX: ::std::os::raw::c_int,
        maxY: ::std::os::raw::c_int,
    ) -> std_vector;
}
#[doc = " @brief The State class relates a shape and related properties to a measure of how close it brings the working image to the target image.\n @author Sam Twidale (https://samcodes.co.uk/)"]
#[repr(C)]
#[derive(Debug)]
pub struct geometrize_State {
    #[doc = "< The score of the state, a measure of the improvement applying the state to the current bitmap will have."]
    pub m_score: f64,
    #[doc = "< The alpha of the shape."]
    pub m_alpha: ::std::os::raw::c_uchar,
    #[doc = "< The geometric primitive owned by the state."]
    pub m_shape: std_shared_ptr,
}
extern "C" {
    #[doc = " @brief mutate Modifies the current state in a random fashion.\n @return The old state, useful for undoing the mutation or keeping track of previous states."]
    #[link_name = "\u{1}_ZN10geometrize5State6mutateEv"]
    pub fn geometrize_State_mutate(this: *mut geometrize_State) -> geometrize_State;
}
extern "C" {
    #[link_name = "\u{1}_ZN10geometrize5StateC1Ev"]
    pub fn geometrize_State_State(this: *mut geometrize_State);
}
extern "C" {
    #[doc = " @brief Creates a new state.\n @param shape The shape.\n @param alpha The color alpha of the geometric shape."]
    #[link_name = "\u{1}_ZN10geometrize5StateC1ERKSt10shared_ptrINS_5ShapeEEh"]
    pub fn geometrize_State_State1(
        this: *mut geometrize_State,
        shape: *const std_shared_ptr,
        alpha: ::std::os::raw::c_uchar,
    );
}
extern "C" {
    #[link_name = "\u{1}_ZN10geometrize5StateC1ERKS0_"]
    pub fn geometrize_State_State2(this: *mut geometrize_State, other: *const geometrize_State);
}
impl geometrize_State {
    #[inline]
    pub unsafe fn mutate(&mut self) -> geometrize_State {
        geometrize_State_mutate(self)
    }
    #[inline]
    pub unsafe fn new() -> Self {
        let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
        geometrize_State_State(__bindgen_tmp.as_mut_ptr());
        __bindgen_tmp.assume_init()
    }
    #[inline]
    pub unsafe fn new1(shape: *const std_shared_ptr, alpha: ::std::os::raw::c_uchar) -> Self {
        let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
        geometrize_State_State1(__bindgen_tmp.as_mut_ptr(), shape, alpha);
        __bindgen_tmp.assume_init()
    }
    #[inline]
    pub unsafe fn new2(other: *const geometrize_State) -> Self {
        let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
        geometrize_State_State2(__bindgen_tmp.as_mut_ptr(), other);
        __bindgen_tmp.assume_init()
    }
}
#[doc = " @brief EnergyFunction Type alias for a function that calculates a measure of the improvement adding the scanlines of a shape provides - lower energy is better.\n @param lines The scanlines of the shape.\n @param alpha The alpha of the scanlines.\n @param target The target bitmap.\n @param current The current bitmap.\n @param buffer The buffer bitmap.\n @param score The score.\n @return The energy measure."]
pub type geometrize_core_EnergyFunction = [u64; 4usize];
extern "C" {
    #[doc = " @brief defaultEnergyFunction The default/built-in energy function that calculates a measure of the improvement adding the scanlines of a shape provides - lower energy is better.\n @param lines The scanlines of the shape.\n @param alpha The alpha of the scanlines.\n @param target The target bitmap.\n @param current The current bitmap.\n @param buffer The buffer bitmap.\n @param score The score.\n @return The energy measure."]
    #[link_name = "\u{1}_ZN10geometrize4core21defaultEnergyFunctionERKSt6vectorINS_8ScanlineESaIS2_EEjRKNS_6BitmapES9_RS7_d"]
    pub fn geometrize_core_defaultEnergyFunction(
        lines: *const std_vector,
        alpha: ::std::os::raw::c_uint,
        target: *const geometrize_Bitmap,
        current: *const geometrize_Bitmap,
        buffer: *mut geometrize_Bitmap,
        score: f64,
    ) -> f64;
}
extern "C" {
    #[doc = " @brief computeColor Calculates the color of the scanlines.\n @param target The target image.\n @param current The current image.\n @param lines The scanlines.\n @param alpha The alpha of the scanline.\n @return The color of the scanlines."]
    #[link_name = "\u{1}_ZN10geometrize4core12computeColorERKNS_6BitmapES3_RKSt6vectorINS_8ScanlineESaIS5_EEh"]
    pub fn geometrize_core_computeColor(
        target: *const geometrize_Bitmap,
        current: *const geometrize_Bitmap,
        lines: *const std_vector,
        alpha: ::std::os::raw::c_uchar,
    ) -> geometrize_rgba;
}
extern "C" {
    #[doc = " @brief differenceFull Calculates the root-mean-square error between two bitmaps.\n @param first The first bitmap.\n @param second The second bitmap.\n @return The difference/error measure between the two bitmaps."]
    #[link_name = "\u{1}_ZN10geometrize4core14differenceFullERKNS_6BitmapES3_"]
    pub fn geometrize_core_differenceFull(
        first: *const geometrize_Bitmap,
        second: *const geometrize_Bitmap,
    ) -> f64;
}
extern "C" {
    #[doc = " @brief differencePartial Calculates the root-mean-square error between the parts of the two bitmaps within the scanline mask.\n This is for optimization purposes, it lets us calculate new error values only for parts of the image we know have changed.\n @param target The target bitmap.\n @param before The bitmap before the change.\n @param after The bitmap after the change.\n @param score The score.\n @param lines The scanlines.\n @return The difference/error between the two bitmaps, masked by the scanlines."]
    #[link_name = "\u{1}_ZN10geometrize4core17differencePartialERKNS_6BitmapES3_S3_dRKSt6vectorINS_8ScanlineESaIS5_EE"]
    pub fn geometrize_core_differencePartial(
        target: *const geometrize_Bitmap,
        before: *const geometrize_Bitmap,
        after: *const geometrize_Bitmap,
        score: f64,
        lines: *const std_vector,
    ) -> f64;
}
extern "C" {
    #[doc = " @brief bestHillClimbState Gets the best state using a hill climbing algorithm.\n @param shapeCreator A function that will create the shapes that will be chosen from.\n @param alpha The opacity of the shape.\n @param n The number of random states to generate.\n @param age The number of hillclimbing steps.\n @param target The target bitmap.\n @param current The current bitmap.\n @param buffer The buffer bitmap.\n @param lastScore The last score.\n @param customEnergyFunction An optional function to calculate the energy (if unspecified a default implementation is used).\n @return The best state acquired from hill climbing i.e. the one with the lowest energy."]
    #[link_name = "\u{1}_ZN10geometrize4core18bestHillClimbStateERKSt8functionIFSt10shared_ptrINS_5ShapeEEvEEjjjRKNS_6BitmapESB_RS9_dRKS1_IFdRKSt6vectorINS_8ScanlineESaISE_EEjSB_SB_SC_dEE"]
    pub fn geometrize_core_bestHillClimbState(
        shapeCreator: *const [u64; 4usize],
        alpha: ::std::os::raw::c_uint,
        n: ::std::os::raw::c_uint,
        age: ::std::os::raw::c_uint,
        target: *const geometrize_Bitmap,
        current: *const geometrize_Bitmap,
        buffer: *mut geometrize_Bitmap,
        lastScore: f64,
        customEnergyFunction: *const geometrize_core_EnergyFunction,
    ) -> geometrize_State;
}
#[doc = " @brief ShapeAcceptancePreconditionFunction Type alias for a function that is used to decide whether or not to finally add a shape to the image\n @param lastScore The image similarity score prior to adding the shape\n @param newScore What the image similarity score would be after adding the shape\n @param shape The shape that this function shall decide whether to add\n @param lines The scanlines for the pixels in the shape\n @param color The colour of the shape\n @param before The image prior to adding the shape\n @param after The image as it would be after adding the shape\n @param target The image that we are trying to replicate\n @return True to add the shape to the image, false not to"]
pub type geometrize_ShapeAcceptancePreconditionFunction = [u64; 4usize];
#[doc = " @brief The Model class is the model for the core optimization/fitting algorithm.\n @author Sam Twidale (https://samcodes.co.uk/)"]
#[repr(C)]
#[derive(Debug)]
pub struct geometrize_Model {
    pub d: std_unique_ptr,
}
extern "C" {
    #[doc = " @brief reset Resets the model back to the state it was in when it was created.\n @param backgroundColor The starting background color to use."]
    #[link_name = "\u{1}_ZN10geometrize5Model5resetENS_4rgbaE"]
    pub fn geometrize_Model_reset(this: *mut geometrize_Model, backgroundColor: geometrize_rgba);
}
extern "C" {
    #[doc = " @brief getWidth Gets the width of the target bitmap.\n @return The width of the target bitmap."]
    #[link_name = "\u{1}_ZNK10geometrize5Model8getWidthEv"]
    pub fn geometrize_Model_getWidth(this: *const geometrize_Model) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = " @brief getHeight Gets the height of the target bitmap.\n @return The height of the target bitmap."]
    #[link_name = "\u{1}_ZNK10geometrize5Model9getHeightEv"]
    pub fn geometrize_Model_getHeight(this: *const geometrize_Model) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = " @brief step Steps the primitive optimization/fitting algorithm.\n @param shapeCreator A function that will produce the shapes.\n @param alpha The alpha of the shape.\n @param shapeCount The number of random shapes to generate (only 1 is chosen in the end).\n @param maxShapeMutations The maximum number of times to mutate each random shape.\n @param maxThreads The maximum number of threads to use during this step.\n @param energyFunction An optional function to calculate the energy (if unspecified a default implementation is used).\n @param addShapePrecondition An optional function to determine whether to accept a shape (if unspecified a default implementation is used).\n @return A vector containing data about the shapes added to the model in this step. This may be empty if no shape that improved the image could be found."]
    #[link_name = "\u{1}_ZN10geometrize5Model4stepERKSt8functionIFSt10shared_ptrINS_5ShapeEEvEEhjjjRKS1_IFdRKSt6vectorINS_8ScanlineESaISA_EEjRKNS_6BitmapESH_RSF_dEERKS1_IFbddRKS3_SE_RKNS_4rgbaESH_SH_SH_EE"]
    pub fn geometrize_Model_step(
        this: *mut geometrize_Model,
        shapeCreator: *const [u64; 4usize],
        alpha: ::std::os::raw::c_uchar,
        shapeCount: ::std::os::raw::c_uint,
        maxShapeMutations: ::std::os::raw::c_uint,
        maxThreads: ::std::os::raw::c_uint,
        energyFunction: *const geometrize_core_EnergyFunction,
        addShapePrecondition: *const geometrize_ShapeAcceptancePreconditionFunction,
    ) -> std_vector;
}
extern "C" {
    #[doc = " @brief drawShape Draws a shape on the model. Typically used when to manually add a shape to the image (e.g. when setting an initial background).\n NOTE this unconditionally draws the shape, even if it increases the difference between the source and target image.\n @param shape The shape to draw.\n @param color The color (including alpha) of the shape.\n @return Data about the shape drawn on the model."]
    #[link_name = "\u{1}_ZN10geometrize5Model9drawShapeESt10shared_ptrINS_5ShapeEENS_4rgbaE"]
    pub fn geometrize_Model_drawShape(
        this: *mut geometrize_Model,
        shape: std_shared_ptr,
        color: geometrize_rgba,
    ) -> geometrize_ShapeResult;
}
extern "C" {
    #[doc = " @brief getCurrent Gets the current bitmap.\n @return The current bitmap."]
    #[link_name = "\u{1}_ZN10geometrize5Model10getCurrentEv"]
    pub fn geometrize_Model_getCurrent(this: *mut geometrize_Model) -> *mut geometrize_Bitmap;
}
extern "C" {
    #[doc = " @brief getTarget Gets the target bitmap.\n @return The target bitmap."]
    #[link_name = "\u{1}_ZN10geometrize5Model9getTargetEv"]
    pub fn geometrize_Model_getTarget(this: *mut geometrize_Model) -> *mut geometrize_Bitmap;
}
extern "C" {
    #[doc = " @brief getCurrent Gets the current bitmap, const-edition.\n @return The current bitmap."]
    #[link_name = "\u{1}_ZNK10geometrize5Model10getCurrentEv"]
    pub fn geometrize_Model_getCurrent1(this: *const geometrize_Model) -> *const geometrize_Bitmap;
}
extern "C" {
    #[doc = " @brief getTarget Gets the target bitmap, const-edition.\n @return The target bitmap."]
    #[link_name = "\u{1}_ZNK10geometrize5Model9getTargetEv"]
    pub fn geometrize_Model_getTarget1(this: *const geometrize_Model) -> *const geometrize_Bitmap;
}
extern "C" {
    #[doc = " @brief setSeed Sets the seed that the random number generators of this model use. Note that the model also uses an internal seed offset which is incremented when the model is stepped.\n @param seed The random number generator seed."]
    #[link_name = "\u{1}_ZN10geometrize5Model7setSeedEj"]
    pub fn geometrize_Model_setSeed(this: *mut geometrize_Model, seed: ::std::os::raw::c_uint);
}
extern "C" {
    #[doc = " @brief Model Creates a model that will aim to replicate the target bitmap with shapes.\n @param target The target bitmap to replicate with shapes."]
    #[link_name = "\u{1}_ZN10geometrize5ModelC1ERKNS_6BitmapE"]
    pub fn geometrize_Model_Model(this: *mut geometrize_Model, target: *const geometrize_Bitmap);
}
extern "C" {
    #[doc = " @brief Model Creates a model that will optimize for the given target bitmap, starting from the given initial bitmap.\n The target bitmap and initial bitmap must be the same size (width and height).\n @param target The target bitmap to replicate with shapes.\n @param initial The starting bitmap."]
    #[link_name = "\u{1}_ZN10geometrize5ModelC1ERKNS_6BitmapES3_"]
    pub fn geometrize_Model_Model1(
        this: *mut geometrize_Model,
        target: *const geometrize_Bitmap,
        initial: *const geometrize_Bitmap,
    );
}
extern "C" {
    #[link_name = "\u{1}_ZN10geometrize5ModelD1Ev"]
    pub fn geometrize_Model_Model_destructor(this: *mut geometrize_Model);
}
impl geometrize_Model {
    #[inline]
    pub unsafe fn reset(&mut self, backgroundColor: geometrize_rgba) {
        geometrize_Model_reset(self, backgroundColor)
    }
    #[inline]
    pub unsafe fn getWidth(&self) -> ::std::os::raw::c_int {
        geometrize_Model_getWidth(self)
    }
    #[inline]
    pub unsafe fn getHeight(&self) -> ::std::os::raw::c_int {
        geometrize_Model_getHeight(self)
    }
    #[inline]
    pub unsafe fn step(
        &mut self,
        shapeCreator: *const [u64; 4usize],
        alpha: ::std::os::raw::c_uchar,
        shapeCount: ::std::os::raw::c_uint,
        maxShapeMutations: ::std::os::raw::c_uint,
        maxThreads: ::std::os::raw::c_uint,
        energyFunction: *const geometrize_core_EnergyFunction,
        addShapePrecondition: *const geometrize_ShapeAcceptancePreconditionFunction,
    ) -> std_vector {
        geometrize_Model_step(
            self,
            shapeCreator,
            alpha,
            shapeCount,
            maxShapeMutations,
            maxThreads,
            energyFunction,
            addShapePrecondition,
        )
    }
    #[inline]
    pub unsafe fn drawShape(
        &mut self,
        shape: std_shared_ptr,
        color: geometrize_rgba,
    ) -> geometrize_ShapeResult {
        geometrize_Model_drawShape(self, shape, color)
    }
    #[inline]
    pub unsafe fn getCurrent(&mut self) -> *mut geometrize_Bitmap {
        geometrize_Model_getCurrent(self)
    }
    #[inline]
    pub unsafe fn getTarget(&mut self) -> *mut geometrize_Bitmap {
        geometrize_Model_getTarget(self)
    }
    #[inline]
    pub unsafe fn getCurrent1(&self) -> *const geometrize_Bitmap {
        geometrize_Model_getCurrent1(self)
    }
    #[inline]
    pub unsafe fn getTarget1(&self) -> *const geometrize_Bitmap {
        geometrize_Model_getTarget1(self)
    }
    #[inline]
    pub unsafe fn setSeed(&mut self, seed: ::std::os::raw::c_uint) {
        geometrize_Model_setSeed(self, seed)
    }
    #[inline]
    pub unsafe fn new(target: *const geometrize_Bitmap) -> Self {
        let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
        geometrize_Model_Model(__bindgen_tmp.as_mut_ptr(), target);
        __bindgen_tmp.assume_init()
    }
    #[inline]
    pub unsafe fn new1(
        target: *const geometrize_Bitmap,
        initial: *const geometrize_Bitmap,
    ) -> Self {
        let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
        geometrize_Model_Model1(__bindgen_tmp.as_mut_ptr(), target, initial);
        __bindgen_tmp.assume_init()
    }
    #[inline]
    pub unsafe fn destruct(&mut self) {
        geometrize_Model_Model_destructor(self)
    }
}
#[doc = " @brief The ImageRunner class is a helper class for creating a set of primitives from a source image.\n @author Sam Twidale (https://samcodes.co.uk/)"]
#[repr(C)]
#[derive(Debug)]
pub struct geometrize_ImageRunner {
    pub d: std_unique_ptr,
}
extern "C" {
    #[doc = " @brief step Updates the internal model once.\n @param options Various configurable settings for doing the step e.g. the shape types to consider.\n @param shapeCreator An optional function for creating and mutating shapes\n @param energyFunction An optional function to calculate the energy (if unspecified a default implementation is used).\n @param addShapePrecondition An optional function to determine whether to accept a shape (if unspecified a default implementation is used).\n @return A vector containing data about the shapes just added to the internal model."]
    #[link_name = "\u{1}_ZN10geometrize11ImageRunner4stepERKNS_18ImageRunnerOptionsESt8functionIFSt10shared_ptrINS_5ShapeEEvEES4_IFdRKSt6vectorINS_8ScanlineESaISB_EEjRKNS_6BitmapESI_RSG_dEES4_IFbddRKS6_SF_RKNS_4rgbaESI_SI_SI_EE"]
    pub fn geometrize_ImageRunner_step(
        this: *mut geometrize_ImageRunner,
        options: *const geometrize_ImageRunnerOptions,
        shapeCreator: [u64; 4usize],
        energyFunction: geometrize_core_EnergyFunction,
        addShapePrecondition: geometrize_ShapeAcceptancePreconditionFunction,
    ) -> std_vector;
}
extern "C" {
    #[doc = " @brief getCurrent Gets the current bitmap with the primitives drawn on it.\n @return The current bitmap."]
    #[link_name = "\u{1}_ZN10geometrize11ImageRunner10getCurrentEv"]
    pub fn geometrize_ImageRunner_getCurrent(
        this: *mut geometrize_ImageRunner,
    ) -> *mut geometrize_Bitmap;
}
extern "C" {
    #[doc = " @brief getTarget Gets the target bitmap.\n @return The target bitmap."]
    #[link_name = "\u{1}_ZN10geometrize11ImageRunner9getTargetEv"]
    pub fn geometrize_ImageRunner_getTarget(
        this: *mut geometrize_ImageRunner,
    ) -> *mut geometrize_Bitmap;
}
extern "C" {
    #[doc = " @brief getCurrent Gets the current bitmap with the primitives drawn on it, const-edition.\n @return The current bitmap."]
    #[link_name = "\u{1}_ZNK10geometrize11ImageRunner10getCurrentEv"]
    pub fn geometrize_ImageRunner_getCurrent1(
        this: *const geometrize_ImageRunner,
    ) -> *const geometrize_Bitmap;
}
extern "C" {
    #[doc = " @brief getTarget Gets the target bitmap, const-edition.\n @return The target bitmap."]
    #[link_name = "\u{1}_ZNK10geometrize11ImageRunner9getTargetEv"]
    pub fn geometrize_ImageRunner_getTarget1(
        this: *const geometrize_ImageRunner,
    ) -> *const geometrize_Bitmap;
}
extern "C" {
    #[doc = " @brief getModel Gets the underlying model.\n @return The model."]
    #[link_name = "\u{1}_ZN10geometrize11ImageRunner8getModelEv"]
    pub fn geometrize_ImageRunner_getModel(
        this: *mut geometrize_ImageRunner,
    ) -> *mut geometrize_Model;
}
extern "C" {
    #[doc = " @brief ImageRunner Creates an new image runner with the given target bitmap. Uses the average color of the target as the starting image.\n @param targetBitmap The target bitmap to replicate with shapes."]
    #[link_name = "\u{1}_ZN10geometrize11ImageRunnerC1ERKNS_6BitmapE"]
    pub fn geometrize_ImageRunner_ImageRunner(
        this: *mut geometrize_ImageRunner,
        targetBitmap: *const geometrize_Bitmap,
    );
}
extern "C" {
    #[doc = " @brief ImageRunner Creates an image runner with the given target bitmap, starting from the given initial bitmap.\n The target bitmap and initial bitmap must be the same size (width and height).\n @param targetBitmap The target bitmap to replicate with shapes.\n @param initialBitmap The starting bitmap."]
    #[link_name = "\u{1}_ZN10geometrize11ImageRunnerC1ERKNS_6BitmapES3_"]
    pub fn geometrize_ImageRunner_ImageRunner1(
        this: *mut geometrize_ImageRunner,
        targetBitmap: *const geometrize_Bitmap,
        initialBitmap: *const geometrize_Bitmap,
    );
}
extern "C" {
    #[link_name = "\u{1}_ZN10geometrize11ImageRunnerD1Ev"]
    pub fn geometrize_ImageRunner_ImageRunner_destructor(this: *mut geometrize_ImageRunner);
}
impl geometrize_ImageRunner {
    #[inline]
    pub unsafe fn step(
        &mut self,
        options: *const geometrize_ImageRunnerOptions,
        shapeCreator: [u64; 4usize],
        energyFunction: geometrize_core_EnergyFunction,
        addShapePrecondition: geometrize_ShapeAcceptancePreconditionFunction,
    ) -> std_vector {
        geometrize_ImageRunner_step(
            self,
            options,
            shapeCreator,
            energyFunction,
            addShapePrecondition,
        )
    }
    #[inline]
    pub unsafe fn getCurrent(&mut self) -> *mut geometrize_Bitmap {
        geometrize_ImageRunner_getCurrent(self)
    }
    #[inline]
    pub unsafe fn getTarget(&mut self) -> *mut geometrize_Bitmap {
        geometrize_ImageRunner_getTarget(self)
    }
    #[inline]
    pub unsafe fn getCurrent1(&self) -> *const geometrize_Bitmap {
        geometrize_ImageRunner_getCurrent1(self)
    }
    #[inline]
    pub unsafe fn getTarget1(&self) -> *const geometrize_Bitmap {
        geometrize_ImageRunner_getTarget1(self)
    }
    #[inline]
    pub unsafe fn getModel(&mut self) -> *mut geometrize_Model {
        geometrize_ImageRunner_getModel(self)
    }
    #[inline]
    pub unsafe fn new(targetBitmap: *const geometrize_Bitmap) -> Self {
        let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
        geometrize_ImageRunner_ImageRunner(__bindgen_tmp.as_mut_ptr(), targetBitmap);
        __bindgen_tmp.assume_init()
    }
    #[inline]
    pub unsafe fn new1(
        targetBitmap: *const geometrize_Bitmap,
        initialBitmap: *const geometrize_Bitmap,
    ) -> Self {
        let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
        geometrize_ImageRunner_ImageRunner1(
            __bindgen_tmp.as_mut_ptr(),
            targetBitmap,
            initialBitmap,
        );
        __bindgen_tmp.assume_init()
    }
    #[inline]
    pub unsafe fn destruct(&mut self) {
        geometrize_ImageRunner_ImageRunner_destructor(self)
    }
}
pub const RECTANGLE: geometrize_ShapeTypes = 1;
pub const ROTATED_RECTANGLE: geometrize_ShapeTypes = 2;
pub const TRIANGLE: geometrize_ShapeTypes = 4;
pub const ELLIPSE: geometrize_ShapeTypes = 8;
pub const ROTATED_ELLIPSE: geometrize_ShapeTypes = 16;
pub const CIRCLE: geometrize_ShapeTypes = 32;
pub const LINE: geometrize_ShapeTypes = 64;
pub const QUADRATIC_BEZIER: geometrize_ShapeTypes = 128;
pub const POLYLINE: geometrize_ShapeTypes = 256;
pub const SHAPE_COUNT: geometrize_ShapeTypes = 9;
#[doc = " @brief The ShapeTypes enum specifies the types of shapes that can be used. These can be combined to produce images composed of multiple primitive types.\n @author Sam Twidale (https://samcodes.co.uk/)"]
pub type geometrize_ShapeTypes = ::std::os::raw::c_uint;
extern "C" {
    #[doc = " @brief allShapes is a convenient array of all of the members of ShapeTypes."]
    #[link_name = "\u{1}_ZN10geometrize9allShapesE"]
    pub static geometrize_allShapes: u8;
}
extern "C" {
    #[doc = " @brief shapeTypeNames provides a convenient mapping to names of types of shape (all lower case, underscores instead of spaces e.g. rotated_ellipse)."]
    #[link_name = "\u{1}_ZN10geometrize14shapeTypeNamesB5cxx11E"]
    pub static geometrize_shapeTypeNames: std_vector;
}
#[doc = " @brief The ImageRunnerShapeBoundsOptions struct encapsulates options for where shapes may be drawn within the image.\n Defines a rectangle expressed as percentages (0-100%) of the target image dimensions\n @author Sam Twidale (https://samcodes.co.uk/)"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct geometrize_ImageRunnerShapeBoundsOptions {
    pub enabled: bool,
    pub xMinPercent: f64,
    pub yMinPercent: f64,
    pub xMaxPercent: f64,
    pub yMaxPercent: f64,
}
#[doc = " @brief The ImageRunnerOptions class encapsulates preferences/options that the image runner uses.\n @author Sam Twidale (https://samcodes.co.uk/)"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct geometrize_ImageRunnerOptions {
    #[doc = "< The shape types that the image runner shall use."]
    pub shapeTypes: geometrize_ShapeTypes,
    #[doc = "< The alpha/opacity of the shapes (0-255)."]
    pub alpha: ::std::os::raw::c_uchar,
    #[doc = "< The number of candidate shapes that will be tried per model step."]
    pub shapeCount: ::std::os::raw::c_uint,
    #[doc = "< The maximum number of times each candidate shape will be modified to attempt to find a better fit."]
    pub maxShapeMutations: ::std::os::raw::c_uint,
    #[doc = "< The seed for the random number generators used by the image runner."]
    pub seed: ::std::os::raw::c_uint,
    #[doc = "< The maximum number of separate threads for the implementation to use. 0 lets the implementation choose a reasonable number."]
    pub maxThreads: ::std::os::raw::c_uint,
    #[doc = "< If zero or do not form a rectangle, the entire target image is used i.e. (0, 0, imageWidth, imageHeight)"]
    pub shapeBounds: geometrize_ImageRunnerShapeBoundsOptions,
}
#[repr(C)]
pub struct geometrize_Shape__bindgen_vtable(::std::os::raw::c_void);
#[doc = " Base class for shape rasterization and manipulation.\n @author Sam Twidale (https://samcodes.co.uk/)"]
#[repr(C)]
#[derive(Debug)]
pub struct geometrize_Shape {
    pub vtable_: *const geometrize_Shape__bindgen_vtable,
    pub setup: [u64; 4usize],
    pub mutate: [u64; 4usize],
    pub rasterize: [u64; 4usize],
}
#[doc = " @brief The Rectangle class represents a rectangle.\n @author Sam Twidale (https://samcodes.co.uk/)"]
#[repr(C)]
#[derive(Debug)]
pub struct geometrize_Rectangle {
    pub _base: geometrize_Shape,
    #[doc = "< Left coordinate."]
    pub m_x1: f32,
    #[doc = "< Top coordinate."]
    pub m_y1: f32,
    #[doc = "< Right coordinate."]
    pub m_x2: f32,
    #[doc = "< Bottom coordinate."]
    pub m_y2: f32,
}
extern "C" {
    #[link_name = "\u{1}_ZN10geometrize9RectangleC1Effff"]
    pub fn geometrize_Rectangle_Rectangle(
        this: *mut geometrize_Rectangle,
        x1: f32,
        y1: f32,
        x2: f32,
        y2: f32,
    );
}
impl geometrize_Rectangle {
    #[inline]
    pub unsafe fn new(x1: f32, y1: f32, x2: f32, y2: f32) -> Self {
        let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
        geometrize_Rectangle_Rectangle(__bindgen_tmp.as_mut_ptr(), x1, y1, x2, y2);
        __bindgen_tmp.assume_init()
    }
}
extern "C" {
    #[link_name = "\u{1}_ZNK10geometrize9Rectangle5cloneEv"]
    pub fn geometrize_Rectangle_clone(this: *mut ::std::os::raw::c_void) -> std_shared_ptr;
}
extern "C" {
    #[link_name = "\u{1}_ZNK10geometrize9Rectangle7getTypeEv"]
    pub fn geometrize_Rectangle_getType(this: *mut ::std::os::raw::c_void)
        -> geometrize_ShapeTypes;
}
extern "C" {
    #[doc = " @brief createDefaultShapeCreator Creates an instance of the default shape creator object.\n The setup, mutate and rasterize methods are bound with default methods.\n @param types The types of shapes to create.\n @param xMin The minimum x coordinate of the shapes created.\n @param yMin The minimum y coordinate of the shapes created.\n @param xMax The maximum x coordinate of the shapes created.\n @param yMax The maximum y coordinate of the shapes created.\n @return The default shape creator."]
    #[link_name = "\u{1}_ZN10geometrize25createDefaultShapeCreatorENS_10ShapeTypesEiiii"]
    pub fn geometrize_createDefaultShapeCreator(
        types: geometrize_ShapeTypes,
        xMin: ::std::os::raw::c_int,
        yMin: ::std::os::raw::c_int,
        xMax: ::std::os::raw::c_int,
        yMax: ::std::os::raw::c_int,
    ) -> [u64; 4usize];
}
extern "C" {
    #[doc = " @brief create Creates a new shape of the specified type.\n @param t The type of shape to create.\n @return The new shape."]
    #[link_name = "\u{1}_ZN10geometrize6createENS_10ShapeTypesE"]
    pub fn geometrize_create(t: geometrize_ShapeTypes) -> std_shared_ptr;
}
extern "C" {
    #[doc = " @brief randomShape Creates a random shape.\n @return The new shape."]
    #[link_name = "\u{1}_ZN10geometrize11randomShapeEv"]
    pub fn geometrize_randomShape() -> std_shared_ptr;
}
extern "C" {
    #[doc = " @brief randomShapeOf Creates a random shape from the types supplied.\n @param t The types of shape to possibly create.\n @return The new shape."]
    #[link_name = "\u{1}_ZN10geometrize13randomShapeOfENS_10ShapeTypesE"]
    pub fn geometrize_randomShapeOf(t: geometrize_ShapeTypes) -> std_shared_ptr;
}