/* automatically generated by rust-bindgen 0.71.1 */

#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct CUstream_st {
    _unused: [u8; 0],
}
pub type cudaStream_t = *mut CUstream_st;
pub mod nvtiffTag {
    pub type Type = i32;
    pub const NVTIFF_TAG_UNKNOWN: Type = -1;
    pub const NVTIFF_TAG_MODEL_PIXEL_SCALE: Type = 33550;
    pub const NVTIFF_TAG_MODEL_TIE_POINT: Type = 33922;
    pub const NVTIFF_TAG_MODEL_TRANSFORMATION: Type = 34264;
}
pub use self::nvtiffTag::Type as nvtiffTag_t;
pub mod nvtiffStatus_t {
    pub type Type = u32;
    pub const NVTIFF_STATUS_SUCCESS: Type = 0;
    pub const NVTIFF_STATUS_NOT_INITIALIZED: Type = 1;
    pub const NVTIFF_STATUS_INVALID_PARAMETER: Type = 2;
    pub const NVTIFF_STATUS_BAD_TIFF: Type = 3;
    pub const NVTIFF_STATUS_TIFF_NOT_SUPPORTED: Type = 4;
    pub const NVTIFF_STATUS_ALLOCATOR_FAILURE: Type = 5;
    pub const NVTIFF_STATUS_EXECUTION_FAILED: Type = 6;
    pub const NVTIFF_STATUS_ARCH_MISMATCH: Type = 7;
    pub const NVTIFF_STATUS_INTERNAL_ERROR: Type = 8;
    pub const NVTIFF_STATUS_NVCOMP_NOT_FOUND: Type = 9;
    pub const NVTIFF_STATUS_NVJPEG_NOT_FOUND: Type = 10;
    pub const NVTIFF_STATUS_TAG_NOT_FOUND: Type = 11;
    pub const NVTIFF_STATUS_PARAMETER_OUT_OF_BOUNDS: Type = 12;
    pub const NVTIFF_STATUS_NVJPEG2K_NOT_FOUND: Type = 13;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nvtiffDecoder {
    _unused: [u8; 0],
}
pub type nvtiffDecoder_t = *mut nvtiffDecoder;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nvtiffStream {
    _unused: [u8; 0],
}
pub type nvtiffStream_t = *mut nvtiffStream;
pub mod nvtiffSampleFormat {
    pub type Type = u32;
    pub const NVTIFF_SAMPLEFORMAT_UNKNOWN: Type = 0;
    pub const NVTIFF_SAMPLEFORMAT_UINT: Type = 1;
    pub const NVTIFF_SAMPLEFORMAT_INT: Type = 2;
    pub const NVTIFF_SAMPLEFORMAT_IEEEFP: Type = 3;
    pub const NVTIFF_SAMPLEFORMAT_VOID: Type = 4;
    pub const NVTIFF_SAMPLEFORMAT_COMPLEXINT: Type = 5;
    pub const NVTIFF_SAMPLEFORMAT_COMPLEXIEEEFP: Type = 6;
}
pub use self::nvtiffSampleFormat::Type as nvtiffSampleFormat_t;
pub mod nvtiffPhotometricInt {
    pub type Type = i32;
    pub const NVTIFF_PHOTOMETRIC_UNKNOWN: Type = -1;
    pub const NVTIFF_PHOTOMETRIC_MINISWHITE: Type = 0;
    pub const NVTIFF_PHOTOMETRIC_MINISBLACK: Type = 1;
    pub const NVTIFF_PHOTOMETRIC_RGB: Type = 2;
    pub const NVTIFF_PHOTOMETRIC_PALETTE: Type = 3;
    pub const NVTIFF_PHOTOMETRIC_MASK: Type = 4;
    pub const NVTIFF_PHOTOMETRIC_SEPARATED: Type = 5;
    pub const NVTIFF_PHOTOMETRIC_YCBCR: Type = 6;
}
pub use self::nvtiffPhotometricInt::Type as nvtiffPhotometricInt_t;
pub mod nvtiffPlanarConfig {
    pub type Type = u32;
    pub const NVTIFF_PLANARCONFIG_UNKNOWN: Type = 0;
    pub const NVTIFF_PLANARCONFIG_CONTIG: Type = 1;
    pub const NVTIFF_PLANARCONFIG_SEPARATE: Type = 2;
}
pub use self::nvtiffPlanarConfig::Type as nvtiffPlanarConfig_t;
pub mod nvtiffCompression {
    pub type Type = u32;
    pub const NVTIFF_COMPRESSION_UNKNOWN: Type = 0;
    pub const NVTIFF_COMPRESSION_NONE: Type = 1;
    pub const NVTIFF_COMPRESSION_LZW: Type = 5;
    pub const NVTIFF_COMPRESSION_JPEG: Type = 7;
    pub const NVTIFF_COMPRESSION_ADOBE_DEFLATE: Type = 8;
    pub const NVTIFF_COMPRESSION_DEFLATE: Type = 32946;
    pub const NVTIFF_COMPRESSION_APERIO_JP2000_YCC: Type = 33003;
    pub const NVTIFF_COMPRESSION_APERIO_JP2000_RGB: Type = 33005;
    pub const NVTIFF_COMPRESSION_JP2000: Type = 34712;
}
pub use self::nvtiffCompression::Type as nvtiffCompression_t;
pub mod nvtiffImageType {
    pub type Type = u32;
    pub const NVTIFF_IMAGETYPE_REDUCED_IMAGE: Type = 1;
    pub const NVTIFF_IMAGETYPE_PAGE: Type = 2;
    pub const NVTIFF_IMAGETYPE_MASK: Type = 4;
    pub const NVTIFF_IMAGETYPE_ENUM_FORCE_UINT32: Type = 4294967295;
}
pub type nvtiffImageType_t = u32;
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct nvtiffImageInfo {
    pub image_type: nvtiffImageType_t,
    pub image_width: u32,
    pub image_height: u32,
    pub compression: nvtiffCompression_t,
    pub photometric_int: nvtiffPhotometricInt_t,
    pub planar_config: nvtiffPlanarConfig_t,
    pub samples_per_pixel: u16,
    pub bits_per_pixel: u16,
    pub bits_per_sample: [u16; 16usize],
    pub sample_format: [nvtiffSampleFormat_t; 16usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of nvtiffImageInfo"][::std::mem::size_of::<nvtiffImageInfo>() - 124usize];
    ["Alignment of nvtiffImageInfo"][::std::mem::align_of::<nvtiffImageInfo>() - 4usize];
    ["Offset of field: nvtiffImageInfo::image_type"]
        [::std::mem::offset_of!(nvtiffImageInfo, image_type) - 0usize];
    ["Offset of field: nvtiffImageInfo::image_width"]
        [::std::mem::offset_of!(nvtiffImageInfo, image_width) - 4usize];
    ["Offset of field: nvtiffImageInfo::image_height"]
        [::std::mem::offset_of!(nvtiffImageInfo, image_height) - 8usize];
    ["Offset of field: nvtiffImageInfo::compression"]
        [::std::mem::offset_of!(nvtiffImageInfo, compression) - 12usize];
    ["Offset of field: nvtiffImageInfo::photometric_int"]
        [::std::mem::offset_of!(nvtiffImageInfo, photometric_int) - 16usize];
    ["Offset of field: nvtiffImageInfo::planar_config"]
        [::std::mem::offset_of!(nvtiffImageInfo, planar_config) - 20usize];
    ["Offset of field: nvtiffImageInfo::samples_per_pixel"]
        [::std::mem::offset_of!(nvtiffImageInfo, samples_per_pixel) - 24usize];
    ["Offset of field: nvtiffImageInfo::bits_per_pixel"]
        [::std::mem::offset_of!(nvtiffImageInfo, bits_per_pixel) - 26usize];
    ["Offset of field: nvtiffImageInfo::bits_per_sample"]
        [::std::mem::offset_of!(nvtiffImageInfo, bits_per_sample) - 28usize];
    ["Offset of field: nvtiffImageInfo::sample_format"]
        [::std::mem::offset_of!(nvtiffImageInfo, sample_format) - 60usize];
};
impl Default for nvtiffImageInfo {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
pub type nvtiffImageInfo_t = nvtiffImageInfo;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nvtiffDecodeParams {
    _unused: [u8; 0],
}
pub type nvtiffDecodeParams_t = *mut nvtiffDecodeParams;
unsafe extern "C" {
    pub fn nvtiffStreamCreate(tiff_stream: *mut nvtiffStream_t) -> nvtiffStatus_t::Type;
}
unsafe extern "C" {
    pub fn nvtiffDecoderCreateSimple(
        decoder: *mut nvtiffDecoder_t,
        cuda_stream: cudaStream_t,
    ) -> nvtiffStatus_t::Type;
}
unsafe extern "C" {
    pub fn nvtiffStreamParseFromFile(
        fname: *const ::std::os::raw::c_char,
        tiff_stream: nvtiffStream_t,
    ) -> nvtiffStatus_t::Type;
}
unsafe extern "C" {
    pub fn nvtiffStreamParse(
        buffer: *const u8,
        buffer_size: usize,
        tiff_stream: nvtiffStream_t,
    ) -> nvtiffStatus_t::Type;
}
unsafe extern "C" {
    pub fn nvtiffStreamGetNumImages(
        tiff_stream: nvtiffStream_t,
        num_images: *mut u32,
    ) -> nvtiffStatus_t::Type;
}
unsafe extern "C" {
    pub fn nvtiffStreamGetImageInfo(
        tiff_stream: nvtiffStream_t,
        image_id: u32,
        image_info: *mut nvtiffImageInfo_t,
    ) -> nvtiffStatus_t::Type;
}
unsafe extern "C" {
    pub fn nvtiffStreamGetTagValue(
        tiff_stream: nvtiffStream_t,
        image_id: u32,
        tiff_tag: nvtiffTag_t,
        tag_value: *mut ::std::os::raw::c_void,
        count: u32,
    ) -> nvtiffStatus_t::Type;
}
unsafe extern "C" {
    pub fn nvtiffDecodeImage(
        tiff_stream: nvtiffStream_t,
        decoder: nvtiffDecoder_t,
        params: nvtiffDecodeParams_t,
        image_id: u32,
        image_out_d: *mut ::std::os::raw::c_void,
        cuda_stream: cudaStream_t,
    ) -> nvtiffStatus_t::Type;
}
unsafe extern "C" {
    pub fn nvtiffDecodeCheckSupported(
        tiff_stream: nvtiffStream_t,
        decoder: nvtiffDecoder_t,
        params: nvtiffDecodeParams_t,
        image_id: u32,
    ) -> nvtiffStatus_t::Type;
}
