ft: 2.3: debug log
This commit is contained in:
@@ -1,10 +1,16 @@
|
|||||||
|
use log::info;
|
||||||
|
use pretty_env_logger;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
pretty_env_logger::init();
|
||||||
|
|
||||||
let image_width = 256;
|
let image_width = 256;
|
||||||
let image_height = 256;
|
let image_height = 256;
|
||||||
|
|
||||||
let mut imgbuf = image::ImageBuffer::new(image_width, image_height);
|
let mut imgbuf = image::ImageBuffer::new(image_width, image_height);
|
||||||
|
|
||||||
for j in 0..image_height {
|
for j in 0..image_height {
|
||||||
|
info!("{}\tScanlines remaining.", (image_height - j));
|
||||||
for i in 0..image_width {
|
for i in 0..image_width {
|
||||||
let r = i as f32 / (image_width - 1) as f32;
|
let r = i as f32 / (image_width - 1) as f32;
|
||||||
let g = j as f32 / (image_height - 1) as f32;
|
let g = j as f32 / (image_height - 1) as f32;
|
||||||
@@ -19,5 +25,6 @@ fn main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
info!("Writing image file...");
|
||||||
imgbuf.save("output.png").unwrap();
|
imgbuf.save("output.png").unwrap();
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
src/output.png
BIN
src/output.png
Binary file not shown.
|
Before Width: | Height: | Size: 2.0 KiB |
Reference in New Issue
Block a user