This repository is a simplified Rust binding of Zwo ASI Camera driver.
The ASI Camera SDK is distributed here. (This driver does not yet support MacOS Apple silicon.)
Tested OS
- MacOS Apple silicon M2 ( Rosseta2 )
- Ubuntu 22.04 x86_64
Other OS (Linux Windows, RasPi) and architecture have not been tested.
First connect the ASI Camera using USB
Linux
RUST_LOG=debug cargo run -r --example snapshot_mode
RUST_LOG=debug cargo run -r --example video_mode
MacOS
For MacOS, add --target x86_64-apple-darwin
rustup target add x86_64-apple-darwin
RUST_LOG=debug cargo run -r --example snapshot_mode --target x86_64-apple-darwin
Official recommended order of function calls
An example implementations snapshot_mode.rs and video_mode.rs is implemented according to the following order.
1. Initialize
- ASIGetNumOfConnectedCameras: Get the count of connected cameras.
- ASIGetCameraProperty: Retrieve camera information (ID, name, resolution, etc.).
- ASIOpenCamera: Open a camera.
- ASIInitCamera: Initialize the camera.
- ASIGetNumOfControls: Get the count of control types.
- ASIGetControlCaps: Retrieve the capacity of each control type.
- ASISetROIFormat: Set image size and format.
- ASISetStartPos: Set the starting position for the Region of Interest (ROI).
2. Get and Set Control Value
- ASIGetControlValue: Get control values.
- ASISetControlValue: Set control values (except for setting exposure time in trigger mode).
3. Capture image
- video mode
- snapshot mode