70#include <glib/gstdio.h>
80#include <sys/statvfs.h>
86#define DT_MIPMAP_CACHE_FILE_MAGIC 0xD71337
87#define DT_MIPMAP_CACHE_FILE_VERSION 23
88#define DT_MIPMAP_CACHE_DEFAULT_FILE_NAME "mipmaps"
99 0x45, 0x78, 0x69, 0x66, 0x00, 0x00, 0x49, 0x49, 0x2a, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x69,
100 0x87, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
101 0x01, 0xa0, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
104 0x45, 0x78, 0x69, 0x66, 0x00, 0x00, 0x49, 0x49, 0x2a, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x69,
105 0x87, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
106 0x01, 0xa0, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
122#if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__)
132#if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__)
133static const size_t dt_mipmap_buffer_dsc_size
__attribute__((unused))
146 assert(dsc->
size > 64 *
sizeof(uint32_t));
147 const uint32_t X = 0xffffffffu;
148 const uint32_t o = 0u;
149 const uint32_t image[]
150 = { o, o, o, o, o, o, o, o,
151 o, o, X, X, X, X, o, o,
152 o, X, o, X, X, o, X, o,
153 o, X, X, X, X, X, X, o,
154 o, o, X, o, o, X, o, o,
155 o, o, o, o, o, o, o, o,
156 o, o, X, X, X, X, o, o,
157 o, o, o, o, o, o, o, o };
165 return (((int32_t)
size) << 28) | (imgid - 1);
170 return (
key & 0xfffffff) + 1;
180 g_snprintf(path,
sizeof(
char) *
PATH_MAX,
"%s.d" G_DIR_SEPARATOR_S
"%d",
189 gchar *file = g_strdup_printf(
"%u.jpg", imgid);
197 char *abspath = NULL;
206 if(!strcmp(dbfilename,
":memory:"))
208 mipmapfilename[0] =
'\0';
214 if(
IS_NULL_PTR(abspath)) abspath = g_strdup(dbfilename);
216 GChecksum *chk = g_checksum_new(G_CHECKSUM_SHA1);
217 g_checksum_update(chk, (guchar *)abspath, strlen(abspath));
218 const gchar *filename = g_checksum_get_string(chk);
220 if(!filename || filename[0] ==
'\0')
225 g_checksum_free(chk);
249 gboolean *is_jpg_input, gboolean *use_embedded_jpg, gboolean *write_to_disk)
254 if(filename || ext || input_exists || is_jpg_input)
258 if(filename) strncpy(filename, _filename,
PATH_MAX);
263 if(ext || is_jpg_input)
265 char *_ext = _filename + strlen(_filename);
266 while(*_ext !=
'.' && _ext > _filename) _ext--;
267 if(ext) strncpy(ext, _ext, 5);
268 if(is_jpg_input) *is_jpg_input = !strcasecmp(_ext,
".jpg") || !strcasecmp(_ext,
".jpeg");
276 gboolean altered =
FALSE;
281 const gboolean _use_embedded_jpg
283 || (mode == 1 && !altered));
284 if(use_embedded_jpg) *use_embedded_jpg = _use_embedded_jpg;
300 const int32_t imgid);
342 return (uint8_t *)(dsc + 1);
379 return buffer_size + dt_mipmap_buffer_dsc_size;
391 const size_t buffer_size)
405 (*dsc)->width =
width;
407 (*dsc)->iscale = 1.0f;
423 fprintf(stderr,
"trying to alloc a wrong mipmap size for %s: %i (should be: %i)\n", img->
filename, buf->
size,
DT_MIPMAP_FULL);
431 fprintf(stderr,
"trying to alloc a buffer entry that has no back-reference to cache entry\n");
444 const int wd = img->
width;
445 const int ht = img->
height;
447 const size_t buffer_size = wd * ht *
bpp;
448 const size_t min_buffer_size = 64 * 4 *
sizeof(float);
463 assert(entry->
data == dsc);
514 gboolean write_to_disk;
523 gboolean io_error =
FALSE;
525 uint8_t *blob = NULL;
530 f = g_fopen(filename,
"rb");
534 "[mipmap_cache] cached file for image %d at mip size %i does not exist\n",
539 fseek(
f, 0, SEEK_END);
543 error =
"empty file";
551 error =
"out of memory";
556 fseek(
f, 0, SEEK_SET);
557 const size_t rd = fread(blob,
sizeof(uint8_t), len,
f);
560 error =
"corrupted file";
567 error =
"couldn't decompress header";
576 error =
"couldn't decompress JPEG";
595 fprintf(stderr,
"[mipmap_cache] failed to open thumbnail for image %" PRIu32
" from `%s'. Reason: %s\n",
596 imgid, filename,
error);
623 dt_print(
DT_DEBUG_CACHE,
"[mipmap_cache] image %i for size %i was deleted from disk cache\n", imgid, mip);
637 gboolean write_to_disk;
653 const int mkd = g_mkdir_with_parents(cache_path, 0750);
662 if((
f = g_fopen(filename,
"wb")))
666 if (!
statvfs(filename, &vfsbuf))
671 fprintf(stderr,
"Aborting image write as only %" PRId64
" MB free to write %s\n", free_mb, filename);
677 fprintf(stderr,
"Aborting image write since couldn't determine free space available to write %s\n", filename);
682 const uint8_t *exif = NULL;
695 MIN(100,
MAX(10, cache_quality)), exif, exif_len))
702 dt_print(
DT_DEBUG_CACHE,
"[mipmap_cache] image %i for size %i was written to cache at %s\n", imgid, mip, filename);
838 g_hash_table_iter_init(&it, c->hashtable);
839 while(g_hash_table_iter_next(&it, &
key, &
value))
847 g_array_append_val(
out, s);
854 if(current) *current = 0;
865 if(current) *current = used;
886 return &cache->
mip_f;
923 gboolean no_buffer =
TRUE;
928 *buffered_image = *cimg;
947 const uint32_t original_width = dsc->
width;
948 const uint32_t original_height = dsc->
height;
949 const float original_iscale = dsc->
iscale;
955 dt_print(
DT_DEBUG_CACHE,
"[mipmap_cache] image %d at mip size %i (%ix%i) will skip disk I/O, found in RAM cache.\n", imgid, mip,
972 "[mipmap_cache] fetch image %i at mip size %d float32 (%ix%i) from original file I/O\n",
990 *img = buffered_image;
1003 "[mipmap_cache] compute mip size %d float32 for image %i (%ix%i) from original file \n", mip,
1011 "[mipmap_cache] compute mip size %d uint8 for image %i (%ix%i) from original file \n", mip,
1023 dsc->
width = original_width;
1024 dsc->
height = original_height;
1025 dsc->
iscale = original_iscale;
1031 dsc->
flags &= ~DT_MIPMAP_BUFFER_DSC_FLAG_GENERATE;
1035 dt_print(
DT_DEBUG_CACHE,
"[mipmap_cache] image %d at mip size %d got a new cache entry (%ix%i / %ix%i) at %p\n", imgid, mip,
1042 const char mode,
const char *file,
int line)
1052 assert(mip <= DT_MIPMAP_NONE && mip >=
DT_MIPMAP_0);
1076 __sync_fetch_and_add(&(
_get_cache(cache, mip)->stats_fetches), 1);
1099 const pthread_t writer = dt_pthread_rwlock_get_writer(&(buf->
cache_entry->
lock));
1102 assert(pthread_equal(writer, pthread_self()));
1106 assert(!pthread_equal(writer, pthread_self()));
1125 assert(buf->
imgid > 0);
1137 const int32_t
height,
const uint32_t imgid)
1153 const int32_t
height,
const uint32_t imgid)
1179 dt_print(
DT_DEBUG_CACHE,
"[mipmap_cache] image %d is synchronized from pipeline at size %i (%ix%i->%ix%i)\n",
1184 const int32_t wd = dsc->
width;
1185 const int32_t ht = dsc->
height;
1193 gboolean alloc =
FALSE;
1206 if(profile_in && profile_out)
1210 INTENT_PERCEPTUAL, 0);
1217 if(alloc) cmsDeleteTransform(
transform);
1221 dsc->
flags &= ~DT_MIPMAP_BUFFER_DSC_FLAG_GENERATE;
1264 const int32_t imgid)
1294 roi_in.
x = roi_in.
y = 0;
1297 roi_in.
scale = 1.0f;
1299 roi_out.
x = roi_out.
y = 0;
1304 roi_out.
scale = fminf(((
float)wd) / (
float)image->
width, ((
float)ht) / (
float)image->
height);
1380 void *exif,
int exif_len, int32_t imgid,
int num,
int total,
dt_dev_pixelpipe_t *pipe,
1381 const gboolean export_masks)
1384 memcpy(
d->buf, in,
sizeof(uint32_t) * data->
width * data->
height);
1388static int _load_jpg(
const char *filename,
const int32_t imgid,
const uint32_t wd,
const uint32_t ht,
1412 const size_t filename_len = strlen(filename) - strlen(ext);
1413 const char *exts[4] = {
".jpg",
".JPG",
".jpeg",
".JPEG" };
1415 for(
int i = 0;
i < 4;
i++)
1418 if(filename_len + strlen(exts[
i]) >=
PATH_MAX)
1422 const size_t str_copy = g_snprintf(sidecar,
PATH_MAX,
"%.*s%s", (
int)filename_len, filename, exts[
i]);
1425 if (str_copy == 0 || str_copy >=
PATH_MAX)
1428 if(g_file_test(sidecar, G_FILE_TEST_EXISTS))
1445 char ext[6] = { 0 };
1446 gboolean input_exists, is_jpg_input, use_embedded_jpg;
1447 const int embedded_jpg_mode =
dt_conf_get_int(
"lighttable/embedded_jpg");
1475 dt_print(
DT_DEBUG_CACHE,
"[mipmap_cache] generate mip size %d for image %d from mip size %d (%ix%i->%ix%i)\n",
1486 if(use_embedded_jpg)
1496 if(res && use_embedded_jpg)
1498 char sidecar_filename[
PATH_MAX] = { 0 };
1515 uint8_t *tmp = NULL;
1516 int32_t thumb_width, thumb_height;
1537 if(embedded_jpg_mode == 2)
1540 "[mipmap_cache] embedded JPEG mode forbids raw processing for image %d at mip %d\n",
1561 NULL, 1, 1, NULL, shutdown);
1576 fprintf(stderr,
"[mipmap_cache] could not process thumbnail!\n");
1585 gboolean write_to_disk_src, write_to_disk_dst;
1589 if(cache->
cachedir[0] && write_to_disk_src && write_to_disk_dst)
1598 GFile *src = g_file_new_for_path(srcpath);
1599 GFile *dst = g_file_new_for_path(dstpath);
1600 GError *gerror = NULL;
1601 g_file_copy(src, dst, G_FILE_COPY_NONE, NULL, NULL, NULL, &gerror);
1603 g_object_unref(dst);
1604 g_object_unref(src);
1605 g_clear_error(&gerror);
static void error(char *msg)
int dt_atomic_get_int(dt_atomic_int *var)
static void transform(float *x, float *o, const float *m, const float t_h, const float t_v)
const dt_colorspaces_color_profile_t * dt_colorspaces_get_profile(dt_colorspaces_color_profile_type_t type, const char *filename, dt_colorspaces_profile_direction_t direction)
void dt_colorspaces_transform_rgba8_to_bgra8(const cmsHTRANSFORM transform, const uint8_t *image_in, uint8_t *image_out, const int width, const int height)
dt_colorspaces_color_profile_type_t
@ DT_PROFILE_DIRECTION_DISPLAY
const dt_aligned_pixel_t f
const dt_colormatrix_t dt_aligned_pixel_t out
#define dt_cache_release(A, B)
#define dt_cache_get(A, B, C)
static void dt_cache_set_cleanup_callback(dt_cache_t *cache, dt_cache_cleanup_t cleanup_cb, void *cleanup_data)
static void dt_cache_set_allocate_callback(dt_cache_t *cache, dt_cache_allocate_t allocate_cb, void *allocate_data)
dt_image_path_source_t dt_image_choose_input_path(const dt_image_t *img, char *pathname, size_t pathname_len, gboolean force_cache)
#define ASAN_POISON_MEMORY_REGION(addr, size)
#define ASAN_UNPOISON_MEMORY_REGION(addr, size)
int dt_conf_get_bool(const char *name)
int dt_conf_get_int(const char *name)
void dt_concat_path_file(char destination[PATH_MAX], const char path[PATH_MAX], const char *const file)
void * dt_alloc_align(size_t size)
size_t dt_get_mipmap_mem()
void dt_print(dt_debug_thread_t thread, const char *msg,...)
#define dt_free_align(ptr)
float dt_aligned_pixel_simd_t __attribute__((vector_size(16), aligned(16)))
Enable aggressive floating-point arithmetic optimizations, in denormals handling. Set through user pr...
#define dt_pixelpipe_cache_free_align(mem)
static const dt_aligned_pixel_simd_t value
#define dt_unreachable_codepath()
#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_CACHELINE_BYTES
const gchar * dt_database_get_path(const struct dt_database_t *db)
static int dt_pthread_mutex_unlock(dt_pthread_mutex_t *mutex) RELEASE(mutex) NO_THREAD_SAFETY_ANALYSIS
static int dt_pthread_mutex_lock(dt_pthread_mutex_t *mutex) ACQUIRE(mutex) NO_THREAD_SAFETY_ANALYSIS
void dt_loc_get_user_cache_dir(char *cachedir, size_t bufsize)
static gchar * g_realpath(const char *path)
void dt_image_cache_read_release(dt_image_cache_t *cache, const dt_image_t *img)
dt_image_t * dt_image_cache_get(dt_image_cache_t *cache, const int32_t imgid, char mode)
void dt_image_cache_write_release(dt_image_cache_t *cache, dt_image_t *img, dt_image_cache_write_mode_t mode)
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)
dt_imageio_retval_t dt_imageio_open(dt_image_t *img, const char *filename, dt_mipmap_buffer_t *buf)
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,...
int dt_imageio_jpeg_read(dt_imageio_jpeg_t *jpg, uint8_t *out)
int dt_imageio_jpeg_read_header(const char *filename, dt_imageio_jpeg_t *jpg)
dt_colorspaces_color_profile_type_t dt_imageio_jpeg_read_color_space(dt_imageio_jpeg_t *jpg)
int dt_imageio_jpeg_decompress_header(const void *in, size_t length, dt_imageio_jpeg_t *jpg)
int dt_imageio_jpeg_decompress(dt_imageio_jpeg_t *jpg, uint8_t *out)
int dt_imageio_jpeg_write(const char *filename, const uint8_t *in, const int width, const int height, const int quality, const void *exif, int exif_len)
void dt_iop_clip_and_zoom_mosaic_half_size_f(float *const out, const float *const in, const dt_iop_roi_t *const roi_out, const dt_iop_roi_t *const roi_in, const int32_t out_stride, const int32_t in_stride, const uint32_t filters)
void dt_iop_clip_and_zoom(float *out, const float *const in, const dt_iop_roi_t *const roi_out, const dt_iop_roi_t *const roi_in, const int32_t out_stride, const int32_t in_stride)
void dt_iop_flip_and_zoom_8(const uint8_t *in, int32_t iw, int32_t ih, uint8_t *out, int32_t ow, int32_t oh, const dt_image_orientation_t orientation, uint32_t *width, uint32_t *height)
void dt_iop_clip_and_zoom_mosaic_half_size(uint16_t *const out, const uint16_t *const in, const dt_iop_roi_t *const roi_out, const dt_iop_roi_t *const roi_in, const int32_t out_stride, const int32_t in_stride, const uint32_t filters)
void dt_iop_clip_and_zoom_mosaic_third_size_xtrans(uint16_t *const out, const uint16_t *const in, const dt_iop_roi_t *const roi_out, const dt_iop_roi_t *const roi_in, const int32_t out_stride, const int32_t in_stride, const uint8_t(*const xtrans)[6])
void dt_iop_clip_and_zoom_mosaic_third_size_xtrans_f(float *const out, const float *const in, const dt_iop_roi_t *const roi_out, const dt_iop_roi_t *const roi_in, const int32_t out_stride, const int32_t in_stride, const uint8_t(*const xtrans)[6])
#define DT_CTL_WORKER_RESERVED
float *const restrict const size_t k
void dt_mipmap_cache_get_with_caller_and_shutdown(dt_mipmap_cache_t *cache, dt_mipmap_buffer_t *buf, const int32_t imgid, const dt_mipmap_size_t mip, const dt_mipmap_get_flags_t flags, const char mode, dt_atomic_int *shutdown, const char *file, int line)
void * dt_mipmap_cache_alloc(dt_mipmap_buffer_t *buf, const dt_image_t *img)
void dt_mipmap_cache_remove_at_size(dt_mipmap_cache_t *cache, const int32_t imgid, const dt_mipmap_size_t mip, const gboolean flush_disk)
static void _sync_dsc_to_buf(dt_mipmap_buffer_t *buf, struct dt_mipmap_buffer_dsc *dsc, const int32_t imgid, const dt_mipmap_size_t mip)
void dt_mipmap_cache_swap_at_size(dt_mipmap_cache_t *cache, const int32_t imgid, const dt_mipmap_size_t mip, const uint8_t *const in, const int32_t width, const int32_t height, dt_colorspaces_color_profile_type_t profile)
static void _paint_skulls(dt_mipmap_buffer_t *buf, struct dt_mipmap_buffer_dsc *dsc, const int32_t imgid, const dt_mipmap_size_t mip)
static const uint8_t dt_mipmap_cache_exif_data_srgb[]
static int _write_image(dt_imageio_module_data_t *data, const char *filename, const void *in, dt_colorspaces_color_profile_type_t over_type, const char *over_filename, void *exif, int exif_len, int32_t imgid, int num, int total, dt_dev_pixelpipe_t *pipe, const gboolean export_masks)
static int _bpp(dt_imageio_module_data_t *data)
static void _init_f(dt_mipmap_buffer_t *mipmap_buf, float *buf, uint32_t *width, uint32_t *height, float *iscale, const int32_t imgid)
static const int dt_mipmap_cache_exif_data_adobergb_length
static void _init_8(uint8_t *buf, uint32_t *width, uint32_t *height, float *iscale, dt_colorspaces_color_profile_type_t *color_space, const int32_t imgid, const dt_mipmap_size_t size, dt_atomic_int *shutdown)
void dt_mipmap_cache_update_buffer_addresses(dt_cache_entry_t *entry, struct dt_mipmap_buffer_dsc **dsc, const size_t width, const size_t height, const size_t buffer_size)
Resync all references to all references.
static int _find_sidecar_jpg(const char *filename, const char *ext, char *sidecar)
void dt_mipmap_get_cache_filename(char path[PATH_MAX], const dt_mipmap_cache_t *cache, dt_mipmap_size_t mip, const int32_t imgid)
static void _mipmap_subcache_collect(dt_cache_t *c, GArray *out)
static void _invalidate_buffer(dt_mipmap_buffer_t *buf)
static const int dt_mipmap_cache_exif_data_srgb_length
static dt_mipmap_cache_one_t * _get_cache(dt_mipmap_cache_t *cache, const dt_mipmap_size_t mip)
void dt_mipmap_cache_init(dt_mipmap_cache_t *cache)
static int dt_mipmap_cache_get_filename(gchar *mipmapfilename, size_t size)
void dt_mipmap_cache_write_get_with_caller(dt_mipmap_cache_t *cache, dt_mipmap_buffer_t *buf, const int32_t imgid, const int mip, const char *file, int line)
static uint8_t * _get_buffer_from_dsc(struct dt_mipmap_buffer_dsc *dsc)
static void _write_mipmap_to_disk(const int32_t imgid, char *filename, char *ext, gboolean *input_exists, gboolean *is_jpg_input, gboolean *use_embedded_jpg, gboolean *write_to_disk)
Check if an image should be written to disk, if the thumbnail should be computed from embedded JPEG,...
static const uint8_t dt_mipmap_cache_exif_data_adobergb[]
void dt_mipmap_cache_get_with_caller(dt_mipmap_cache_t *cache, dt_mipmap_buffer_t *buf, const int32_t imgid, const dt_mipmap_size_t mip, const dt_mipmap_get_flags_t flags, const char mode, const char *file, int line)
void dt_mipmap_cache_remove(dt_mipmap_cache_t *cache, const int32_t imgid, const gboolean flush_disk)
static void * dead_image_8(struct dt_mipmap_buffer_dsc *dsc)
void dt_mipmap_cache_cleanup(dt_mipmap_cache_t *cache)
static void _generate_blocking(dt_cache_entry_t *entry, dt_mipmap_buffer_t *buf, const int32_t imgid, const dt_mipmap_size_t mip, dt_atomic_int *shutdown)
static gboolean _get_image_copy(const int32_t imgid, dt_image_t *buffered_image)
GArray * dt_mipmap_cache_get_entries_stats(dt_mipmap_cache_t *cache)
void dt_mimap_cache_evict(dt_mipmap_cache_t *cache, const int32_t imgid)
static void _validate_buffer(dt_mipmap_buffer_t *buf, struct dt_mipmap_buffer_dsc *dsc, const int32_t imgid, const dt_mipmap_size_t mip)
static size_t _get_entry_size(const size_t buffer_size)
static uint32_t get_imgid(const uint32_t key)
void dt_mipmap_get_cache_dir(char path[PATH_MAX], const dt_mipmap_cache_t *cache, dt_mipmap_size_t mip)
void dt_mipmap_cache_print(dt_mipmap_cache_t *cache)
void dt_mipmap_cache_deallocate_dynamic(void *data, dt_cache_entry_t *entry)
void dt_mipmap_cache_get_usage(dt_mipmap_cache_t *cache, size_t *current, size_t *max)
void dt_mipmap_cache_allocate_dynamic(void *data, dt_cache_entry_t *entry)
static int _load_jpg(const char *filename, const int32_t imgid, const uint32_t wd, const uint32_t ht, const dt_mipmap_size_t size, const dt_image_orientation_t orientation, uint8_t *buf, uint32_t *width, uint32_t *height, dt_colorspaces_color_profile_type_t *color_space)
static int32_t get_key(const int32_t imgid, const dt_mipmap_size_t size)
struct dt_mipmap_buffer_dsc * _get_dsc_from_entry(dt_cache_entry_t *entry)
#define DT_MIPMAP_CACHE_DEFAULT_FILE_NAME
dt_mipmap_size_t dt_mipmap_cache_get_fitting_size(const dt_mipmap_cache_t *cache, const int32_t width, const int32_t height, const uint32_t imgid)
dt_mipmap_size_t dt_mipmap_cache_get_matching_size(const dt_mipmap_cache_t *cache, const int32_t width, const int32_t height, const uint32_t imgid)
dt_colorspaces_color_profile_type_t color_space
static dt_mipmap_size_t get_size(const uint32_t key)
dt_mipmap_buffer_dsc_flags
@ DT_MIPMAP_BUFFER_DSC_FLAG_NONE
@ DT_MIPMAP_BUFFER_DSC_FLAG_INVALIDATE
@ DT_MIPMAP_BUFFER_DSC_FLAG_GENERATE
static void dt_mipmap_cache_unlink_ondisk_thumbnail(void *data, int32_t imgid, dt_mipmap_size_t mip)
void dt_mipmap_cache_copy_thumbnails(const dt_mipmap_cache_t *cache, const uint32_t dst_imgid, const uint32_t src_imgid)
dt_mipmap_buffer_dsc_flags flags
void dt_mipmap_cache_release_with_caller(dt_mipmap_cache_t *cache, dt_mipmap_buffer_t *buf, const char *file, int line)
static int _levels(dt_imageio_module_data_t *data)
#define dt_mipmap_cache_get(A, B, C, D, E, F)
#define dt_mipmap_cache_release(A, B)
void dt_cache_release_with_caller(dt_cache_t *cache, dt_cache_entry_t *entry, const char *file, int line)
dt_cache_entry_t * dt_cache_testget(dt_cache_t *cache, const uint32_t key, char mode)
void dt_cache_init(dt_cache_t *cache, size_t entry_size, size_t cost_quota)
dt_cache_entry_t * dt_cache_get_with_caller(dt_cache_t *cache, const uint32_t key, char mode, const char *file, int line)
int dt_cache_remove(dt_cache_t *cache, const uint32_t key)
void dt_cache_cleanup(dt_cache_t *cache)
unsigned __int64 uint64_t
dt_imageio_module_data_t head
struct dt_colorspaces_t * color_profiles
struct dt_mipmap_cache_t * mipmap_cache
struct dt_sys_resources_t dtresources
const struct dt_database_t * db
struct dt_image_cache_t * image_cache
cmsHTRANSFORM transform_display_to_adobe_rgb
pthread_rwlock_t xprofile_lock
dt_image_orientation_t orientation
char filename[DT_MAX_FILENAME_LEN]
dt_iop_buffer_type_t datatype
Region of interest passed through the pixelpipe.
dt_colorspaces_color_profile_type_t color_space
dt_mipmap_buffer_dsc_flags flags
dt_colorspaces_color_profile_type_t color_space
dt_cache_entry_t * cache_entry
long int stats_near_match
dt_mipmap_cache_one_t mip_full
size_t max_height[DT_MIPMAP_NONE]
dt_mipmap_cache_one_t mip_f
dt_mipmap_cache_one_t mip_thumbs
size_t max_width[DT_MIPMAP_NONE]
size_t buffer_size[DT_MIPMAP_NONE]
void dt_supervisor_mipmap(const dt_sv_op_t op, const int32_t imgid, const int mip)
void dt_supervisor_image(const dt_sv_op_t op, const int32_t imgid, const dt_image_t *img)
static gboolean dt_supervisor_active(void)