docs.rs failed to build generic-camera-asi-0.0.9
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
generic-camera-asi
generic-camera-asi
implements the API traits provided by generic-camera
to capture frames from CCD/CMOS based detectors from ZWO. This crate provides
wrappers for the ASI Camera SDK C library to access the
cameras for image capture and other housekeeping functions in a safe way. Images are obtained as
refimage::GenericImageRef
with extensive metadata.
As is, this Rust driver is intended for use on Linux and macOS platforms.
You can use generic-camera-asi
to:
- Access a connected ZWO ASI camera,
- Acquire images from the in supported pixel formats (using the
image
crate as a backend), - Save these images to
FITS
files (requires thecfitsio
C library, and uses thefitsio
crate) with extensive metadata, - Alternatively, use the internal
image::DynamicImage
object to obtainJPEG
,PNG
,BMP
etc.
Pre-requisite
- Install
libusb-1.0-dev
on your system. - Obtain the ZWO ASI Camera SDK.
- Extract the
ASI_linux_mac_SDK_VX.XX.tar.bz2
from the ZIP, and extract its contents (tar -xf ASI_linux_mac_SDK_VX.XX.tar.bz2
), which will extract the contents toASI_linux_mac_SDK_VX.XX
in the current directory. - Copy
ASI_linux_mac_SDK_VX.XX/include/ASICamera2.h
to/usr/local/include
, or any other directory in your include path. - Open
README.txt
inASI_linux_mac_SDK_VX.XX/lib
to determine the applicable system platform. Follow the additional commands to install theudev
rules so that the cameras can be accessed withoutsudo
. - Copy
ASI_linux_mac_SDK_VX.XX/lib/your_target_platform/libASICamera*
to a directory in your library path (probably/usr/local/lib
), and ensureLD_LIBRARY_PATH
(Linux) orDYLD_LIBRARY_PATH
(macOS) contains the library path.
Usage
Add this to your Cargo.toml
:
[]
= "<1.0"
and this to your source code:
use ;
use ;
use ;
Example
Minimally, the following can open the first available camera and capture a single image:
let mut drv = GenCamDriverAsi;
if drv.available_devices == 0
let mut cam = drv.connect_first_device.expect;
cam.start_exposure.expect;
while !cam.image_ready.expect
let img = cam
.download_image
.expect;
For a more complete example, refer to the bundled program.
Features
Activate the bayerswap
feature to swap the Bayer mosaic conversion.