![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
shit ahead. More...
#include "common/mipmap_cache.h"
#include "common/darktable.h"
#include "common/debug.h"
#include "common/exif.h"
#include "common/file_location.h"
#include "common/grealpath.h"
#include "common/image_cache.h"
#include "common/imageio.h"
#include "common/imageio_jpeg.h"
#include "common/imageio_module.h"
#include "control/conf.h"
#include "control/jobs.h"
#include "develop/imageop_math.h"
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
#include <glib.h>
#include <glib/gstdio.h>
#include <inttypes.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <unistd.h>
#include <sys/statvfs.h>
Data Structures | |
struct | dt_mipmap_buffer_dsc |
struct | _dummy_data_t |
Macros | |
#define | DT_MIPMAP_CACHE_FILE_MAGIC 0xD71337 |
#define | DT_MIPMAP_CACHE_FILE_VERSION 23 |
#define | DT_MIPMAP_CACHE_DEFAULT_FILE_NAME "mipmaps" |
Typedefs | |
typedef enum dt_mipmap_buffer_dsc_flags | dt_mipmap_buffer_dsc_flags |
typedef struct _dummy_data_t | _dummy_data_t |
Enumerations | |
enum | dt_mipmap_buffer_dsc_flags { DT_MIPMAP_BUFFER_DSC_FLAG_NONE = 0 , DT_MIPMAP_BUFFER_DSC_FLAG_GENERATE = 1 << 0 , DT_MIPMAP_BUFFER_DSC_FLAG_INVALIDATE = 1 << 1 } |
Functions | |
struct dt_mipmap_buffer_dsc | __attribute__ ((packed, aligned(DT_CACHELINE_BYTES))) |
static const size_t dt_mipmap_buffer_dsc_size | __attribute__ ((unused)) |
static uint8_t * | _get_buffer_from_dsc (struct dt_mipmap_buffer_dsc *dsc) |
static void * | dead_image_8 (struct dt_mipmap_buffer_dsc *dsc) |
static int32_t | get_key (const int32_t imgid, const dt_mipmap_size_t size) |
static uint32_t | get_imgid (const uint32_t key) |
static dt_mipmap_size_t | get_size (const uint32_t key) |
static int | dt_mipmap_cache_get_filename (gchar *mipmapfilename, size_t size) |
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, and optionaly return intermediate checks to get there, like whether the input is a JPEG file and if it exists on the filesystem. | |
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 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) |
struct dt_mipmap_buffer_dsc * | _get_dsc_from_entry (dt_cache_entry_t *entry) |
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) |
static void | _invalidate_buffer (dt_mipmap_buffer_t *buf) |
static size_t | _get_entry_size (const size_t buffer_size) |
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. | |
void * | dt_mipmap_cache_alloc (dt_mipmap_buffer_t *buf, const dt_image_t *img) |
void | dt_mipmap_cache_allocate_dynamic (void *data, dt_cache_entry_t *entry) |
static void | dt_mipmap_cache_unlink_ondisk_thumbnail (void *data, int32_t imgid, dt_mipmap_size_t mip) |
void | dt_mipmap_cache_deallocate_dynamic (void *data, dt_cache_entry_t *entry) |
void | dt_mipmap_cache_init (dt_mipmap_cache_t *cache) |
void | dt_mipmap_cache_cleanup (dt_mipmap_cache_t *cache) |
void | dt_mipmap_cache_print (dt_mipmap_cache_t *cache) |
static dt_mipmap_cache_one_t * | _get_cache (dt_mipmap_cache_t *cache, const dt_mipmap_size_t mip) |
static void | _paint_skulls (dt_mipmap_buffer_t *buf, struct dt_mipmap_buffer_dsc *dsc, const dt_mipmap_size_t mip) |
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 gboolean | _get_image_copy (const int32_t imgid, dt_image_t *buffered_image) |
static void | _generate_blocking (dt_cache_entry_t *entry, dt_mipmap_buffer_t *buf, const int32_t imgid, const dt_mipmap_size_t mip) |
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_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) |
void | dt_mipmap_cache_release_with_caller (dt_mipmap_cache_t *cache, dt_mipmap_buffer_t *buf, const char *file, int line) |
dt_mipmap_size_t | dt_mipmap_cache_get_matching_size (const dt_mipmap_cache_t *cache, const int32_t width, const int32_t height) |
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) |
void | dt_mipmap_cache_remove (dt_mipmap_cache_t *cache, const int32_t imgid, const gboolean flush_disk) |
void | dt_mimap_cache_evict (dt_mipmap_cache_t *cache, const int32_t imgid) |
static int | _levels (dt_imageio_module_data_t *data) |
static int | _bpp (dt_imageio_module_data_t *data) |
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 | _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 int | _find_sidecar_jpg (const char *filename, const char *ext, char *sidecar) |
void | dt_mipmap_cache_copy_thumbnails (const dt_mipmap_cache_t *cache, const uint32_t dst_imgid, const uint32_t src_imgid) |
Variables | |
static const uint8_t | dt_mipmap_cache_exif_data_srgb [] |
static const uint8_t | dt_mipmap_cache_exif_data_adobergb [] |
static const int | dt_mipmap_cache_exif_data_srgb_length = sizeof(dt_mipmap_cache_exif_data_srgb) / sizeof(*dt_mipmap_cache_exif_data_srgb) |
static const int | dt_mipmap_cache_exif_data_adobergb_length = sizeof(dt_mipmap_cache_exif_data_adobergb) / sizeof(*dt_mipmap_cache_exif_data_adobergb) |
uint32_t | width |
uint32_t | height |
float | iscale |
size_t | size |
dt_mipmap_buffer_dsc_flags | flags |
dt_colorspaces_color_profile_type_t | color_space |
shit ahead.
So, (dt_mipmap_buffer_t *buf)->cache_entry
holds a back-reference to the cache entry dt_cache_entry_t *entry
. (dt_cache_entry_t *entry)->data
is a reference to the dt_mipmap_buffer_dsc *dsc
, which is mostly a duplicate of dt_mipmap_buffer_t *buf
, adding state flags and then 64-bytes memory padding.
entry->data
is an opaque, manually-handled, memory buffer holding (in this order):
dt_mipmap_buffer_dsc dsc
structure,buf->buf
(aligned to 64 bytes);So the only way of accessing the buf->buf
memory is by shifting the entry->data
pointer by the size of one dt_mipmap_buffer_dsc
structure.
But we need to resync the dt_mipmap_buffer_dsc dsc
values with those in dt_mipmap_buffer_t *buf
all the fucking time (namely, width, height, scale, color space). And then, we need to resync the buffer sizes between entry->data_size
and dsc->size
. But beware, because buf->size
is actually the integer enum member of mipmap fixed sizes.
All in all, this clever design guarantees a maximum number of opportunities for mistakes, along with non-uniforms accesses, sometimes to dsc
, sometimes to buf
.
From the rest of the app, we access only dt_mipmap_buffer_t *buf
, so this is our way of communicating stuff out there.
#define DT_MIPMAP_CACHE_DEFAULT_FILE_NAME "mipmaps" |
#define DT_MIPMAP_CACHE_FILE_MAGIC 0xD71337 |
#define DT_MIPMAP_CACHE_FILE_VERSION 23 |
typedef struct _dummy_data_t _dummy_data_t |
typedef enum dt_mipmap_buffer_dsc_flags dt_mipmap_buffer_dsc_flags |
struct dt_mipmap_buffer_dsc __attribute__ | ( | (packed, aligned(DT_CACHELINE_BYTES)) | ) |
|
static |
|
static |
Referenced by _init_8().
|
static |
|
static |
References _get_buffer_from_dsc(), _get_dsc_from_entry(), _get_image_copy(), _init_8(), _init_f(), _paint_skulls(), _validate_buffer(), dt_mipmap_buffer_t::buf, dt_mipmap_buffer_dsc::color_space, darktable, DT_DEBUG_CACHE, dt_image_cache_get(), DT_IMAGE_CACHE_RELAXED, dt_image_cache_write_release(), dt_image_full_path(), DT_IMAGEIO_OK, dt_imageio_open(), DT_MIPMAP_BUFFER_DSC_FLAG_GENERATE, DT_MIPMAP_F, DT_MIPMAP_FULL, dt_print(), dt_mipmap_buffer_dsc::flags, dt_mipmap_buffer_dsc::height, dt_mipmap_buffer_t::height, dt_image_t::id, darktable_t::image_cache, dt_mipmap_buffer_dsc::iscale, PATH_MAX, TRUE, dt_mipmap_buffer_dsc::width, and dt_mipmap_buffer_t::width.
Referenced by dt_mipmap_cache_get_with_caller().
|
static |
|
static |
struct dt_mipmap_buffer_dsc * _get_dsc_from_entry | ( | dt_cache_entry_t * | entry | ) |
|
static |
|
static |
References darktable, dt_image_cache_get(), dt_image_cache_read_release(), FALSE, darktable_t::image_cache, and TRUE.
Referenced by _generate_blocking().
|
static |
References _bpp(), _find_sidecar_jpg(), _levels(), _load_jpg(), _write_image(), _write_mipmap_to_disk(), _dummy_data_t::buf, dt_mipmap_buffer_t::buf, color_space, dt_mipmap_buffer_t::color_space, darktable, DT_COLORSPACE_ADOBERGB, DT_COLORSPACE_NONE, DT_DEBUG_CACHE, dt_free_align, dt_image_get_orientation(), dt_imageio_export_with_flags(), dt_imageio_large_thumbnail(), DT_INTENT_LAST, dt_iop_flip_and_zoom_8(), dt_mipmap_cache_get, dt_mipmap_cache_release, DT_MIPMAP_F, DT_MIPMAP_TESTLOCK, dt_print(), FALSE, _dummy_data_t::head, dt_imageio_module_data_t::height, height, dt_mipmap_buffer_t::height, iscale, dt_imageio_module_data_t::max_height, dt_imageio_module_data_t::max_width, darktable_t::mipmap_cache, ORIENTATION_NONE, PATH_MAX, size, TRUE, dt_imageio_module_data_t::width, width, and dt_mipmap_buffer_t::width.
Referenced by _generate_blocking().
|
static |
References dt_mipmap_buffer_t::buf, dt_image_t::buf_dsc, dt_mipmap_buffer_t::color_space, darktable, dt_iop_buffer_dsc_t::datatype, DT_COLORSPACE_NONE, dt_image_cache_get(), dt_image_cache_read_release(), dt_image_full_path(), dt_iop_clip_and_zoom(), dt_iop_clip_and_zoom_mosaic_half_size(), dt_iop_clip_and_zoom_mosaic_half_size_f(), dt_iop_clip_and_zoom_mosaic_third_size_xtrans(), dt_iop_clip_and_zoom_mosaic_third_size_xtrans_f(), DT_MIPMAP_BLOCKING, dt_mipmap_cache_get, dt_mipmap_cache_release, DT_MIPMAP_FULL, dt_unreachable_codepath, dt_iop_buffer_dsc_t::filters, dt_image_t::height, height, dt_mipmap_buffer_t::height, dt_iop_roi_t::height, darktable_t::image_cache, iscale, darktable_t::mipmap_cache, PATH_MAX, dt_iop_roi_t::scale, TRUE, TYPE_FLOAT, TYPE_UINT16, dt_image_t::width, width, dt_mipmap_buffer_t::width, dt_iop_roi_t::width, dt_iop_roi_t::x, dt_iop_buffer_dsc_t::xtrans, and dt_iop_roi_t::y.
Referenced by _generate_blocking().
|
static |
References dt_mipmap_buffer_t::buf, dt_mipmap_buffer_t::height, dt_mipmap_buffer_t::iscale, and dt_mipmap_buffer_t::width.
Referenced by dt_mipmap_cache_get_with_caller().
|
static |
References IMAGEIO_INT8, and IMAGEIO_RGB.
Referenced by _init_8().
|
static |
References color_space, dt_alloc_align, DT_DEBUG_CACHE, dt_free_align, dt_imageio_jpeg_read(), dt_imageio_jpeg_read_color_space(), dt_imageio_jpeg_read_header(), dt_iop_flip_and_zoom_8(), dt_print(), dt_imageio_jpeg_t::height, height, size, dt_imageio_jpeg_t::width, and width.
Referenced by _init_8().
|
static |
References dt_mipmap_buffer_t::buf, dead_image_8(), DT_MIPMAP_F, dt_mipmap_buffer_dsc::height, and dt_mipmap_buffer_dsc::width.
Referenced by _generate_blocking().
|
static |
References _get_buffer_from_dsc(), dt_mipmap_buffer_t::buf, dt_mipmap_buffer_dsc::color_space, dt_mipmap_buffer_t::color_space, dt_mipmap_buffer_dsc::height, dt_mipmap_buffer_t::height, dt_mipmap_buffer_t::imgid, dt_mipmap_buffer_dsc::iscale, dt_mipmap_buffer_t::iscale, dt_mipmap_buffer_t::size, dt_mipmap_buffer_dsc::width, and dt_mipmap_buffer_t::width.
Referenced by _validate_buffer().
|
static |
References _sync_dsc_to_buf(), ASAN_UNPOISON_MEMORY_REGION, dt_mipmap_buffer_t::buf, and dt_mipmap_buffer_dsc::size.
Referenced by _generate_blocking(), and dt_mipmap_cache_get_with_caller().
|
static |
References _dummy_data_t::buf, dt_imageio_module_data_t::height, and dt_imageio_module_data_t::width.
Referenced by _init_8().
|
static |
Check if an image should be written to disk, if the thumbnail should be computed from embedded JPEG, and optionaly return intermediate checks to get there, like whether the input is a JPEG file and if it exists on the filesystem.
imgid | Database SQL ID of the image |
filename | Filename of the input file. Can be NULL. |
ext | Extension of the input file. Can be NULL. |
input_exists | Whether the file can be found on the filesystem. Can be NULL. |
is_jpg_input | Whether the file is a JPEG. Can be NULL. |
use_embedded_jpg | Whether the lighttable should use the embedded JPEG thumbnail. Can be NULL. |
write_to_disk | Whether the cached thumbnail should be flushed to disk before being flushed from RAM. Can be NULL. |
References dt_conf_get_bool(), dt_conf_get_int(), dt_image_altered(), dt_image_full_path(), PATH_MAX, and TRUE.
Referenced by _init_8(), dt_mipmap_cache_allocate_dynamic(), dt_mipmap_cache_copy_thumbnails(), and dt_mipmap_cache_deallocate_dynamic().
|
inlinestatic |
void dt_mimap_cache_evict | ( | dt_mipmap_cache_t * | cache, |
const int32_t | imgid | ||
) |
References _get_cache(), dt_cache_remove(), DT_MIPMAP_0, DT_MIPMAP_F, and get_key().
Referenced by generate_thumbnail_cache(), and preload_image_cache().
void * dt_mipmap_cache_alloc | ( | dt_mipmap_buffer_t * | buf, |
const dt_image_t * | img | ||
) |
References _get_buffer_from_dsc(), _get_entry_size(), ASAN_POISON_MEMORY_REGION, ASAN_UNPOISON_MEMORY_REGION, bpp, dt_mipmap_buffer_t::buf, dt_image_t::buf_dsc, dt_mipmap_buffer_t::cache_entry, dt_cache_entry_t::data, dt_cache_entry_t::data_size, dt_alloc_align, dt_free_align, dt_iop_buffer_dsc_to_bpp(), dt_mipmap_cache_update_buffer_addresses(), DT_MIPMAP_FULL, dt_image_t::filename, dt_image_t::height, MAX, dt_mipmap_buffer_dsc::size, dt_mipmap_buffer_t::size, and dt_image_t::width.
Referenced by dt_imageio_open_avif(), dt_imageio_open_exr(), dt_imageio_open_heif(), dt_imageio_open_j2k(), dt_imageio_open_jpeg(), dt_imageio_open_pfm(), dt_imageio_open_png(), dt_imageio_open_pnm(), dt_imageio_open_rawspeed(), dt_imageio_open_rawspeed_sraw(), dt_imageio_open_rgbe(), dt_imageio_open_tiff(), and dt_imageio_open_webp().
void dt_mipmap_cache_allocate_dynamic | ( | void * | data, |
dt_cache_entry_t * | entry | ||
) |
References _get_buffer_from_dsc(), _get_entry_size(), _write_mipmap_to_disk(), dt_mipmap_cache_t::buffer_size, dt_mipmap_cache_t::cachedir, color_space, dt_mipmap_buffer_dsc::color_space, dt_cache_entry_t::cost, dt_cache_entry_t::data, dt_alloc_align, DT_COLORSPACE_DISPLAY, DT_DEBUG_CACHE, dt_free_align, dt_imageio_jpeg_decompress(), dt_imageio_jpeg_decompress_header(), dt_imageio_jpeg_read_color_space(), dt_mipmap_cache_update_buffer_addresses(), DT_MIPMAP_F, DT_MIPMAP_NONE, dt_print(), error(), f(), FALSE, dt_mipmap_buffer_dsc::flags, get_imgid(), get_size(), dt_imageio_jpeg_t::height, dt_mipmap_buffer_dsc::height, dt_mipmap_buffer_dsc::iscale, dt_cache_entry_t::key, dt_mipmap_cache_t::max_height, dt_mipmap_cache_t::max_width, PATH_MAX, TRUE, dt_imageio_jpeg_t::width, and dt_mipmap_buffer_dsc::width.
Referenced by dt_mipmap_cache_init().
void dt_mipmap_cache_cleanup | ( | dt_mipmap_cache_t * | cache | ) |
References dt_mipmap_cache_one_t::cache, dt_cache_cleanup(), dt_mipmap_cache_print(), dt_mipmap_cache_t::mip_f, dt_mipmap_cache_t::mip_full, and dt_mipmap_cache_t::mip_thumbs.
Referenced by dt_cleanup().
void dt_mipmap_cache_copy_thumbnails | ( | const dt_mipmap_cache_t * | cache, |
const uint32_t | dst_imgid, | ||
const uint32_t | src_imgid | ||
) |
References _write_mipmap_to_disk(), dt_mipmap_cache_t::cachedir, DT_MIPMAP_0, DT_MIPMAP_F, and PATH_MAX.
Referenced by dt_image_copy_rename().
void dt_mipmap_cache_deallocate_dynamic | ( | void * | data, |
dt_cache_entry_t * | entry | ||
) |
References _get_buffer_from_dsc(), _get_dsc_from_entry(), _write_mipmap_to_disk(), dt_mipmap_cache_t::cachedir, dt_mipmap_buffer_dsc::color_space, dt_cache_entry_t::data, DT_COLORSPACE_ADOBERGB, DT_COLORSPACE_SRGB, dt_conf_get_int(), dt_free_align, dt_imageio_jpeg_write(), DT_MIPMAP_BUFFER_DSC_FLAG_INVALIDATE, dt_mipmap_cache_exif_data_adobergb, dt_mipmap_cache_exif_data_adobergb_length, dt_mipmap_cache_exif_data_srgb, dt_mipmap_cache_exif_data_srgb_length, dt_mipmap_cache_unlink_ondisk_thumbnail(), DT_MIPMAP_F, f(), statvfs::f_bavail, statvfs::f_frsize, dt_mipmap_buffer_dsc::flags, get_imgid(), get_size(), dt_mipmap_buffer_dsc::height, dt_cache_entry_t::key, MAX, MIN, PATH_MAX, and dt_mipmap_buffer_dsc::width.
Referenced by dt_mipmap_cache_init().
|
static |
References darktable, darktable_t::db, dt_database_get_path(), dt_loc_get_user_cache_dir(), DT_MIPMAP_CACHE_DEFAULT_FILE_NAME, g_realpath(), PATH_MAX, and size.
Referenced by dt_mipmap_cache_init().
dt_mipmap_size_t dt_mipmap_cache_get_matching_size | ( | const dt_mipmap_cache_t * | cache, |
const int32_t | width, | ||
const int32_t | height | ||
) |
References DT_DEBUG_IMAGEIO, DT_MIPMAP_0, DT_MIPMAP_F, dt_print(), height, dt_mipmap_cache_t::max_height, dt_mipmap_cache_t::max_width, and width.
Referenced by _draw_image(), and dt_view_image_get_surface().
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 | ||
) |
References _generate_blocking(), _get_cache(), _get_dsc_from_entry(), _invalidate_buffer(), dt_cache_entry_t::_lock_demoting, _validate_buffer(), dt_mipmap_buffer_t::cache_entry, dt_cache_get, dt_cache_get_with_caller(), dt_cache_release, dt_cache_testget(), DT_MIPMAP_0, DT_MIPMAP_BLOCKING, DT_MIPMAP_TESTLOCK, flags, get_key(), dt_mipmap_buffer_t::imgid, key, dt_cache_entry_t::lock, and dt_mipmap_buffer_t::size.
Referenced by dt_mipmap_cache_write_get_with_caller().
void dt_mipmap_cache_init | ( | dt_mipmap_cache_t * | cache | ) |
References _get_entry_size(), dt_mipmap_cache_t::buffer_size, dt_mipmap_cache_one_t::cache, dt_mipmap_cache_t::cachedir, darktable, dt_cache_init(), dt_cache_set_allocate_callback(), dt_cache_set_cleanup_callback(), DT_CTL_WORKER_RESERVED, dt_get_mipmap_mem(), DT_MIPMAP_2, dt_mipmap_cache_allocate_dynamic(), dt_mipmap_cache_deallocate_dynamic(), dt_mipmap_cache_get_filename(), DT_MIPMAP_F, DT_MIPMAP_FULL, dt_mipmap_cache_t::max_height, dt_mipmap_cache_t::max_width, dt_mipmap_cache_t::mip_f, dt_mipmap_cache_t::mip_full, dt_mipmap_cache_t::mip_thumbs, darktable_t::num_openmp_threads, dt_mipmap_cache_one_t::stats_fetches, dt_mipmap_cache_one_t::stats_misses, dt_mipmap_cache_one_t::stats_near_match, dt_mipmap_cache_one_t::stats_requests, and dt_mipmap_cache_one_t::stats_standin.
Referenced by dt_init().
void dt_mipmap_cache_print | ( | dt_mipmap_cache_t * | cache | ) |
References dt_mipmap_cache_one_t::cache, dt_cache_t::cost, dt_cache_t::cost_quota, dt_mipmap_cache_t::mip_f, dt_mipmap_cache_t::mip_full, dt_mipmap_cache_t::mip_thumbs, dt_mipmap_cache_one_t::stats_fetches, dt_mipmap_cache_one_t::stats_misses, dt_mipmap_cache_one_t::stats_near_match, dt_mipmap_cache_one_t::stats_requests, and dt_mipmap_cache_one_t::stats_standin.
Referenced by dt_mipmap_cache_cleanup().
void dt_mipmap_cache_release_with_caller | ( | dt_mipmap_cache_t * | cache, |
dt_mipmap_buffer_t * | buf, | ||
const char * | file, | ||
int | line | ||
) |
void dt_mipmap_cache_remove | ( | dt_mipmap_cache_t * | cache, |
const int32_t | imgid, | ||
const gboolean | flush_disk | ||
) |
References DT_MIPMAP_0, dt_mipmap_cache_remove_at_size(), and DT_MIPMAP_F.
Referenced by _image_import_internal(), _jpg_combobox_changed(), clear_image_cache(), drop_cache(), dt_dev_write_history_ext(), dt_film_remove(), dt_history_delete_on_image_ext(), dt_history_load_and_apply(), dt_image_flip(), dt_image_remove(), dt_image_set_flip(), and dt_styles_apply_to_image().
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 | ||
) |
References _get_cache(), _get_dsc_from_entry(), ASAN_UNPOISON_MEMORY_REGION, dt_cache_release, dt_cache_remove(), dt_cache_testget(), DT_MIPMAP_0, DT_MIPMAP_BUFFER_DSC_FLAG_INVALIDATE, dt_mipmap_cache_unlink_ondisk_thumbnail(), DT_MIPMAP_F, dt_mipmap_buffer_dsc::flags, get_key(), and key.
Referenced by dt_mipmap_cache_remove().
|
static |
References dt_mipmap_cache_t::cachedir, and PATH_MAX.
Referenced by dt_mipmap_cache_deallocate_dynamic(), and dt_mipmap_cache_remove_at_size().
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.
entry | Cache entry. |
dsc | |
buf |
References _get_dsc_from_entry(), _get_entry_size(), dt_cache_entry_t::data, dt_cache_entry_t::data_size, DT_COLORSPACE_NONE, DT_MIPMAP_BUFFER_DSC_FLAG_GENERATE, height, and width.
Referenced by dt_mipmap_cache_alloc(), and dt_mipmap_cache_allocate_dynamic().
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 | ||
) |
References DT_MIPMAP_BLOCKING, and dt_mipmap_cache_get_with_caller().
|
inlinestatic |
References key.
Referenced by dt_mipmap_cache_allocate_dynamic(), and dt_mipmap_cache_deallocate_dynamic().
|
inlinestatic |
References size.
Referenced by dt_mimap_cache_evict(), dt_mipmap_cache_get_with_caller(), and dt_mipmap_cache_remove_at_size().
|
inlinestatic |
References key.
Referenced by dt_mipmap_cache_allocate_dynamic(), and dt_mipmap_cache_deallocate_dynamic().
dt_colorspaces_color_profile_type_t color_space |
|
static |
Referenced by dt_mipmap_cache_deallocate_dynamic().
|
static |
Referenced by dt_mipmap_cache_deallocate_dynamic().
|
static |
Referenced by dt_mipmap_cache_deallocate_dynamic().
|
static |
Referenced by dt_mipmap_cache_deallocate_dynamic().
Referenced by _add_generic_accel(), _add_widget_accel(), _altered_clicked(), _button_draw(), _colorlabel_clicked(), _draw_triangle(), _ellipse_events_mouse_scrolled(), _ellipse_events_post_expose(), _ellipse_sanitize_config(), _image_import_internal(), _metadata_view_update_values(), _pop_menu_dictionary_edit_tag(), _rating_clicked(), _row_tooltip_setup(), _thumbnail_btn_draw(), _togglebutton_draw(), _tree_tagname_show(), _unaltered_clicked(), _update_altered_filters(), _update_colors_filter(), _update_rating_filter(), _upgrade_library_schema_step(), cht_state_callback(), dt_accels_init(), dt_codepaths_init(), dt_collection_reset(), dt_collection_set_filter_flags(), dt_collection_set_query_flags(), dt_control_crawler_run(), dt_control_refresh_exif_run(), dt_dng_opcode_process_opcode_list_2(), dt_draw_paint_to_pixbuf(), dt_gui_gtk_init(), dt_gui_hist_dialog_new(), dt_history_module_skip_copy(), dt_image_get_xmp_rating_from_flags(), dt_lib_export_metadata_configuration_dialog(), dt_lib_export_metadata_default_flags(), dt_lib_export_metadata_get_conf_flags(), dt_lib_gui_set_expanded(), dt_mipmap_cache_get_with_caller(), dt_tag_export(), dt_tag_get_flags(), dt_tag_get_hierarchical_export(), dt_tag_get_list_export(), dt_tag_get_tag_order_by_id(), dt_tag_set_flags(), dt_tag_set_tag_order_by_id(), dt_variables_set_tags_flags(), dtgtk_cairo_paint_alignment(), dtgtk_cairo_paint_altered(), dtgtk_cairo_paint_arrow(), dtgtk_cairo_paint_aspectflip(), dtgtk_cairo_paint_bulb(), dtgtk_cairo_paint_cut_forms(), dtgtk_cairo_paint_display_wavelet_scale(), dtgtk_cairo_paint_eye(), dtgtk_cairo_paint_eye_toggle(), dtgtk_cairo_paint_flip(), dtgtk_cairo_paint_grouping(), dtgtk_cairo_paint_label(), dtgtk_cairo_paint_label_flower(), dtgtk_cairo_paint_label_sel(), dtgtk_cairo_paint_line_arrow(), dtgtk_cairo_paint_local_copy(), dtgtk_cairo_paint_masks_drawn_and_parametric(), dtgtk_cairo_paint_masks_parametric(), dtgtk_cairo_paint_perspective(), dtgtk_cairo_paint_plus(), dtgtk_cairo_paint_plusminus(), dtgtk_cairo_paint_rawoverexposed(), dtgtk_cairo_paint_refresh(), dtgtk_cairo_paint_reject(), dtgtk_cairo_paint_solid_arrow(), dtgtk_cairo_paint_solid_triangle(), dtgtk_cairo_paint_sortby(), dtgtk_cairo_paint_styles(), dtgtk_cairo_paint_triangle(), dtgtk_cairo_paint_unaltered(), dtgtk_cell_renderer_button_activate(), legacy_params(), and rating_member().
uint32_t height |
Referenced by _init_8(), _init_f(), _load_jpg(), dt_mipmap_cache_get_matching_size(), and dt_mipmap_cache_update_buffer_addresses().
float iscale |
size_t size |
Referenced by _ask_for_maintenance(), _colorspaces_create_transfer(), _compass_star(), _draw_ellipse(), _draw_rectangle(), _dt_masks_dynbuf_growto(), _get_image_list(), _get_max_scale(), _init_8(), _init_image_pin(), _init_place_pin(), _iop_zonesystem_calculate_zonemap(), _iop_zonesystem_zone_index_from_lightness(), _load_jpg(), _make_clipping_profile(), _panel_get_size_cb(), _print_trace(), _update_display_profile(), _update_params(), _update_size(), _util_get_svg_img(), _view_map_images_count(), ambient_light(), PermutohedralLattice< D, VD >::blur(), char2qstring(), checker_size_callback(), color_filter(), color_picker_helper_4ch(), color_picker_helper_4ch_parallel(), color_picker_helper_4ch_seq(), color_picker_helper_bayer(), color_picker_helper_xtrans(), commit_params(), curl_write_data_cb(), dark_channel(), dl(), draw_rectangle(), draw_triangle(), dt_alloc_align(), dt_alloc_align_internal(), dt_bauhaus_draw_indicator(), dt_box_mean_1ch(), dt_box_mean_4ch(), dt_calloc_align(), dt_colorspaces_get_profile_name(), dt_colorspaces_get_rgb_profile_from_mem(), dt_colorspaces_pseudoinverse(), dt_colorspaces_set_display_profile(), dt_dev_pixelpipe_cache_get(), dt_dev_pixelpipe_set_input(), dt_draw_paint_to_pixbuf(), dt_exif_get_color_space(), dt_exif_get_datetime_taken(), dt_exif_get_thumbnail(), dt_exif_read_from_blob(), dt_exif_write_blob(), dt_get_papers(), dt_hash(), dt_history_compress_on_list(), dt_history_end_attop(), dt_image_cache_init(), dt_imageio_avif_read_profile(), dt_imageio_export_with_flags(), dt_imageio_heif_read_profile(), dt_iop_alloc_image_buffers(), dt_ioppr_deserialize_iop_order_list(), dt_ioppr_serialize_iop_order_list(), dt_lua_event_multiinstance_destroy(), dt_masks_dynbuf_init(), dt_mipmap_cache_get_filename(), dt_pdf_add_icc_from_data(), dt_pdf_finish(), dt_pixel_cache_new_entry(), dt_pwstorage_kwallet_set(), dt_round_size(), dt_round_size_sse(), dt_ui_panel_get_size(), dt_util_get_logo(), dt_util_get_logo_text(), dwt_wavelet_decompose(), get_key(), get_params(), get_pref_name(), get_scales(), gui_post_expose(), guided_filter_tiling(), init(), init_presets(), legacy_params(), lin_interpolate(), main(), main(), matrice_pseudoinverse(), memset_zero(), PermutohedralLattice< D, VD >::merge_splat_threads(), modify_roi_out(), process(), process_common_cleanup(), process_laplacian_bayer(), rfwrite(), rt_adjust_levels(), rt_process_stats(), set_params(), set_params(), set_params(), set_params(), split_path(), to_char_array(), transition_map(), wavelet_denoise(), and wavelet_denoise_xtrans().
uint32_t width |
Referenced by _init_8(), _init_f(), _load_jpg(), dt_mipmap_cache_get_matching_size(), and dt_mipmap_cache_update_buffer_addresses().