equal
deleted
inserted
replaced
26 |
26 |
27 if (verbose) |
27 if (verbose) |
28 fprintf(stdout, "rendered %dx%d mandelbrot in %f seconds\n", img_w, img_h, duration); |
28 fprintf(stdout, "rendered %dx%d mandelbrot in %f seconds\n", img_w, img_h, duration); |
29 } |
29 } |
30 |
30 |
|
31 #if 0 |
31 void render_remote (int img_w, int img_h, FILE *output, FILE *remote) { |
32 void render_remote (int img_w, int img_h, FILE *output, FILE *remote) { |
32 render_t ctx; |
33 render_t ctx; |
33 struct render_cmd cmd; |
34 struct render_cmd cmd; |
34 |
35 |
35 render_init(&ctx, RENDER_PNG); |
36 render_init(&ctx, RENDER_PNG); |
99 |
100 |
100 setbuffer(fh, NULL, 0); |
101 setbuffer(fh, NULL, 0); |
101 |
102 |
102 return fh; |
103 return fh; |
103 } |
104 } |
|
105 #endif |
104 |
106 |
105 int main (int argc, char **argv) { |
107 int main (int argc, char **argv) { |
106 int opt; |
108 int opt; |
107 |
109 |
108 FILE *output = NULL, *remote = NULL; |
110 FILE *output = NULL, *remote = NULL; |
132 |
134 |
133 case 'v' : |
135 case 'v' : |
134 verbose = 1; |
136 verbose = 1; |
135 break; |
137 break; |
136 |
138 |
|
139 #if 0 |
137 case 'r' : |
140 case 'r' : |
138 if (remote) |
141 if (remote) |
139 err_exit("Only use -r once"); |
142 err_exit("Only use -r once"); |
140 |
143 |
141 remote = open_remote(optarg); |
144 remote = open_remote(optarg); |
142 |
145 |
143 break; |
146 break; |
|
147 #endif |
144 |
148 |
145 default : |
149 default : |
146 err_exit("Usage: %s [-w img_w] [-h img_h] [-o output_file] [-v] [-r host[:port]]", argv[0]); |
150 err_exit("Usage: %s [-w img_w] [-h img_h] [-o output_file] [-v] [-r host[:port]]", argv[0]); |
147 } |
151 } |
148 } |
152 } |
149 |
153 |
150 if (!output) |
154 if (!output) |
151 output = stdout; |
155 output = stdout; |
152 |
156 |
|
157 #if 0 |
153 if (remote) { |
158 if (remote) { |
154 if (verbose) |
159 if (verbose) |
155 fprintf(stderr, "Render [%dx%d] mandelbrot remotely\n", img_w, img_h); |
160 fprintf(stderr, "Render [%dx%d] mandelbrot remotely\n", img_w, img_h); |
156 |
161 |
157 render_remote(img_w, img_h, output, remote); |
162 render_remote(img_w, img_h, output, remote); |
158 |
163 |
159 fclose(remote); |
164 fclose(remote); |
160 } else { |
165 } else |
|
166 #endif |
|
167 { |
161 if (verbose) |
168 if (verbose) |
162 fprintf(stderr, "Render [%dx%d] mandelbrot locally\n", img_w, img_h); |
169 fprintf(stderr, "Render [%dx%d] mandelbrot locally\n", img_w, img_h); |
163 |
170 |
164 render_local(img_w, img_h, output); |
171 render_local(img_w, img_h, output); |
165 } |
172 } |