11 releases

new 0.3.6 Dec 16, 2024
0.3.5 Dec 16, 2024
0.2.0 Jul 25, 2019
0.1.2 Jul 11, 2019
0.1.1 Apr 11, 2019

#43 in Multimedia

Download history 2/week @ 2024-09-20 106/week @ 2024-11-29 305/week @ 2024-12-06 486/week @ 2024-12-13

897 downloads per month

MIT license

20KB
289 lines

Highlevel API for Basler Pylon cameras

Crates.io docs Crates.io License

This is a highlevel API on top of the pylon-cxx crate which is a Rust-binding around the official Basler Pylon-SDK.

Features:

  • Typestate-pattern based camera objects to avoid common mistakes that lead to runtime errors like opening an already open camera or start grabbing on a already grabbing camera.

  • Async stream combinators for Linescan-cameras.

  • Support for the Sequencer feature to quickly grab consecutive frames with different acquisition paramters.

use std::time::Duration;
use pylon::{ClosedCamera, Pylon, LineCameraExt, GrabStatus, PylonError};

let pylon = Pylon::new();

let cam = ClosedCamera::new(&pylon)?;
let mut cam = cam.open()?;    // this is a OpenCamera struct now.

// we use time futures here but it can ba any kind of future (IO-Cards, network-sockets...)
let start = tokio::time::sleep(Duration::from_secs(1));
let end = tokio::time::sleep(Duration::from_secs(2));

assert!(matches!(
    cam.join_from_until(start, end, Some(1024*1024*100)).await?,
    GrabStatus::Success(_)
));

Copyright 2024, Falco Hirschenberger falco.hirschenberger@gmail.com

Dependencies

~6–15MB
~192K SLoC