103#if defined(HAVE_GRAPHICSMAGICK)
104#include <magick/api.h>
105#include <magick/blob.h>
106#elif defined(HAVE_IMAGEMAGICK)
107#include <MagickWand/MagickWand.h>
111#include <glib/gstdio.h>
130 = {
"3fr",
"ari",
"arw",
"bay",
"cr2",
"cr3",
"crw",
"dc2",
"dcr",
"erf",
"fff",
131 "ia",
"iiq",
"k25",
"kc2",
"kdc",
"mdc",
"mef",
"mos",
"mrw",
"nef",
"nrw",
132 "orf",
"pef",
"raf",
"raw",
"rw2",
"rwl",
"sr2",
"srf",
"srw",
"sti",
"x3f", NULL };
135 = {
"bmp",
"bmq",
"cap",
"cine",
"cs1",
"dcm",
"gif",
"gpr",
"j2c",
"j2k",
"jng",
"jp2",
"jpc",
136 "jpeg",
"jpg",
"miff",
"mng",
"ori",
"pbm",
"pgm",
"png",
"pnm",
"ppm",
"pxn",
"qtk",
"rdc",
156#if defined(HAVE_GRAPHICSMAGICK)
157static const char *_preview_format_from_mime_type(
const char *mime_type)
159 if(
IS_NULL_PTR(mime_type) || mime_type[0] ==
'\0')
return NULL;
161 if(!strcmp(mime_type,
"image/jpeg"))
return "JPEG";
162 if(!strcmp(mime_type,
"image/png"))
return "PNG";
163 if(!strcmp(mime_type,
"image/tiff"))
return "TIFF";
164 if(!strcmp(mime_type,
"image/x-tiff"))
return "TIFF";
165 if(!strcmp(mime_type,
"image/gif"))
return "GIF";
166 if(!strcmp(mime_type,
"image/bmp"))
return "BMP";
167 if(!strcmp(mime_type,
"image/x-portable-pixmap"))
return "PPM";
168 if(!strcmp(mime_type,
"image/x-portable-graymap"))
return "PGM";
169 if(!strcmp(mime_type,
"image/x-portable-bitmap"))
return "PBM";
170 if(!strcmp(mime_type,
"image/x-portable-anymap"))
return "PNM";
171 if(!strcmp(mime_type,
"image/webp"))
return "WEBP";
185 if(!g_ascii_strncasecmp(ext, *
i, strlen(*
i)))
192 if(!g_ascii_strncasecmp(ext, *
i, strlen(*
i)))
199 if(!g_ascii_strncasecmp(ext, *
i, strlen(*
i)))
214 char *mime_type = NULL;
220 if(strcmp(mime_type,
"image/jpeg") == 0)
228 if(!*buffer)
goto error;
230 *th_width = jpg.
width;
245#if defined(HAVE_GRAPHICSMAGICK)
246 const char *
const preview_format = _preview_format_from_mime_type(mime_type);
247 ExceptionInfo exception;
249 ImageInfo *image_info = NULL;
251 GetExceptionInfo(&exception);
252 image_info = CloneImageInfo((ImageInfo *)NULL);
254 g_strlcpy(image_info->magick, preview_format,
sizeof(image_info->magick));
256 image = BlobToImage(image_info, buf, bufsize, &exception);
258 if(exception.severity != UndefinedException) CatchException(&exception);
262 fprintf(stderr,
"[dt_imageio_large_thumbnail GM] thumbnail not found?\n");
266 *th_width = image->columns;
267 *th_height = image->rows;
271 sizeof(uint8_t) * 4 * image->columns * image->rows,
273 if(!*buffer)
goto error_gm;
275 for(uint32_t
row = 0;
row < image->rows;
row++)
277 uint8_t *bufprt = *buffer + (size_t)4 *
row * image->columns;
278 int gm_ret = DispatchImage(image, 0,
row, image->columns, 1,
"RGBP", CharPixel, bufprt, &exception);
280 if(exception.severity != UndefinedException) CatchException(&exception);
282 if(gm_ret != MagickPass)
284 fprintf(stderr,
"[dt_imageio_large_thumbnail GM] error_gm reading thumbnail\n");
295 if(image) DestroyImage(image);
296 if(image_info) DestroyImageInfo(image_info);
297 DestroyExceptionInfo(&exception);
299#elif defined(HAVE_IMAGEMAGICK)
300 MagickWand *image = NULL;
301 MagickBooleanType mret;
303 image = NewMagickWand();
304 mret = MagickReadImageBlob(image, buf, bufsize);
305 if(mret != MagickTrue)
307 fprintf(stderr,
"[dt_imageio_large_thumbnail IM] thumbnail not found?\n");
311 *th_width = MagickGetImageWidth(image);
312 *th_height = MagickGetImageHeight(image);
313 switch (MagickGetImageColorspace(image)) {
319 "[dt_imageio_large_thumbnail IM] could not map colorspace, using sRGB");
324 *buffer = malloc(
sizeof(uint8_t) * (*th_width) * (*th_height) * 4);
327 mret = MagickExportImagePixels(image, 0, 0, *th_width, *th_height,
"RGBP", CharPixel, *buffer);
328 if(mret != MagickTrue) {
331 "[dt_imageio_large_thumbnail IM] error while reading thumbnail\n");
338 DestroyMagickWand(image);
339 if(res != 0)
goto error;
342 "[dt_imageio_large_thumbnail] error: The thumbnail image is not in "
343 "JPEG format, and DT was built without neither GraphicsMagick or "
344 "ImageMagick. Please rebuild DT with GraphicsMagick or ImageMagick "
345 "support enabled.\n");
353 "[dt_imageio_large_thumbnail] error: Not a supported thumbnail image format or broken thumbnail: %s\n",
368 int32_t thumb_width = 0, thumb_height = 0;
369 gboolean mono =
FALSE;
373 if((thumb_width < 32) || (thumb_height < 32) || (
IS_NULL_PTR(tmp)))
377 for(
int y = 0; y < thumb_height; y++)
379 uint8_t *in = (uint8_t *)tmp + (
size_t)4 * y * thumb_width;
380 for(
int x = 0;
x < thumb_width;
x++, in += 4)
382 if((in[0] != in[1]) || (in[0] != in[2]) || (in[1] != in[2]))
392 dt_print(
DT_DEBUG_IMAGEIO,
"[dt_imageio_has_mono_preview] testing `%s', yes/no %i, %ix%i\n", filename, mono, thumb_width, thumb_height);
399 const int fwd,
const int fht,
const int stride,
405 for(
int j = 0; j < ht; j++) memcpy(
out + (
size_t)j *
bpp * wd, in + (
size_t)j * stride,
bpp * wd);
409 int si =
bpp, sj = wd *
bpp;
417 jj = (int)fht - jj - 1;
422 ii = (int)fwd - ii - 1;
426 for(
int j = 0; j < ht; j++)
428 char *out2 =
out + (size_t)labs(sj) * jj + (size_t)labs(si) * ii + (size_t)sj * j;
429 const char *in2 = in + (size_t)stride * j;
430 for(
int i = 0;
i < wd;
i++)
432 memcpy(out2, in2,
bpp);
440 const int ch,
const int wd,
const int ht,
const int fwd,
441 const int fht,
const int stride,
444 const float scale = 1.0f / (white - black);
448 for(
int j = 0; j < ht; j++)
449 for(
int i = 0;
i < wd;
i++)
450 for(
int k = 0;
k <
ch;
k++)
451 out[4 * ((
size_t)j * wd +
i) +
k] = (in[(size_t)j * stride + (
size_t)
ch *
i +
k] - black) * scale;
455 int si = 4, sj = wd * 4;
463 jj = (int)fht - jj - 1;
468 ii = (int)fwd - ii - 1;
472 for(
int j = 0; j < ht; j++)
474 float *out2 =
out + (size_t)labs(sj) * jj + (size_t)labs(si) * ii + sj * j;
475 const uint8_t *in2 = in + (size_t)stride * j;
476 for(
int i = 0;
i < wd;
i++)
478 for(
int k = 0;
k <
ch;
k++) out2[
k] = (in2[
k] - black) * scale;
527 ".jpg",
".jpeg",
".png",
".tiff",
".tif",
".pgm",
".pbm",
".ppm",
542 const char *c = filename + strlen(filename);
543 while(c > filename && *c !=
'.') c--;
544 if(*c !=
'.')
return FALSE;
558 ".3fr",
".ari",
".arw",
".bay",
".bmq",
".cap",
".cine",
".cr2",
".crw",
".cs1",
".dc2",
559 ".dcr",
".dng",
".gpr",
".erf",
".fff",
".ia",
".iiq",
".k25",
".kc2",
".kdc",
".mdc",
560 ".mef",
".mos",
".mrw",
".nef",
".nrw",
".orf",
".ori",
".pef",
".pxn",
".qtk",
".raf",
561 ".raw",
".rdc",
".rw2",
".rwl",
".sr2",
".srf",
".srw",
".x3f",
573 const char *c = filename + strlen(filename);
574 while(c > filename && *c !=
'.') c--;
575 if(*c !=
'.')
return FALSE;
599 ".heif",
".heic",
".hif",
608 const char *c = filename + strlen(filename);
609 while(c > filename && *c !=
'.') c--;
610 if(*c !=
'.')
return FALSE;
625 gboolean success =
FALSE;
630 success = !g_ascii_strncasecmp(list, elem, strlen(elem));
631 list = strtok(NULL,
",");
641 gboolean is_handled =
FALSE;
643 char *ext = g_strrstr(filename,
".") + 1;
648 is_handled |=
_is_in_list(ext, strtok(extensions,
","));
656 const char *iolib = (is_handled) ?
"Libraw" :
"Rawspeed";
757 *num = (int)(in * *den + .5f);
758 while(fabsf(*num / (
float)*den - in) > 0.001f)
761 *num = (int)(in * *den + .5f);
767 const gboolean copy_metadata,
const gboolean export_masks,
772 if(strcmp(format->mime(format_params),
"x-copy") == 0)
774 return format->write_image(format_params, filename, NULL, icc_type, icc_filename, NULL, 0, imgid, num, total, NULL,
778 const gboolean is_scaling =
782 FALSE, NULL, copy_metadata, export_masks, icc_type, icc_filename, icc_intent,
783 storage, storage_params, num, total, metadata, NULL);
792 dt_control_log(_(
"cannot find the style '%s' to apply during export."), format_params->
style);
800 for(GList *st_items = style_items; st_items; st_items = g_list_next(st_items))
816 fprintf(stderr,
"[dt_imageio_export_with_flags] ");
819 fprintf(stderr,
"appending style `%s'\n", format_params->
style);
821 else fprintf(stderr,
"\n");
823 for(GList *nodes = pipe->
nodes; nodes; nodes = g_list_next(nodes))
829 fprintf(stderr,
" %s", piece->module->op);
832 fprintf(stderr,
" (%i)\n", cnt);
850 int width,
int height,
int *processed_width,
int *processed_height)
858 const double scale_factor = _num / _denum;
859 *scale = fmin(scale_factor, 1.);
882 *scale = fmin(scale_x, scale_y);
885 if(image_ratio > 1.0)
889 *processed_height =
MIN((
int)roundf(*processed_width / image_ratio), pipe->
processed_height);
891 else if(image_ratio < 1.0)
895 *processed_width =
MIN((
int)roundf(*processed_height * image_ratio), pipe->
processed_width);
910 *processed_height = (int)roundf(*processed_width / image_ratio);
916 *processed_width = (int)roundf(*processed_height * image_ratio);
921 *scale = fmin(scale_x, scale_y);
928 const size_t processed_height)
931 for(
size_t k = 0;
k < processed_width * processed_height;
k++)
933 outbuf[4 *
k + c] = (uint8_t)
CLAMPF(roundf(inbuf[4 *
k + c] * 255.f), 0.f, 255.f);
938 const size_t processed_width,
const size_t processed_height)
941 for(
size_t k = 0;
k < processed_width * processed_height;
k++)
943 outbuf[4 *
k + 0] = (uint8_t)
CLAMPF(roundf(inbuf[4 *
k + 2] * 255.f), 0.f, 255.f);
944 outbuf[4 *
k + 1] = (uint8_t)
CLAMPF(roundf(inbuf[4 *
k + 1] * 255.f), 0.f, 255.f);
945 outbuf[4 *
k + 2] = (uint8_t)
CLAMPF(roundf(inbuf[4 *
k + 0] * 255.f), 0.f, 255.f);
946 outbuf[4 *
k + 3] = (uint8_t)
CLAMPF(roundf(inbuf[4 *
k + 3] * 255.f), 0.f, 255.f);
952 const size_t processed_width,
const size_t processed_height)
955 for(
size_t k = 0;
k < processed_width * processed_height;
k++)
957 outbuf[4 *
k + c] = (uint16_t)CLAMP(roundf(inbuf[4 *
k + c] * 65535.f), 0.f, 65535.f);
963 const gboolean ignore_exif,
const gboolean display_byteorder,
964 const gboolean high_quality, gboolean is_scaling,
const gboolean thumbnail_export,
965 const char *filter,
const gboolean copy_metadata,
const gboolean export_masks,
985 const gboolean use_style = !thumbnail_export && format_params->
style[0] !=
'\0';
1002 if(!res)
goto error;
1025 const size_t buf_width = buf.
width;
1026 const size_t buf_height = buf.
height;
1056 int processed_width = 0;
1057 int processed_height = 0;
1059 &processed_width, &processed_height);
1062 "[dt_imageio_export] (direct) image input %ix%i, turned to output %ix%i, will be exported to fit %ix%i "
1063 "--> final size is %ix%i\n",
1068 const int bpp = format->bpp(format_params);
1074 dt_show_times(&start, thumbnail_export ?
"[dev_process_thumbnail] pixel pipeline processing thread"
1075 :
"[dev_process_export] pixel pipeline processing thread");
1086 &cache_entry, pipe.
devid, NULL))
1101 sizeof(uint8_t) * pixels,
1103 if(outbuf && display_byteorder)
1113 if(outbuf && thumbnail_export)
1115 uint8_t *thumbnail_buf = (uint8_t *)outbuf;
1117 for(
size_t k = 0;
k < pixels / 4;
k++) thumbnail_buf[4 *
k + 3] = UINT8_MAX;
1123 sizeof(uint16_t) * pixels,
1128 if(outbuf && thumbnail_export)
1130 uint16_t *thumbnail_buf = (uint16_t *)outbuf;
1132 for(
size_t k = 0;
k < pixels / 4;
k++) thumbnail_buf[4 *
k + 3] = UINT16_MAX;
1138 sizeof(float_t) * pixels,
1141 memcpy(outbuf,
data,
sizeof(float_t) * pixels);
1143 if(outbuf && thumbnail_export)
1145 float *thumbnail_buf = (
float *)outbuf;
1147 for(
size_t k = 0;
k < pixels / 4;
k++) thumbnail_buf[4 *
k + 3] = 1.0f;
1164 uint8_t *exif_profile = NULL;
1168 gboolean from_cache =
TRUE;
1178 res = format->write_image(format_params, filename, outbuf, icc_type, icc_filename, exif_profile, length, imgid,
1179 num, total, &pipe, export_masks);
1191 if(!thumbnail_export && strcmp(format->mime(format_params),
"memory")
1195 format_params, storage, storage_params);
1220#if defined(HAVE_GRAPHICSMAGICK)
1222#elif defined(HAVE_IMAGEMAGICK)
1236 const char *filename,
1240 if(!g_file_test(filename, G_FILE_TEST_IS_REGULAR))
1254 fprintf(stderr,
"[imageio] The file %s is corrupted. Abort.\n", filename);
1265 fprintf(stderr,
"[imageio] The file %s is corrupted. Abort.\n", filename);
1276 fprintf(stderr,
"[imageio] The file %s is corrupted. Abort.\n", filename);
1296 fprintf(stderr,
"[imageio] The file %s is supported by none of our decoders.\n", filename);
1297 dt_control_log(_(
"The file `%s` is supported by none of our decoders."), filename);
1313 char *mk,
int mk_len,
char *md,
int md_len,
1314 char *al,
int al_len)
static void error(char *msg)
const char * extension(dt_imageio_module_data_t *data)
void cleanup(dt_imageio_module_format_t *self)
const dt_colorspaces_color_profile_t * dt_colorspaces_get_output_profile(const int32_t imgid, dt_colorspaces_color_profile_type_t *over_type, const char *over_filename)
dt_colorspaces_color_profile_type_t
static dt_aligned_pixel_t sRGB
const dt_colormatrix_t dt_aligned_pixel_t out
void dt_image_buffer_resolve_flags(dt_image_t *img)
void dt_image_full_path(const int32_t imgid, char *pathname, size_t pathname_len, gboolean *from_cache, const char *calling_func)
Get the full path of an image out of the database.
gchar * dt_conf_get_string(const char *name)
gboolean dt_conf_is_equal(const char *name, const char *value)
void dt_control_log(const char *msg,...)
void dt_show_times(const dt_times_t *start, const char *prefix)
void dt_print(dt_debug_thread_t thread, const char *msg,...)
#define dt_pixelpipe_cache_alloc_align_cache(size, id)
static void dt_get_times(dt_times_t *t)
#define dt_pixelpipe_cache_free_align(mem)
#define __DT_CLONE_TARGETS__
#define for_four_channels(_var,...)
#define __OMP_PARALLEL_FOR__(...)
#define IS_NULL_PTR(p)
C is way too permissive with !=, == and if(var) checks, which can mean too many things depending on w...
void dt_dev_pop_history_items(dt_develop_t *dev)
Thread-safe wrapper around dt_dev_pop_history_items_ext(), then update GUI.
void dt_dev_pixelpipe_propagate_formats(dt_dev_pixelpipe_t *pipe)
void dt_dev_pixelpipe_get_roi_out(dt_dev_pixelpipe_t *pipe, const int width_in, const int height_in, int *width, int *height)
void dt_dev_cleanup(dt_develop_t *dev)
dt_dev_image_storage_t dt_dev_load_image(dt_develop_t *dev, const int32_t imgid)
void dt_dev_init(dt_develop_t *dev, int32_t gui_attached)
int dt_exif_xmp_attach_export(const int32_t imgid, const char *filename, void *metadata)
int dt_exif_get_thumbnail(const char *path, uint8_t **buffer, size_t *size, char **mime_type, int *width, int *height, int min_width)
int dt_exif_read_blob(uint8_t **buf, const char *path, const int32_t imgid, const int sRGB, const int out_width, const int out_height, const int dng_mode)
@ DT_IMAGEIO_FILE_CORRUPTED
int dt_imageio_export_with_flags(const int32_t imgid, const char *filename, dt_imageio_module_format_t *format, dt_imageio_module_data_t *format_params, const gboolean ignore_exif, const gboolean display_byteorder, const gboolean high_quality, gboolean is_scaling, const gboolean thumbnail_export, const char *filter, const gboolean copy_metadata, const gboolean export_masks, dt_colorspaces_color_profile_type_t icc_type, const gchar *icc_filename, dt_iop_color_intent_t icc_intent, dt_imageio_module_storage_t *storage, dt_imageio_module_data_t *storage_params, int num, int total, dt_export_metadata_t *metadata, dt_atomic_int *shutdown)
void _clamp_float_to_uint8(const float *const inbuf, uint8_t *const outbuf, const size_t processed_width, const size_t processed_height)
void dt_imageio_flip_buffers_ui8_to_float(float *out, const uint8_t *in, const float black, const float white, const int ch, const int wd, const int ht, const int fwd, const int fht, const int stride, const dt_image_orientation_t orientation)
int dt_imageio_is_hdr(const char *filename)
static const gchar * _supported_raw[]
static const char * raster_formats[]
static const char * raw_formats[]
gboolean dt_imageio_lookup_makermodel(const char *maker, const char *model, char *mk, int mk_len, char *md, int md_len, char *al, int al_len)
dt_imageio_retval_t dt_imageio_open(dt_image_t *img, const char *filename, dt_mipmap_buffer_t *buf)
int dt_imageio_export(const int32_t imgid, const char *filename, dt_imageio_module_format_t *format, dt_imageio_module_data_t *format_params, const gboolean high_quality, const gboolean copy_metadata, const gboolean export_masks, dt_colorspaces_color_profile_type_t icc_type, const gchar *icc_filename, dt_iop_color_intent_t icc_intent, dt_imageio_module_storage_t *storage, dt_imageio_module_data_t *storage_params, int num, int total, dt_export_metadata_t *metadata)
void _swap_byteorder_float_to_uint8(const float *const restrict inbuf, uint8_t *const outbuf, const size_t processed_width, const size_t processed_height)
dt_imageio_retval_t dt_imageio_open_raster(dt_image_t *img, const char *filename, dt_mipmap_buffer_t *buf)
void _filter_pipeline(const char *filter, dt_dev_pixelpipe_t *pipe)
static const gchar * _supported_ldr[]
static const char * hdr_formats[]
gboolean dt_imageio_is_raster(const char *filename)
gboolean dt_imageio_has_mono_preview(const char *filename)
void dt_imageio_to_fractional(float in, uint32_t *num, uint32_t *den)
gboolean dt_imageio_is_handled_by_libraw(dt_image_t *img, const char *filename)
gboolean _get_export_size(dt_develop_t *dev, dt_dev_pixelpipe_t *pipe, const dt_imageio_module_data_t *format_params, const gboolean is_scaling, double *scale, int width, int height, int *processed_width, int *processed_height)
gboolean _apply_style_before_export(dt_develop_t *dev, dt_imageio_module_data_t *format_params, const int32_t imgid)
dt_imageio_retval_t dt_imageio_open_hdr(dt_image_t *img, const char *filename, dt_mipmap_buffer_t *buf)
dt_imageio_retval_t dt_imageio_open_raw(dt_image_t *img, const char *filename, dt_mipmap_buffer_t *buf)
static gboolean _is_in_list(char *elem, char *list)
gboolean dt_imageio_is_raw(const char *filename)
dt_imageio_retval_t dt_imageio_open_exotic(dt_image_t *img, const char *filename, dt_mipmap_buffer_t *buf)
dt_image_flags_t dt_imageio_get_type_from_extension(const char *extension)
Map Exiv2 preview MIME types to decoder format identifiers.
int dt_imageio_large_thumbnail(const char *filename, uint8_t **buffer, int32_t *th_width, int32_t *th_height, dt_colorspaces_color_profile_type_t *color_space, const int width, const int height)
Load the thumbnail embedded into a RAW file having at least the size MAX(width, height) x MAX(width,...
static const gchar * _supported_hdr[]
void _print_export_debug(dt_dev_pixelpipe_t *pipe, dt_imageio_module_data_t *format_params, const gboolean use_style)
__DT_CLONE_TARGETS__ void dt_imageio_flip_buffers(char *out, const char *in, const size_t bpp, const int wd, const int ht, const int fwd, const int fht, const int stride, const dt_image_orientation_t orientation)
void _export_final_buffer_to_uint16(const float *const restrict inbuf, uint16_t *const outbuf, const size_t processed_width, const size_t processed_height)
dt_imageio_retval_t dt_imageio_open_avif(dt_image_t *img, const char *filename, dt_mipmap_buffer_t *mbuf)
dt_imageio_retval_t dt_imageio_open_exr(dt_image_t *img, const char *filename, dt_mipmap_buffer_t *mbuf)
dt_imageio_retval_t dt_imageio_open_gm(dt_image_t *img, const char *filename, dt_mipmap_buffer_t *buf)
dt_imageio_retval_t dt_imageio_open_heif(dt_image_t *img, const char *filename, dt_mipmap_buffer_t *mbuf)
dt_imageio_retval_t dt_imageio_open_im(dt_image_t *img, const char *filename, dt_mipmap_buffer_t *buf)
dt_imageio_retval_t dt_imageio_open_j2k(dt_image_t *img, const char *filename, dt_mipmap_buffer_t *mbuf)
int dt_imageio_jpeg_decompress_header(const void *in, size_t length, dt_imageio_jpeg_t *jpg)
dt_imageio_retval_t dt_imageio_open_jpeg(dt_image_t *img, const char *filename, dt_mipmap_buffer_t *mbuf)
int dt_imageio_jpeg_decompress(dt_imageio_jpeg_t *jpg, uint8_t *out)
dt_imageio_retval_t dt_imageio_open_libraw(dt_image_t *img, const char *filename, dt_mipmap_buffer_t *buf)
gboolean dt_libraw_lookup_makermodel(const char *maker, const char *model, char *mk, int mk_len, char *md, int md_len, char *al, int al_len)
gchar * dt_imageio_resizing_factor_get_and_parsing(double *num, double *denum)
@ FORMAT_FLAGS_SUPPORT_XMP
@ FORMAT_FLAGS_NO_TMPFILE
dt_imageio_retval_t dt_imageio_open_pfm(dt_image_t *img, const char *filename, dt_mipmap_buffer_t *mbuf)
dt_imageio_retval_t dt_imageio_open_png(dt_image_t *img, const char *filename, dt_mipmap_buffer_t *mbuf)
dt_imageio_retval_t dt_imageio_open_pnm(dt_image_t *img, const char *filename, dt_mipmap_buffer_t *mbuf)
gboolean dt_rawspeed_lookup_makermodel(const char *maker, const char *model, char *mk, int mk_len, char *md, int md_len, char *al, int al_len)
dt_imageio_retval_t dt_imageio_open_rawspeed(dt_image_t *img, const char *filename, dt_mipmap_buffer_t *mbuf)
dt_imageio_retval_t dt_imageio_open_rgbe(dt_image_t *img, const char *filename, dt_mipmap_buffer_t *mbuf)
dt_imageio_retval_t dt_imageio_open_tiff(dt_image_t *img, const char *filename, dt_mipmap_buffer_t *mbuf)
dt_imageio_retval_t dt_imageio_open_webp(dt_image_t *img, const char *filename, dt_mipmap_buffer_t *mbuf)
void dt_ioppr_resync_modules_order(dt_develop_t *dev)
Update dev->iop module order values from dev->iop_order_list.
void dt_ioppr_update_for_style_items(dt_develop_t *dev, GList *st_items, gboolean append)
Update dev->iop_order_list with modules referenced by style items.
int dt_ioppr_check_iop_order(dt_develop_t *dev, const int32_t imgid, const char *msg)
Debug helper to validate the current order for a develop context.
float *const restrict const size_t k
float *const restrict const size_t const size_t ch
#define CLAMPF(a, mn, mx)
dt_colorspaces_color_profile_type_t color_space
#define dt_mipmap_cache_get(A, B, C, D, E, F)
#define dt_mipmap_cache_release(A, B)
void dt_dev_pixelpipe_cache_ref_count_entry(dt_dev_pixelpipe_cache_t *cache, gboolean lock, dt_pixel_cache_entry_t *cache_entry)
Increase/Decrease the reference count on the cache line as to prevent LRU item removal....
gboolean dt_dev_pixelpipe_cache_peek(dt_dev_pixelpipe_cache_t *cache, const uint64_t hash, void **data, dt_pixel_cache_entry_t **entry, const int preferred_devid, void **cl_mem_output)
Non-owning lookup of an existing cache line.
void dt_dev_pixelpipe_cache_rdlock_entry(dt_dev_pixelpipe_cache_t *cache, gboolean lock, dt_pixel_cache_entry_t *cache_entry)
Lock or release the read lock on the entry.
void dt_dev_pixelpipe_set_input(dt_dev_pixelpipe_t *pipe, int32_t imgid, int width, int height, float iscale, dt_mipmap_size_t size)
void dt_dev_pixelpipe_disable_before(dt_dev_pixelpipe_t *pipe, const char *op)
void dt_dev_pixelpipe_disable_after(dt_dev_pixelpipe_t *pipe, const char *op)
void dt_dev_pixelpipe_set_icc(dt_dev_pixelpipe_t *pipe, dt_colorspaces_color_profile_type_t icc_type, const gchar *icc_filename, dt_iop_color_intent_t icc_intent)
void dt_dev_pixelpipe_create_nodes(dt_dev_pixelpipe_t *pipe)
int dt_dev_pixelpipe_init_thumbnail(dt_dev_pixelpipe_t *pipe, dt_develop_t *dev)
int dt_dev_pixelpipe_init_export(dt_dev_pixelpipe_t *pipe, dt_develop_t *dev, int levels, gboolean store_masks)
void dt_dev_pixelpipe_cleanup(dt_dev_pixelpipe_t *pipe)
int dt_dev_pixelpipe_process(dt_dev_pixelpipe_t *pipe, dt_iop_roi_t roi)
#define dt_dev_pixelpipe_synch_all(pipe)
static uint64_t dt_dev_backbuf_get_hash(const dt_backbuf_t *backbuf)
#define DT_DEBUG_CONTROL_SIGNAL_RAISE(ctlsig, signal,...)
@ DT_SIGNAL_IMAGE_EXPORT_TMPFILE
This signal is raised after an image has been exported to a file, but before it is sent to facebook/p...
GList * dt_styles_get_item_list(const char *name, gboolean params, int32_t imgid)
void dt_styles_apply_style_item(dt_develop_t *dev, dt_style_item_t *style_item)
void dt_style_item_free(gpointer data)
struct dt_dev_pixelpipe_cache_t * pixelpipe_cache
struct dt_mipmap_cache_t * mipmap_cache
struct dt_control_signal_t * signals
struct dt_iop_module_t *void * data
dt_atomic_int * shutdown_ext
Region of interest passed through the pixelpipe.
dt_dev_pixelpipe_cache_t * cache
typedef double((*spd)(unsigned long int wavelength, double TempK))