33#include <glib/gstdio.h>
49 void *exif,
int exif_len, int32_t imgid,
int num,
int total,
struct dt_dev_pixelpipe_t *pipe,
50 const gboolean export_masks)
52 const uint16_t *in = (
const uint16_t *)in_tmp;
54 uint16_t *
row = (uint16_t *)in;
56 FILE *
f = g_fopen(filename,
"wb");
60 for(
int y = 0; y < ppm->
height; y++)
64 for(
int c = 0; c < 3; c++) swapped[c] = (0xff00 & (
row[c] << 8)) | (
row[c] >> 8);
65 int cnt = fwrite(&swapped,
sizeof(uint16_t), 3,
f);
94 if(
size != self->params_size(self))
return 1;
110 return "image/x-portable-pixmap";
120 return _(
"PPM (16-bit)");
static const dt_aligned_pixel_simd_t const dt_adaptation_t const float p
dt_colorspaces_color_profile_type_t
const dt_aligned_pixel_t f
typedef void((*dt_cache_allocate_t)(void *userdata, dt_cache_entry_t *entry))
#define DT_MODULE(MODVER)
const char * mime(dt_imageio_module_data_t *data)
size_t params_size(dt_imageio_module_format_t *self)
void gui_reset(dt_imageio_module_format_t *self)
void gui_init(dt_imageio_module_format_t *self)
const char * extension(dt_imageio_module_data_t *data)
int set_params(dt_imageio_module_format_t *self, const void *params, const int size)
void cleanup(dt_imageio_module_format_t *self)
int levels(dt_imageio_module_data_t *p)
void free_params(dt_imageio_module_format_t *self, dt_imageio_module_data_t *params)
int write_image(dt_imageio_module_data_t *ppm, const char *filename, const void *in_tmp, dt_colorspaces_color_profile_type_t over_type, const char *over_filename, void *exif, int exif_len, int32_t imgid, int num, int total, struct dt_dev_pixelpipe_t *pipe, const gboolean export_masks)
void init(dt_imageio_module_format_t *self)
void * get_params(dt_imageio_module_format_t *self)
void gui_cleanup(dt_imageio_module_format_t *self)