save vecs too

This commit is contained in:
bendn 2023-09-05 09:58:07 +07:00
parent 7b3e67fd19
commit 5168d0f6d9
No known key found for this signature in database
GPG key ID: 0D9D3A2A3B2A93D6

View file

@ -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 "]