This repository has been archived by the owner on May 18, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
ffi.rs
3340 lines (3338 loc) · 108 KB
/
ffi.rs
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
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* automatically generated by rust-bindgen 0.58.1 */
pub type ktx_size_t = usize;
#[cfg(target_os = "windows")]
pub type ktx_off_t = i64;
#[cfg(not(target_os = "windows"))]
pub type ktx_off_t = isize;
#[repr(C)]
pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>);
impl<T> __BindgenUnionField<T> {
#[inline]
pub const fn new() -> Self {
__BindgenUnionField(::std::marker::PhantomData)
}
#[inline]
pub unsafe fn as_ref(&self) -> &T {
::std::mem::transmute(self)
}
#[inline]
pub unsafe fn as_mut(&mut self) -> &mut T {
::std::mem::transmute(self)
}
}
impl<T> ::std::default::Default for __BindgenUnionField<T> {
#[inline]
fn default() -> Self {
Self::new()
}
}
impl<T> ::std::clone::Clone for __BindgenUnionField<T> {
#[inline]
fn clone(&self) -> Self {
Self::new()
}
}
impl<T> ::std::marker::Copy for __BindgenUnionField<T> {}
impl<T> ::std::fmt::Debug for __BindgenUnionField<T> {
fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
fmt.write_str("__BindgenUnionField")
}
}
impl<T> ::std::hash::Hash for __BindgenUnionField<T> {
fn hash<H: ::std::hash::Hasher>(&self, _state: &mut H) {}
}
impl<T> ::std::cmp::PartialEq for __BindgenUnionField<T> {
fn eq(&self, _other: &__BindgenUnionField<T>) -> bool {
true
}
}
impl<T> ::std::cmp::Eq for __BindgenUnionField<T> {}
pub const KTX_ANIMDATA_KEY: &'static [u8; 12usize] = b"KTXanimData\0";
pub const KTX_ORIENTATION_KEY: &'static [u8; 15usize] = b"KTXorientation\0";
pub const KTX_SWIZZLE_KEY: &'static [u8; 11usize] = b"KTXswizzle\0";
pub const KTX_WRITER_KEY: &'static [u8; 10usize] = b"KTXwriter\0";
pub const KTX_WRITER_SCPARAMS_KEY: &'static [u8; 18usize] = b"KTXwriterScParams\0";
pub const KTX_ORIENTATION1_FMT: &'static [u8; 5usize] = b"S=%c\0";
pub const KTX_ORIENTATION2_FMT: &'static [u8; 10usize] = b"S=%c,T=%c\0";
pub const KTX_ORIENTATION3_FMT: &'static [u8; 15usize] = b"S=%c,T=%c,R=%c\0";
pub const KTX_GL_UNPACK_ALIGNMENT: u32 = 4;
pub const KTX_TRUE: u32 = 1;
pub const KTX_FALSE: u32 = 0;
pub const KTX_ENDIAN_REF: u32 = 67305985;
pub const KTX_ENDIAN_REF_REV: u32 = 16909060;
pub const KTX_HEADER_SIZE: u32 = 64;
pub type size_t = ::std::os::raw::c_ulong;
pub type __int16_t = ::std::os::raw::c_short;
pub type __uint16_t = ::std::os::raw::c_ushort;
pub type __int32_t = ::std::os::raw::c_int;
pub type __uint32_t = ::std::os::raw::c_uint;
pub type __int64_t = ::std::os::raw::c_long;
pub type __uint64_t = ::std::os::raw::c_ulong;
pub type __off_t = ::std::os::raw::c_long;
pub type FILE = [u64; 27usize];
pub type off_t = __off_t;
#[doc = " To avoid including <KHR/khrplatform.h> define our own types."]
pub type ktx_uint8_t = ::std::os::raw::c_uchar;
pub type ktx_bool_t = bool;
pub type ktx_uint16_t = u16;
pub type ktx_int16_t = i16;
pub type ktx_uint32_t = u32;
pub type ktx_int32_t = i32;
pub type ktx_uint64_t = u64;
pub type ktx_int64_t = i64;
#[doc = " This will cause compilation to fail if size of uint32 != 4."]
pub type ktx_uint32_t_SIZE_ASSERT = [::std::os::raw::c_uchar; 1usize];
pub type GLenum = ::std::os::raw::c_uint;
pub type GLuint = ::std::os::raw::c_uint;
#[doc = "< Operation was successful."]
pub const ktx_error_code_e_KTX_SUCCESS: ktx_error_code_e = 0;
#[doc = "< The data in the file is inconsistent with the spec."]
pub const ktx_error_code_e_KTX_FILE_DATA_ERROR: ktx_error_code_e = 1;
#[doc = "< The file is a pipe or named pipe."]
pub const ktx_error_code_e_KTX_FILE_ISPIPE: ktx_error_code_e = 2;
#[doc = "< The target file could not be opened."]
pub const ktx_error_code_e_KTX_FILE_OPEN_FAILED: ktx_error_code_e = 3;
#[doc = "< The operation would exceed the max file size."]
pub const ktx_error_code_e_KTX_FILE_OVERFLOW: ktx_error_code_e = 4;
#[doc = "< An error occurred while reading from the file."]
pub const ktx_error_code_e_KTX_FILE_READ_ERROR: ktx_error_code_e = 5;
#[doc = "< An error occurred while seeking in the file."]
pub const ktx_error_code_e_KTX_FILE_SEEK_ERROR: ktx_error_code_e = 6;
#[doc = "< File does not have enough data to satisfy request."]
pub const ktx_error_code_e_KTX_FILE_UNEXPECTED_EOF: ktx_error_code_e = 7;
#[doc = "< An error occurred while writing to the file."]
pub const ktx_error_code_e_KTX_FILE_WRITE_ERROR: ktx_error_code_e = 8;
#[doc = "< GL operations resulted in an error."]
pub const ktx_error_code_e_KTX_GL_ERROR: ktx_error_code_e = 9;
#[doc = "< The operation is not allowed in the current state."]
pub const ktx_error_code_e_KTX_INVALID_OPERATION: ktx_error_code_e = 10;
#[doc = "< A parameter value was not valid"]
pub const ktx_error_code_e_KTX_INVALID_VALUE: ktx_error_code_e = 11;
#[doc = "< Requested key was not found"]
pub const ktx_error_code_e_KTX_NOT_FOUND: ktx_error_code_e = 12;
#[doc = "< Not enough memory to complete the operation."]
pub const ktx_error_code_e_KTX_OUT_OF_MEMORY: ktx_error_code_e = 13;
#[doc = "< Transcoding of block compressed texture failed."]
pub const ktx_error_code_e_KTX_TRANSCODE_FAILED: ktx_error_code_e = 14;
#[doc = "< The file not a KTX file"]
pub const ktx_error_code_e_KTX_UNKNOWN_FILE_FORMAT: ktx_error_code_e = 15;
#[doc = "< The KTX file specifies an unsupported texture type."]
pub const ktx_error_code_e_KTX_UNSUPPORTED_TEXTURE_TYPE: ktx_error_code_e = 16;
#[doc = "< Feature not included in in-use library or not yet implemented."]
pub const ktx_error_code_e_KTX_UNSUPPORTED_FEATURE: ktx_error_code_e = 17;
#[doc = "< Library dependency (OpenGL or Vulkan) not linked into application."]
pub const ktx_error_code_e_KTX_LIBRARY_NOT_LINKED: ktx_error_code_e = 18;
#[doc = "< For safety checks."]
pub const ktx_error_code_e_KTX_ERROR_MAX_ENUM: ktx_error_code_e = 18;
#[doc = " @~English"]
#[doc = " @brief Error codes returned by library functions."]
pub type ktx_error_code_e = ::std::os::raw::c_uint;
#[doc = " @~English"]
#[doc = " @brief Result codes returned by library functions."]
pub use self::ktx_error_code_e as ktxResult;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ktxKVListEntry {
_unused: [u8; 0],
}
#[doc = " @class ktxHashList"]
#[doc = " @~English"]
#[doc = " @brief Opaque handle to a ktxHashList."]
pub type ktxHashList = *mut ktxKVListEntry;
#[doc = " @class ktxHashListEntry"]
#[doc = " @~English"]
#[doc = " @brief Opaque handle to an entry in a @ref ktxHashList."]
pub type ktxHashListEntry = ktxKVListEntry;
pub const ktxOrientationX_KTX_ORIENT_X_LEFT: ktxOrientationX = 108;
pub const ktxOrientationX_KTX_ORIENT_X_RIGHT: ktxOrientationX = 114;
pub type ktxOrientationX = ::std::os::raw::c_uint;
pub const ktxOrientationY_KTX_ORIENT_Y_UP: ktxOrientationY = 117;
pub const ktxOrientationY_KTX_ORIENT_Y_DOWN: ktxOrientationY = 100;
pub type ktxOrientationY = ::std::os::raw::c_uint;
pub const ktxOrientationZ_KTX_ORIENT_Z_IN: ktxOrientationZ = 105;
pub const ktxOrientationZ_KTX_ORIENT_Z_OUT: ktxOrientationZ = 111;
pub type ktxOrientationZ = ::std::os::raw::c_uint;
pub const class_id_ktxTexture1_c: class_id = 1;
pub const class_id_ktxTexture2_c: class_id = 2;
pub type class_id = ::std::os::raw::c_uint;
#[doc = " @~English"]
#[doc = " @brief Struct describing the logical orientation of an image."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ktxOrientation {
#[doc = "< Orientation in X"]
pub x: ktxOrientationX,
#[doc = "< Orientation in Y"]
pub y: ktxOrientationY,
#[doc = "< Orientation in Z"]
pub z: ktxOrientationZ,
}
#[test]
fn bindgen_test_layout_ktxOrientation() {
assert_eq!(
::std::mem::size_of::<ktxOrientation>(),
12usize,
concat!("Size of: ", stringify!(ktxOrientation))
);
assert_eq!(
::std::mem::align_of::<ktxOrientation>(),
4usize,
concat!("Alignment of ", stringify!(ktxOrientation))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ktxOrientation>())).x as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(ktxOrientation),
"::",
stringify!(x)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ktxOrientation>())).y as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(ktxOrientation),
"::",
stringify!(y)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ktxOrientation>())).z as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(ktxOrientation),
"::",
stringify!(z)
)
);
}
#[doc = " @class ktxTexture"]
#[doc = " @~English"]
#[doc = " @brief Base class representing a texture."]
#[doc = ""]
#[doc = " ktxTextures should be created only by one of the provided"]
#[doc = " functions and these fields should be considered read-only."]
#[repr(C)]
pub struct ktxTexture {
pub classId: class_id,
pub vtbl: *mut ktxTexture_vtbl,
pub vvtbl: *mut ktxTexture_vvtbl,
pub _protected: *mut ktxTexture_protected,
pub isArray: ktx_bool_t,
pub isCubemap: ktx_bool_t,
pub isCompressed: ktx_bool_t,
pub generateMipmaps: ktx_bool_t,
pub baseWidth: ktx_uint32_t,
pub baseHeight: ktx_uint32_t,
pub baseDepth: ktx_uint32_t,
pub numDimensions: ktx_uint32_t,
pub numLevels: ktx_uint32_t,
pub numLayers: ktx_uint32_t,
pub numFaces: ktx_uint32_t,
pub orientation: ktxOrientation,
pub kvDataHead: ktxHashList,
pub kvDataLen: ktx_uint32_t,
pub kvData: *mut ktx_uint8_t,
pub dataSize: ktx_size_t,
pub pData: *mut ktx_uint8_t,
}
#[test]
fn bindgen_test_layout_ktxTexture() {
assert_eq!(
::std::mem::size_of::<ktxTexture>(),
120usize,
concat!("Size of: ", stringify!(ktxTexture))
);
assert_eq!(
::std::mem::align_of::<ktxTexture>(),
8usize,
concat!("Alignment of ", stringify!(ktxTexture))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ktxTexture>())).classId as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture),
"::",
stringify!(classId)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ktxTexture>())).vtbl as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture),
"::",
stringify!(vtbl)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ktxTexture>())).vvtbl as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture),
"::",
stringify!(vvtbl)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ktxTexture>()))._protected as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture),
"::",
stringify!(_protected)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ktxTexture>())).isArray as *const _ as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture),
"::",
stringify!(isArray)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ktxTexture>())).isCubemap as *const _ as usize },
33usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture),
"::",
stringify!(isCubemap)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ktxTexture>())).isCompressed as *const _ as usize },
34usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture),
"::",
stringify!(isCompressed)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ktxTexture>())).generateMipmaps as *const _ as usize },
35usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture),
"::",
stringify!(generateMipmaps)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ktxTexture>())).baseWidth as *const _ as usize },
36usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture),
"::",
stringify!(baseWidth)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ktxTexture>())).baseHeight as *const _ as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture),
"::",
stringify!(baseHeight)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ktxTexture>())).baseDepth as *const _ as usize },
44usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture),
"::",
stringify!(baseDepth)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ktxTexture>())).numDimensions as *const _ as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture),
"::",
stringify!(numDimensions)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ktxTexture>())).numLevels as *const _ as usize },
52usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture),
"::",
stringify!(numLevels)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ktxTexture>())).numLayers as *const _ as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture),
"::",
stringify!(numLayers)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ktxTexture>())).numFaces as *const _ as usize },
60usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture),
"::",
stringify!(numFaces)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ktxTexture>())).orientation as *const _ as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture),
"::",
stringify!(orientation)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ktxTexture>())).kvDataHead as *const _ as usize },
80usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture),
"::",
stringify!(kvDataHead)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ktxTexture>())).kvDataLen as *const _ as usize },
88usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture),
"::",
stringify!(kvDataLen)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ktxTexture>())).kvData as *const _ as usize },
96usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture),
"::",
stringify!(kvData)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ktxTexture>())).dataSize as *const _ as usize },
104usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture),
"::",
stringify!(dataSize)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ktxTexture>())).pData as *const _ as usize },
112usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture),
"::",
stringify!(pData)
)
);
}
#[doc = " @memberof ktxTexture"]
#[doc = " @~English"]
#[doc = " @brief Signature of function called by the <tt>ktxTexture_Iterate*</tt>"]
#[doc = " functions to receive image data."]
#[doc = ""]
#[doc = " The function parameters are used to pass values which change for each image."]
#[doc = " Obtain values which are uniform across all images from the @c ktxTexture"]
#[doc = " object."]
#[doc = ""]
#[doc = " @param [in] miplevel MIP level from 0 to the max level which is"]
#[doc = " dependent on the texture size."]
#[doc = " @param [in] face usually 0; for cube maps, one of the 6 cube"]
#[doc = " faces in the order +X, -X, +Y, -Y, +Z, -Z,"]
#[doc = " 0 to 5."]
#[doc = " @param [in] width width of the image."]
#[doc = " @param [in] height height of the image or, for 1D textures"]
#[doc = " textures, 1."]
#[doc = " @param [in] depth depth of the image or, for 1D & 2D"]
#[doc = " textures, 1."]
#[doc = " @param [in] faceLodSize number of bytes of data pointed at by"]
#[doc = " @p pixels."]
#[doc = " @param [in] pixels pointer to the image data."]
#[doc = " @param [in,out] userdata pointer for the application to pass data to and"]
#[doc = " from the callback function."]
pub type PFNKTXITERCB = ::std::option::Option<
unsafe extern "C" fn(
miplevel: ::std::os::raw::c_int,
face: ::std::os::raw::c_int,
width: ::std::os::raw::c_int,
height: ::std::os::raw::c_int,
depth: ::std::os::raw::c_int,
faceLodSize: ktx_uint64_t,
pixels: *mut ::std::os::raw::c_void,
userdata: *mut ::std::os::raw::c_void,
) -> ktx_error_code_e,
>;
#[doc = " Don't use KTX_APIENTRYP to avoid a Doxygen bug."]
pub type PFNKTEXDESTROY = ::std::option::Option<unsafe extern "C" fn(This: *mut ktxTexture)>;
pub type PFNKTEXGETIMAGEOFFSET = ::std::option::Option<
unsafe extern "C" fn(
This: *mut ktxTexture,
level: ktx_uint32_t,
layer: ktx_uint32_t,
faceSlice: ktx_uint32_t,
pOffset: *mut ktx_size_t,
) -> ktx_error_code_e,
>;
pub type PFNKTEXGETDATASIZEUNCOMPRESSED =
::std::option::Option<unsafe extern "C" fn(This: *mut ktxTexture) -> ktx_size_t>;
pub type PFNKTEXGETIMAGESIZE = ::std::option::Option<
unsafe extern "C" fn(This: *mut ktxTexture, level: ktx_uint32_t) -> ktx_size_t,
>;
pub type PFNKTEXITERATELEVELS = ::std::option::Option<
unsafe extern "C" fn(
This: *mut ktxTexture,
iterCb: PFNKTXITERCB,
userdata: *mut ::std::os::raw::c_void,
) -> ktx_error_code_e,
>;
pub type PFNKTEXITERATELOADLEVELFACES = ::std::option::Option<
unsafe extern "C" fn(
This: *mut ktxTexture,
iterCb: PFNKTXITERCB,
userdata: *mut ::std::os::raw::c_void,
) -> ktx_error_code_e,
>;
pub type PFNKTEXLOADIMAGEDATA = ::std::option::Option<
unsafe extern "C" fn(
This: *mut ktxTexture,
pBuffer: *mut ktx_uint8_t,
bufSize: ktx_size_t,
) -> ktx_error_code_e,
>;
pub type PFNKTEXNEEDSTRANSCODING =
::std::option::Option<unsafe extern "C" fn(This: *mut ktxTexture) -> ktx_bool_t>;
pub type PFNKTEXSETIMAGEFROMMEMORY = ::std::option::Option<
unsafe extern "C" fn(
This: *mut ktxTexture,
level: ktx_uint32_t,
layer: ktx_uint32_t,
faceSlice: ktx_uint32_t,
src: *const ktx_uint8_t,
srcSize: ktx_size_t,
) -> ktx_error_code_e,
>;
pub type PFNKTEXSETIMAGEFROMSTDIOSTREAM = ::std::option::Option<
unsafe extern "C" fn(
This: *mut ktxTexture,
level: ktx_uint32_t,
layer: ktx_uint32_t,
faceSlice: ktx_uint32_t,
src: *mut FILE,
srcSize: ktx_size_t,
) -> ktx_error_code_e,
>;
pub type PFNKTEXWRITETOSTDIOSTREAM = ::std::option::Option<
unsafe extern "C" fn(This: *mut ktxTexture, dstsstr: *mut FILE) -> ktx_error_code_e,
>;
pub type PFNKTEXWRITETONAMEDFILE = ::std::option::Option<
unsafe extern "C" fn(
This: *mut ktxTexture,
dstname: *const ::std::os::raw::c_char,
) -> ktx_error_code_e,
>;
pub type PFNKTEXWRITETOMEMORY = ::std::option::Option<
unsafe extern "C" fn(
This: *mut ktxTexture,
bytes: *mut *mut ktx_uint8_t,
size: *mut ktx_size_t,
) -> ktx_error_code_e,
>;
pub type PFNKTEXWRITETOSTREAM = ::std::option::Option<
unsafe extern "C" fn(This: *mut ktxTexture, dststr: *mut ktxStream) -> ktx_error_code_e,
>;
#[doc = " @memberof ktxTexture"]
#[doc = " @~English"]
#[doc = " @brief Table of virtual ktxTexture methods."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ktxTexture_vtbl {
pub Destroy: PFNKTEXDESTROY,
pub GetImageOffset: PFNKTEXGETIMAGEOFFSET,
pub GetDataSizeUncompressed: PFNKTEXGETDATASIZEUNCOMPRESSED,
pub GetImageSize: PFNKTEXGETIMAGESIZE,
pub IterateLevels: PFNKTEXITERATELEVELS,
pub IterateLoadLevelFaces: PFNKTEXITERATELOADLEVELFACES,
pub NeedsTranscoding: PFNKTEXNEEDSTRANSCODING,
pub LoadImageData: PFNKTEXLOADIMAGEDATA,
pub SetImageFromMemory: PFNKTEXSETIMAGEFROMMEMORY,
pub SetImageFromStdioStream: PFNKTEXSETIMAGEFROMSTDIOSTREAM,
pub WriteToStdioStream: PFNKTEXWRITETOSTDIOSTREAM,
pub WriteToNamedFile: PFNKTEXWRITETONAMEDFILE,
pub WriteToMemory: PFNKTEXWRITETOMEMORY,
pub WriteToStream: PFNKTEXWRITETOSTREAM,
}
#[test]
fn bindgen_test_layout_ktxTexture_vtbl() {
assert_eq!(
::std::mem::size_of::<ktxTexture_vtbl>(),
112usize,
concat!("Size of: ", stringify!(ktxTexture_vtbl))
);
assert_eq!(
::std::mem::align_of::<ktxTexture_vtbl>(),
8usize,
concat!("Alignment of ", stringify!(ktxTexture_vtbl))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ktxTexture_vtbl>())).Destroy as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture_vtbl),
"::",
stringify!(Destroy)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ktxTexture_vtbl>())).GetImageOffset as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture_vtbl),
"::",
stringify!(GetImageOffset)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<ktxTexture_vtbl>())).GetDataSizeUncompressed as *const _ as usize
},
16usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture_vtbl),
"::",
stringify!(GetDataSizeUncompressed)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ktxTexture_vtbl>())).GetImageSize as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture_vtbl),
"::",
stringify!(GetImageSize)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ktxTexture_vtbl>())).IterateLevels as *const _ as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture_vtbl),
"::",
stringify!(IterateLevels)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<ktxTexture_vtbl>())).IterateLoadLevelFaces as *const _ as usize
},
40usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture_vtbl),
"::",
stringify!(IterateLoadLevelFaces)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<ktxTexture_vtbl>())).NeedsTranscoding as *const _ as usize
},
48usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture_vtbl),
"::",
stringify!(NeedsTranscoding)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ktxTexture_vtbl>())).LoadImageData as *const _ as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture_vtbl),
"::",
stringify!(LoadImageData)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<ktxTexture_vtbl>())).SetImageFromMemory as *const _ as usize
},
64usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture_vtbl),
"::",
stringify!(SetImageFromMemory)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<ktxTexture_vtbl>())).SetImageFromStdioStream as *const _ as usize
},
72usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture_vtbl),
"::",
stringify!(SetImageFromStdioStream)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<ktxTexture_vtbl>())).WriteToStdioStream as *const _ as usize
},
80usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture_vtbl),
"::",
stringify!(WriteToStdioStream)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<ktxTexture_vtbl>())).WriteToNamedFile as *const _ as usize
},
88usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture_vtbl),
"::",
stringify!(WriteToNamedFile)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ktxTexture_vtbl>())).WriteToMemory as *const _ as usize },
96usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture_vtbl),
"::",
stringify!(WriteToMemory)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ktxTexture_vtbl>())).WriteToStream as *const _ as usize },
104usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture_vtbl),
"::",
stringify!(WriteToStream)
)
);
}
#[doc = " @class ktxTexture1"]
#[doc = " @~English"]
#[doc = " @brief Class representing a KTX version 1 format texture."]
#[doc = ""]
#[doc = " ktxTextures should be created only by one of the ktxTexture_Create*"]
#[doc = " functions and these fields should be considered read-only."]
#[repr(C)]
pub struct ktxTexture1 {
pub classId: class_id,
pub vtbl: *mut ktxTexture_vtbl,
pub vvtbl: *mut ktxTexture_vvtbl,
pub _protected: *mut ktxTexture_protected,
pub isArray: ktx_bool_t,
pub isCubemap: ktx_bool_t,
pub isCompressed: ktx_bool_t,
pub generateMipmaps: ktx_bool_t,
pub baseWidth: ktx_uint32_t,
pub baseHeight: ktx_uint32_t,
pub baseDepth: ktx_uint32_t,
pub numDimensions: ktx_uint32_t,
pub numLevels: ktx_uint32_t,
pub numLayers: ktx_uint32_t,
pub numFaces: ktx_uint32_t,
pub orientation: ktxOrientation,
pub kvDataHead: ktxHashList,
pub kvDataLen: ktx_uint32_t,
pub kvData: *mut ktx_uint8_t,
pub dataSize: ktx_size_t,
pub pData: *mut ktx_uint8_t,
#[doc = "< Format of the texture data, e.g., GL_RGB."]
pub glFormat: ktx_uint32_t,
#[doc = "< Internal format of the texture data,"]
#[doc = "e.g., GL_RGB8."]
pub glInternalformat: ktx_uint32_t,
#[doc = "< Base format of the texture data,"]
#[doc = "e.g., GL_RGB."]
pub glBaseInternalformat: ktx_uint32_t,
#[doc = "< Type of the texture data, e.g, GL_UNSIGNED_BYTE."]
pub glType: ktx_uint32_t,
#[doc = "< Private data."]
pub _private: *mut ktxTexture1_private,
}
#[test]
fn bindgen_test_layout_ktxTexture1() {
assert_eq!(
::std::mem::size_of::<ktxTexture1>(),
144usize,
concat!("Size of: ", stringify!(ktxTexture1))
);
assert_eq!(
::std::mem::align_of::<ktxTexture1>(),
8usize,
concat!("Alignment of ", stringify!(ktxTexture1))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ktxTexture1>())).classId as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture1),
"::",
stringify!(classId)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ktxTexture1>())).vtbl as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture1),
"::",
stringify!(vtbl)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ktxTexture1>())).vvtbl as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture1),
"::",
stringify!(vvtbl)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ktxTexture1>()))._protected as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture1),
"::",
stringify!(_protected)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ktxTexture1>())).isArray as *const _ as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture1),
"::",
stringify!(isArray)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ktxTexture1>())).isCubemap as *const _ as usize },
33usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture1),
"::",
stringify!(isCubemap)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ktxTexture1>())).isCompressed as *const _ as usize },
34usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture1),
"::",
stringify!(isCompressed)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ktxTexture1>())).generateMipmaps as *const _ as usize },
35usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture1),
"::",
stringify!(generateMipmaps)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ktxTexture1>())).baseWidth as *const _ as usize },
36usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture1),
"::",
stringify!(baseWidth)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ktxTexture1>())).baseHeight as *const _ as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture1),
"::",
stringify!(baseHeight)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ktxTexture1>())).baseDepth as *const _ as usize },
44usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture1),
"::",
stringify!(baseDepth)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ktxTexture1>())).numDimensions as *const _ as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture1),
"::",
stringify!(numDimensions)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ktxTexture1>())).numLevels as *const _ as usize },
52usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture1),
"::",
stringify!(numLevels)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ktxTexture1>())).numLayers as *const _ as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture1),
"::",
stringify!(numLayers)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ktxTexture1>())).numFaces as *const _ as usize },
60usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture1),
"::",
stringify!(numFaces)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ktxTexture1>())).orientation as *const _ as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture1),
"::",
stringify!(orientation)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ktxTexture1>())).kvDataHead as *const _ as usize },
80usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture1),
"::",
stringify!(kvDataHead)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ktxTexture1>())).kvDataLen as *const _ as usize },
88usize,
concat!(
"Offset of field: ",
stringify!(ktxTexture1),
"::",