pylon

Crates.iopylon
lib.rspylon
version0.3.6
created_at2019-04-03 13:05:09.123181+00
updated_at2024-12-16 15:57:09.277247+00
descriptionHighlevel API for Basler Pylon cameras
homepage
repositoryhttps://gitlab.com/hirschenberger/pylon
max_upload_size
id125636
size64,434
Falco Hirschenberger (hirschenberger)

documentation

https://hirschenberger.gitlab.io/pylon/doc/pylon/index.html

README

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

Commit count: 50

cargo fmt