nvjpeg-sys 0.1.0

Raw Rust bindings for NVIDIA nvJPEG library
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
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
/* automatically generated by rust-bindgen 0.66.1 */

pub const NVJPEG_MAX_COMPONENT: u32 = 4;
pub const NVJPEG_VER_MAJOR: u32 = 11;
pub const NVJPEG_VER_MINOR: u32 = 9;
pub const NVJPEG_VER_PATCH: u32 = 0;
pub const NVJPEG_VER_BUILD: u32 = 86;
pub const NVJPEG_FLAGS_DEFAULT: u32 = 0;
pub const NVJPEG_FLAGS_HW_DECODE_NO_PIPELINE: u32 = 1;
pub const NVJPEG_FLAGS_ENABLE_MEMORY_POOLS: u32 = 2;
pub const NVJPEG_FLAGS_BITSTREAM_STRICT: u32 = 4;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct CUstream_st {
    _unused: [u8; 0],
}
pub type cudaStream_t = *mut CUstream_st;
pub const libraryPropertyType_t_MAJOR_VERSION: libraryPropertyType_t = 0;
pub const libraryPropertyType_t_MINOR_VERSION: libraryPropertyType_t = 1;
pub const libraryPropertyType_t_PATCH_LEVEL: libraryPropertyType_t = 2;
pub type libraryPropertyType_t = ::std::os::raw::c_uint;
use std::ptr::null_mut;

pub use self::libraryPropertyType_t as libraryPropertyType;
pub const nvjpegStatus_t_NVJPEG_STATUS_SUCCESS: nvjpegStatus_t = 0;
pub const nvjpegStatus_t_NVJPEG_STATUS_NOT_INITIALIZED: nvjpegStatus_t = 1;
pub const nvjpegStatus_t_NVJPEG_STATUS_INVALID_PARAMETER: nvjpegStatus_t = 2;
pub const nvjpegStatus_t_NVJPEG_STATUS_BAD_JPEG: nvjpegStatus_t = 3;
pub const nvjpegStatus_t_NVJPEG_STATUS_JPEG_NOT_SUPPORTED: nvjpegStatus_t = 4;
pub const nvjpegStatus_t_NVJPEG_STATUS_ALLOCATOR_FAILURE: nvjpegStatus_t = 5;
pub const nvjpegStatus_t_NVJPEG_STATUS_EXECUTION_FAILED: nvjpegStatus_t = 6;
pub const nvjpegStatus_t_NVJPEG_STATUS_ARCH_MISMATCH: nvjpegStatus_t = 7;
pub const nvjpegStatus_t_NVJPEG_STATUS_INTERNAL_ERROR: nvjpegStatus_t = 8;
pub const nvjpegStatus_t_NVJPEG_STATUS_IMPLEMENTATION_NOT_SUPPORTED: nvjpegStatus_t = 9;
pub const nvjpegStatus_t_NVJPEG_STATUS_INCOMPLETE_BITSTREAM: nvjpegStatus_t = 10;
pub type nvjpegStatus_t = ::std::os::raw::c_uint;
pub const nvjpegExifOrientation_NVJPEG_ORIENTATION_UNKNOWN: nvjpegExifOrientation = 0;
pub const nvjpegExifOrientation_NVJPEG_ORIENTATION_NORMAL: nvjpegExifOrientation = 1;
pub const nvjpegExifOrientation_NVJPEG_ORIENTATION_FLIP_HORIZONTAL: nvjpegExifOrientation = 2;
pub const nvjpegExifOrientation_NVJPEG_ORIENTATION_ROTATE_180: nvjpegExifOrientation = 3;
pub const nvjpegExifOrientation_NVJPEG_ORIENTATION_FLIP_VERTICAL: nvjpegExifOrientation = 4;
pub const nvjpegExifOrientation_NVJPEG_ORIENTATION_TRANSPOSE: nvjpegExifOrientation = 5;
pub const nvjpegExifOrientation_NVJPEG_ORIENTATION_ROTATE_90: nvjpegExifOrientation = 6;
pub const nvjpegExifOrientation_NVJPEG_ORIENTATION_TRANSVERSE: nvjpegExifOrientation = 7;
pub const nvjpegExifOrientation_NVJPEG_ORIENTATION_ROTATE_270: nvjpegExifOrientation = 8;
pub type nvjpegExifOrientation = ::std::os::raw::c_uint;
pub use self::nvjpegExifOrientation as nvjpegExifOrientation_t;
pub const nvjpegChromaSubsampling_t_NVJPEG_CSS_444: nvjpegChromaSubsampling_t = 0;
pub const nvjpegChromaSubsampling_t_NVJPEG_CSS_422: nvjpegChromaSubsampling_t = 1;
pub const nvjpegChromaSubsampling_t_NVJPEG_CSS_420: nvjpegChromaSubsampling_t = 2;
pub const nvjpegChromaSubsampling_t_NVJPEG_CSS_440: nvjpegChromaSubsampling_t = 3;
pub const nvjpegChromaSubsampling_t_NVJPEG_CSS_411: nvjpegChromaSubsampling_t = 4;
pub const nvjpegChromaSubsampling_t_NVJPEG_CSS_410: nvjpegChromaSubsampling_t = 5;
pub const nvjpegChromaSubsampling_t_NVJPEG_CSS_GRAY: nvjpegChromaSubsampling_t = 6;
pub const nvjpegChromaSubsampling_t_NVJPEG_CSS_410V: nvjpegChromaSubsampling_t = 7;
pub const nvjpegChromaSubsampling_t_NVJPEG_CSS_UNKNOWN: nvjpegChromaSubsampling_t = -1;
pub type nvjpegChromaSubsampling_t = ::std::os::raw::c_int;
pub const nvjpegOutputFormat_t_NVJPEG_OUTPUT_UNCHANGED: nvjpegOutputFormat_t = 0;
pub const nvjpegOutputFormat_t_NVJPEG_OUTPUT_YUV: nvjpegOutputFormat_t = 1;
pub const nvjpegOutputFormat_t_NVJPEG_OUTPUT_Y: nvjpegOutputFormat_t = 2;
pub const nvjpegOutputFormat_t_NVJPEG_OUTPUT_RGB: nvjpegOutputFormat_t = 3;
pub const nvjpegOutputFormat_t_NVJPEG_OUTPUT_BGR: nvjpegOutputFormat_t = 4;
pub const nvjpegOutputFormat_t_NVJPEG_OUTPUT_RGBI: nvjpegOutputFormat_t = 5;
pub const nvjpegOutputFormat_t_NVJPEG_OUTPUT_BGRI: nvjpegOutputFormat_t = 6;
pub const nvjpegOutputFormat_t_NVJPEG_OUTPUT_FORMAT_MAX: nvjpegOutputFormat_t = 6;
pub type nvjpegOutputFormat_t = ::std::os::raw::c_uint;
pub const nvjpegInputFormat_t_NVJPEG_INPUT_RGB: nvjpegInputFormat_t = 3;
pub const nvjpegInputFormat_t_NVJPEG_INPUT_BGR: nvjpegInputFormat_t = 4;
pub const nvjpegInputFormat_t_NVJPEG_INPUT_RGBI: nvjpegInputFormat_t = 5;
pub const nvjpegInputFormat_t_NVJPEG_INPUT_BGRI: nvjpegInputFormat_t = 6;
pub type nvjpegInputFormat_t = ::std::os::raw::c_uint;
pub const nvjpegBackend_t_NVJPEG_BACKEND_DEFAULT: nvjpegBackend_t = 0;
pub const nvjpegBackend_t_NVJPEG_BACKEND_HYBRID: nvjpegBackend_t = 1;
pub const nvjpegBackend_t_NVJPEG_BACKEND_GPU_HYBRID: nvjpegBackend_t = 2;
pub const nvjpegBackend_t_NVJPEG_BACKEND_HARDWARE: nvjpegBackend_t = 3;
pub const nvjpegBackend_t_NVJPEG_BACKEND_GPU_HYBRID_DEVICE: nvjpegBackend_t = 4;
pub const nvjpegBackend_t_NVJPEG_BACKEND_HARDWARE_DEVICE: nvjpegBackend_t = 5;
pub type nvjpegBackend_t = ::std::os::raw::c_uint;
pub const nvjpegJpegEncoding_t_NVJPEG_ENCODING_UNKNOWN: nvjpegJpegEncoding_t = 0;
pub const nvjpegJpegEncoding_t_NVJPEG_ENCODING_BASELINE_DCT: nvjpegJpegEncoding_t = 192;
pub const nvjpegJpegEncoding_t_NVJPEG_ENCODING_EXTENDED_SEQUENTIAL_DCT_HUFFMAN:
    nvjpegJpegEncoding_t = 193;
pub const nvjpegJpegEncoding_t_NVJPEG_ENCODING_PROGRESSIVE_DCT_HUFFMAN: nvjpegJpegEncoding_t = 194;
pub type nvjpegJpegEncoding_t = ::std::os::raw::c_uint;
pub const nvjpegScaleFactor_t_NVJPEG_SCALE_NONE: nvjpegScaleFactor_t = 0;
pub const nvjpegScaleFactor_t_NVJPEG_SCALE_1_BY_2: nvjpegScaleFactor_t = 1;
pub const nvjpegScaleFactor_t_NVJPEG_SCALE_1_BY_4: nvjpegScaleFactor_t = 2;
pub const nvjpegScaleFactor_t_NVJPEG_SCALE_1_BY_8: nvjpegScaleFactor_t = 3;
pub type nvjpegScaleFactor_t = ::std::os::raw::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nvjpegImage_t {
    pub channel: [*mut ::std::os::raw::c_uchar; 4usize],
    pub pitch: [usize; 4usize],
}

impl Default for nvjpegImage_t {
    #[inline]
    fn default() -> Self {
        Self::new()
    }
}

impl nvjpegImage_t {
    pub fn new() -> Self {
        nvjpegImage_t {
            channel: [null_mut(); 4],
            pitch: [0; 4],
        }
    }
}

#[test]
fn bindgen_test_layout_nvjpegImage_t() {
    const UNINIT: ::std::mem::MaybeUninit<nvjpegImage_t> = ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<nvjpegImage_t>(),
        64usize,
        concat!("Size of: ", stringify!(nvjpegImage_t))
    );
    assert_eq!(
        ::std::mem::align_of::<nvjpegImage_t>(),
        8usize,
        concat!("Alignment of ", stringify!(nvjpegImage_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).channel) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(nvjpegImage_t),
            "::",
            stringify!(channel)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).pitch) as usize - ptr as usize },
        32usize,
        concat!(
            "Offset of field: ",
            stringify!(nvjpegImage_t),
            "::",
            stringify!(pitch)
        )
    );
}
pub type tDevMalloc = ::std::option::Option<
    unsafe extern "C" fn(
        arg1: *mut *mut ::std::os::raw::c_void,
        arg2: usize,
    ) -> ::std::os::raw::c_int,
>;
pub type tDevFree = ::std::option::Option<
    unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int,
>;
pub type tPinnedMalloc = ::std::option::Option<
    unsafe extern "C" fn(
        arg1: *mut *mut ::std::os::raw::c_void,
        arg2: usize,
        flags: ::std::os::raw::c_uint,
    ) -> ::std::os::raw::c_int,
>;
pub type tPinnedFree = ::std::option::Option<
    unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int,
>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nvjpegDevAllocator_t {
    pub dev_malloc: tDevMalloc,
    pub dev_free: tDevFree,
}
#[test]
fn bindgen_test_layout_nvjpegDevAllocator_t() {
    const UNINIT: ::std::mem::MaybeUninit<nvjpegDevAllocator_t> = ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<nvjpegDevAllocator_t>(),
        16usize,
        concat!("Size of: ", stringify!(nvjpegDevAllocator_t))
    );
    assert_eq!(
        ::std::mem::align_of::<nvjpegDevAllocator_t>(),
        8usize,
        concat!("Alignment of ", stringify!(nvjpegDevAllocator_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).dev_malloc) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(nvjpegDevAllocator_t),
            "::",
            stringify!(dev_malloc)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).dev_free) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(nvjpegDevAllocator_t),
            "::",
            stringify!(dev_free)
        )
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nvjpegPinnedAllocator_t {
    pub pinned_malloc: tPinnedMalloc,
    pub pinned_free: tPinnedFree,
}
#[test]
fn bindgen_test_layout_nvjpegPinnedAllocator_t() {
    const UNINIT: ::std::mem::MaybeUninit<nvjpegPinnedAllocator_t> =
        ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<nvjpegPinnedAllocator_t>(),
        16usize,
        concat!("Size of: ", stringify!(nvjpegPinnedAllocator_t))
    );
    assert_eq!(
        ::std::mem::align_of::<nvjpegPinnedAllocator_t>(),
        8usize,
        concat!("Alignment of ", stringify!(nvjpegPinnedAllocator_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).pinned_malloc) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(nvjpegPinnedAllocator_t),
            "::",
            stringify!(pinned_malloc)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).pinned_free) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(nvjpegPinnedAllocator_t),
            "::",
            stringify!(pinned_free)
        )
    );
}
pub type tDevMallocV2 = ::std::option::Option<
    unsafe extern "C" fn(
        ctx: *mut ::std::os::raw::c_void,
        ptr: *mut *mut ::std::os::raw::c_void,
        size: usize,
        stream: cudaStream_t,
    ) -> ::std::os::raw::c_int,
>;
pub type tDevFreeV2 = ::std::option::Option<
    unsafe extern "C" fn(
        ctx: *mut ::std::os::raw::c_void,
        ptr: *mut ::std::os::raw::c_void,
        size: usize,
        stream: cudaStream_t,
    ) -> ::std::os::raw::c_int,
>;
pub type tPinnedMallocV2 = ::std::option::Option<
    unsafe extern "C" fn(
        ctx: *mut ::std::os::raw::c_void,
        ptr: *mut *mut ::std::os::raw::c_void,
        size: usize,
        stream: cudaStream_t,
    ) -> ::std::os::raw::c_int,
>;
pub type tPinnedFreeV2 = ::std::option::Option<
    unsafe extern "C" fn(
        ctx: *mut ::std::os::raw::c_void,
        ptr: *mut ::std::os::raw::c_void,
        size: usize,
        stream: cudaStream_t,
    ) -> ::std::os::raw::c_int,
>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nvjpegDevAllocatorV2_t {
    pub dev_malloc: tDevMallocV2,
    pub dev_free: tDevFreeV2,
    pub dev_ctx: *mut ::std::os::raw::c_void,
}
#[test]
fn bindgen_test_layout_nvjpegDevAllocatorV2_t() {
    const UNINIT: ::std::mem::MaybeUninit<nvjpegDevAllocatorV2_t> =
        ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<nvjpegDevAllocatorV2_t>(),
        24usize,
        concat!("Size of: ", stringify!(nvjpegDevAllocatorV2_t))
    );
    assert_eq!(
        ::std::mem::align_of::<nvjpegDevAllocatorV2_t>(),
        8usize,
        concat!("Alignment of ", stringify!(nvjpegDevAllocatorV2_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).dev_malloc) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(nvjpegDevAllocatorV2_t),
            "::",
            stringify!(dev_malloc)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).dev_free) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(nvjpegDevAllocatorV2_t),
            "::",
            stringify!(dev_free)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).dev_ctx) as usize - ptr as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(nvjpegDevAllocatorV2_t),
            "::",
            stringify!(dev_ctx)
        )
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nvjpegPinnedAllocatorV2_t {
    pub pinned_malloc: tPinnedMallocV2,
    pub pinned_free: tPinnedFreeV2,
    pub pinned_ctx: *mut ::std::os::raw::c_void,
}
#[test]
fn bindgen_test_layout_nvjpegPinnedAllocatorV2_t() {
    const UNINIT: ::std::mem::MaybeUninit<nvjpegPinnedAllocatorV2_t> =
        ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<nvjpegPinnedAllocatorV2_t>(),
        24usize,
        concat!("Size of: ", stringify!(nvjpegPinnedAllocatorV2_t))
    );
    assert_eq!(
        ::std::mem::align_of::<nvjpegPinnedAllocatorV2_t>(),
        8usize,
        concat!("Alignment of ", stringify!(nvjpegPinnedAllocatorV2_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).pinned_malloc) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(nvjpegPinnedAllocatorV2_t),
            "::",
            stringify!(pinned_malloc)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).pinned_free) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(nvjpegPinnedAllocatorV2_t),
            "::",
            stringify!(pinned_free)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).pinned_ctx) as usize - ptr as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(nvjpegPinnedAllocatorV2_t),
            "::",
            stringify!(pinned_ctx)
        )
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nvjpegHandle {
    _unused: [u8; 0],
}
pub type nvjpegHandle_t = *mut nvjpegHandle;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nvjpegJpegState {
    _unused: [u8; 0],
}
pub type nvjpegJpegState_t = *mut nvjpegJpegState;
extern "C" {
    pub fn nvjpegGetProperty(
        type_: libraryPropertyType,
        value: *mut ::std::os::raw::c_int,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegGetCudartProperty(
        type_: libraryPropertyType,
        value: *mut ::std::os::raw::c_int,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegCreate(
        backend: nvjpegBackend_t,
        dev_allocator: *mut nvjpegDevAllocator_t,
        handle: *mut nvjpegHandle_t,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegCreateSimple(handle: *mut nvjpegHandle_t) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegCreateEx(
        backend: nvjpegBackend_t,
        dev_allocator: *mut nvjpegDevAllocator_t,
        pinned_allocator: *mut nvjpegPinnedAllocator_t,
        flags: ::std::os::raw::c_uint,
        handle: *mut nvjpegHandle_t,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegCreateExV2(
        backend: nvjpegBackend_t,
        dev_allocator: *mut nvjpegDevAllocatorV2_t,
        pinned_allocator: *mut nvjpegPinnedAllocatorV2_t,
        flags: ::std::os::raw::c_uint,
        handle: *mut nvjpegHandle_t,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegDestroy(handle: nvjpegHandle_t) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegSetDeviceMemoryPadding(padding: usize, handle: nvjpegHandle_t) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegGetDeviceMemoryPadding(
        padding: *mut usize,
        handle: nvjpegHandle_t,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegSetPinnedMemoryPadding(padding: usize, handle: nvjpegHandle_t) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegGetPinnedMemoryPadding(
        padding: *mut usize,
        handle: nvjpegHandle_t,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegGetHardwareDecoderInfo(
        handle: nvjpegHandle_t,
        num_engines: *mut ::std::os::raw::c_uint,
        num_cores_per_engine: *mut ::std::os::raw::c_uint,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegJpegStateCreate(
        handle: nvjpegHandle_t,
        jpeg_handle: *mut nvjpegJpegState_t,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegJpegStateDestroy(jpeg_handle: nvjpegJpegState_t) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegGetImageInfo(
        handle: nvjpegHandle_t,
        data: *const ::std::os::raw::c_uchar,
        length: usize,
        nComponents: *mut ::std::os::raw::c_int,
        subsampling: *mut nvjpegChromaSubsampling_t,
        widths: *mut ::std::os::raw::c_int,
        heights: *mut ::std::os::raw::c_int,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegDecode(
        handle: nvjpegHandle_t,
        jpeg_handle: nvjpegJpegState_t,
        data: *const ::std::os::raw::c_uchar,
        length: usize,
        output_format: nvjpegOutputFormat_t,
        destination: *mut nvjpegImage_t,
        stream: cudaStream_t,
    ) -> nvjpegStatus_t;
}
extern "C" {
    #[doc = "\n Batch decoding ///////////////\n"]
    pub fn nvjpegDecodeBatchedInitialize(
        handle: nvjpegHandle_t,
        jpeg_handle: nvjpegJpegState_t,
        batch_size: ::std::os::raw::c_int,
        max_cpu_threads: ::std::os::raw::c_int,
        output_format: nvjpegOutputFormat_t,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegDecodeBatched(
        handle: nvjpegHandle_t,
        jpeg_handle: nvjpegJpegState_t,
        data: *const *const ::std::os::raw::c_uchar,
        lengths: *const usize,
        destinations: *mut nvjpegImage_t,
        stream: cudaStream_t,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegDecodeBatchedPreAllocate(
        handle: nvjpegHandle_t,
        jpeg_handle: nvjpegJpegState_t,
        batch_size: ::std::os::raw::c_int,
        width: ::std::os::raw::c_int,
        height: ::std::os::raw::c_int,
        chroma_subsampling: nvjpegChromaSubsampling_t,
        output_format: nvjpegOutputFormat_t,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegDecodeBatchedParseJpegTables(
        handle: nvjpegHandle_t,
        jpeg_handle: nvjpegJpegState_t,
        data: *const ::std::os::raw::c_uchar,
        length: usize,
    ) -> nvjpegStatus_t;
}
#[doc = "                        Compression                      *"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nvjpegEncoderState {
    _unused: [u8; 0],
}
pub type nvjpegEncoderState_t = *mut nvjpegEncoderState;
extern "C" {
    pub fn nvjpegEncoderStateCreate(
        handle: nvjpegHandle_t,
        encoder_state: *mut nvjpegEncoderState_t,
        stream: cudaStream_t,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegEncoderStateDestroy(encoder_state: nvjpegEncoderState_t) -> nvjpegStatus_t;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nvjpegEncoderParams {
    _unused: [u8; 0],
}
pub type nvjpegEncoderParams_t = *mut nvjpegEncoderParams;
extern "C" {
    pub fn nvjpegEncoderParamsCreate(
        handle: nvjpegHandle_t,
        encoder_params: *mut nvjpegEncoderParams_t,
        stream: cudaStream_t,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegEncoderParamsDestroy(encoder_params: nvjpegEncoderParams_t) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegEncoderParamsSetQuality(
        encoder_params: nvjpegEncoderParams_t,
        quality: ::std::os::raw::c_int,
        stream: cudaStream_t,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegEncoderParamsSetEncoding(
        encoder_params: nvjpegEncoderParams_t,
        etype: nvjpegJpegEncoding_t,
        stream: cudaStream_t,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegEncoderParamsSetOptimizedHuffman(
        encoder_params: nvjpegEncoderParams_t,
        optimized: ::std::os::raw::c_int,
        stream: cudaStream_t,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegEncoderParamsSetSamplingFactors(
        encoder_params: nvjpegEncoderParams_t,
        chroma_subsampling: nvjpegChromaSubsampling_t,
        stream: cudaStream_t,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegEncodeGetBufferSize(
        handle: nvjpegHandle_t,
        encoder_params: nvjpegEncoderParams_t,
        image_width: ::std::os::raw::c_int,
        image_height: ::std::os::raw::c_int,
        max_stream_length: *mut usize,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegEncodeYUV(
        handle: nvjpegHandle_t,
        encoder_state: nvjpegEncoderState_t,
        encoder_params: nvjpegEncoderParams_t,
        source: *const nvjpegImage_t,
        chroma_subsampling: nvjpegChromaSubsampling_t,
        image_width: ::std::os::raw::c_int,
        image_height: ::std::os::raw::c_int,
        stream: cudaStream_t,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegEncodeImage(
        handle: nvjpegHandle_t,
        encoder_state: nvjpegEncoderState_t,
        encoder_params: nvjpegEncoderParams_t,
        source: *const nvjpegImage_t,
        input_format: nvjpegInputFormat_t,
        image_width: ::std::os::raw::c_int,
        image_height: ::std::os::raw::c_int,
        stream: cudaStream_t,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegEncodeRetrieveBitstreamDevice(
        handle: nvjpegHandle_t,
        encoder_state: nvjpegEncoderState_t,
        data: *mut ::std::os::raw::c_uchar,
        length: *mut usize,
        stream: cudaStream_t,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegEncodeRetrieveBitstream(
        handle: nvjpegHandle_t,
        encoder_state: nvjpegEncoderState_t,
        data: *mut ::std::os::raw::c_uchar,
        length: *mut usize,
        stream: cudaStream_t,
    ) -> nvjpegStatus_t;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nvjpegBufferPinned {
    _unused: [u8; 0],
}
pub type nvjpegBufferPinned_t = *mut nvjpegBufferPinned;
extern "C" {
    pub fn nvjpegBufferPinnedCreate(
        handle: nvjpegHandle_t,
        pinned_allocator: *mut nvjpegPinnedAllocator_t,
        buffer: *mut nvjpegBufferPinned_t,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegBufferPinnedCreateV2(
        handle: nvjpegHandle_t,
        pinned_allocator: *mut nvjpegPinnedAllocatorV2_t,
        buffer: *mut nvjpegBufferPinned_t,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegBufferPinnedDestroy(buffer: nvjpegBufferPinned_t) -> nvjpegStatus_t;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nvjpegBufferDevice {
    _unused: [u8; 0],
}
pub type nvjpegBufferDevice_t = *mut nvjpegBufferDevice;
extern "C" {
    pub fn nvjpegBufferDeviceCreate(
        handle: nvjpegHandle_t,
        device_allocator: *mut nvjpegDevAllocator_t,
        buffer: *mut nvjpegBufferDevice_t,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegBufferDeviceCreateV2(
        handle: nvjpegHandle_t,
        device_allocator: *mut nvjpegDevAllocatorV2_t,
        buffer: *mut nvjpegBufferDevice_t,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegBufferDeviceDestroy(buffer: nvjpegBufferDevice_t) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegBufferPinnedRetrieve(
        buffer: nvjpegBufferPinned_t,
        size: *mut usize,
        ptr: *mut *mut ::std::os::raw::c_void,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegBufferDeviceRetrieve(
        buffer: nvjpegBufferDevice_t,
        size: *mut usize,
        ptr: *mut *mut ::std::os::raw::c_void,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegStateAttachPinnedBuffer(
        decoder_state: nvjpegJpegState_t,
        pinned_buffer: nvjpegBufferPinned_t,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegStateAttachDeviceBuffer(
        decoder_state: nvjpegJpegState_t,
        device_buffer: nvjpegBufferDevice_t,
    ) -> nvjpegStatus_t;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nvjpegJpegStream {
    _unused: [u8; 0],
}
pub type nvjpegJpegStream_t = *mut nvjpegJpegStream;
extern "C" {
    pub fn nvjpegJpegStreamCreate(
        handle: nvjpegHandle_t,
        jpeg_stream: *mut nvjpegJpegStream_t,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegJpegStreamDestroy(jpeg_stream: nvjpegJpegStream_t) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegJpegStreamParse(
        handle: nvjpegHandle_t,
        data: *const ::std::os::raw::c_uchar,
        length: usize,
        save_metadata: ::std::os::raw::c_int,
        save_stream: ::std::os::raw::c_int,
        jpeg_stream: nvjpegJpegStream_t,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegJpegStreamParseHeader(
        handle: nvjpegHandle_t,
        data: *const ::std::os::raw::c_uchar,
        length: usize,
        jpeg_stream: nvjpegJpegStream_t,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegJpegStreamParseTables(
        handle: nvjpegHandle_t,
        data: *const ::std::os::raw::c_uchar,
        length: usize,
        jpeg_stream: nvjpegJpegStream_t,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegJpegStreamGetJpegEncoding(
        jpeg_stream: nvjpegJpegStream_t,
        jpeg_encoding: *mut nvjpegJpegEncoding_t,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegJpegStreamGetFrameDimensions(
        jpeg_stream: nvjpegJpegStream_t,
        width: *mut ::std::os::raw::c_uint,
        height: *mut ::std::os::raw::c_uint,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegJpegStreamGetComponentsNum(
        jpeg_stream: nvjpegJpegStream_t,
        components_num: *mut ::std::os::raw::c_uint,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegJpegStreamGetComponentDimensions(
        jpeg_stream: nvjpegJpegStream_t,
        component: ::std::os::raw::c_uint,
        width: *mut ::std::os::raw::c_uint,
        height: *mut ::std::os::raw::c_uint,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegJpegStreamGetExifOrientation(
        jpeg_stream: nvjpegJpegStream_t,
        orientation_flag: *mut nvjpegExifOrientation_t,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegJpegStreamGetChromaSubsampling(
        jpeg_stream: nvjpegJpegStream_t,
        chroma_subsampling: *mut nvjpegChromaSubsampling_t,
    ) -> nvjpegStatus_t;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nvjpegDecodeParams {
    _unused: [u8; 0],
}
pub type nvjpegDecodeParams_t = *mut nvjpegDecodeParams;
extern "C" {
    pub fn nvjpegDecodeParamsCreate(
        handle: nvjpegHandle_t,
        decode_params: *mut nvjpegDecodeParams_t,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegDecodeParamsDestroy(decode_params: nvjpegDecodeParams_t) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegDecodeParamsSetOutputFormat(
        decode_params: nvjpegDecodeParams_t,
        output_format: nvjpegOutputFormat_t,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegDecodeParamsSetROI(
        decode_params: nvjpegDecodeParams_t,
        offset_x: ::std::os::raw::c_int,
        offset_y: ::std::os::raw::c_int,
        roi_width: ::std::os::raw::c_int,
        roi_height: ::std::os::raw::c_int,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegDecodeParamsSetAllowCMYK(
        decode_params: nvjpegDecodeParams_t,
        allow_cmyk: ::std::os::raw::c_int,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegDecodeParamsSetScaleFactor(
        decode_params: nvjpegDecodeParams_t,
        scale_factor: nvjpegScaleFactor_t,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegDecodeParamsSetExifOrientation(
        decode_params: nvjpegDecodeParams_t,
        orientation: nvjpegExifOrientation_t,
    ) -> nvjpegStatus_t;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nvjpegJpegDecoder {
    _unused: [u8; 0],
}
pub type nvjpegJpegDecoder_t = *mut nvjpegJpegDecoder;
extern "C" {
    pub fn nvjpegDecoderCreate(
        nvjpeg_handle: nvjpegHandle_t,
        implementation: nvjpegBackend_t,
        decoder_handle: *mut nvjpegJpegDecoder_t,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegDecoderDestroy(decoder_handle: nvjpegJpegDecoder_t) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegDecoderJpegSupported(
        decoder_handle: nvjpegJpegDecoder_t,
        jpeg_stream: nvjpegJpegStream_t,
        decode_params: nvjpegDecodeParams_t,
        is_supported: *mut ::std::os::raw::c_int,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegDecodeBatchedSupported(
        handle: nvjpegHandle_t,
        jpeg_stream: nvjpegJpegStream_t,
        is_supported: *mut ::std::os::raw::c_int,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegDecodeBatchedSupportedEx(
        handle: nvjpegHandle_t,
        jpeg_stream: nvjpegJpegStream_t,
        decode_params: nvjpegDecodeParams_t,
        is_supported: *mut ::std::os::raw::c_int,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegDecoderStateCreate(
        nvjpeg_handle: nvjpegHandle_t,
        decoder_handle: nvjpegJpegDecoder_t,
        decoder_state: *mut nvjpegJpegState_t,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegDecodeJpeg(
        handle: nvjpegHandle_t,
        decoder: nvjpegJpegDecoder_t,
        decoder_state: nvjpegJpegState_t,
        jpeg_bitstream: nvjpegJpegStream_t,
        destination: *mut nvjpegImage_t,
        decode_params: nvjpegDecodeParams_t,
        stream: cudaStream_t,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegDecodeJpegHost(
        handle: nvjpegHandle_t,
        decoder: nvjpegJpegDecoder_t,
        decoder_state: nvjpegJpegState_t,
        decode_params: nvjpegDecodeParams_t,
        jpeg_stream: nvjpegJpegStream_t,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegDecodeJpegTransferToDevice(
        handle: nvjpegHandle_t,
        decoder: nvjpegJpegDecoder_t,
        decoder_state: nvjpegJpegState_t,
        jpeg_stream: nvjpegJpegStream_t,
        stream: cudaStream_t,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegDecodeJpegDevice(
        handle: nvjpegHandle_t,
        decoder: nvjpegJpegDecoder_t,
        decoder_state: nvjpegJpegState_t,
        destination: *mut nvjpegImage_t,
        stream: cudaStream_t,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegDecodeBatchedEx(
        handle: nvjpegHandle_t,
        jpeg_handle: nvjpegJpegState_t,
        data: *const *const ::std::os::raw::c_uchar,
        lengths: *const usize,
        destinations: *mut nvjpegImage_t,
        decode_params: *mut nvjpegDecodeParams_t,
        stream: cudaStream_t,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegEncoderParamsCopyMetadata(
        encoder_state: nvjpegEncoderState_t,
        encode_params: nvjpegEncoderParams_t,
        jpeg_stream: nvjpegJpegStream_t,
        stream: cudaStream_t,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegEncoderParamsCopyQuantizationTables(
        encode_params: nvjpegEncoderParams_t,
        jpeg_stream: nvjpegJpegStream_t,
        stream: cudaStream_t,
    ) -> nvjpegStatus_t;
}
extern "C" {
    pub fn nvjpegEncoderParamsCopyHuffmanTables(
        encoder_state: nvjpegEncoderState_t,
        encode_params: nvjpegEncoderParams_t,
        jpeg_stream: nvjpegJpegStream_t,
        stream: cudaStream_t,
    ) -> nvjpegStatus_t;
}