![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "common/atomic.h"#include "common/cache.h"#include "common/colorspaces.h"#include "common/image.h"
Include dependency graph for mipmap_cache.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Data Structures | |
| struct | dt_mipmap_buffer_t |
| struct | dt_mipmap_cache_one_t |
| struct | dt_mipmap_cache_t |
Macros | |
| #define | dt_mipmap_cache_get(A, B, C, D, E, F) dt_mipmap_cache_get_with_caller(A,B,C,D,E,F,__FILE__,__LINE__) |
| #define | dt_mipmap_cache_get_with_shutdown(A, B, C, D, E, F, G) dt_mipmap_cache_get_with_caller_and_shutdown(A,B,C,D,E,F,G,__FILE__,__LINE__) |
| #define | dt_mipmap_cache_write_get(A, B, C, D) dt_mipmap_cache_write_get_with_caller(A,B,C,D,__FILE__,__LINE__) |
| #define | dt_mipmap_cache_release(A, B) dt_mipmap_cache_release_with_caller(A, B, __FILE__, __LINE__) |
Typedefs | |
| typedef enum dt_mipmap_size_t | dt_mipmap_size_t |
| typedef enum dt_mipmap_get_flags_t | dt_mipmap_get_flags_t |
| typedef struct dt_mipmap_buffer_t | dt_mipmap_buffer_t |
| typedef struct dt_mipmap_cache_one_t | dt_mipmap_cache_one_t |
| typedef struct dt_mipmap_cache_t | dt_mipmap_cache_t |
Enumerations | |
| enum | dt_mipmap_size_t { DT_MIPMAP_0 , DT_MIPMAP_1 , DT_MIPMAP_2 , DT_MIPMAP_3 , DT_MIPMAP_4 , DT_MIPMAP_5 , DT_MIPMAP_6 , DT_MIPMAP_7 , DT_MIPMAP_8 , DT_MIPMAP_F , DT_MIPMAP_FULL , DT_MIPMAP_NONE } |
| enum | dt_mipmap_get_flags_t { DT_MIPMAP_BLOCKING = 0 , DT_MIPMAP_TESTLOCK = 1 } |
| #define dt_mipmap_cache_get | ( | A, | |
| B, | |||
| C, | |||
| D, | |||
| E, | |||
| F | |||
| ) | dt_mipmap_cache_get_with_caller(A,B,C,D,E,F,__FILE__,__LINE__) |
| #define dt_mipmap_cache_get_with_shutdown | ( | A, | |
| B, | |||
| C, | |||
| D, | |||
| E, | |||
| F, | |||
| G | |||
| ) | dt_mipmap_cache_get_with_caller_and_shutdown(A,B,C,D,E,F,G,__FILE__,__LINE__) |
| #define dt_mipmap_cache_release | ( | A, | |
| B | |||
| ) | dt_mipmap_cache_release_with_caller(A, B, __FILE__, __LINE__) |
| #define dt_mipmap_cache_write_get | ( | A, | |
| B, | |||
| C, | |||
| D | |||
| ) | dt_mipmap_cache_write_get_with_caller(A,B,C,D,__FILE__,__LINE__) |
| typedef struct dt_mipmap_buffer_t dt_mipmap_buffer_t |
| typedef struct dt_mipmap_cache_one_t dt_mipmap_cache_one_t |
| typedef struct dt_mipmap_cache_t dt_mipmap_cache_t |
| typedef enum dt_mipmap_get_flags_t dt_mipmap_get_flags_t |
| typedef enum dt_mipmap_size_t dt_mipmap_size_t |
| enum dt_mipmap_size_t |
| 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, get_key(), and k.
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, dt_iop_buffer_dsc_t::bpp, bpp, dt_mipmap_buffer_t::buf, dt_mipmap_buffer_t::cache_entry, dt_cache_entry_t::data, dt_cache_entry_t::data_size, dt_image_t::dsc, dt_alloc_align(), dt_free_align, dt_mipmap_cache_update_buffer_addresses(), DT_MIPMAP_FULL, dt_image_t::filename, dt_image_t::height, IS_NULL_PTR, 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_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, dt_mipmap_get_cache_filename(), and PATH_MAX.
Referenced by dt_image_copy_rename().
| 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 | ||
| ) |
References DT_DEBUG_CACHE, DT_MIPMAP_0, DT_MIPMAP_F, dt_print(), height, k, dt_mipmap_cache_t::max_height, dt_mipmap_cache_t::max_width, and width.
Referenced by _preview_pipe_finished(), and dt_dev_resync_mipmap_cache().
| 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 | ||
| ) |
References DT_DEBUG_CACHE, DT_MIPMAP_0, DT_MIPMAP_F, dt_print(), height, k, dt_mipmap_cache_t::max_height, dt_mipmap_cache_t::max_width, and width.
Referenced by _view_image_get_surface_internal(), and preload_auto_callback().
| 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 dt_mipmap_cache_get_with_caller_and_shutdown(), and flags.
Referenced by dt_mipmap_cache_write_get_with_caller().
| 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 | ||
| ) |
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_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, 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_worker_threads(), k, 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, 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_DEBUG_CACHE, dt_print(), 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(), DT_MIPMAP_F, and k.
Referenced by _image_import_internal(), _jpg_combobox_changed(), clear_image_cache(), dt_dev_history_notify_change(), dt_film_remove(), dt_history_delete_on_image_ext(), dt_image_flip(), dt_image_remove(), and dt_image_set_flip().
| 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().
| 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 | buffer, | ||
| const int32_t | width, | ||
| const int32_t | height, | ||
| dt_colorspaces_color_profile_type_t | profile | ||
| ) |
References _get_buffer_from_dsc(), _get_cache(), _get_dsc_from_entry(), darktable_t::color_profiles, dt_mipmap_buffer_dsc::color_space, darktable, dt_cache_get_with_caller(), dt_cache_release, DT_COLORSPACE_ADOBERGB, DT_COLORSPACE_DISPLAY, dt_colorspaces_get_profile(), dt_colorspaces_transform_rgba8_to_bgra8(), DT_DEBUG_CACHE, dt_iop_flip_and_zoom_8(), DT_MIPMAP_0, DT_MIPMAP_F, dt_print(), DT_PROFILE_DIRECTION_DISPLAY, FALSE, dt_mipmap_buffer_dsc::flags, get_key(), height, dt_mipmap_buffer_dsc::height, dt_mipmap_buffer_dsc::iscale, key, ORIENTATION_NONE, transform(), dt_colorspaces_t::transform_display_to_adobe_rgb, TRUE, width, dt_mipmap_buffer_dsc::width, and dt_colorspaces_t::xprofile_lock.
Referenced by dt_dev_resync_mipmap_cache().
| 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().
| void dt_mipmap_get_cache_dir | ( | char | path[PATH_MAX], |
| const dt_mipmap_cache_t * | cache, | ||
| dt_mipmap_size_t | mip | ||
| ) |
References dt_mipmap_cache_t::cachedir, and PATH_MAX.
Referenced by dt_mipmap_cache_deallocate_dynamic(), dt_mipmap_get_cache_filename(), and generate_thumbnail_cache().
| 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 | ||
| ) |
References dt_concat_path_file(), dt_free, dt_mipmap_get_cache_dir(), and PATH_MAX.
Referenced by dt_mipmap_cache_allocate_dynamic(), dt_mipmap_cache_copy_thumbnails(), dt_mipmap_cache_deallocate_dynamic(), dt_mipmap_cache_unlink_ondisk_thumbnail(), generate_thumbnail_cache(), and preload_image_cache().