15 bool parse_ppm(
const char *source,
int length, mpfr_t cx, mpfr_t cy, mpfr_t cz) {
18 char *source2 = strdup(source);
25 if (0 == strcmp(
"P6", line)) {
27 int len = strlen(line);
31 sx = (
char *) malloc(len);
32 sy = (
char *) malloc(len);
33 sz = (
char *) malloc(len);
34 if (3 == sscanf(line,
"# mightymandel %s + %s i @ %s", sx, sy, sz)) {
35 mpfr_set_prec(cz, 53);
36 mpfr_set_str(cz, sz, 10, MPFR_RNDN);
47 mpfr_set_str(cx, sx, 10, MPFR_RNDN);
48 mpfr_set_str(cy, sy, 10, MPFR_RNDN);