1#[repr(C)]
4#[derive(Debug, Copy, Clone)]
5pub struct CUstream_st {
6 _unused: [u8; 0],
7}
8pub type cudaStream_t = *mut CUstream_st;
9pub mod nvtiffStatus_t {
10 pub type Type = u32;
11 pub const NVTIFF_STATUS_SUCCESS: Type = 0;
12 pub const NVTIFF_STATUS_NOT_INITIALIZED: Type = 1;
13 pub const NVTIFF_STATUS_INVALID_PARAMETER: Type = 2;
14 pub const NVTIFF_STATUS_BAD_TIFF: Type = 3;
15 pub const NVTIFF_STATUS_TIFF_NOT_SUPPORTED: Type = 4;
16 pub const NVTIFF_STATUS_ALLOCATOR_FAILURE: Type = 5;
17 pub const NVTIFF_STATUS_EXECUTION_FAILED: Type = 6;
18 pub const NVTIFF_STATUS_ARCH_MISMATCH: Type = 7;
19 pub const NVTIFF_STATUS_INTERNAL_ERROR: Type = 8;
20 pub const NVTIFF_STATUS_NVCOMP_NOT_FOUND: Type = 9;
21 pub const NVTIFF_STATUS_NVJPEG_NOT_FOUND: Type = 10;
22 pub const NVTIFF_STATUS_TAG_NOT_FOUND: Type = 11;
23 pub const NVTIFF_STATUS_PARAMETER_OUT_OF_BOUNDS: Type = 12;
24 pub const NVTIFF_STATUS_NVJPEG2K_NOT_FOUND: Type = 13;
25}
26#[repr(C)]
27#[derive(Debug, Copy, Clone)]
28pub struct nvtiffDecoder {
29 _unused: [u8; 0],
30}
31pub type nvtiffDecoder_t = *mut nvtiffDecoder;
32#[repr(C)]
33#[derive(Debug, Copy, Clone)]
34pub struct nvtiffStream {
35 _unused: [u8; 0],
36}
37pub type nvtiffStream_t = *mut nvtiffStream;
38pub mod nvtiffSampleFormat {
39 pub type Type = u32;
40 pub const NVTIFF_SAMPLEFORMAT_UNKNOWN: Type = 0;
41 pub const NVTIFF_SAMPLEFORMAT_UINT: Type = 1;
42 pub const NVTIFF_SAMPLEFORMAT_INT: Type = 2;
43 pub const NVTIFF_SAMPLEFORMAT_IEEEFP: Type = 3;
44 pub const NVTIFF_SAMPLEFORMAT_VOID: Type = 4;
45 pub const NVTIFF_SAMPLEFORMAT_COMPLEXINT: Type = 5;
46 pub const NVTIFF_SAMPLEFORMAT_COMPLEXIEEEFP: Type = 6;
47}
48pub use self::nvtiffSampleFormat::Type as nvtiffSampleFormat_t;
49pub mod nvtiffPhotometricInt {
50 pub type Type = i32;
51 pub const NVTIFF_PHOTOMETRIC_UNKNOWN: Type = -1;
52 pub const NVTIFF_PHOTOMETRIC_MINISWHITE: Type = 0;
53 pub const NVTIFF_PHOTOMETRIC_MINISBLACK: Type = 1;
54 pub const NVTIFF_PHOTOMETRIC_RGB: Type = 2;
55 pub const NVTIFF_PHOTOMETRIC_PALETTE: Type = 3;
56 pub const NVTIFF_PHOTOMETRIC_MASK: Type = 4;
57 pub const NVTIFF_PHOTOMETRIC_SEPARATED: Type = 5;
58 pub const NVTIFF_PHOTOMETRIC_YCBCR: Type = 6;
59}
60pub use self::nvtiffPhotometricInt::Type as nvtiffPhotometricInt_t;
61pub mod nvtiffPlanarConfig {
62 pub type Type = u32;
63 pub const NVTIFF_PLANARCONFIG_UNKNOWN: Type = 0;
64 pub const NVTIFF_PLANARCONFIG_CONTIG: Type = 1;
65 pub const NVTIFF_PLANARCONFIG_SEPARATE: Type = 2;
66}
67pub use self::nvtiffPlanarConfig::Type as nvtiffPlanarConfig_t;
68pub mod nvtiffCompression {
69 pub type Type = u32;
70 pub const NVTIFF_COMPRESSION_UNKNOWN: Type = 0;
71 pub const NVTIFF_COMPRESSION_NONE: Type = 1;
72 pub const NVTIFF_COMPRESSION_LZW: Type = 5;
73 pub const NVTIFF_COMPRESSION_JPEG: Type = 7;
74 pub const NVTIFF_COMPRESSION_ADOBE_DEFLATE: Type = 8;
75 pub const NVTIFF_COMPRESSION_DEFLATE: Type = 32946;
76 pub const NVTIFF_COMPRESSION_APERIO_JP2000_YCC: Type = 33003;
77 pub const NVTIFF_COMPRESSION_APERIO_JP2000_RGB: Type = 33005;
78 pub const NVTIFF_COMPRESSION_JP2000: Type = 34712;
79}
80pub use self::nvtiffCompression::Type as nvtiffCompression_t;
81pub mod nvtiffImageType {
82 pub type Type = u32;
83 pub const NVTIFF_IMAGETYPE_REDUCED_IMAGE: Type = 1;
84 pub const NVTIFF_IMAGETYPE_PAGE: Type = 2;
85 pub const NVTIFF_IMAGETYPE_MASK: Type = 4;
86 pub const NVTIFF_IMAGETYPE_ENUM_FORCE_UINT32: Type = 4294967295;
87}
88pub type nvtiffImageType_t = u32;
89#[repr(C)]
90#[derive(Debug, Copy, Clone, PartialEq)]
91pub struct nvtiffImageInfo {
92 pub image_type: nvtiffImageType_t,
93 pub image_width: u32,
94 pub image_height: u32,
95 pub compression: nvtiffCompression_t,
96 pub photometric_int: nvtiffPhotometricInt_t,
97 pub planar_config: nvtiffPlanarConfig_t,
98 pub samples_per_pixel: u16,
99 pub bits_per_pixel: u16,
100 pub bits_per_sample: [u16; 16usize],
101 pub sample_format: [nvtiffSampleFormat_t; 16usize],
102}
103#[allow(clippy::unnecessary_operation, clippy::identity_op)]
104const _: () = {
105 ["Size of nvtiffImageInfo"][::std::mem::size_of::<nvtiffImageInfo>() - 124usize];
106 ["Alignment of nvtiffImageInfo"][::std::mem::align_of::<nvtiffImageInfo>() - 4usize];
107 ["Offset of field: nvtiffImageInfo::image_type"]
108 [::std::mem::offset_of!(nvtiffImageInfo, image_type) - 0usize];
109 ["Offset of field: nvtiffImageInfo::image_width"]
110 [::std::mem::offset_of!(nvtiffImageInfo, image_width) - 4usize];
111 ["Offset of field: nvtiffImageInfo::image_height"]
112 [::std::mem::offset_of!(nvtiffImageInfo, image_height) - 8usize];
113 ["Offset of field: nvtiffImageInfo::compression"]
114 [::std::mem::offset_of!(nvtiffImageInfo, compression) - 12usize];
115 ["Offset of field: nvtiffImageInfo::photometric_int"]
116 [::std::mem::offset_of!(nvtiffImageInfo, photometric_int) - 16usize];
117 ["Offset of field: nvtiffImageInfo::planar_config"]
118 [::std::mem::offset_of!(nvtiffImageInfo, planar_config) - 20usize];
119 ["Offset of field: nvtiffImageInfo::samples_per_pixel"]
120 [::std::mem::offset_of!(nvtiffImageInfo, samples_per_pixel) - 24usize];
121 ["Offset of field: nvtiffImageInfo::bits_per_pixel"]
122 [::std::mem::offset_of!(nvtiffImageInfo, bits_per_pixel) - 26usize];
123 ["Offset of field: nvtiffImageInfo::bits_per_sample"]
124 [::std::mem::offset_of!(nvtiffImageInfo, bits_per_sample) - 28usize];
125 ["Offset of field: nvtiffImageInfo::sample_format"]
126 [::std::mem::offset_of!(nvtiffImageInfo, sample_format) - 60usize];
127};
128impl Default for nvtiffImageInfo {
129 fn default() -> Self {
130 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
131 unsafe {
132 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
133 s.assume_init()
134 }
135 }
136}
137pub type nvtiffImageInfo_t = nvtiffImageInfo;
138#[repr(C)]
139#[derive(Debug, Copy, Clone)]
140pub struct nvtiffDecodeParams {
141 _unused: [u8; 0],
142}
143pub type nvtiffDecodeParams_t = *mut nvtiffDecodeParams;
144unsafe extern "C" {
145 pub fn nvtiffStreamCreate(tiff_stream: *mut nvtiffStream_t) -> nvtiffStatus_t::Type;
146}
147unsafe extern "C" {
148 pub fn nvtiffDecoderCreateSimple(
149 decoder: *mut nvtiffDecoder_t,
150 cuda_stream: cudaStream_t,
151 ) -> nvtiffStatus_t::Type;
152}
153unsafe extern "C" {
154 pub fn nvtiffStreamParseFromFile(
155 fname: *const ::std::os::raw::c_char,
156 tiff_stream: nvtiffStream_t,
157 ) -> nvtiffStatus_t::Type;
158}
159unsafe extern "C" {
160 pub fn nvtiffStreamParse(
161 buffer: *const u8,
162 buffer_size: usize,
163 tiff_stream: nvtiffStream_t,
164 ) -> nvtiffStatus_t::Type;
165}
166unsafe extern "C" {
167 pub fn nvtiffStreamGetNumImages(
168 tiff_stream: nvtiffStream_t,
169 num_images: *mut u32,
170 ) -> nvtiffStatus_t::Type;
171}
172unsafe extern "C" {
173 pub fn nvtiffStreamGetImageInfo(
174 tiff_stream: nvtiffStream_t,
175 image_id: u32,
176 image_info: *mut nvtiffImageInfo_t,
177 ) -> nvtiffStatus_t::Type;
178}
179unsafe extern "C" {
180 pub fn nvtiffDecodeImage(
181 tiff_stream: nvtiffStream_t,
182 decoder: nvtiffDecoder_t,
183 params: nvtiffDecodeParams_t,
184 image_id: u32,
185 image_out_d: *mut ::std::os::raw::c_void,
186 cuda_stream: cudaStream_t,
187 ) -> nvtiffStatus_t::Type;
188}
189unsafe extern "C" {
190 pub fn nvtiffDecodeCheckSupported(
191 tiff_stream: nvtiffStream_t,
192 decoder: nvtiffDecoder_t,
193 params: nvtiffDecodeParams_t,
194 image_id: u32,
195 ) -> nvtiffStatus_t::Type;
196}