nvjpeg-sys 0.1.0

Raw Rust bindings for NVIDIA nvJPEG library
Documentation
/* 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;
}