1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
/* automatically generated by rust-bindgen 0.57.0 */

#![allow(non_camel_case_types)]

pub const SEP_TBYTE: ::std::os::raw::c_int = 11;
pub const SEP_TINT: ::std::os::raw::c_int = 31;
pub const SEP_TFLOAT: ::std::os::raw::c_int = 42;
pub const SEP_TDOUBLE: ::std::os::raw::c_int = 82;
pub const SEP_OBJ_MERGED: ::std::os::raw::c_short = 1;
pub const SEP_OBJ_TRUNC: ::std::os::raw::c_short = 2;
pub const SEP_OBJ_DOVERFLOW: ::std::os::raw::c_short = 4;
pub const SEP_OBJ_SINGU: ::std::os::raw::c_short = 8;
pub const SEP_APER_TRUNC: ::std::os::raw::c_short = 16;
pub const SEP_APER_HASMASKED: ::std::os::raw::c_short = 32;
pub const SEP_APER_ALLMASKED: ::std::os::raw::c_short = 64;
pub const SEP_APER_NONPOSITIVE: ::std::os::raw::c_short = 128;
pub const SEP_NOISE_NONE: ::std::os::raw::c_short = 0;
pub const SEP_NOISE_STDDEV: ::std::os::raw::c_short = 1;
pub const SEP_NOISE_VAR: ::std::os::raw::c_short = 2;
pub const SEP_MASK_IGNORE: ::std::os::raw::c_short = 4;
pub const SEP_THRESH_REL: ::std::os::raw::c_int = 0;
pub const SEP_THRESH_ABS: ::std::os::raw::c_int = 1;
pub const SEP_FILTER_CONV: ::std::os::raw::c_int = 0;
pub const SEP_FILTER_MATCHED: ::std::os::raw::c_int = 1;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct sep_image {
    pub data: *const ::std::os::raw::c_void,
    pub noise: *const ::std::os::raw::c_void,
    pub mask: *const ::std::os::raw::c_void,
    pub segmap: *const ::std::os::raw::c_void,
    pub dtype: ::std::os::raw::c_int,
    pub ndtype: ::std::os::raw::c_int,
    pub mdtype: ::std::os::raw::c_int,
    pub sdtype: ::std::os::raw::c_int,
    pub w: ::std::os::raw::c_int,
    pub h: ::std::os::raw::c_int,
    pub noiseval: f64,
    pub noise_type: ::std::os::raw::c_short,
    pub gain: f64,
    pub maskthresh: f64,
}
impl Default for sep_image {
    fn default() -> Self {
        unsafe { ::std::mem::zeroed() }
    }
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct sep_bkg {
    pub w: ::std::os::raw::c_int,
    pub h: ::std::os::raw::c_int,
    pub bw: ::std::os::raw::c_int,
    pub bh: ::std::os::raw::c_int,
    pub nx: ::std::os::raw::c_int,
    pub ny: ::std::os::raw::c_int,
    pub n: ::std::os::raw::c_int,
    pub global: f32,
    pub globalrms: f32,
    pub back: *mut f32,
    pub dback: *mut f32,
    pub sigma: *mut f32,
    pub dsigma: *mut f32,
}
impl Default for sep_bkg {
    fn default() -> Self {
        unsafe { ::std::mem::zeroed() }
    }
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct sep_catalog {
    pub nobj: ::std::os::raw::c_int,
    pub thresh: *mut f32,
    pub npix: *mut ::std::os::raw::c_int,
    pub tnpix: *mut ::std::os::raw::c_int,
    pub xmin: *mut ::std::os::raw::c_int,
    pub xmax: *mut ::std::os::raw::c_int,
    pub ymin: *mut ::std::os::raw::c_int,
    pub ymax: *mut ::std::os::raw::c_int,
    pub x: *mut f64,
    pub y: *mut f64,
    pub x2: *mut f64,
    pub y2: *mut f64,
    pub xy: *mut f64,
    pub errx2: *mut f64,
    pub erry2: *mut f64,
    pub errxy: *mut f64,
    pub a: *mut f32,
    pub b: *mut f32,
    pub theta: *mut f32,
    pub cxx: *mut f32,
    pub cyy: *mut f32,
    pub cxy: *mut f32,
    pub cflux: *mut f32,
    pub flux: *mut f32,
    pub cpeak: *mut f32,
    pub peak: *mut f32,
    pub xcpeak: *mut ::std::os::raw::c_int,
    pub ycpeak: *mut ::std::os::raw::c_int,
    pub xpeak: *mut ::std::os::raw::c_int,
    pub ypeak: *mut ::std::os::raw::c_int,
    pub flag: *mut ::std::os::raw::c_short,
    pub pix: *mut *mut ::std::os::raw::c_int,
    pub objectspix: *mut ::std::os::raw::c_int,
}
impl Default for sep_catalog {
    fn default() -> Self {
        unsafe { ::std::mem::zeroed() }
    }
}
extern "C" {
    pub fn sep_background(
        image: *const sep_image,
        bw: ::std::os::raw::c_int,
        bh: ::std::os::raw::c_int,
        fw: ::std::os::raw::c_int,
        fh: ::std::os::raw::c_int,
        fthresh: f64,
        bkg: *mut *mut sep_bkg,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn sep_bkg_global(bkg: *const sep_bkg) -> f32;
}
extern "C" {
    pub fn sep_bkg_globalrms(bkg: *const sep_bkg) -> f32;
}
extern "C" {
    pub fn sep_bkg_pix(
        bkg: *const sep_bkg,
        x: ::std::os::raw::c_int,
        y: ::std::os::raw::c_int,
    ) -> f32;
}
extern "C" {
    pub fn sep_bkg_line(
        bkg: *const sep_bkg,
        y: ::std::os::raw::c_int,
        line: *mut ::std::os::raw::c_void,
        dtype: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn sep_bkg_subline(
        bkg: *const sep_bkg,
        y: ::std::os::raw::c_int,
        line: *mut ::std::os::raw::c_void,
        dtype: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn sep_bkg_rmsline(
        bkg: *const sep_bkg,
        y: ::std::os::raw::c_int,
        line: *mut ::std::os::raw::c_void,
        dtype: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn sep_bkg_array(
        bkg: *const sep_bkg,
        arr: *mut ::std::os::raw::c_void,
        dtype: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn sep_bkg_subarray(
        bkg: *const sep_bkg,
        arr: *mut ::std::os::raw::c_void,
        dtype: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn sep_bkg_rmsarray(
        bkg: *const sep_bkg,
        arr: *mut ::std::os::raw::c_void,
        dtype: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn sep_bkg_free(bkg: *mut sep_bkg);
}
extern "C" {
    pub fn sep_extract(
        image: *const sep_image,
        thresh: f32,
        thresh_type: ::std::os::raw::c_int,
        minarea: ::std::os::raw::c_int,
        conv: *const f32,
        convw: ::std::os::raw::c_int,
        convh: ::std::os::raw::c_int,
        filter_type: ::std::os::raw::c_int,
        deblend_nthresh: ::std::os::raw::c_int,
        deblend_cont: f64,
        clean_flag: ::std::os::raw::c_int,
        clean_param: f64,
        catalog: *mut *mut sep_catalog,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn sep_set_extract_pixstack(val: size_t);
}
extern "C" {
    pub fn sep_get_extract_pixstack() -> size_t;
}
extern "C" {
    pub fn sep_set_sub_object_limit(val: ::std::os::raw::c_int);
}
extern "C" {
    pub fn sep_get_sub_object_limit() -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn sep_catalog_free(catalog: *mut sep_catalog);
}
extern "C" {
    pub fn sep_sum_circle(
        image: *const sep_image,
        x: f64,
        y: f64,
        r: f64,
        id: ::std::os::raw::c_int,
        subpix: ::std::os::raw::c_int,
        inflags: ::std::os::raw::c_short,
        sum: *mut f64,
        sumerr: *mut f64,
        area: *mut f64,
        flag: *mut ::std::os::raw::c_short,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn sep_sum_circann(
        image: *const sep_image,
        x: f64,
        y: f64,
        rin: f64,
        rout: f64,
        id: ::std::os::raw::c_int,
        subpix: ::std::os::raw::c_int,
        inflags: ::std::os::raw::c_short,
        sum: *mut f64,
        sumerr: *mut f64,
        area: *mut f64,
        flag: *mut ::std::os::raw::c_short,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn sep_sum_ellipse(
        image: *const sep_image,
        x: f64,
        y: f64,
        a: f64,
        b: f64,
        theta: f64,
        r: f64,
        id: ::std::os::raw::c_int,
        subpix: ::std::os::raw::c_int,
        inflags: ::std::os::raw::c_short,
        sum: *mut f64,
        sumerr: *mut f64,
        area: *mut f64,
        flag: *mut ::std::os::raw::c_short,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn sep_sum_ellipann(
        image: *const sep_image,
        x: f64,
        y: f64,
        a: f64,
        b: f64,
        theta: f64,
        rin: f64,
        rout: f64,
        id: ::std::os::raw::c_int,
        subpix: ::std::os::raw::c_int,
        inflags: ::std::os::raw::c_short,
        sum: *mut f64,
        sumerr: *mut f64,
        area: *mut f64,
        flag: *mut ::std::os::raw::c_short,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn sep_sum_circann_multi(
        im: *const sep_image,
        x: f64,
        y: f64,
        rmax: f64,
        n: ::std::os::raw::c_int,
        id: ::std::os::raw::c_int,
        subpix: ::std::os::raw::c_int,
        inflag: ::std::os::raw::c_short,
        sum: *mut f64,
        sumvar: *mut f64,
        area: *mut f64,
        maskarea: *mut f64,
        flag: *mut ::std::os::raw::c_short,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn sep_flux_radius(
        im: *const sep_image,
        x: f64,
        y: f64,
        rmax: f64,
        id: ::std::os::raw::c_int,
        subpix: ::std::os::raw::c_int,
        inflag: ::std::os::raw::c_short,
        fluxtot: *const f64,
        fluxfrac: *const f64,
        n: ::std::os::raw::c_int,
        r: *mut f64,
        flag: *mut ::std::os::raw::c_short,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn sep_kron_radius(
        im: *const sep_image,
        x: f64,
        y: f64,
        cxx: f64,
        cyy: f64,
        cxy: f64,
        r: f64,
        id: ::std::os::raw::c_int,
        kronrad: *mut f64,
        flag: *mut ::std::os::raw::c_short,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn sep_windowed(
        im: *const sep_image,
        x: f64,
        y: f64,
        sig: f64,
        subpix: ::std::os::raw::c_int,
        inflag: ::std::os::raw::c_short,
        xout: *mut f64,
        yout: *mut f64,
        niter: *mut ::std::os::raw::c_int,
        flag: *mut ::std::os::raw::c_short,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn sep_set_ellipse(
        arr: *mut ::std::os::raw::c_uchar,
        w: ::std::os::raw::c_int,
        h: ::std::os::raw::c_int,
        x: f64,
        y: f64,
        cxx: f64,
        cyy: f64,
        cxy: f64,
        r: f64,
        val: ::std::os::raw::c_uchar,
    );
}
extern "C" {
    pub fn sep_ellipse_axes(
        cxx: f64,
        cyy: f64,
        cxy: f64,
        a: *mut f64,
        b: *mut f64,
        theta: *mut f64,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn sep_ellipse_coeffs(
        a: f64,
        b: f64,
        theta: f64,
        cxx: *mut f64,
        cyy: *mut f64,
        cxy: *mut f64,
    );
}
extern "C" {
    pub static sep_version_string: *const ::std::os::raw::c_char;
}
extern "C" {
    pub fn sep_get_errmsg(status: ::std::os::raw::c_int, errtext: *mut ::std::os::raw::c_char);
}
extern "C" {
    pub fn sep_get_errdetail(errtext: *mut ::std::os::raw::c_char);
}
pub type size_t = ::std::os::raw::c_ulonglong;