diff options
Diffstat (limited to 'lvc/codec/src/impls.rs')
-rw-r--r-- | lvc/codec/src/impls.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lvc/codec/src/impls.rs b/lvc/codec/src/impls.rs index 098db39..b4cc119 100644 --- a/lvc/codec/src/impls.rs +++ b/lvc/codec/src/impls.rs @@ -1,6 +1,19 @@ use crate::{Frame, Pixel, Ref, View, P2}; use std::ops::{Add, AddAssign, Index, IndexMut, Sub}; +#[cfg(feature = "parallel")] +pub use rayon::join; +#[cfg(not(feature = "parallel"))] +pub fn join<A, B, RA, RB>(oper_a: A, oper_b: B) -> (RA, RB) +where + A: FnOnce() -> RA + Send, + B: FnOnce() -> RB + Send, + RA: Send, + RB: Send, +{ + (oper_a(), oper_b()) +} + impl Frame { pub fn export(&self, view: View) -> Vec<Pixel> { let mut o = vec![]; |