fast image operations
save vecs too
bendn 2023-09-05
parent 7b3e67f · commit 5168d0f
-rw-r--r--src/lib.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index fda1cb2..d64c02c 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -243,6 +243,15 @@ impl<const CHANNELS: usize> Image<Vec<u8>, CHANNELS> {
}
macro_rules! save {
($channels:literal == $clr:ident ($clrhuman:literal)) => {
+ impl Image<Vec<u8>, $channels> {
+ #[doc = "Save this "]
+ #[doc = $clrhuman]
+ #[doc = " image."]
+ pub fn save(&self, f: impl AsRef<std::path::Path>) {
+ self.as_ref().save(f)
+ }
+ }
+
impl Image<&[u8], $channels> {
#[cfg(feature = "save")]
#[doc = "Save this "]