30#include <glib/gstdio.h>
36float *
read_pfm(
const char *filename,
int *wd,
int *ht)
59 else if(magic[1] ==
'f')
92 for(
int c = 0; c < 3; c++)
98 v.f = image[3 * (
i - 1) + c];
100 image[3 * (
i - 1) + c] =
v.f;
112 int ret =
fread(&
v.f,
sizeof(
float), 1,
f);
123 float *line = (
float *)
calloc(3 *
width,
sizeof(
float));
152 const float *in = data + 3 * (size_t)
width *
row_in;
float * read_pfm(const char *filename, int *wd, int *ht)
void write_pfm(const char *filename, int width, int height, float *data)
static void error(char *msg)
typedef void((*dt_cache_allocate_t)(void *userdata, dt_cache_entry_t *entry))
const dt_colormatrix_t dt_aligned_pixel_t out
#define IS_NULL_PTR(p)
C is way too permissive with !=, == and if(var) checks, which can mean too many things depending on w...
#define dt_free(ptr)
g_free() ptr and set it to NULL, skipping both if it is already NULL.
#define dt_pixelpipe_cache_alloc_align_float_cache(pixels, id)
#define dt_pixelpipe_cache_free_align(mem)