From 4998f5936dc7da36aba0cd018de2a1a6127dda08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Manuel=20Tom=C3=A1s?= Date: Tue, 19 Jan 2021 09:06:32 -0300 Subject: Make shader sample intervals uniform --- src/lerp/poly/iter.rs | 38 -------------------------------------- 1 file changed, 38 deletions(-) delete mode 100644 src/lerp/poly/iter.rs (limited to 'src/lerp/poly') 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, - degree: usize, -} - -impl Iter { - pub fn new(data: Vec, degree: usize) -> Iter { - Iter { - index: 0, - data, - degree, - } - } - - pub fn zip(self, other: Self) -> Zip, Take> { - 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 { - self.index += 1; - if self.index <= self.data.len() { - Some(self.data[self.index - 1]) - } else { - Some(0.0) - } - } -} -- cgit v1.2.3