Skip to main content

nvtiff_sys/
nvtiff.rs

1/* automatically generated by rust-bindgen 0.71.1 */
2
3#[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 {
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    pub const NVTIFF_STATUS_BATCH_INCOMPATIBLE: Type = 14;
26}
27pub use self::nvtiffStatus::Type as nvtiffStatus_t;
28pub mod nvtiffGeoKeys {
29    pub type Type = u32;
30    pub const NVTIFF_GEOKEY_GT_MODEL_TYPE: Type = 1024;
31    pub const NVTIFF_GEOKEY_GT_RASTER_TYPE: Type = 1025;
32    pub const NVTIFF_GEOKEY_GT_CITATION: Type = 1026;
33    pub const NVTIFF_GEOKEY_GEODETIC_CRS: Type = 2048;
34    pub const NVTIFF_GEOKEY_GEODETIC_CITATION: Type = 2049;
35    pub const NVTIFF_GEOKEY_GEODETIC_DATUM: Type = 2050;
36    pub const NVTIFF_GEOKEY_PRIME_MERIDIAN: Type = 2051;
37    pub const NVTIFF_GEOKEY_GEOG_LINEAR_UNITS: Type = 2052;
38    pub const NVTIFF_GEOKEY_GEOG_LINEAR_UNIT_SIZE: Type = 2053;
39    pub const NVTIFF_GEOKEY_GEOG_ANGULAR_UNITS: Type = 2054;
40    pub const NVTIFF_GEOKEY_GEOG_ANGULAR_UNIT_SIZE: Type = 2055;
41    pub const NVTIFF_GEOKEY_ELLIPSOID: Type = 2056;
42    pub const NVTIFF_GEOKEY_ELLIPSOID_SEMI_MAJOR_AXIS: Type = 2057;
43    pub const NVTIFF_GEOKEY_ELLIPSOID_SEMI_MINOR_AXIS: Type = 2058;
44    pub const NVTIFF_GEOKEY_ELLIPSOID_INV_FLATTENING: Type = 2059;
45    pub const NVTIFF_GEOKEY_GEOG_AZIMUTH_UNITS: Type = 2060;
46    pub const NVTIFF_GEOKEY_PRIME_MERIDIAN_LONG: Type = 2061;
47    pub const NVTIFF_GEOKEY_PROJECTED_CRS: Type = 3072;
48    pub const NVTIFF_GEOKEY_PROJECTED_CITATION: Type = 3073;
49    pub const NVTIFF_GEOKEY_PROJECTION: Type = 3074;
50    pub const NVTIFF_GEOKEY_PROJ_METHOD: Type = 3075;
51    pub const NVTIFF_GEOKEY_PROJ_LINEAR_UNITS: Type = 3076;
52    pub const NVTIFF_GEOKEY_PROJ_LINEAR_UNIT_SIZE: Type = 3077;
53    pub const NVTIFF_GEOKEY_PROJ_STD_PARALLEL1: Type = 3078;
54    pub const NVTIFF_GEOKEY_PROJ_STD_PARALLEL: Type = 3078;
55    pub const NVTIFF_GEOKEY_PROJ_STD_PARALLEL2: Type = 3079;
56    pub const NVTIFF_GEOKEY_PROJ_NAT_ORIGIN_LONG: Type = 3080;
57    pub const NVTIFF_GEOKEY_PROJ_ORIGIN_LONG: Type = 3080;
58    pub const NVTIFF_GEOKEY_PROJ_NAT_ORIGIN_LAT: Type = 3081;
59    pub const NVTIFF_GEOKEY_PROJ_ORIGIN_LAT: Type = 3081;
60    pub const NVTIFF_GEOKEY_PROJ_FALSE_EASTING: Type = 3082;
61    pub const NVTIFF_GEOKEY_PROJ_FALSE_NORTHING: Type = 3083;
62    pub const NVTIFF_GEOKEY_PROJ_FALSE_ORIGIN_LONG: Type = 3084;
63    pub const NVTIFF_GEOKEY_PROJ_FALSE_ORIGIN_LAT: Type = 3085;
64    pub const NVTIFF_GEOKEY_PROJ_FALSE_ORIGIN_EASTING: Type = 3086;
65    pub const NVTIFF_GEOKEY_PROJ_FALSE_ORIGIN_NORTHING: Type = 3087;
66    pub const NVTIFF_GEOKEY_PROJ_CENTER_LONG: Type = 3088;
67    pub const NVTIFF_GEOKEY_PROJ_CENTER_LAT: Type = 3089;
68    pub const NVTIFF_GEOKEY_PROJ_CENTER_EASTING: Type = 3090;
69    pub const NVTIFF_GEOKEY_PROJ_CENTER_NORTHING: Type = 3091;
70    pub const NVTIFF_GEOKEY_PROJ_SCALE_AT_NAT_ORIGIN: Type = 3092;
71    pub const NVTIFF_GEOKEY_PROJ_SCALE_AT_ORIGIN: Type = 3092;
72    pub const NVTIFF_GEOKEY_PROJ_SCALE_AT_CENTER: Type = 3093;
73    pub const NVTIFF_GEOKEY_PROJ_AZIMUTH_ANGLE: Type = 3094;
74    pub const NVTIFF_GEOKEY_PROJ_STRAIGHT_VERT_POLE_LONG: Type = 3095;
75    pub const NVTIFF_GEOKEY_VERTICAL: Type = 4096;
76    pub const NVTIFF_GEOKEY_VERTICAL_CITATION: Type = 4097;
77    pub const NVTIFF_GEOKEY_VERTICAL_DATUM: Type = 4098;
78    pub const NVTIFF_GEOKEY_VERTICAL_UNITS: Type = 4099;
79    pub const NVTIFF_GEOKEY_BASE: Type = 32768;
80    pub const NVTIFF_GEOKEY_END: Type = 65535;
81}
82pub use self::nvtiffGeoKeys::Type as nvtiffGeoKey_t;
83pub mod nvtiffGeoKeyDataType {
84    pub type Type = u32;
85    pub const NVTIFF_GEOKEY_TYPE_SHORT: Type = 1;
86    pub const NVTIFF_GEOKEY_TYPE_ASCII: Type = 2;
87    pub const NVTIFF_GEOKEY_TYPE_DOUBLE: Type = 3;
88    pub const NVTIFF_GEOKEY_TYPE_UNKNOWN: Type = 4;
89}
90pub use self::nvtiffGeoKeyDataType::Type as nvtiffGeoKeyDataType_t;
91#[repr(C)]
92#[derive(Debug, Copy, Clone)]
93pub struct nvtiffDecoder {
94    _unused: [u8; 0],
95}
96pub type nvtiffDecoder_t = *mut nvtiffDecoder;
97#[repr(C)]
98#[derive(Debug, Copy, Clone)]
99pub struct nvtiffStream {
100    _unused: [u8; 0],
101}
102pub type nvtiffStream_t = *mut nvtiffStream;
103pub mod nvtiffSampleFormat {
104    pub type Type = u32;
105    pub const NVTIFF_SAMPLEFORMAT_UNKNOWN: Type = 0;
106    pub const NVTIFF_SAMPLEFORMAT_UINT: Type = 1;
107    pub const NVTIFF_SAMPLEFORMAT_INT: Type = 2;
108    pub const NVTIFF_SAMPLEFORMAT_IEEEFP: Type = 3;
109    pub const NVTIFF_SAMPLEFORMAT_VOID: Type = 4;
110    pub const NVTIFF_SAMPLEFORMAT_COMPLEXINT: Type = 5;
111    pub const NVTIFF_SAMPLEFORMAT_COMPLEXIEEEFP: Type = 6;
112}
113pub use self::nvtiffSampleFormat::Type as nvtiffSampleFormat_t;
114pub mod nvtiffPhotometricInt {
115    pub type Type = i32;
116    pub const NVTIFF_PHOTOMETRIC_UNKNOWN: Type = -1;
117    pub const NVTIFF_PHOTOMETRIC_MINISWHITE: Type = 0;
118    pub const NVTIFF_PHOTOMETRIC_MINISBLACK: Type = 1;
119    pub const NVTIFF_PHOTOMETRIC_RGB: Type = 2;
120    pub const NVTIFF_PHOTOMETRIC_PALETTE: Type = 3;
121    pub const NVTIFF_PHOTOMETRIC_MASK: Type = 4;
122    pub const NVTIFF_PHOTOMETRIC_SEPARATED: Type = 5;
123    pub const NVTIFF_PHOTOMETRIC_YCBCR: Type = 6;
124}
125pub use self::nvtiffPhotometricInt::Type as nvtiffPhotometricInt_t;
126pub mod nvtiffPlanarConfig {
127    pub type Type = u32;
128    pub const NVTIFF_PLANARCONFIG_UNKNOWN: Type = 0;
129    pub const NVTIFF_PLANARCONFIG_CONTIG: Type = 1;
130    pub const NVTIFF_PLANARCONFIG_SEPARATE: Type = 2;
131}
132pub use self::nvtiffPlanarConfig::Type as nvtiffPlanarConfig_t;
133pub mod nvtiffCompression {
134    pub type Type = u32;
135    pub const NVTIFF_COMPRESSION_UNKNOWN: Type = 0;
136    pub const NVTIFF_COMPRESSION_NONE: Type = 1;
137    pub const NVTIFF_COMPRESSION_LZW: Type = 5;
138    pub const NVTIFF_COMPRESSION_JPEG: Type = 7;
139    pub const NVTIFF_COMPRESSION_ADOBE_DEFLATE: Type = 8;
140    pub const NVTIFF_COMPRESSION_PACKBITS: Type = 32773;
141    pub const NVTIFF_COMPRESSION_DEFLATE: Type = 32946;
142    pub const NVTIFF_COMPRESSION_APERIO_JP2000_YCC: Type = 33003;
143    pub const NVTIFF_COMPRESSION_APERIO_JP2000_RGB: Type = 33005;
144    pub const NVTIFF_COMPRESSION_JP2000: Type = 34712;
145}
146pub use self::nvtiffCompression::Type as nvtiffCompression_t;
147pub mod nvtiffImageType {
148    pub type Type = u32;
149    pub const NVTIFF_IMAGETYPE_REDUCED_IMAGE: Type = 1;
150    pub const NVTIFF_IMAGETYPE_PAGE: Type = 2;
151    pub const NVTIFF_IMAGETYPE_MASK: Type = 4;
152    pub const NVTIFF_IMAGETYPE_ENUM_FORCE_UINT32: Type = 4294967295;
153}
154pub type nvtiffImageType_t = u32;
155#[repr(C)]
156#[derive(Debug, Copy, Clone, PartialEq)]
157pub struct nvtiffImageInfo {
158    pub image_type: nvtiffImageType_t,
159    pub image_width: u32,
160    pub image_height: u32,
161    pub compression: nvtiffCompression_t,
162    pub photometric_int: nvtiffPhotometricInt_t,
163    pub planar_config: nvtiffPlanarConfig_t,
164    pub samples_per_pixel: u16,
165    pub bits_per_pixel: u16,
166    pub bits_per_sample: [u16; 16usize],
167    pub sample_format: [nvtiffSampleFormat_t; 16usize],
168}
169#[allow(clippy::unnecessary_operation, clippy::identity_op)]
170const _: () = {
171    ["Size of nvtiffImageInfo"][::std::mem::size_of::<nvtiffImageInfo>() - 124usize];
172    ["Alignment of nvtiffImageInfo"][::std::mem::align_of::<nvtiffImageInfo>() - 4usize];
173    ["Offset of field: nvtiffImageInfo::image_type"]
174        [::std::mem::offset_of!(nvtiffImageInfo, image_type) - 0usize];
175    ["Offset of field: nvtiffImageInfo::image_width"]
176        [::std::mem::offset_of!(nvtiffImageInfo, image_width) - 4usize];
177    ["Offset of field: nvtiffImageInfo::image_height"]
178        [::std::mem::offset_of!(nvtiffImageInfo, image_height) - 8usize];
179    ["Offset of field: nvtiffImageInfo::compression"]
180        [::std::mem::offset_of!(nvtiffImageInfo, compression) - 12usize];
181    ["Offset of field: nvtiffImageInfo::photometric_int"]
182        [::std::mem::offset_of!(nvtiffImageInfo, photometric_int) - 16usize];
183    ["Offset of field: nvtiffImageInfo::planar_config"]
184        [::std::mem::offset_of!(nvtiffImageInfo, planar_config) - 20usize];
185    ["Offset of field: nvtiffImageInfo::samples_per_pixel"]
186        [::std::mem::offset_of!(nvtiffImageInfo, samples_per_pixel) - 24usize];
187    ["Offset of field: nvtiffImageInfo::bits_per_pixel"]
188        [::std::mem::offset_of!(nvtiffImageInfo, bits_per_pixel) - 26usize];
189    ["Offset of field: nvtiffImageInfo::bits_per_sample"]
190        [::std::mem::offset_of!(nvtiffImageInfo, bits_per_sample) - 28usize];
191    ["Offset of field: nvtiffImageInfo::sample_format"]
192        [::std::mem::offset_of!(nvtiffImageInfo, sample_format) - 60usize];
193};
194impl Default for nvtiffImageInfo {
195    fn default() -> Self {
196        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
197        unsafe {
198            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
199            s.assume_init()
200        }
201    }
202}
203pub type nvtiffImageInfo_t = nvtiffImageInfo;
204pub mod nvtiffImageGeometryType {
205    pub type Type = u32;
206    pub const NVTIFF_IMAGE_STRIPED: Type = 0;
207    pub const NVTIFF_IMAGE_TILED: Type = 1;
208}
209pub use self::nvtiffImageGeometryType::Type as nvtiffImageGeometryType_t;
210#[repr(C)]
211#[derive(Debug, Copy, Clone, PartialEq)]
212pub struct nvtiffImageGeometry {
213    pub type_: nvtiffImageGeometryType_t,
214    pub image_depth: u32,
215    pub strile_width: u32,
216    pub strile_height: u32,
217    pub strile_depth: u32,
218    pub num_striles_per_plane: u32,
219    pub num_striles: u32,
220}
221#[allow(clippy::unnecessary_operation, clippy::identity_op)]
222const _: () = {
223    ["Size of nvtiffImageGeometry"][::std::mem::size_of::<nvtiffImageGeometry>() - 28usize];
224    ["Alignment of nvtiffImageGeometry"][::std::mem::align_of::<nvtiffImageGeometry>() - 4usize];
225    ["Offset of field: nvtiffImageGeometry::type_"]
226        [::std::mem::offset_of!(nvtiffImageGeometry, type_) - 0usize];
227    ["Offset of field: nvtiffImageGeometry::image_depth"]
228        [::std::mem::offset_of!(nvtiffImageGeometry, image_depth) - 4usize];
229    ["Offset of field: nvtiffImageGeometry::strile_width"]
230        [::std::mem::offset_of!(nvtiffImageGeometry, strile_width) - 8usize];
231    ["Offset of field: nvtiffImageGeometry::strile_height"]
232        [::std::mem::offset_of!(nvtiffImageGeometry, strile_height) - 12usize];
233    ["Offset of field: nvtiffImageGeometry::strile_depth"]
234        [::std::mem::offset_of!(nvtiffImageGeometry, strile_depth) - 16usize];
235    ["Offset of field: nvtiffImageGeometry::num_striles_per_plane"]
236        [::std::mem::offset_of!(nvtiffImageGeometry, num_striles_per_plane) - 20usize];
237    ["Offset of field: nvtiffImageGeometry::num_striles"]
238        [::std::mem::offset_of!(nvtiffImageGeometry, num_striles) - 24usize];
239};
240impl Default for nvtiffImageGeometry {
241    fn default() -> Self {
242        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
243        unsafe {
244            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
245            s.assume_init()
246        }
247    }
248}
249pub type nvtiffImageGeometry_t = nvtiffImageGeometry;
250#[repr(C)]
251#[derive(Debug, Copy, Clone)]
252pub struct nvtiffDecodeParams {
253    _unused: [u8; 0],
254}
255pub type nvtiffDecodeParams_t = *mut nvtiffDecodeParams;
256#[repr(C)]
257#[derive(Debug, Copy, Clone, PartialEq)]
258pub struct nvtiffImage {
259    pub plane_data: *mut *mut ::std::os::raw::c_void,
260    pub plane_pitch_bytes: *mut usize,
261    pub num_planes: u32,
262}
263#[allow(clippy::unnecessary_operation, clippy::identity_op)]
264const _: () = {
265    ["Size of nvtiffImage"][::std::mem::size_of::<nvtiffImage>() - 24usize];
266    ["Alignment of nvtiffImage"][::std::mem::align_of::<nvtiffImage>() - 8usize];
267    ["Offset of field: nvtiffImage::plane_data"]
268        [::std::mem::offset_of!(nvtiffImage, plane_data) - 0usize];
269    ["Offset of field: nvtiffImage::plane_pitch_bytes"]
270        [::std::mem::offset_of!(nvtiffImage, plane_pitch_bytes) - 8usize];
271    ["Offset of field: nvtiffImage::num_planes"]
272        [::std::mem::offset_of!(nvtiffImage, num_planes) - 16usize];
273};
274impl Default for nvtiffImage {
275    fn default() -> Self {
276        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
277        unsafe {
278            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
279            s.assume_init()
280        }
281    }
282}
283pub type nvtiffImage_t = nvtiffImage;
284#[repr(C)]
285#[derive(Debug, Default, Copy, Clone, PartialEq)]
286pub struct nvtiffDecodeRegion {
287    pub ifd_offset: usize,
288    pub offset_x: i32,
289    pub offset_y: i32,
290    pub width: u32,
291    pub height: u32,
292}
293#[allow(clippy::unnecessary_operation, clippy::identity_op)]
294const _: () = {
295    ["Size of nvtiffDecodeRegion"][::std::mem::size_of::<nvtiffDecodeRegion>() - 24usize];
296    ["Alignment of nvtiffDecodeRegion"][::std::mem::align_of::<nvtiffDecodeRegion>() - 8usize];
297    ["Offset of field: nvtiffDecodeRegion::ifd_offset"]
298        [::std::mem::offset_of!(nvtiffDecodeRegion, ifd_offset) - 0usize];
299    ["Offset of field: nvtiffDecodeRegion::offset_x"]
300        [::std::mem::offset_of!(nvtiffDecodeRegion, offset_x) - 8usize];
301    ["Offset of field: nvtiffDecodeRegion::offset_y"]
302        [::std::mem::offset_of!(nvtiffDecodeRegion, offset_y) - 12usize];
303    ["Offset of field: nvtiffDecodeRegion::width"]
304        [::std::mem::offset_of!(nvtiffDecodeRegion, width) - 16usize];
305    ["Offset of field: nvtiffDecodeRegion::height"]
306        [::std::mem::offset_of!(nvtiffDecodeRegion, height) - 20usize];
307};
308pub type nvtiffDecodeRegion_t = nvtiffDecodeRegion;
309unsafe extern "C" {
310    pub fn nvtiffDecodeParamsCreate(decode_params: *mut nvtiffDecodeParams_t) -> nvtiffStatus_t;
311}
312unsafe extern "C" {
313    pub fn nvtiffDecoderCreateSimple(
314        decoder: *mut nvtiffDecoder_t,
315        stream: cudaStream_t,
316    ) -> nvtiffStatus_t;
317}
318unsafe extern "C" {
319    pub fn nvtiffStreamOpenFromFile(
320        fname: *const ::std::os::raw::c_char,
321        tiff_stream: *mut nvtiffStream_t,
322    ) -> nvtiffStatus_t;
323}
324unsafe extern "C" {
325    pub fn nvtiffStreamOpen(
326        buffer: *const u8,
327        buffer_size: usize,
328        tiff_stream: *mut nvtiffStream_t,
329    ) -> nvtiffStatus_t;
330}
331unsafe extern "C" {
332    pub fn nvtiffStreamGetNextIFDOffset(
333        tiff_stream: nvtiffStream_t,
334        ifd_offset: usize,
335        next_ifd_offset: *mut usize,
336    ) -> nvtiffStatus_t;
337}
338unsafe extern "C" {
339    pub fn nvtiffStreamPrint(tiff_stream: nvtiffStream_t) -> nvtiffStatus_t;
340}
341unsafe extern "C" {
342    pub fn nvtiffStreamGetImageInfo(
343        tiff_stream: nvtiffStream_t,
344        ifd_offset: usize,
345        image_info: *mut nvtiffImageInfo_t,
346    ) -> nvtiffStatus_t;
347}
348unsafe extern "C" {
349    pub fn nvtiffStreamGetImageGeometry(
350        tiff_stream: nvtiffStream_t,
351        ifd_offset: usize,
352        geometry: *mut nvtiffImageGeometry_t,
353    ) -> nvtiffStatus_t;
354}
355unsafe extern "C" {
356    pub fn nvtiffStreamGetGeoKeyInfo(
357        tiff_stream: nvtiffStream_t,
358        key: nvtiffGeoKey_t,
359        size: *mut u32,
360        count: *mut u32,
361        type_: *mut nvtiffGeoKeyDataType_t,
362    ) -> nvtiffStatus_t;
363}
364unsafe extern "C" {
365    pub fn nvtiffStreamGetTagValue(
366        tiff_stream: nvtiffStream_t,
367        ifd_offset: usize,
368        tiff_tag: u16,
369        tag_value: *mut ::std::os::raw::c_void,
370        count: u32,
371    ) -> nvtiffStatus_t;
372}
373unsafe extern "C" {
374    pub fn nvtiffStreamGetGeoKey(
375        tiff_stream: nvtiffStream_t,
376        key: nvtiffGeoKey_t,
377        val: *mut ::std::os::raw::c_void,
378        count: u32,
379    ) -> nvtiffStatus_t;
380}
381unsafe extern "C" {
382    pub fn nvtiffDecode(
383        tiff_stream: nvtiffStream_t,
384        decoder: nvtiffDecoder_t,
385        params: nvtiffDecodeParams_t,
386        image_out: *mut nvtiffImage_t,
387        stream: cudaStream_t,
388    ) -> nvtiffStatus_t;
389}
390unsafe extern "C" {
391    pub fn nvtiffDecodeCheckSupported(
392        tiff_stream: nvtiffStream_t,
393        decoder: nvtiffDecoder_t,
394        params: nvtiffDecodeParams_t,
395        image_out: *const nvtiffImage_t,
396    ) -> nvtiffStatus_t;
397}
398unsafe extern "C" {
399    pub fn nvtiffDecodeParamsSetRegions(
400        decode_params: nvtiffDecodeParams_t,
401        regions: *const nvtiffDecodeRegion_t,
402        count: u32,
403    ) -> nvtiffStatus_t;
404}