diff options
author | tomsmeding <tom.smeding@gmail.com> | 2017-04-05 16:01:17 +0200 |
---|---|---|
committer | tomsmeding <tom.smeding@gmail.com> | 2017-04-05 16:01:17 +0200 |
commit | ce3318404a44f39fc51c951643e18caa734c386d (patch) | |
tree | 4fcda5e8a86b6bdcb3e44b02d62b50bf827194b0 | |
parent | 3c845bf493856da2de260f56f60d11a6c746ccef (diff) |
Make exponent an optional command-line param
-rw-r--r-- | attract.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -119,13 +119,18 @@ static void* thread_entry(void *arg_vp){ pthread_exit(NULL); } -int main(void){ +int main(int argc,char **argv){ struct config cfg={ .unitsz=200, .width=500, .height=500, .exponent=8.5 }; + assert(argc==1||argc==2); + if(argc==2){ + cfg.exponent=strtod(argv[1],NULL); + } + unsigned char img[cfg.width*cfg.height*3]; int nthreads=sysconf(_SC_NPROCESSORS_ONLN); |