[julia] add option for color displacement

This commit is contained in:
Lucas 2020-03-08 02:15:16 +00:00
parent 5c74874352
commit 6627e3f08e

13
julia.c
View File

@ -128,7 +128,7 @@ usage(void)
fprintf(stderr, "Usage: %s julia [-L] [-x julia_x] [-y julia_y]\n"
" [-n niters] [-h height] [-w width] [-z zoom]\n"
" [-a center_x] [-b center_y] [-l light_intensity]\n"
" [-d density] [-c contour]\n",
" [-d density] [-c contour] [-D displacement]\n",
xgetprogname());
exit(1);
}
@ -161,7 +161,7 @@ julia_main(int argc, char *argv[])
i, j;
int ch, do_light = 0;
while ((ch = getopt(argc, argv, "a:b:c:d:h:Ll:n:w:x:y:z:")) != -1)
while ((ch = getopt(argc, argv, "a:b:c:D:d:h:Ll:n:w:x:y:z:")) != -1)
switch (ch) {
case 'a':
errno = 0;
@ -191,6 +191,15 @@ julia_main(int argc, char *argv[])
exit(1);
}
break;
case 'D':
errno = 0;
displacement = strtold(optarg, &end);
if (end == optarg || *end != '\0' || errno != 0) {
fprintf(stderr, "-d: invalid value \"%s\"",
optarg);
exit(1);
}
break;
case 'd':
errno = 0;
density = strtold(optarg, &end);