#include <assert.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <mpfr.h>
#include "parse.h"
#include "parse_ppm.h"
Go to the source code of this file.
Functions | |
bool | parse_ppm (const char *source, int length, mpfr_t cx, mpfr_t cy, mpfr_t cz) |
Parse the original mightymandel .ppm metadata file format. |
bool parse_ppm | ( | const char * | source, |
int | length, | ||
mpfr_t | cx, | ||
mpfr_t | cy, | ||
mpfr_t | cz | ||
) |
Parse the original mightymandel .ppm
metadata file format.
File format example:
P6 # mightymandel -0.75 + 0.0 i @ 1.5 1280 720 255
followed by binary image data. The binary image data could contain all kinds of confusing things, so we don't parse the whole file.
source | A null-terminated input file already loaded into memory. |
length | Length of the input file (without the extra null terminator). |
cx | For output of the real part of the view center. It is already mpfr_init2() 'd. |
cy | For output of the imaginary part of the view center. It is already mpfr_init2() 'd. |
cz | For output of the view radius. It is already mpfr_init2() 'd. |
true
) or failure (false
). Definition at line 15 of file parse_ppm.c.
References parse_line(), precision_for_radius(), and radius_is_valid().