File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 2222class camera {
2323 public:
2424 double aspect_ratio = 1.0 ; // Ratio of image width over height
25- int image_width = 100 ; // Rendered image width in pixel count
25+ int image_width = 60 ; // Rendered image width in pixel count
2626 int samples_per_pixel = 10 ; // Count of random samples for each pixel
2727 int max_depth = 10 ; // Maximum number of ray bounces into scene
2828
@@ -37,6 +37,8 @@ class camera {
3737 void render (const hittable& world) {
3838 initialize ();
3939
40+ std::cout << " P3\n " << image_width << ' ' << image_height << " \n 255\n " ;
41+
4042 std::clog << " P3\n " << image_width << ' ' << image_height << " \n 255\n " << std::endl;
4143
4244 int core_count = 6 ;
@@ -57,13 +59,12 @@ class camera {
5759 else if (pid == 0 ) {
5860 // Child proccess
5961 std::clog << " Created child process number: " << i << std::endl;
60- int j = i*render_tile_size;
61- while (j < j+(i*render_tile_size)) {
62+ int start = i*render_tile_size;
63+ int j = start;
64+ while (j < start + render_tile_size) {
6265 render_line (j, world, rendered_image);
6366 j++;
6467 }
65-
66- std::clog << " process" << i << " finished" << std::endl;
6768 exit (0 );
6869 }
6970 }
@@ -108,7 +109,7 @@ class camera {
108109 printf (" Wait failed.\n " );
109110 exit (1 );
110111 }
111- std::clog << " child number " << n << " finished" << std::endl;
112+ std::clog << " process finished" << std::endl;
112113 n--;
113114 }
114115
You can’t perform that action at this time.
0 commit comments