1pub const NVJPEG_MAX_COMPONENT: u32 = 4;
4pub const NVJPEG_VER_MAJOR: u32 = 11;
5pub const NVJPEG_VER_MINOR: u32 = 9;
6pub const NVJPEG_VER_PATCH: u32 = 0;
7pub const NVJPEG_VER_BUILD: u32 = 86;
8pub const NVJPEG_FLAGS_DEFAULT: u32 = 0;
9pub const NVJPEG_FLAGS_HW_DECODE_NO_PIPELINE: u32 = 1;
10pub const NVJPEG_FLAGS_ENABLE_MEMORY_POOLS: u32 = 2;
11pub const NVJPEG_FLAGS_BITSTREAM_STRICT: u32 = 4;
12#[repr(C)]
13#[derive(Debug, Copy, Clone)]
14pub struct CUstream_st {
15 _unused: [u8; 0],
16}
17pub type cudaStream_t = *mut CUstream_st;
18pub const libraryPropertyType_t_MAJOR_VERSION: libraryPropertyType_t = 0;
19pub const libraryPropertyType_t_MINOR_VERSION: libraryPropertyType_t = 1;
20pub const libraryPropertyType_t_PATCH_LEVEL: libraryPropertyType_t = 2;
21pub type libraryPropertyType_t = ::std::os::raw::c_uint;
22use std::ptr::null_mut;
23
24pub use self::libraryPropertyType_t as libraryPropertyType;
25pub const nvjpegStatus_t_NVJPEG_STATUS_SUCCESS: nvjpegStatus_t = 0;
26pub const nvjpegStatus_t_NVJPEG_STATUS_NOT_INITIALIZED: nvjpegStatus_t = 1;
27pub const nvjpegStatus_t_NVJPEG_STATUS_INVALID_PARAMETER: nvjpegStatus_t = 2;
28pub const nvjpegStatus_t_NVJPEG_STATUS_BAD_JPEG: nvjpegStatus_t = 3;
29pub const nvjpegStatus_t_NVJPEG_STATUS_JPEG_NOT_SUPPORTED: nvjpegStatus_t = 4;
30pub const nvjpegStatus_t_NVJPEG_STATUS_ALLOCATOR_FAILURE: nvjpegStatus_t = 5;
31pub const nvjpegStatus_t_NVJPEG_STATUS_EXECUTION_FAILED: nvjpegStatus_t = 6;
32pub const nvjpegStatus_t_NVJPEG_STATUS_ARCH_MISMATCH: nvjpegStatus_t = 7;
33pub const nvjpegStatus_t_NVJPEG_STATUS_INTERNAL_ERROR: nvjpegStatus_t = 8;
34pub const nvjpegStatus_t_NVJPEG_STATUS_IMPLEMENTATION_NOT_SUPPORTED: nvjpegStatus_t = 9;
35pub const nvjpegStatus_t_NVJPEG_STATUS_INCOMPLETE_BITSTREAM: nvjpegStatus_t = 10;
36pub type nvjpegStatus_t = ::std::os::raw::c_uint;
37pub const nvjpegExifOrientation_NVJPEG_ORIENTATION_UNKNOWN: nvjpegExifOrientation = 0;
38pub const nvjpegExifOrientation_NVJPEG_ORIENTATION_NORMAL: nvjpegExifOrientation = 1;
39pub const nvjpegExifOrientation_NVJPEG_ORIENTATION_FLIP_HORIZONTAL: nvjpegExifOrientation = 2;
40pub const nvjpegExifOrientation_NVJPEG_ORIENTATION_ROTATE_180: nvjpegExifOrientation = 3;
41pub const nvjpegExifOrientation_NVJPEG_ORIENTATION_FLIP_VERTICAL: nvjpegExifOrientation = 4;
42pub const nvjpegExifOrientation_NVJPEG_ORIENTATION_TRANSPOSE: nvjpegExifOrientation = 5;
43pub const nvjpegExifOrientation_NVJPEG_ORIENTATION_ROTATE_90: nvjpegExifOrientation = 6;
44pub const nvjpegExifOrientation_NVJPEG_ORIENTATION_TRANSVERSE: nvjpegExifOrientation = 7;
45pub const nvjpegExifOrientation_NVJPEG_ORIENTATION_ROTATE_270: nvjpegExifOrientation = 8;
46pub type nvjpegExifOrientation = ::std::os::raw::c_uint;
47pub use self::nvjpegExifOrientation as nvjpegExifOrientation_t;
48pub const nvjpegChromaSubsampling_t_NVJPEG_CSS_444: nvjpegChromaSubsampling_t = 0;
49pub const nvjpegChromaSubsampling_t_NVJPEG_CSS_422: nvjpegChromaSubsampling_t = 1;
50pub const nvjpegChromaSubsampling_t_NVJPEG_CSS_420: nvjpegChromaSubsampling_t = 2;
51pub const nvjpegChromaSubsampling_t_NVJPEG_CSS_440: nvjpegChromaSubsampling_t = 3;
52pub const nvjpegChromaSubsampling_t_NVJPEG_CSS_411: nvjpegChromaSubsampling_t = 4;
53pub const nvjpegChromaSubsampling_t_NVJPEG_CSS_410: nvjpegChromaSubsampling_t = 5;
54pub const nvjpegChromaSubsampling_t_NVJPEG_CSS_GRAY: nvjpegChromaSubsampling_t = 6;
55pub const nvjpegChromaSubsampling_t_NVJPEG_CSS_410V: nvjpegChromaSubsampling_t = 7;
56pub const nvjpegChromaSubsampling_t_NVJPEG_CSS_UNKNOWN: nvjpegChromaSubsampling_t = -1;
57pub type nvjpegChromaSubsampling_t = ::std::os::raw::c_int;
58pub const nvjpegOutputFormat_t_NVJPEG_OUTPUT_UNCHANGED: nvjpegOutputFormat_t = 0;
59pub const nvjpegOutputFormat_t_NVJPEG_OUTPUT_YUV: nvjpegOutputFormat_t = 1;
60pub const nvjpegOutputFormat_t_NVJPEG_OUTPUT_Y: nvjpegOutputFormat_t = 2;
61pub const nvjpegOutputFormat_t_NVJPEG_OUTPUT_RGB: nvjpegOutputFormat_t = 3;
62pub const nvjpegOutputFormat_t_NVJPEG_OUTPUT_BGR: nvjpegOutputFormat_t = 4;
63pub const nvjpegOutputFormat_t_NVJPEG_OUTPUT_RGBI: nvjpegOutputFormat_t = 5;
64pub const nvjpegOutputFormat_t_NVJPEG_OUTPUT_BGRI: nvjpegOutputFormat_t = 6;
65pub const nvjpegOutputFormat_t_NVJPEG_OUTPUT_FORMAT_MAX: nvjpegOutputFormat_t = 6;
66pub type nvjpegOutputFormat_t = ::std::os::raw::c_uint;
67pub const nvjpegInputFormat_t_NVJPEG_INPUT_RGB: nvjpegInputFormat_t = 3;
68pub const nvjpegInputFormat_t_NVJPEG_INPUT_BGR: nvjpegInputFormat_t = 4;
69pub const nvjpegInputFormat_t_NVJPEG_INPUT_RGBI: nvjpegInputFormat_t = 5;
70pub const nvjpegInputFormat_t_NVJPEG_INPUT_BGRI: nvjpegInputFormat_t = 6;
71pub type nvjpegInputFormat_t = ::std::os::raw::c_uint;
72pub const nvjpegBackend_t_NVJPEG_BACKEND_DEFAULT: nvjpegBackend_t = 0;
73pub const nvjpegBackend_t_NVJPEG_BACKEND_HYBRID: nvjpegBackend_t = 1;
74pub const nvjpegBackend_t_NVJPEG_BACKEND_GPU_HYBRID: nvjpegBackend_t = 2;
75pub const nvjpegBackend_t_NVJPEG_BACKEND_HARDWARE: nvjpegBackend_t = 3;
76pub const nvjpegBackend_t_NVJPEG_BACKEND_GPU_HYBRID_DEVICE: nvjpegBackend_t = 4;
77pub const nvjpegBackend_t_NVJPEG_BACKEND_HARDWARE_DEVICE: nvjpegBackend_t = 5;
78pub type nvjpegBackend_t = ::std::os::raw::c_uint;
79pub const nvjpegJpegEncoding_t_NVJPEG_ENCODING_UNKNOWN: nvjpegJpegEncoding_t = 0;
80pub const nvjpegJpegEncoding_t_NVJPEG_ENCODING_BASELINE_DCT: nvjpegJpegEncoding_t = 192;
81pub const nvjpegJpegEncoding_t_NVJPEG_ENCODING_EXTENDED_SEQUENTIAL_DCT_HUFFMAN:
82 nvjpegJpegEncoding_t = 193;
83pub const nvjpegJpegEncoding_t_NVJPEG_ENCODING_PROGRESSIVE_DCT_HUFFMAN: nvjpegJpegEncoding_t = 194;
84pub type nvjpegJpegEncoding_t = ::std::os::raw::c_uint;
85pub const nvjpegScaleFactor_t_NVJPEG_SCALE_NONE: nvjpegScaleFactor_t = 0;
86pub const nvjpegScaleFactor_t_NVJPEG_SCALE_1_BY_2: nvjpegScaleFactor_t = 1;
87pub const nvjpegScaleFactor_t_NVJPEG_SCALE_1_BY_4: nvjpegScaleFactor_t = 2;
88pub const nvjpegScaleFactor_t_NVJPEG_SCALE_1_BY_8: nvjpegScaleFactor_t = 3;
89pub type nvjpegScaleFactor_t = ::std::os::raw::c_uint;
90#[repr(C)]
91#[derive(Debug, Copy, Clone)]
92pub struct nvjpegImage_t {
93 pub channel: [*mut ::std::os::raw::c_uchar; 4usize],
94 pub pitch: [usize; 4usize],
95}
96
97impl Default for nvjpegImage_t {
98 #[inline]
99 fn default() -> Self {
100 Self::new()
101 }
102}
103
104impl nvjpegImage_t {
105 pub fn new() -> Self {
106 nvjpegImage_t {
107 channel: [null_mut(); 4],
108 pitch: [0; 4],
109 }
110 }
111}
112
113#[test]
114fn bindgen_test_layout_nvjpegImage_t() {
115 const UNINIT: ::std::mem::MaybeUninit<nvjpegImage_t> = ::std::mem::MaybeUninit::uninit();
116 let ptr = UNINIT.as_ptr();
117 assert_eq!(
118 ::std::mem::size_of::<nvjpegImage_t>(),
119 64usize,
120 concat!("Size of: ", stringify!(nvjpegImage_t))
121 );
122 assert_eq!(
123 ::std::mem::align_of::<nvjpegImage_t>(),
124 8usize,
125 concat!("Alignment of ", stringify!(nvjpegImage_t))
126 );
127 assert_eq!(
128 unsafe { ::std::ptr::addr_of!((*ptr).channel) as usize - ptr as usize },
129 0usize,
130 concat!(
131 "Offset of field: ",
132 stringify!(nvjpegImage_t),
133 "::",
134 stringify!(channel)
135 )
136 );
137 assert_eq!(
138 unsafe { ::std::ptr::addr_of!((*ptr).pitch) as usize - ptr as usize },
139 32usize,
140 concat!(
141 "Offset of field: ",
142 stringify!(nvjpegImage_t),
143 "::",
144 stringify!(pitch)
145 )
146 );
147}
148pub type tDevMalloc = ::std::option::Option<
149 unsafe extern "C" fn(
150 arg1: *mut *mut ::std::os::raw::c_void,
151 arg2: usize,
152 ) -> ::std::os::raw::c_int,
153>;
154pub type tDevFree = ::std::option::Option<
155 unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int,
156>;
157pub type tPinnedMalloc = ::std::option::Option<
158 unsafe extern "C" fn(
159 arg1: *mut *mut ::std::os::raw::c_void,
160 arg2: usize,
161 flags: ::std::os::raw::c_uint,
162 ) -> ::std::os::raw::c_int,
163>;
164pub type tPinnedFree = ::std::option::Option<
165 unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int,
166>;
167#[repr(C)]
168#[derive(Debug, Copy, Clone)]
169pub struct nvjpegDevAllocator_t {
170 pub dev_malloc: tDevMalloc,
171 pub dev_free: tDevFree,
172}
173#[test]
174fn bindgen_test_layout_nvjpegDevAllocator_t() {
175 const UNINIT: ::std::mem::MaybeUninit<nvjpegDevAllocator_t> = ::std::mem::MaybeUninit::uninit();
176 let ptr = UNINIT.as_ptr();
177 assert_eq!(
178 ::std::mem::size_of::<nvjpegDevAllocator_t>(),
179 16usize,
180 concat!("Size of: ", stringify!(nvjpegDevAllocator_t))
181 );
182 assert_eq!(
183 ::std::mem::align_of::<nvjpegDevAllocator_t>(),
184 8usize,
185 concat!("Alignment of ", stringify!(nvjpegDevAllocator_t))
186 );
187 assert_eq!(
188 unsafe { ::std::ptr::addr_of!((*ptr).dev_malloc) as usize - ptr as usize },
189 0usize,
190 concat!(
191 "Offset of field: ",
192 stringify!(nvjpegDevAllocator_t),
193 "::",
194 stringify!(dev_malloc)
195 )
196 );
197 assert_eq!(
198 unsafe { ::std::ptr::addr_of!((*ptr).dev_free) as usize - ptr as usize },
199 8usize,
200 concat!(
201 "Offset of field: ",
202 stringify!(nvjpegDevAllocator_t),
203 "::",
204 stringify!(dev_free)
205 )
206 );
207}
208#[repr(C)]
209#[derive(Debug, Copy, Clone)]
210pub struct nvjpegPinnedAllocator_t {
211 pub pinned_malloc: tPinnedMalloc,
212 pub pinned_free: tPinnedFree,
213}
214#[test]
215fn bindgen_test_layout_nvjpegPinnedAllocator_t() {
216 const UNINIT: ::std::mem::MaybeUninit<nvjpegPinnedAllocator_t> =
217 ::std::mem::MaybeUninit::uninit();
218 let ptr = UNINIT.as_ptr();
219 assert_eq!(
220 ::std::mem::size_of::<nvjpegPinnedAllocator_t>(),
221 16usize,
222 concat!("Size of: ", stringify!(nvjpegPinnedAllocator_t))
223 );
224 assert_eq!(
225 ::std::mem::align_of::<nvjpegPinnedAllocator_t>(),
226 8usize,
227 concat!("Alignment of ", stringify!(nvjpegPinnedAllocator_t))
228 );
229 assert_eq!(
230 unsafe { ::std::ptr::addr_of!((*ptr).pinned_malloc) as usize - ptr as usize },
231 0usize,
232 concat!(
233 "Offset of field: ",
234 stringify!(nvjpegPinnedAllocator_t),
235 "::",
236 stringify!(pinned_malloc)
237 )
238 );
239 assert_eq!(
240 unsafe { ::std::ptr::addr_of!((*ptr).pinned_free) as usize - ptr as usize },
241 8usize,
242 concat!(
243 "Offset of field: ",
244 stringify!(nvjpegPinnedAllocator_t),
245 "::",
246 stringify!(pinned_free)
247 )
248 );
249}
250pub type tDevMallocV2 = ::std::option::Option<
251 unsafe extern "C" fn(
252 ctx: *mut ::std::os::raw::c_void,
253 ptr: *mut *mut ::std::os::raw::c_void,
254 size: usize,
255 stream: cudaStream_t,
256 ) -> ::std::os::raw::c_int,
257>;
258pub type tDevFreeV2 = ::std::option::Option<
259 unsafe extern "C" fn(
260 ctx: *mut ::std::os::raw::c_void,
261 ptr: *mut ::std::os::raw::c_void,
262 size: usize,
263 stream: cudaStream_t,
264 ) -> ::std::os::raw::c_int,
265>;
266pub type tPinnedMallocV2 = ::std::option::Option<
267 unsafe extern "C" fn(
268 ctx: *mut ::std::os::raw::c_void,
269 ptr: *mut *mut ::std::os::raw::c_void,
270 size: usize,
271 stream: cudaStream_t,
272 ) -> ::std::os::raw::c_int,
273>;
274pub type tPinnedFreeV2 = ::std::option::Option<
275 unsafe extern "C" fn(
276 ctx: *mut ::std::os::raw::c_void,
277 ptr: *mut ::std::os::raw::c_void,
278 size: usize,
279 stream: cudaStream_t,
280 ) -> ::std::os::raw::c_int,
281>;
282#[repr(C)]
283#[derive(Debug, Copy, Clone)]
284pub struct nvjpegDevAllocatorV2_t {
285 pub dev_malloc: tDevMallocV2,
286 pub dev_free: tDevFreeV2,
287 pub dev_ctx: *mut ::std::os::raw::c_void,
288}
289#[test]
290fn bindgen_test_layout_nvjpegDevAllocatorV2_t() {
291 const UNINIT: ::std::mem::MaybeUninit<nvjpegDevAllocatorV2_t> =
292 ::std::mem::MaybeUninit::uninit();
293 let ptr = UNINIT.as_ptr();
294 assert_eq!(
295 ::std::mem::size_of::<nvjpegDevAllocatorV2_t>(),
296 24usize,
297 concat!("Size of: ", stringify!(nvjpegDevAllocatorV2_t))
298 );
299 assert_eq!(
300 ::std::mem::align_of::<nvjpegDevAllocatorV2_t>(),
301 8usize,
302 concat!("Alignment of ", stringify!(nvjpegDevAllocatorV2_t))
303 );
304 assert_eq!(
305 unsafe { ::std::ptr::addr_of!((*ptr).dev_malloc) as usize - ptr as usize },
306 0usize,
307 concat!(
308 "Offset of field: ",
309 stringify!(nvjpegDevAllocatorV2_t),
310 "::",
311 stringify!(dev_malloc)
312 )
313 );
314 assert_eq!(
315 unsafe { ::std::ptr::addr_of!((*ptr).dev_free) as usize - ptr as usize },
316 8usize,
317 concat!(
318 "Offset of field: ",
319 stringify!(nvjpegDevAllocatorV2_t),
320 "::",
321 stringify!(dev_free)
322 )
323 );
324 assert_eq!(
325 unsafe { ::std::ptr::addr_of!((*ptr).dev_ctx) as usize - ptr as usize },
326 16usize,
327 concat!(
328 "Offset of field: ",
329 stringify!(nvjpegDevAllocatorV2_t),
330 "::",
331 stringify!(dev_ctx)
332 )
333 );
334}
335#[repr(C)]
336#[derive(Debug, Copy, Clone)]
337pub struct nvjpegPinnedAllocatorV2_t {
338 pub pinned_malloc: tPinnedMallocV2,
339 pub pinned_free: tPinnedFreeV2,
340 pub pinned_ctx: *mut ::std::os::raw::c_void,
341}
342#[test]
343fn bindgen_test_layout_nvjpegPinnedAllocatorV2_t() {
344 const UNINIT: ::std::mem::MaybeUninit<nvjpegPinnedAllocatorV2_t> =
345 ::std::mem::MaybeUninit::uninit();
346 let ptr = UNINIT.as_ptr();
347 assert_eq!(
348 ::std::mem::size_of::<nvjpegPinnedAllocatorV2_t>(),
349 24usize,
350 concat!("Size of: ", stringify!(nvjpegPinnedAllocatorV2_t))
351 );
352 assert_eq!(
353 ::std::mem::align_of::<nvjpegPinnedAllocatorV2_t>(),
354 8usize,
355 concat!("Alignment of ", stringify!(nvjpegPinnedAllocatorV2_t))
356 );
357 assert_eq!(
358 unsafe { ::std::ptr::addr_of!((*ptr).pinned_malloc) as usize - ptr as usize },
359 0usize,
360 concat!(
361 "Offset of field: ",
362 stringify!(nvjpegPinnedAllocatorV2_t),
363 "::",
364 stringify!(pinned_malloc)
365 )
366 );
367 assert_eq!(
368 unsafe { ::std::ptr::addr_of!((*ptr).pinned_free) as usize - ptr as usize },
369 8usize,
370 concat!(
371 "Offset of field: ",
372 stringify!(nvjpegPinnedAllocatorV2_t),
373 "::",
374 stringify!(pinned_free)
375 )
376 );
377 assert_eq!(
378 unsafe { ::std::ptr::addr_of!((*ptr).pinned_ctx) as usize - ptr as usize },
379 16usize,
380 concat!(
381 "Offset of field: ",
382 stringify!(nvjpegPinnedAllocatorV2_t),
383 "::",
384 stringify!(pinned_ctx)
385 )
386 );
387}
388#[repr(C)]
389#[derive(Debug, Copy, Clone)]
390pub struct nvjpegHandle {
391 _unused: [u8; 0],
392}
393pub type nvjpegHandle_t = *mut nvjpegHandle;
394#[repr(C)]
395#[derive(Debug, Copy, Clone)]
396pub struct nvjpegJpegState {
397 _unused: [u8; 0],
398}
399pub type nvjpegJpegState_t = *mut nvjpegJpegState;
400extern "C" {
401 pub fn nvjpegGetProperty(
402 type_: libraryPropertyType,
403 value: *mut ::std::os::raw::c_int,
404 ) -> nvjpegStatus_t;
405}
406extern "C" {
407 pub fn nvjpegGetCudartProperty(
408 type_: libraryPropertyType,
409 value: *mut ::std::os::raw::c_int,
410 ) -> nvjpegStatus_t;
411}
412extern "C" {
413 pub fn nvjpegCreate(
414 backend: nvjpegBackend_t,
415 dev_allocator: *mut nvjpegDevAllocator_t,
416 handle: *mut nvjpegHandle_t,
417 ) -> nvjpegStatus_t;
418}
419extern "C" {
420 pub fn nvjpegCreateSimple(handle: *mut nvjpegHandle_t) -> nvjpegStatus_t;
421}
422extern "C" {
423 pub fn nvjpegCreateEx(
424 backend: nvjpegBackend_t,
425 dev_allocator: *mut nvjpegDevAllocator_t,
426 pinned_allocator: *mut nvjpegPinnedAllocator_t,
427 flags: ::std::os::raw::c_uint,
428 handle: *mut nvjpegHandle_t,
429 ) -> nvjpegStatus_t;
430}
431extern "C" {
432 pub fn nvjpegCreateExV2(
433 backend: nvjpegBackend_t,
434 dev_allocator: *mut nvjpegDevAllocatorV2_t,
435 pinned_allocator: *mut nvjpegPinnedAllocatorV2_t,
436 flags: ::std::os::raw::c_uint,
437 handle: *mut nvjpegHandle_t,
438 ) -> nvjpegStatus_t;
439}
440extern "C" {
441 pub fn nvjpegDestroy(handle: nvjpegHandle_t) -> nvjpegStatus_t;
442}
443extern "C" {
444 pub fn nvjpegSetDeviceMemoryPadding(padding: usize, handle: nvjpegHandle_t) -> nvjpegStatus_t;
445}
446extern "C" {
447 pub fn nvjpegGetDeviceMemoryPadding(
448 padding: *mut usize,
449 handle: nvjpegHandle_t,
450 ) -> nvjpegStatus_t;
451}
452extern "C" {
453 pub fn nvjpegSetPinnedMemoryPadding(padding: usize, handle: nvjpegHandle_t) -> nvjpegStatus_t;
454}
455extern "C" {
456 pub fn nvjpegGetPinnedMemoryPadding(
457 padding: *mut usize,
458 handle: nvjpegHandle_t,
459 ) -> nvjpegStatus_t;
460}
461extern "C" {
462 pub fn nvjpegGetHardwareDecoderInfo(
463 handle: nvjpegHandle_t,
464 num_engines: *mut ::std::os::raw::c_uint,
465 num_cores_per_engine: *mut ::std::os::raw::c_uint,
466 ) -> nvjpegStatus_t;
467}
468extern "C" {
469 pub fn nvjpegJpegStateCreate(
470 handle: nvjpegHandle_t,
471 jpeg_handle: *mut nvjpegJpegState_t,
472 ) -> nvjpegStatus_t;
473}
474extern "C" {
475 pub fn nvjpegJpegStateDestroy(jpeg_handle: nvjpegJpegState_t) -> nvjpegStatus_t;
476}
477extern "C" {
478 pub fn nvjpegGetImageInfo(
479 handle: nvjpegHandle_t,
480 data: *const ::std::os::raw::c_uchar,
481 length: usize,
482 nComponents: *mut ::std::os::raw::c_int,
483 subsampling: *mut nvjpegChromaSubsampling_t,
484 widths: *mut ::std::os::raw::c_int,
485 heights: *mut ::std::os::raw::c_int,
486 ) -> nvjpegStatus_t;
487}
488extern "C" {
489 pub fn nvjpegDecode(
490 handle: nvjpegHandle_t,
491 jpeg_handle: nvjpegJpegState_t,
492 data: *const ::std::os::raw::c_uchar,
493 length: usize,
494 output_format: nvjpegOutputFormat_t,
495 destination: *mut nvjpegImage_t,
496 stream: cudaStream_t,
497 ) -> nvjpegStatus_t;
498}
499extern "C" {
500 #[doc = "\n Batch decoding ///////////////\n"]
501 pub fn nvjpegDecodeBatchedInitialize(
502 handle: nvjpegHandle_t,
503 jpeg_handle: nvjpegJpegState_t,
504 batch_size: ::std::os::raw::c_int,
505 max_cpu_threads: ::std::os::raw::c_int,
506 output_format: nvjpegOutputFormat_t,
507 ) -> nvjpegStatus_t;
508}
509extern "C" {
510 pub fn nvjpegDecodeBatched(
511 handle: nvjpegHandle_t,
512 jpeg_handle: nvjpegJpegState_t,
513 data: *const *const ::std::os::raw::c_uchar,
514 lengths: *const usize,
515 destinations: *mut nvjpegImage_t,
516 stream: cudaStream_t,
517 ) -> nvjpegStatus_t;
518}
519extern "C" {
520 pub fn nvjpegDecodeBatchedPreAllocate(
521 handle: nvjpegHandle_t,
522 jpeg_handle: nvjpegJpegState_t,
523 batch_size: ::std::os::raw::c_int,
524 width: ::std::os::raw::c_int,
525 height: ::std::os::raw::c_int,
526 chroma_subsampling: nvjpegChromaSubsampling_t,
527 output_format: nvjpegOutputFormat_t,
528 ) -> nvjpegStatus_t;
529}
530extern "C" {
531 pub fn nvjpegDecodeBatchedParseJpegTables(
532 handle: nvjpegHandle_t,
533 jpeg_handle: nvjpegJpegState_t,
534 data: *const ::std::os::raw::c_uchar,
535 length: usize,
536 ) -> nvjpegStatus_t;
537}
538#[doc = " Compression *"]
539#[repr(C)]
540#[derive(Debug, Copy, Clone)]
541pub struct nvjpegEncoderState {
542 _unused: [u8; 0],
543}
544pub type nvjpegEncoderState_t = *mut nvjpegEncoderState;
545extern "C" {
546 pub fn nvjpegEncoderStateCreate(
547 handle: nvjpegHandle_t,
548 encoder_state: *mut nvjpegEncoderState_t,
549 stream: cudaStream_t,
550 ) -> nvjpegStatus_t;
551}
552extern "C" {
553 pub fn nvjpegEncoderStateDestroy(encoder_state: nvjpegEncoderState_t) -> nvjpegStatus_t;
554}
555#[repr(C)]
556#[derive(Debug, Copy, Clone)]
557pub struct nvjpegEncoderParams {
558 _unused: [u8; 0],
559}
560pub type nvjpegEncoderParams_t = *mut nvjpegEncoderParams;
561extern "C" {
562 pub fn nvjpegEncoderParamsCreate(
563 handle: nvjpegHandle_t,
564 encoder_params: *mut nvjpegEncoderParams_t,
565 stream: cudaStream_t,
566 ) -> nvjpegStatus_t;
567}
568extern "C" {
569 pub fn nvjpegEncoderParamsDestroy(encoder_params: nvjpegEncoderParams_t) -> nvjpegStatus_t;
570}
571extern "C" {
572 pub fn nvjpegEncoderParamsSetQuality(
573 encoder_params: nvjpegEncoderParams_t,
574 quality: ::std::os::raw::c_int,
575 stream: cudaStream_t,
576 ) -> nvjpegStatus_t;
577}
578extern "C" {
579 pub fn nvjpegEncoderParamsSetEncoding(
580 encoder_params: nvjpegEncoderParams_t,
581 etype: nvjpegJpegEncoding_t,
582 stream: cudaStream_t,
583 ) -> nvjpegStatus_t;
584}
585extern "C" {
586 pub fn nvjpegEncoderParamsSetOptimizedHuffman(
587 encoder_params: nvjpegEncoderParams_t,
588 optimized: ::std::os::raw::c_int,
589 stream: cudaStream_t,
590 ) -> nvjpegStatus_t;
591}
592extern "C" {
593 pub fn nvjpegEncoderParamsSetSamplingFactors(
594 encoder_params: nvjpegEncoderParams_t,
595 chroma_subsampling: nvjpegChromaSubsampling_t,
596 stream: cudaStream_t,
597 ) -> nvjpegStatus_t;
598}
599extern "C" {
600 pub fn nvjpegEncodeGetBufferSize(
601 handle: nvjpegHandle_t,
602 encoder_params: nvjpegEncoderParams_t,
603 image_width: ::std::os::raw::c_int,
604 image_height: ::std::os::raw::c_int,
605 max_stream_length: *mut usize,
606 ) -> nvjpegStatus_t;
607}
608extern "C" {
609 pub fn nvjpegEncodeYUV(
610 handle: nvjpegHandle_t,
611 encoder_state: nvjpegEncoderState_t,
612 encoder_params: nvjpegEncoderParams_t,
613 source: *const nvjpegImage_t,
614 chroma_subsampling: nvjpegChromaSubsampling_t,
615 image_width: ::std::os::raw::c_int,
616 image_height: ::std::os::raw::c_int,
617 stream: cudaStream_t,
618 ) -> nvjpegStatus_t;
619}
620extern "C" {
621 pub fn nvjpegEncodeImage(
622 handle: nvjpegHandle_t,
623 encoder_state: nvjpegEncoderState_t,
624 encoder_params: nvjpegEncoderParams_t,
625 source: *const nvjpegImage_t,
626 input_format: nvjpegInputFormat_t,
627 image_width: ::std::os::raw::c_int,
628 image_height: ::std::os::raw::c_int,
629 stream: cudaStream_t,
630 ) -> nvjpegStatus_t;
631}
632extern "C" {
633 pub fn nvjpegEncodeRetrieveBitstreamDevice(
634 handle: nvjpegHandle_t,
635 encoder_state: nvjpegEncoderState_t,
636 data: *mut ::std::os::raw::c_uchar,
637 length: *mut usize,
638 stream: cudaStream_t,
639 ) -> nvjpegStatus_t;
640}
641extern "C" {
642 pub fn nvjpegEncodeRetrieveBitstream(
643 handle: nvjpegHandle_t,
644 encoder_state: nvjpegEncoderState_t,
645 data: *mut ::std::os::raw::c_uchar,
646 length: *mut usize,
647 stream: cudaStream_t,
648 ) -> nvjpegStatus_t;
649}
650#[repr(C)]
651#[derive(Debug, Copy, Clone)]
652pub struct nvjpegBufferPinned {
653 _unused: [u8; 0],
654}
655pub type nvjpegBufferPinned_t = *mut nvjpegBufferPinned;
656extern "C" {
657 pub fn nvjpegBufferPinnedCreate(
658 handle: nvjpegHandle_t,
659 pinned_allocator: *mut nvjpegPinnedAllocator_t,
660 buffer: *mut nvjpegBufferPinned_t,
661 ) -> nvjpegStatus_t;
662}
663extern "C" {
664 pub fn nvjpegBufferPinnedCreateV2(
665 handle: nvjpegHandle_t,
666 pinned_allocator: *mut nvjpegPinnedAllocatorV2_t,
667 buffer: *mut nvjpegBufferPinned_t,
668 ) -> nvjpegStatus_t;
669}
670extern "C" {
671 pub fn nvjpegBufferPinnedDestroy(buffer: nvjpegBufferPinned_t) -> nvjpegStatus_t;
672}
673#[repr(C)]
674#[derive(Debug, Copy, Clone)]
675pub struct nvjpegBufferDevice {
676 _unused: [u8; 0],
677}
678pub type nvjpegBufferDevice_t = *mut nvjpegBufferDevice;
679extern "C" {
680 pub fn nvjpegBufferDeviceCreate(
681 handle: nvjpegHandle_t,
682 device_allocator: *mut nvjpegDevAllocator_t,
683 buffer: *mut nvjpegBufferDevice_t,
684 ) -> nvjpegStatus_t;
685}
686extern "C" {
687 pub fn nvjpegBufferDeviceCreateV2(
688 handle: nvjpegHandle_t,
689 device_allocator: *mut nvjpegDevAllocatorV2_t,
690 buffer: *mut nvjpegBufferDevice_t,
691 ) -> nvjpegStatus_t;
692}
693extern "C" {
694 pub fn nvjpegBufferDeviceDestroy(buffer: nvjpegBufferDevice_t) -> nvjpegStatus_t;
695}
696extern "C" {
697 pub fn nvjpegBufferPinnedRetrieve(
698 buffer: nvjpegBufferPinned_t,
699 size: *mut usize,
700 ptr: *mut *mut ::std::os::raw::c_void,
701 ) -> nvjpegStatus_t;
702}
703extern "C" {
704 pub fn nvjpegBufferDeviceRetrieve(
705 buffer: nvjpegBufferDevice_t,
706 size: *mut usize,
707 ptr: *mut *mut ::std::os::raw::c_void,
708 ) -> nvjpegStatus_t;
709}
710extern "C" {
711 pub fn nvjpegStateAttachPinnedBuffer(
712 decoder_state: nvjpegJpegState_t,
713 pinned_buffer: nvjpegBufferPinned_t,
714 ) -> nvjpegStatus_t;
715}
716extern "C" {
717 pub fn nvjpegStateAttachDeviceBuffer(
718 decoder_state: nvjpegJpegState_t,
719 device_buffer: nvjpegBufferDevice_t,
720 ) -> nvjpegStatus_t;
721}
722#[repr(C)]
723#[derive(Debug, Copy, Clone)]
724pub struct nvjpegJpegStream {
725 _unused: [u8; 0],
726}
727pub type nvjpegJpegStream_t = *mut nvjpegJpegStream;
728extern "C" {
729 pub fn nvjpegJpegStreamCreate(
730 handle: nvjpegHandle_t,
731 jpeg_stream: *mut nvjpegJpegStream_t,
732 ) -> nvjpegStatus_t;
733}
734extern "C" {
735 pub fn nvjpegJpegStreamDestroy(jpeg_stream: nvjpegJpegStream_t) -> nvjpegStatus_t;
736}
737extern "C" {
738 pub fn nvjpegJpegStreamParse(
739 handle: nvjpegHandle_t,
740 data: *const ::std::os::raw::c_uchar,
741 length: usize,
742 save_metadata: ::std::os::raw::c_int,
743 save_stream: ::std::os::raw::c_int,
744 jpeg_stream: nvjpegJpegStream_t,
745 ) -> nvjpegStatus_t;
746}
747extern "C" {
748 pub fn nvjpegJpegStreamParseHeader(
749 handle: nvjpegHandle_t,
750 data: *const ::std::os::raw::c_uchar,
751 length: usize,
752 jpeg_stream: nvjpegJpegStream_t,
753 ) -> nvjpegStatus_t;
754}
755extern "C" {
756 pub fn nvjpegJpegStreamParseTables(
757 handle: nvjpegHandle_t,
758 data: *const ::std::os::raw::c_uchar,
759 length: usize,
760 jpeg_stream: nvjpegJpegStream_t,
761 ) -> nvjpegStatus_t;
762}
763extern "C" {
764 pub fn nvjpegJpegStreamGetJpegEncoding(
765 jpeg_stream: nvjpegJpegStream_t,
766 jpeg_encoding: *mut nvjpegJpegEncoding_t,
767 ) -> nvjpegStatus_t;
768}
769extern "C" {
770 pub fn nvjpegJpegStreamGetFrameDimensions(
771 jpeg_stream: nvjpegJpegStream_t,
772 width: *mut ::std::os::raw::c_uint,
773 height: *mut ::std::os::raw::c_uint,
774 ) -> nvjpegStatus_t;
775}
776extern "C" {
777 pub fn nvjpegJpegStreamGetComponentsNum(
778 jpeg_stream: nvjpegJpegStream_t,
779 components_num: *mut ::std::os::raw::c_uint,
780 ) -> nvjpegStatus_t;
781}
782extern "C" {
783 pub fn nvjpegJpegStreamGetComponentDimensions(
784 jpeg_stream: nvjpegJpegStream_t,
785 component: ::std::os::raw::c_uint,
786 width: *mut ::std::os::raw::c_uint,
787 height: *mut ::std::os::raw::c_uint,
788 ) -> nvjpegStatus_t;
789}
790extern "C" {
791 pub fn nvjpegJpegStreamGetExifOrientation(
792 jpeg_stream: nvjpegJpegStream_t,
793 orientation_flag: *mut nvjpegExifOrientation_t,
794 ) -> nvjpegStatus_t;
795}
796extern "C" {
797 pub fn nvjpegJpegStreamGetChromaSubsampling(
798 jpeg_stream: nvjpegJpegStream_t,
799 chroma_subsampling: *mut nvjpegChromaSubsampling_t,
800 ) -> nvjpegStatus_t;
801}
802#[repr(C)]
803#[derive(Debug, Copy, Clone)]
804pub struct nvjpegDecodeParams {
805 _unused: [u8; 0],
806}
807pub type nvjpegDecodeParams_t = *mut nvjpegDecodeParams;
808extern "C" {
809 pub fn nvjpegDecodeParamsCreate(
810 handle: nvjpegHandle_t,
811 decode_params: *mut nvjpegDecodeParams_t,
812 ) -> nvjpegStatus_t;
813}
814extern "C" {
815 pub fn nvjpegDecodeParamsDestroy(decode_params: nvjpegDecodeParams_t) -> nvjpegStatus_t;
816}
817extern "C" {
818 pub fn nvjpegDecodeParamsSetOutputFormat(
819 decode_params: nvjpegDecodeParams_t,
820 output_format: nvjpegOutputFormat_t,
821 ) -> nvjpegStatus_t;
822}
823extern "C" {
824 pub fn nvjpegDecodeParamsSetROI(
825 decode_params: nvjpegDecodeParams_t,
826 offset_x: ::std::os::raw::c_int,
827 offset_y: ::std::os::raw::c_int,
828 roi_width: ::std::os::raw::c_int,
829 roi_height: ::std::os::raw::c_int,
830 ) -> nvjpegStatus_t;
831}
832extern "C" {
833 pub fn nvjpegDecodeParamsSetAllowCMYK(
834 decode_params: nvjpegDecodeParams_t,
835 allow_cmyk: ::std::os::raw::c_int,
836 ) -> nvjpegStatus_t;
837}
838extern "C" {
839 pub fn nvjpegDecodeParamsSetScaleFactor(
840 decode_params: nvjpegDecodeParams_t,
841 scale_factor: nvjpegScaleFactor_t,
842 ) -> nvjpegStatus_t;
843}
844extern "C" {
845 pub fn nvjpegDecodeParamsSetExifOrientation(
846 decode_params: nvjpegDecodeParams_t,
847 orientation: nvjpegExifOrientation_t,
848 ) -> nvjpegStatus_t;
849}
850#[repr(C)]
851#[derive(Debug, Copy, Clone)]
852pub struct nvjpegJpegDecoder {
853 _unused: [u8; 0],
854}
855pub type nvjpegJpegDecoder_t = *mut nvjpegJpegDecoder;
856extern "C" {
857 pub fn nvjpegDecoderCreate(
858 nvjpeg_handle: nvjpegHandle_t,
859 implementation: nvjpegBackend_t,
860 decoder_handle: *mut nvjpegJpegDecoder_t,
861 ) -> nvjpegStatus_t;
862}
863extern "C" {
864 pub fn nvjpegDecoderDestroy(decoder_handle: nvjpegJpegDecoder_t) -> nvjpegStatus_t;
865}
866extern "C" {
867 pub fn nvjpegDecoderJpegSupported(
868 decoder_handle: nvjpegJpegDecoder_t,
869 jpeg_stream: nvjpegJpegStream_t,
870 decode_params: nvjpegDecodeParams_t,
871 is_supported: *mut ::std::os::raw::c_int,
872 ) -> nvjpegStatus_t;
873}
874extern "C" {
875 pub fn nvjpegDecodeBatchedSupported(
876 handle: nvjpegHandle_t,
877 jpeg_stream: nvjpegJpegStream_t,
878 is_supported: *mut ::std::os::raw::c_int,
879 ) -> nvjpegStatus_t;
880}
881extern "C" {
882 pub fn nvjpegDecodeBatchedSupportedEx(
883 handle: nvjpegHandle_t,
884 jpeg_stream: nvjpegJpegStream_t,
885 decode_params: nvjpegDecodeParams_t,
886 is_supported: *mut ::std::os::raw::c_int,
887 ) -> nvjpegStatus_t;
888}
889extern "C" {
890 pub fn nvjpegDecoderStateCreate(
891 nvjpeg_handle: nvjpegHandle_t,
892 decoder_handle: nvjpegJpegDecoder_t,
893 decoder_state: *mut nvjpegJpegState_t,
894 ) -> nvjpegStatus_t;
895}
896extern "C" {
897 pub fn nvjpegDecodeJpeg(
898 handle: nvjpegHandle_t,
899 decoder: nvjpegJpegDecoder_t,
900 decoder_state: nvjpegJpegState_t,
901 jpeg_bitstream: nvjpegJpegStream_t,
902 destination: *mut nvjpegImage_t,
903 decode_params: nvjpegDecodeParams_t,
904 stream: cudaStream_t,
905 ) -> nvjpegStatus_t;
906}
907extern "C" {
908 pub fn nvjpegDecodeJpegHost(
909 handle: nvjpegHandle_t,
910 decoder: nvjpegJpegDecoder_t,
911 decoder_state: nvjpegJpegState_t,
912 decode_params: nvjpegDecodeParams_t,
913 jpeg_stream: nvjpegJpegStream_t,
914 ) -> nvjpegStatus_t;
915}
916extern "C" {
917 pub fn nvjpegDecodeJpegTransferToDevice(
918 handle: nvjpegHandle_t,
919 decoder: nvjpegJpegDecoder_t,
920 decoder_state: nvjpegJpegState_t,
921 jpeg_stream: nvjpegJpegStream_t,
922 stream: cudaStream_t,
923 ) -> nvjpegStatus_t;
924}
925extern "C" {
926 pub fn nvjpegDecodeJpegDevice(
927 handle: nvjpegHandle_t,
928 decoder: nvjpegJpegDecoder_t,
929 decoder_state: nvjpegJpegState_t,
930 destination: *mut nvjpegImage_t,
931 stream: cudaStream_t,
932 ) -> nvjpegStatus_t;
933}
934extern "C" {
935 pub fn nvjpegDecodeBatchedEx(
936 handle: nvjpegHandle_t,
937 jpeg_handle: nvjpegJpegState_t,
938 data: *const *const ::std::os::raw::c_uchar,
939 lengths: *const usize,
940 destinations: *mut nvjpegImage_t,
941 decode_params: *mut nvjpegDecodeParams_t,
942 stream: cudaStream_t,
943 ) -> nvjpegStatus_t;
944}
945extern "C" {
946 pub fn nvjpegEncoderParamsCopyMetadata(
947 encoder_state: nvjpegEncoderState_t,
948 encode_params: nvjpegEncoderParams_t,
949 jpeg_stream: nvjpegJpegStream_t,
950 stream: cudaStream_t,
951 ) -> nvjpegStatus_t;
952}
953extern "C" {
954 pub fn nvjpegEncoderParamsCopyQuantizationTables(
955 encode_params: nvjpegEncoderParams_t,
956 jpeg_stream: nvjpegJpegStream_t,
957 stream: cudaStream_t,
958 ) -> nvjpegStatus_t;
959}
960extern "C" {
961 pub fn nvjpegEncoderParamsCopyHuffmanTables(
962 encoder_state: nvjpegEncoderState_t,
963 encode_params: nvjpegEncoderParams_t,
964 jpeg_stream: nvjpegJpegStream_t,
965 stream: cudaStream_t,
966 ) -> nvjpegStatus_t;
967}