#![allow(dead_code)]
use std::ffi::c_char;
use std::os::raw::{c_double, c_int, c_uint};
#[repr(C)]
pub struct PvcamCtx {
_private: [u8; 0],
}
extern "C" {
pub fn pvcam_init() -> c_int;
pub fn pvcam_uninit();
pub fn pvcam_get_camera_count() -> c_int;
pub fn pvcam_get_camera_name(idx: c_int, buf: *mut c_char, len: c_int) -> c_int;
pub fn pvcam_open(name: *const c_char) -> *mut PvcamCtx;
pub fn pvcam_close(ctx: *mut PvcamCtx);
pub fn pvcam_get_sensor_width(ctx: *mut PvcamCtx) -> u16;
pub fn pvcam_get_sensor_height(ctx: *mut PvcamCtx) -> u16;
pub fn pvcam_get_image_width(ctx: *mut PvcamCtx) -> u16;
pub fn pvcam_get_image_height(ctx: *mut PvcamCtx) -> u16;
pub fn pvcam_get_bit_depth(ctx: *mut PvcamCtx) -> c_int;
pub fn pvcam_get_serial_number(ctx: *mut PvcamCtx, buf: *mut c_char, len: c_int) -> c_int;
pub fn pvcam_get_chip_name(ctx: *mut PvcamCtx, buf: *mut c_char, len: c_int) -> c_int;
pub fn pvcam_get_gain_index(ctx: *mut PvcamCtx) -> c_int;
pub fn pvcam_get_gain_max(ctx: *mut PvcamCtx) -> c_int;
pub fn pvcam_set_gain_index(ctx: *mut PvcamCtx, idx: c_int) -> c_int;
pub fn pvcam_get_temperature(ctx: *mut PvcamCtx) -> c_double;
pub fn pvcam_get_temp_setpoint(ctx: *mut PvcamCtx) -> c_double;
pub fn pvcam_set_temp_setpoint(ctx: *mut PvcamCtx, celsius: c_double) -> c_int;
pub fn pvcam_set_roi(
ctx: *mut PvcamCtx,
x: u16, y: u16, w: u16, h: u16,
xbin: u16, ybin: u16,
);
pub fn pvcam_clear_roi(ctx: *mut PvcamCtx);
pub fn pvcam_snap(ctx: *mut PvcamCtx, exp_ms: c_uint, timeout_ms: c_uint) -> c_int;
pub fn pvcam_get_snap_frame(ctx: *mut PvcamCtx) -> *const u8;
pub fn pvcam_get_frame_size(ctx: *mut PvcamCtx) -> c_uint;
pub fn pvcam_start_cont(ctx: *mut PvcamCtx, exp_ms: c_uint, num_frames: c_int) -> c_int;
pub fn pvcam_get_frame_cont(ctx: *mut PvcamCtx, frame_out: *mut *const u8) -> c_int;
pub fn pvcam_release_frame_cont(ctx: *mut PvcamCtx) -> c_int;
pub fn pvcam_stop_cont(ctx: *mut PvcamCtx) -> c_int;
pub fn pvcam_get_error_message(buf: *mut c_char, len: c_int) -> c_int;
}