diff options
author | Juan Manuel Tomás <jtomas1815@gmail.com> | 2021-01-19 09:06:32 -0300 |
---|---|---|
committer | Juan Manuel Tomás <jtomas1815@gmail.com> | 2021-01-19 09:15:02 -0300 |
commit | 4998f5936dc7da36aba0cd018de2a1a6127dda08 (patch) | |
tree | 1363045387c3730d33fbed10f682662e3a635860 /src/lerp/poly/iter.rs | |
parent | be18a9a0503fa09318b5d99452a3407a92db4366 (diff) | |
download | bezier-4998f5936dc7da36aba0cd018de2a1a6127dda08.tar.gz bezier-4998f5936dc7da36aba0cd018de2a1a6127dda08.zip |
Make shader sample intervals uniform
Diffstat (limited to 'src/lerp/poly/iter.rs')
-rw-r--r-- | src/lerp/poly/iter.rs | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/src/lerp/poly/iter.rs b/src/lerp/poly/iter.rs deleted file mode 100644 index 90cc4b5..0000000 --- a/src/lerp/poly/iter.rs +++ /dev/null @@ -1,38 +0,0 @@ -use std::cmp; -use std::iter::{Take, Zip}; - -pub struct Iter { - index: usize, - data: Vec<f32>, - degree: usize, -} - -impl Iter { - pub fn new(data: Vec<f32>, degree: usize) -> Iter { - Iter { - index: 0, - data, - degree, - } - } - - pub fn zip(self, other: Self) -> Zip<Take<Iter>, Take<Iter>> { - let deg = cmp::max(self.degree, other.degree) + 1; - let a = self.take(deg); - let b = other.take(deg); - a.zip(b) - } -} - -impl Iterator for Iter { - type Item = f32; - - fn next(&mut self) -> Option<f32> { - self.index += 1; - if self.index <= self.data.len() { - Some(self.data[self.index - 1]) - } else { - Some(0.0) - } - } -} |