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_CONTIG: Type = 1;
64 pub const NVTIFF_PLANARCONFIG_SEPARATE: Type = 2;
65}
66pub use self::nvtiffPlanarConfig::Type as nvtiffPlanarConfig_t;
67pub mod nvtiffCompression {
68 pub type Type = u32;
69 pub const NVTIFF_COMPRESSION_UNKNOWN: Type = 0;
70 pub const NVTIFF_COMPRESSION_NONE: Type = 1;
71 pub const NVTIFF_COMPRESSION_LZW: Type = 5;
72 pub const NVTIFF_COMPRESSION_JPEG: Type = 7;
73 pub const NVTIFF_COMPRESSION_ADOBE_DEFLATE: Type = 8;
74 pub const NVTIFF_COMPRESSION_DEFLATE: Type = 32946;
75 pub const NVTIFF_COMPRESSION_APERIO_JP2000_YCC: Type = 33003;
76 pub const NVTIFF_COMPRESSION_APERIO_JP2000_RGB: Type = 33005;
77 pub const NVTIFF_COMPRESSION_JP2000: Type = 34712;
78}
79pub use self::nvtiffCompression::Type as nvtiffCompression_t;
80pub type nvtiffImageType_t = u32;
81#[repr(C)]
82#[derive(Debug, Copy, Clone, PartialEq)]
83pub struct nvtiffFileInfo {
84 pub num_images: u32,
85 pub image_width: u32,
86 pub image_height: u32,
87 pub photometric_int: nvtiffPhotometricInt_t,
88 pub planar_config: nvtiffPlanarConfig_t,
89 pub samples_per_pixel: u16,
90 pub bits_per_pixel: u16,
91 pub bits_per_sample: [u16; 16usize],
92 pub sample_format: [nvtiffSampleFormat_t; 16usize],
93}
94#[allow(clippy::unnecessary_operation, clippy::identity_op)]
95const _: () = {
96 ["Size of nvtiffFileInfo"][::std::mem::size_of::<nvtiffFileInfo>() - 120usize];
97 ["Alignment of nvtiffFileInfo"][::std::mem::align_of::<nvtiffFileInfo>() - 4usize];
98 ["Offset of field: nvtiffFileInfo::num_images"]
99 [::std::mem::offset_of!(nvtiffFileInfo, num_images) - 0usize];
100 ["Offset of field: nvtiffFileInfo::image_width"]
101 [::std::mem::offset_of!(nvtiffFileInfo, image_width) - 4usize];
102 ["Offset of field: nvtiffFileInfo::image_height"]
103 [::std::mem::offset_of!(nvtiffFileInfo, image_height) - 8usize];
104 ["Offset of field: nvtiffFileInfo::photometric_int"]
105 [::std::mem::offset_of!(nvtiffFileInfo, photometric_int) - 12usize];
106 ["Offset of field: nvtiffFileInfo::planar_config"]
107 [::std::mem::offset_of!(nvtiffFileInfo, planar_config) - 16usize];
108 ["Offset of field: nvtiffFileInfo::samples_per_pixel"]
109 [::std::mem::offset_of!(nvtiffFileInfo, samples_per_pixel) - 20usize];
110 ["Offset of field: nvtiffFileInfo::bits_per_pixel"]
111 [::std::mem::offset_of!(nvtiffFileInfo, bits_per_pixel) - 22usize];
112 ["Offset of field: nvtiffFileInfo::bits_per_sample"]
113 [::std::mem::offset_of!(nvtiffFileInfo, bits_per_sample) - 24usize];
114 ["Offset of field: nvtiffFileInfo::sample_format"]
115 [::std::mem::offset_of!(nvtiffFileInfo, sample_format) - 56usize];
116};
117impl Default for nvtiffFileInfo {
118 fn default() -> Self {
119 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
120 unsafe {
121 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
122 s.assume_init()
123 }
124 }
125}
126pub type nvtiffFileInfo_t = nvtiffFileInfo;
127#[repr(C)]
128#[derive(Debug, Copy, Clone, PartialEq)]
129pub struct nvtiffImageInfo {
130 pub image_type: nvtiffImageType_t,
131 pub image_width: u32,
132 pub image_height: u32,
133 pub compression: nvtiffCompression_t,
134 pub photometric_int: nvtiffPhotometricInt_t,
135 pub planar_config: nvtiffPlanarConfig_t,
136 pub samples_per_pixel: u16,
137 pub bits_per_pixel: u16,
138 pub bits_per_sample: [u16; 16usize],
139 pub sample_format: [nvtiffSampleFormat_t; 16usize],
140}
141#[allow(clippy::unnecessary_operation, clippy::identity_op)]
142const _: () = {
143 ["Size of nvtiffImageInfo"][::std::mem::size_of::<nvtiffImageInfo>() - 124usize];
144 ["Alignment of nvtiffImageInfo"][::std::mem::align_of::<nvtiffImageInfo>() - 4usize];
145 ["Offset of field: nvtiffImageInfo::image_type"]
146 [::std::mem::offset_of!(nvtiffImageInfo, image_type) - 0usize];
147 ["Offset of field: nvtiffImageInfo::image_width"]
148 [::std::mem::offset_of!(nvtiffImageInfo, image_width) - 4usize];
149 ["Offset of field: nvtiffImageInfo::image_height"]
150 [::std::mem::offset_of!(nvtiffImageInfo, image_height) - 8usize];
151 ["Offset of field: nvtiffImageInfo::compression"]
152 [::std::mem::offset_of!(nvtiffImageInfo, compression) - 12usize];
153 ["Offset of field: nvtiffImageInfo::photometric_int"]
154 [::std::mem::offset_of!(nvtiffImageInfo, photometric_int) - 16usize];
155 ["Offset of field: nvtiffImageInfo::planar_config"]
156 [::std::mem::offset_of!(nvtiffImageInfo, planar_config) - 20usize];
157 ["Offset of field: nvtiffImageInfo::samples_per_pixel"]
158 [::std::mem::offset_of!(nvtiffImageInfo, samples_per_pixel) - 24usize];
159 ["Offset of field: nvtiffImageInfo::bits_per_pixel"]
160 [::std::mem::offset_of!(nvtiffImageInfo, bits_per_pixel) - 26usize];
161 ["Offset of field: nvtiffImageInfo::bits_per_sample"]
162 [::std::mem::offset_of!(nvtiffImageInfo, bits_per_sample) - 28usize];
163 ["Offset of field: nvtiffImageInfo::sample_format"]
164 [::std::mem::offset_of!(nvtiffImageInfo, sample_format) - 60usize];
165};
166impl Default for nvtiffImageInfo {
167 fn default() -> Self {
168 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
169 unsafe {
170 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
171 s.assume_init()
172 }
173 }
174}
175pub type nvtiffImageInfo_t = nvtiffImageInfo;
176#[repr(C)]
177#[derive(Debug, Copy, Clone)]
178pub struct nvtiffDecodeParams {
179 _unused: [u8; 0],
180}
181pub type nvtiffDecodeParams_t = *mut nvtiffDecodeParams;
182unsafe extern "C" {
183 pub fn nvtiffStreamCreate(tiff_stream: *mut nvtiffStream_t) -> nvtiffStatus_t::Type;
184}
185unsafe extern "C" {
186 pub fn nvtiffDecoderCreateSimple(
187 decoder: *mut nvtiffDecoder_t,
188 cuda_stream: cudaStream_t,
189 ) -> nvtiffStatus_t::Type;
190}
191unsafe extern "C" {
192 pub fn nvtiffStreamParseFromFile(
193 fname: *const ::std::os::raw::c_char,
194 tiff_stream: nvtiffStream_t,
195 ) -> nvtiffStatus_t::Type;
196}
197unsafe extern "C" {
198 pub fn nvtiffStreamParse(
199 buffer: *const u8,
200 buffer_size: usize,
201 tiff_stream: nvtiffStream_t,
202 ) -> nvtiffStatus_t::Type;
203}
204unsafe extern "C" {
205 pub fn nvtiffStreamGetFileInfo(
206 tiff_stream: nvtiffStream_t,
207 file_info: *mut nvtiffFileInfo_t,
208 ) -> nvtiffStatus_t::Type;
209}
210unsafe extern "C" {
211 pub fn nvtiffStreamGetImageInfo(
212 tiff_stream: nvtiffStream_t,
213 image_id: u32,
214 image_info: *mut nvtiffImageInfo_t,
215 ) -> nvtiffStatus_t::Type;
216}
217unsafe extern "C" {
218 pub fn nvtiffDecodeImage(
219 tiff_stream: nvtiffStream_t,
220 decoder: nvtiffDecoder_t,
221 params: nvtiffDecodeParams_t,
222 image_id: u32,
223 image_out_d: *mut ::std::os::raw::c_void,
224 cuda_stream: cudaStream_t,
225 ) -> nvtiffStatus_t::Type;
226}
227unsafe extern "C" {
228 pub fn nvtiffDecodeCheckSupported(
229 tiff_stream: nvtiffStream_t,
230 decoder: nvtiffDecoder_t,
231 params: nvtiffDecodeParams_t,
232 image_id: u32,
233 ) -> nvtiffStatus_t::Type;
234}