pub struct LanePool { /* private fields */ }Expand description
See the module doc. Lanes and their rate models persist across runs, so a caller rendering many images of one scene (a tilt video, successive coordinator jobs) calibrates each lane once.
Implementations§
Source§impl LanePool
impl LanePool
Sourcepub const fn new(config: PoolConfig) -> Self
pub const fn new(config: PoolConfig) -> Self
An empty pool.
Sourcepub fn add_lane(&mut self, lane: Arc<dyn WorkerLane>, rate: RateModel) -> usize
pub fn add_lane(&mut self, lane: Arc<dyn WorkerLane>, rate: RateModel) -> usize
Registers lane starting from rate, returning its index.
Sourcepub const fn config(&self) -> &PoolConfig
pub const fn config(&self) -> &PoolConfig
The pool’s configuration.
Sourcepub const fn lane_count(&self) -> usize
pub const fn lane_count(&self) -> usize
How many lanes are registered.
Sourcepub fn run(
&self,
scene: &SceneState,
range: SampleRange,
cancel: &CancelToken,
events: &(dyn Fn(PoolEvent) + Sync),
) -> PoolOutcome
pub fn run( &self, scene: &SceneState, range: SampleRange, cancel: &CancelToken, events: &(dyn Fn(PoolEvent) + Sync), ) -> PoolOutcome
Renders range of scene with every lane and returns the merged result.
Blocks until the run ends (see PoolStatus); events is called from the lane
threads as things happen.
Sourcepub fn run_into(
&self,
scene: &SceneState,
range: SampleRange,
merger: &Merger,
cancel: &CancelToken,
events: &(dyn Fn(PoolEvent) + Sync),
) -> Result<PoolStatus, MergerMismatch>
pub fn run_into( &self, scene: &SceneState, range: SampleRange, merger: &Merger, cancel: &CancelToken, events: &(dyn Fn(PoolEvent) + Sync), ) -> Result<PoolStatus, MergerMismatch>
Like Self::run, merging into a caller-owned merger so another thread can
read progressive snapshots (Merger::snapshot_into) while the run is going.
merger must be fresh, built with Merger::new(width * height, range.first_sample).
§Errors
MergerMismatch when merger was built for another size or range; nothing
is rendered then.