vrellis_core/canvas/
save.rs

1use crate::{Result, VrellisCanvas};
2use image::ImageFormat;
3use std::{fs, path::Path};
4
5impl VrellisCanvas {
6    pub fn save_image_steps(&self, dir: impl AsRef<Path>) -> Result<()> {
7        let _ = dir;
8        unimplemented!()
9    }
10    pub fn save_image(&self, path: impl AsRef<Path>) -> Result<()> {
11        Ok(self.draw_image().save_with_format(path, ImageFormat::Png)?)
12    }
13}
14
15impl VrellisCanvas {
16    pub fn save_svg_steps(&self, dir: impl AsRef<Path>) -> Result<()> {
17        let _ = dir;
18        unimplemented!()
19    }
20    pub fn save_svg(&self, path: impl AsRef<Path>) -> Result<()> {
21        Ok(fs::write(path, self.draw_svg().as_bytes())?)
22    }
23}
24
25impl VrellisCanvas {
26    pub fn save_sequence(&self, _: impl AsRef<Path>) -> Result<()> {
27        unimplemented!()
28    }
29}