File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ fn main() -> anyhow::Result<()> {
6565 . expect ( "standalone render should not be cancelled" ) ;
6666
6767 let mut image = RgbImage :: new ( world. image_width , world. image_height ) ;
68+
6869 for ( flipped_y, row) in & rows {
6970 for ( x, pixel_color) in row. iter ( ) . enumerate ( ) {
7071 image. put_pixel (
@@ -73,7 +74,6 @@ fn main() -> anyhow::Result<()> {
7374 pixel_color. to_image_rgbu8 ( world. samples_per_pixel ) ,
7475 ) ;
7576 }
76- println ! ( "{} / {} scanlines done" , image. height( ) - flipped_y, world. image_height) ;
7777 }
7878
7979 ImageRgb8 ( image) . save ( "output.png" ) ?;
Original file line number Diff line number Diff line change @@ -101,13 +101,14 @@ pub fn render_frame(
101101 drop ( tx) ;
102102
103103 let mut rows = Vec :: with_capacity ( render_h as usize ) ;
104- for item in rx. iter ( ) {
104+ for ( idx , row ) in rx. iter ( ) . enumerate ( ) {
105105 if let Some ( ( ref generation, expected) ) = cancel
106106 && generation. load ( Ordering :: Acquire ) != expected
107107 {
108108 return None ;
109109 }
110- rows. push ( item) ;
110+ rows. push ( row) ;
111+ println ! ( "{} / {} scanlines done" , idx, world. image_height) ;
111112 }
112113
113114 if cancel. is_none_or ( |( generation, expected) | generation. load ( Ordering :: Acquire ) == expected) {
You can’t perform that action at this time.
0 commit comments