mirror of
https://github.com/bend-n/fimg.git
synced 2024-12-22 10:28:21 -06:00
save vecs too
This commit is contained in:
parent
7b3e67fd19
commit
5168d0f6d9
|
@ -243,6 +243,15 @@ impl<const CHANNELS: usize> Image<Vec<u8>, CHANNELS> {
|
||||||
}
|
}
|
||||||
macro_rules! save {
|
macro_rules! save {
|
||||||
($channels:literal == $clr:ident ($clrhuman:literal)) => {
|
($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> {
|
impl Image<&[u8], $channels> {
|
||||||
#[cfg(feature = "save")]
|
#[cfg(feature = "save")]
|
||||||
#[doc = "Save this "]
|
#[doc = "Save this "]
|
||||||
|
|
Loading…
Reference in a new issue