Crates.io | cameraunit |
lib.rs | cameraunit |
version | 5.1.0 |
source | src |
created_at | 2023-09-18 16:31:19.925949 |
updated_at | 2024-05-14 23:40:25.15614 |
description | An efficient and ergonomic interface to capture images using cameras. |
homepage | https://crates.io/crates/cameraunit |
repository | https://github.com/sunipkm/cameraunit |
max_upload_size | |
id | 976086 |
size | 20,294 |
cameraunit
provides a well-defined and ergonomic API to write interfaces to capture frames from CCD/CMOS based
detectors through Rust traits cameraunit::CameraUnit
and cameraunit::CameraInfo
. The library additionally
provides the cameraunit::ImageData
struct to obtain images with extensive metadata.
You can use cameraunit
to:
image
crate as a backend),FITS
files (requires the cfitsio
C library, and uses the fitsio
crate) with extensive metadata,serialimage::DynamicSerialImage
object to obtain JPEG
, PNG
, BMP
etc.Add this to your Cargo.toml
:
[dependencies]
cameraunit = "5.1"
and this to your source code:
use cameraunit::{CameraUnit, CameraInfo, DynamicSerialImage, OptimumExposureBuilder, SerialImageBuffer};
Since this library is mostly trait-only, refer to projects (such as cameraunit_asi
) to see it in action.
The interface provides two traits:
CameraUnit
: This trait supports extensive access to the camera, and provides the API for mutating the camera
state, such as changing the exposure, region of interest on the detector, etc. The object implementing this trait
should not derive from the Clone
trait, since ideally image capture should happen in a single thread.CameraInfo
: This trait supports limited access to the camera, and provides the API for obtaining housekeeping
data such as temperatures, gain etc., while allowing limited mutation of the camera state, such as changing the
detector temperature set point, turning cooler on and off, etc.Ideally, the crate implementing the camera interface should
CameraUnit
and CameraInfo
for a struct
that does not allow cloning, and implement a second,
smaller structure that allows clone and implement only CameraInfo
for that struct.CameraUnit
trait and
another implementing the CameraInfo
trait, should be returned. The second object should be clonable to be
handed off to some threads if required to handle housekeeping functions.