fast image operations
Diffstat (limited to 'src/drawing/poly.rs')
-rw-r--r--src/drawing/poly.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/drawing/poly.rs b/src/drawing/poly.rs
index 0799457..ae20914 100644
--- a/src/drawing/poly.rs
+++ b/src/drawing/poly.rs
@@ -70,4 +70,17 @@ impl<T: DerefMut<Target = [u8]>, const CHANNELS: usize> Image<T, CHANNELS> {
self.line((x1, y1), (x2, y2), c);
}
}
+
+ /// Draws a filled quadrilateral.
+ /// This currently just uses [`Image::points`], but in the future this may change.
+ pub fn quad(
+ &mut self,
+ a: (i32, i32),
+ b: (i32, i32),
+ c: (i32, i32),
+ d: (i32, i32),
+ col: [u8; CHANNELS],
+ ) {
+ self.points(&[a, b, c, d, a], col);
+ }
}