-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jort van Waes
committed
Sep 20, 2023
1 parent
d6702d1
commit 00a7bb7
Showing
4 changed files
with
47 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
use crate::model::mandelbrot_model::MandelbrotModel; | ||
|
||
pub fn save(mandelbrot_model: &MandelbrotModel) { | ||
let time_stamp = chrono::Utc::now().to_string(); | ||
if mandelbrot_model.config.window_scale == 1.0 { | ||
Check warning on line 5 in src/view/image.rs
|
||
mandelbrot_model.p.save_as_png( | ||
&time_stamp, | ||
&mandelbrot_model.c.get_view(), | ||
&mandelbrot_model.m, | ||
mandelbrot_model.config.supersampling_amount, | ||
); | ||
} else { | ||
println!( | ||
"[UNSUPPORTED]: There is currently no support for saving images in the window scale is not 1.0. The window scale is {}.", | ||
mandelbrot_model.config.window_scale | ||
) | ||
Check warning on line 16 in src/view/image.rs
|
||
} | ||
|
||
/*else { | ||
let mut image_p: PixelBuffer = PixelBuffer::new(PixelPlane::new( | ||
mandelbrot_model.config.image_width, | ||
mandelbrot_model.config.image_height, | ||
)); | ||
let mut image_c: ComplexPlane = ComplexPlane::new(mandelbrot_model.config.image_width, mandelbrot_model.config.image_height); | ||
image_p.color_channel_mapping = mandelbrot_model.p.color_channel_mapping; | ||
image_c.set_view(&mandelbrot_model.c.get_view()); | ||
rendering::render_complex_plane_into_buffer(mandelbrot_model); | ||
image_p.save_as_png( | ||
&time_stamp, | ||
&mandelbrot_model.c.get_view(), | ||
&mandelbrot_model.m, | ||
mandelbrot_model.config.supersampling_amount, | ||
); | ||
}*/ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
pub mod image; | ||
pub mod minifb_mandelbrot_view; | ||
pub mod terminal; |