34#include <glib/gstdio.h>
50 void *exif,
int exif_len, int32_t imgid,
int num,
int total,
struct dt_dev_pixelpipe_t *pipe,
51 const gboolean export_masks)
53 const uint16_t *in = (
const uint16_t *)in_tmp;
55 uint16_t *
row = (uint16_t *)in;
57 FILE *
f = g_fopen(filename,
"wb");
61 for(
int y = 0; y < ppm->
height; y++)
65 for(
int c = 0; c < 3; c++) swapped[c] = (0xff00 & (
row[c] << 8)) | (
row[c] >> 8);
66 int cnt = fwrite(&swapped,
sizeof(uint16_t), 3,
f);
95 if(
size != self->params_size(self))
return 1;
111 return "image/x-portable-pixmap";
121 return _(
"PPM (16-bit)");
typedef void((*dt_cache_allocate_t)(void *userdata, dt_cache_entry_t *entry))
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,...
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)
dt_colorspaces_color_profile_type_t