36#include <glib/gstdio.h>
45 void *exif,
int exif_len, int32_t imgid,
int num,
int total, struct
dt_dev_pixelpipe_t *pipe,
46 const gboolean export_masks)
50 FILE *
f = g_fopen(filename,
"wb");
56 snprintf(header, 1024,
"PF\n%d %d\n-1.0", pfm->
width, pfm->
height);
57 size_t len = strlen(header);
60 while((len + 1 + off) & 0xf) off++;
61 while(off-- > 0) fprintf(
f,
"0");
64 for(
int j = 0; j < pfm->
height; j++)
67 const int row_in = pfm->
height - 1 - j;
68 const float *in = (
const float *)ivoid + 4 * (
size_t)pfm->
width * row_in;
69 float *
out = (
float *)buf_line;
70 for(
int i = 0;
i < pfm->
width;
i++, in += 4,
out += 3)
72 memcpy(
out, in,
sizeof(
float) * 3);
75 int cnt = fwrite(buf_line,
sizeof(
float) * 3, pfm->
width,
f);
122 return "image/x-portable-floatmap";
132 return _(
"PFM (float)");
const dt_colormatrix_t dt_aligned_pixel_t out
GtkWidget * status
result of the last capture
#define dt_free(ptr)
g_free() ptr and set it to NULL, skipping both if it is already NULL.
#define DT_MODULE(MODVER)
Instantiate the version handshake every module must export. Use once, at file scope,...
#define dt_pixelpipe_cache_alloc_align_float_cache(pixels, id)
#define dt_pixelpipe_cache_free_align(mem)
dt_colorspaces_color_profile_type_t