pub struct Strobe {
pub period: Time,
pub duty: f64,
pub phase: Time,
}Expand description
How a light is gated in time.
This is how machine vision freezes a moving part: fire the light for a small fraction of the frame and the object barely moves while it is lit. The trade is brightness — gating away nine tenths of the time delivers a tenth of the energy — and nothing here hides that. Watch out for auto-exposure, which will happily lengthen the integration to win the light back and undo the whole point; a strobed station wants a fixed exposure.
Fields§
§period: TimeTime between pulses. Match it to the frame period to fire once per frame.
duty: f64Fraction of each period the light is on, 0..1.
phase: TimeWhere the pulse sits inside the period.
Implementations§
Source§impl Strobe
impl Strobe
Sourcepub fn new(period: Time, duty: f64) -> Strobe
pub fn new(period: Time, duty: f64) -> Strobe
A strobe of the given period, open for duty of each cycle.
duty is a fraction rather than a time, so changing the rate of a strobe leaves its
exposure ratio alone — which is how a camera behaves and not how a shutter does.
Sourcepub fn on_fraction(&self, start: Time, length: Time) -> f64
pub fn on_fraction(&self, start: Time, length: Time) -> f64
Fraction of a window of length opening at start for which the light is
on. Exact, so it can be checked against the duty cycle — and it is what
says how much of an exposure’s light a strobe actually delivers.