83#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__DragonFly__)
87#include <sys/malloc.h>
97#include <sys/sysctl.h>
99#if defined(__DragonFly__) || defined(__FreeBSD__)
100#include <sys/sysctl.h>
101#include <sys/types.h>
103#if defined(__NetBSD__) || defined(__OpenBSD__)
104#include <sys/param.h>
105#include <sys/sysctl.h>
180#if !defined(_WIN32) && !defined(__APPLE__)
181#include <fontconfig/fontconfig.h>
184#include <glib/gstdio.h>
185#include <pango/pangocairo.h>
190#include <sys/param.h>
191#include <sys/types.h>
196#if defined(__x86_64__) || defined(__i386__)
197#include <xmmintrin.h>
205#if defined(__SUNOS__)
206#include <sys/varargs.h>
215#if !defined(_WIN32) && !defined(__APPLE__)
216typedef struct _PangoFcFontMap PangoFcFontMap;
217extern GType pango_fc_font_map_get_type(
void);
218extern void pango_fc_font_map_shutdown(PangoFcFontMap *fcfontmap);
228 gsize n_fields, gpointer user_data)
230 const gchar *message = NULL;
232 for(gsize
k = 0;
k < n_fields;
k++)
234 if(g_strcmp0(fields[
k].
key,
"MESSAGE"))
continue;
236 message = fields[
k].value;
246 if(!g_strcmp0(message,
"Unable to load dot from the cursor theme"))
247 return G_LOG_WRITER_HANDLED;
249 if(g_str_has_prefix(message,
"Theme parsing error:")
250 && g_str_has_suffix(message,
"The :insensitive pseudo-class is deprecated. Use :disabled instead."))
251 return G_LOG_WRITER_HANDLED;
253 if(g_str_has_prefix(message,
"Theme parsing error:")
254 && g_str_has_suffix(message,
"The :inconsistent pseudo-class is deprecated. Use :indeterminate instead."))
255 return G_LOG_WRITER_HANDLED;
258 return g_log_writer_default(log_level, fields, n_fields, user_data);
264 char *logfile = g_build_filename(g_get_user_cache_dir(),
"ansel",
"ansel-log.txt", NULL);
267 printf(
"usage: %s [options] [IMG_1234.{RAW,..}|image_folder/]\n", argv0);
269 printf(
"options:\n");
271 printf(
" --cachedir <user cache directory>\n");
272 printf(
" --conf <key>=<value>\n");
273 printf(
" --configdir <user config directory>\n");
274 printf(
" -d {all,cache,camctl,camsupport,colorprofile,control,demosaic,dev,gtk,history,imageio,import,\n");
275 printf(
" input,ioporder,lighttable,lua,masks,memory,nan,nocache_reuse,opencl,params,\n");
276 printf(
" perf,pipe,pipecache,print,signal,sql,shortcuts,tiling,undo,verbose}\n");
277 printf(
" --d-signal <signal> \n");
278 printf(
" --d-signal-act <all,raise,connect,disconnect");
280#ifdef DT_HAVE_SIGNAL_TRACE
281 printf(
",print-trace");
284 printf(
" --datadir <data directory>\n");
286 printf(
" --disable-opencl\n");
288 printf(
" --doc [documentation directory]\n");
289 printf(
" -h, --help");
294 printf(
" --library <library file>\n");
295 printf(
" --localedir <locale directory>\n");
296 printf(
" --moduledir <module directory>\n");
297 printf(
" --noiseprofiles <noiseprofiles json file>\n");
298 printf(
" -t <num openmp threads>\n");
299 printf(
" --tmpdir <tmp directory>\n");
300 printf(
" --version\n");
303 printf(
" note: debug log and output will be written to this file:\n");
304 printf(
" %s\n", logfile);
316 char ver[100] = { 0 };
320 for(
char *
p = ver; *
p;
p++)
325 if(*
p >=
'0' && *
p <=
'9')
334 if(*
p ==
'.' || *
p ==
'+') count++;
342 return g_strdup(start);
349 static gchar *
id = NULL;
350 static gsize
init = 0;
351 if(g_once_init_enter(&
init))
353 id = g_uuid_string_random();
354 g_once_init_leave(&
init, 1);
364 static gchar *
id = NULL;
365 static gsize
init = 0;
366 if(g_once_init_enter(&
init))
369 if(!stored || !*stored)
372 stored = g_uuid_string_random();
376 g_once_init_leave(&
init, 1);
383 char *ext = g_strrstr(filename,
".");
392 if(
IS_NULL_PTR(input) || input[0] ==
'\0')
return 0;
402 if(g_file_test(filename, G_FILE_TEST_IS_DIR))
415 if(single_image) *single_image =
FALSE;
420 gchar *
directory = g_path_get_dirname((
const gchar *)filename);
451 if(single_image) *single_image =
TRUE;
461#if defined(__linux__)
462 FILE *
f = g_fopen(
"/proc/meminfo",
"rb");
467 int first = 1, found = 0;
469 while(!found &&
getline(&line, &len,
f) != -1)
471 char *colon = strchr(line,
':');
473 found = !strncmp(line,
"MemTotal:", 9);
474 if(found || first) mem = atol(colon + 1);
483#elif defined(__APPLE__) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) \
484 || defined(__OpenBSD__)
485#if defined(__APPLE__)
486 int mib[2] = { CTL_HW, HW_MEMSIZE };
487#elif defined(HW_PHYSMEM64)
488 int mib[2] = { CTL_HW, HW_PHYSMEM64 };
490 int mib[2] = { CTL_HW, HW_PHYSMEM };
494 sysctl(mib, 2, (
void *)&physical_memory, &length, (
void *)NULL, 0);
495 return physical_memory / 1024;
497 MEMORYSTATUSEX memInfo;
498 memInfo.dwLength =
sizeof(MEMORYSTATUSEX);
499 GlobalMemoryStatusEx(&memInfo);
500 return memInfo.ullTotalPhys / (
uint64_t)1024;
503 fprintf(stderr,
"Unknown memory size. Assuming 2GB\n");
752 g_list_copy((GList *)imgs), 0);
792 g_list_copy((GList *)imgs));
805 lib_modules = g_list_next(lib_modules))
861 gchar *label = (
module->multi_name[0] != '\0')
862 ? g_strdup_printf("%s (%s)", module->common_fields.name, module->multi_name)
863 : g_strdup(module->common_fields.name);
882 dt_control_log(_(
"A newer nightly build is available (%s).\nHelp ▸ Update to the latest nightly build"), version);
885int dt_init(
int argc,
char *argv[],
const gboolean init_gui,
const gboolean load_data)
890 if(getuid() == 0 || geteuid() == 0)
892 "WARNING: either your user id or the effective user id are 0. are you running darktable as root?\n");
899#ifdef M_MMAP_THRESHOLD
900 mallopt(M_MMAP_THRESHOLD, 128 * 1024);
922 char *dbfilename_from_command = NULL;
923 char *noiseprofiles_from_command = NULL;
924 char *datadir_from_command = NULL;
925 char *moduledir_from_command = NULL;
926 char *localedir_from_command = NULL;
927 char *tmpdir_from_command = NULL;
928 char *configdir_from_command = NULL;
929 char *cachedir_from_command = NULL;
930 char *kerneldir_from_command = NULL;
933 gboolean exclude_opencl =
FALSE;
934 gboolean print_statistics = (strstr(argv[0],
"ansel-cltest") == NULL);
943 gboolean cpu_threads_from_cli =
FALSE;
945 GSList *config_override = NULL;
946 for(
int k = 1;
k < argc;
k++)
949 if(!strcmp(argv[
k],
"/?"))
951 return usage(argv[0]);
954 if(argv[
k][0] ==
'-')
956 if(!strcmp(argv[
k],
"--help") || !strcmp(argv[
k],
"-h"))
958 return usage(argv[0]);
960 else if(!strcmp(argv[
k],
"--version"))
962 printf(
"this is %s\ncopyright (c) 2009-2022 Johannes Hanika, (c) 2022-%s Aurélien Pierre\n" PACKAGE_BUGREPORT "\n\ncompile options:\n"
963 " bit depth is %" G_GSIZE_FORMAT
" bit\n"
970 " OpenMP support enabled\n"
972 " OpenMP support disabled\n"
976 " OpenCL support enabled\n"
978 " OpenCL support disabled\n"
982 " Colord support enabled\n"
984 " Colord support disabled\n"
988 " OpenEXR support enabled\n"
990 " OpenEXR support disabled\n"
995 CHAR_BIT *
sizeof(
void *)
999 else if(!strcmp(argv[
k],
"--library") && argc >
k + 1)
1001 dbfilename_from_command = argv[++
k];
1005 else if(!strcmp(argv[
k],
"--datadir") && argc >
k + 1)
1007 datadir_from_command = argv[++
k];
1011 else if(!strcmp(argv[
k],
"--moduledir") && argc >
k + 1)
1013 moduledir_from_command = argv[++
k];
1017 else if(!strcmp(argv[
k],
"--tmpdir") && argc >
k + 1)
1019 tmpdir_from_command = argv[++
k];
1023 else if(!strcmp(argv[
k],
"--configdir") && argc >
k + 1)
1025 configdir_from_command = argv[++
k];
1029 else if(!strcmp(argv[
k],
"--cachedir") && argc >
k + 1)
1031 cachedir_from_command = argv[++
k];
1035 else if(!strcmp(argv[
k],
"--localedir") && argc >
k + 1)
1037 localedir_from_command = argv[++
k];
1041 else if(!strcmp(argv[
k],
"--kerneldir") && argc >
k + 1)
1043 kerneldir_from_command = argv[++
k];
1047 else if(argv[
k][1] ==
'd' && argc >
k + 1)
1049 if(!strcmp(argv[
k + 1],
"all"))
1051 else if(!strcmp(argv[
k + 1],
"cache"))
1053 else if(!strcmp(argv[
k + 1],
"control"))
1055 else if(!strcmp(argv[
k + 1],
"dev"))
1057 else if(!strcmp(argv[
k + 1],
"gtk"))
1059 else if(!strcmp(argv[
k + 1],
"input"))
1061 else if(!strcmp(argv[
k + 1],
"pipecache"))
1063 else if(!strcmp(argv[
k + 1],
"perf"))
1065 else if(!strcmp(argv[
k + 1],
"opencl"))
1067 else if(!strcmp(argv[
k + 1],
"sql"))
1069 else if(!strcmp(argv[
k + 1],
"memory"))
1071 else if(!strcmp(argv[
k + 1],
"lighttable"))
1073 else if(!strcmp(argv[
k + 1],
"nan"))
1075 else if(!strcmp(argv[
k + 1],
"masks"))
1077 else if(!strcmp(argv[
k + 1],
"lua"))
1079 else if(!strcmp(argv[
k + 1],
"print"))
1081 else if(!strcmp(argv[
k + 1],
"camsupport"))
1083 else if(!strcmp(argv[
k + 1],
"colorprofile"))
1085 else if(!strcmp(argv[
k + 1],
"nocache_reuse"))
1087 else if(!strcmp(argv[
k + 1],
"ioporder"))
1089 else if(!strcmp(argv[
k + 1],
"imageio"))
1091 else if(!strcmp(argv[
k + 1],
"undo"))
1093 else if(!strcmp(argv[
k + 1],
"signal"))
1095 else if(!strcmp(argv[
k + 1],
"params"))
1097 else if(!strcmp(argv[
k + 1],
"demosaic"))
1099 else if(!strcmp(argv[
k + 1],
"shortcuts"))
1101 else if(!strcmp(argv[
k + 1],
"tiling"))
1103 else if(!strcmp(argv[
k + 1],
"verbose"))
1105 else if(!strcmp(argv[
k + 1],
"pipe"))
1107 else if(!strcmp(argv[
k + 1],
"history"))
1109 else if(!strcmp(argv[
k + 1],
"import"))
1111 else if(!strcmp(argv[
k + 1],
"supervisor"))
1114 return usage(argv[0]);
1119 else if(!strcmp(argv[
k],
"--d-signal-act") && argc >
k + 1)
1121 if(!strcmp(argv[
k + 1],
"all"))
1123 else if(!strcmp(argv[
k + 1],
"raise"))
1125 else if(!strcmp(argv[
k + 1],
"connect"))
1127 else if(!strcmp(argv[
k + 1],
"disconnect"))
1129 else if(!strcmp(argv[
k + 1],
"print-trace"))
1131#ifdef DT_HAVE_SIGNAL_TRACE
1134 fprintf(stderr,
"[signal] print-trace not available, skipping\n");
1138 return usage(argv[0]);
1143 else if(!strcmp(argv[
k],
"--d-signal") && argc >
k + 1)
1145 gchar *str = g_ascii_strup(argv[
k+1], -1);
1147 #define CHKSIGDBG(sig) else if(!g_strcmp0(str, #sig)) do {darktable.unmuted_signal_dbg[sig] = TRUE;} while (0)
1148 if(!g_strcmp0(str,
"ALL"))
1197 fprintf(stderr,
"unknown signal name: '%s'. use 'ALL' to enable debug for all or use full signal name\n", str);
1198 return usage(argv[0]);
1206 else if(argv[
k][1] ==
't' && argc >
k + 1)
1213 cpu_threads_from_cli =
TRUE;
1215 else if(!strcmp(argv[
k],
"--conf") && argc >
k + 1)
1217 gchar *keyval = g_strdup(argv[++
k]), *c = keyval;
1220 gchar *end = keyval + strlen(keyval);
1221 while(*c !=
'=' && c < end) c++;
1222 if(*c ==
'=' && *(c + 1) !=
'\0')
1226 entry->
key = g_strdup(keyval);
1227 entry->
value = g_strdup(c);
1228 config_override = g_slist_append(config_override, entry);
1232 else if(!strcmp(argv[
k],
"--noiseprofiles") && argc >
k + 1)
1234 noiseprofiles_from_command = argv[++
k];
1238 else if(!strcmp(argv[
k],
"--disable-opencl"))
1241 exclude_opencl =
TRUE;
1245 else if(!strcmp(argv[
k],
"--doc"))
1254 if(argc >
k + 1 && !
IS_NULL_PTR(argv[
k + 1]) && g_file_test(argv[
k + 1], G_FILE_TEST_IS_DIR))
1263 else if(!strcmp(argv[
k],
"--debug"))
1267 else if(!strcmp(argv[
k],
"--"))
1274 else if(!strncmp(argv[
k],
"-psn_", 5))
1281 return usage(argv[0]);
1286 for(
int i = 1;
i < argc;
i++)
1289 for(
k =
i;
k < argc;
k++)
1295 for(
int j =
i +
k; j < argc; j++)
1297 argv[j-
k] = argv[j];
1305 dt_loc_init(datadir_from_command, moduledir_from_command, localedir_from_command, configdir_from_command, cachedir_from_command, tmpdir_from_command, kerneldir_from_command);
1316 fprintf(stderr,
"[memory] at startup\n");
1326 const gchar *xdg_data_dirs = g_getenv(
"XDG_DATA_DIRS");
1327 gchar *new_xdg_data_dirs = NULL;
1328 gboolean set_env =
TRUE;
1329 if(!
IS_NULL_PTR(xdg_data_dirs) && *xdg_data_dirs !=
'\0')
1332 gboolean found =
FALSE;
1333 gchar **tokens = g_strsplit(xdg_data_dirs, G_SEARCHPATH_SEPARATOR_S, 0);
1335 for(
char **iter = tokens; !
IS_NULL_PTR(*iter); iter++)
1336 if(!strcmp(sharedir, *iter))
1345 new_xdg_data_dirs = g_strjoin(G_SEARCHPATH_SEPARATOR_S, sharedir, xdg_data_dirs, NULL);
1352 if(!g_strcmp0(sharedir,
"/usr/local/share")
1353 || !g_strcmp0(sharedir,
"/usr/local/share/")
1354 || !g_strcmp0(sharedir,
"/usr/share") || !g_strcmp0(sharedir,
"/usr/share/"))
1355 new_xdg_data_dirs = g_strdup(
"/usr/local/share/" G_SEARCHPATH_SEPARATOR_S
"/usr/share/");
1357 new_xdg_data_dirs = g_strdup_printf(
"%s" G_SEARCHPATH_SEPARATOR_S
"/usr/local/share/" G_SEARCHPATH_SEPARATOR_S
1358 "/usr/share/", sharedir);
1364 if(set_env) g_setenv(
"XDG_DATA_DIRS", new_xdg_data_dirs, 1);
1369 setlocale(LC_ALL,
"");
1408 if(!cpu_threads_from_cli)
1422 gtk_init(&argc, &argv);
1447 .library = configured_library,
1448 .load_data = load_data,
1449 .has_gui = init_gui,
1452 gboolean recheck_needed =
TRUE;
1453 while (recheck_needed)
1464 printf(
"ERROR : cannot open database\n");
1475 gboolean image_loaded_elsewhere =
FALSE;
1476#ifndef MAC_INTEGRATION
1478 fprintf(stderr,
"trying to open the images in the running instance\n");
1482 GDBusConnection *connection = NULL;
1483 for(
int i = 1;
i < argc;
i++)
1486 if(argv[
i] == NULL || *argv[
i] ==
'\0')
continue;
1489 if(
IS_NULL_PTR(connection)) connection = g_bus_get_sync(G_BUS_TYPE_SESSION, NULL, NULL);
1491 image_loaded_elsewhere = g_dbus_connection_call_sync(connection,
"org.darktable.service",
"/darktable",
1492 "org.darktable.service.Remote",
"Open",
1493 g_variant_new(
"(s)", filename), NULL,
1494 G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL) != NULL;
1497 if(connection) g_object_unref(connection);
1500 if(!image_loaded_elsewhere)
1506 fprintf(stderr,
"ERROR: can't acquire database lock, aborting.\n");
1522 recheck_needed =
FALSE;
1564 if(dbfilename_from_command && !strcmp(dbfilename_from_command,
":memory:"))
1628 fprintf(stderr,
"ERROR: can't init gui, aborting.\n");
1648 fprintf(stderr,
"ERROR: can't init develop system, aborting.\n");
1663 pipecache_size /= 2;
1665 "WARNING: can't reserve %" G_GSIZE_FORMAT
" MiB of virtual memory for the pixelpipe cache, "
1666 "retrying with %" G_GSIZE_FORMAT
" MiB. Check your memory settings.\n",
1667 2 * pipecache_size / (1024 * 1024), pipecache_size / (1024 * 1024));
1683 fprintf(stderr,
"ERROR: can't init pixelpipe cache, aborting.\n");
1728 fprintf(stderr,
"ERROR: iop order looks bad, aborting.\n");
1766 fprintf(stderr,
"[memory] after successful startup\n");
1776#ifndef MAC_INTEGRATION
1858 if(max_iters <= 0)
return;
1859 GMainContext *ctx = g_main_context_default();
1860 for(
int i = 0;
i < max_iters && g_main_context_pending(ctx);
i++)
1861 g_main_context_iteration(ctx,
FALSE);
1890 gchar **snaps_to_remove = NULL;
1891 if(perform_snapshot)
1944 if(GTK_IS_WIDGET(main_window))
1945 gtk_widget_destroy(main_window);
1998 if(perform_maintenance)
2005 if(perform_snapshot)
2010 while(snaps_to_remove[
i])
2013 g_chmod(snaps_to_remove[
i], S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
2016 const int retunlink = g_remove(snaps_to_remove[
i++]);
2023 g_strfreev(snaps_to_remove);
2060 g_thread_pool_stop_unused_threads();
2061#if !defined(_WIN32) && !defined(__APPLE__)
2062 PangoFontMap *fontmap = pango_cairo_font_map_get_default();
2063 gboolean use_fontconfig_backend =
FALSE;
2065 if(fontmap && PANGO_IS_CAIRO_FONT_MAP(fontmap))
2067 const cairo_font_type_t font_backend
2068 = pango_cairo_font_map_get_font_type(PANGO_CAIRO_FONT_MAP(fontmap));
2069 use_fontconfig_backend = (font_backend == CAIRO_FONT_TYPE_FT);
2072 if(use_fontconfig_backend && fontmap && g_type_is_a(G_OBJECT_TYPE(fontmap), pango_fc_font_map_get_type()))
2073 pango_fc_font_map_shutdown((PangoFcFontMap *)fontmap);
2074 if(use_fontconfig_backend) FcFini();
2076 pango_cairo_font_map_set_default(NULL);
2146 snprintf(buf,
sizeof(buf),
"%s took %.3f secs (%.3f CPU)", prefix, end.
clock - start->
clock,
2160 const int n = snprintf(buf,
sizeof(buf),
"%s took %.3f secs (%.3f CPU) ", prefix, end.
clock - start->
clock,
2162 if(
n <
sizeof(buf) - 1)
2165 va_start(ap, suffix);
2166 vsnprintf(buf +
n,
sizeof(buf) -
n, suffix, ap);
2180 if(GlobalMemoryStatusEx(&
status))
2181 return (
size_t)
status.ullAvailPhys;
2186#elif defined(__APPLE__)
2187#include <mach/mach.h>
2191 mach_port_t host = mach_host_self();
2192 vm_statistics64_data_t vmstat;
2193 mach_msg_type_number_t count = HOST_VM_INFO64_COUNT;
2194 if(host_statistics64(host, HOST_VM_INFO64, (host_info64_t)&vmstat, &count) != KERN_SUCCESS)
return 0;
2197 host_page_size(host, &page_size);
2200 return (vmstat.free_count + vmstat.inactive_count) * page_size;
2203#elif defined(__linux__)
2212static void _probe_cgroup_v2(
size_t *out_limit,
size_t *out_available)
2214 size_t tightest = SIZE_MAX;
2215 size_t tightest_limit = SIZE_MAX;
2216 *out_limit = SIZE_MAX;
2217 *out_available = SIZE_MAX;
2219 FILE *
f = g_fopen(
"/proc/self/cgroup",
"r");
2223 char path[512] =
"";
2224 while(fgets(line,
sizeof(line),
f))
2227 if(!strncmp(line,
"0::", 3))
2229 g_strlcpy(path, line + 3,
sizeof(path));
2230 char *newline = strchr(path,
'\n');
2231 if(newline) *newline =
'\0';
2236 if(path[0] ==
'\0')
return;
2241 snprintf(file,
sizeof(file),
"/sys/fs/cgroup%s/memory.max", path);
2242 FILE *fmax = g_fopen(file,
"r");
2247 unsigned long long max_bytes = 0;
2248 if(fscanf(fmax,
"%llu", &max_bytes) == 1 && max_bytes > 0)
2250 unsigned long long cur_bytes = max_bytes;
2251 snprintf(file,
sizeof(file),
"/sys/fs/cgroup%s/memory.current", path);
2252 FILE *fcur = g_fopen(file,
"r");
2255 if(fscanf(fcur,
"%llu", &cur_bytes) != 1) cur_bytes = max_bytes;
2264 unsigned long long inactive_file = 0;
2265 snprintf(file,
sizeof(file),
"/sys/fs/cgroup%s/memory.stat", path);
2266 FILE *fstat = g_fopen(file,
"r");
2269 char stat_line[256];
2270 while(fgets(stat_line,
sizeof(stat_line), fstat))
2271 if(sscanf(stat_line,
"inactive_file %llu", &inactive_file) == 1)
break;
2275 const size_t slack = (max_bytes > cur_bytes) ? (
size_t)(max_bytes - cur_bytes) : 0;
2276 const size_t available = slack + (size_t)inactive_file;
2277 if(available < tightest) tightest = available;
2278 if((
size_t)max_bytes < tightest_limit) tightest_limit = (
size_t)max_bytes;
2283 char *slash = strrchr(path,
'/');
2288 *out_limit = tightest_limit;
2289 *out_available = tightest;
2294 FILE *
f = g_fopen(
"/proc/meminfo",
"r");
2298 size_t available_kb = 0;
2299 size_t available = 0;
2301 while(fgets(line,
sizeof(line),
f))
2303 if(sscanf(line,
"MemAvailable: %" G_GSIZE_FORMAT
" kB", &available_kb) == 1)
2305 available = available_kb * 1024;
2311 size_t cgroup_limit = SIZE_MAX;
2312 size_t cgroup_available = SIZE_MAX;
2313 _probe_cgroup_v2(&cgroup_limit, &cgroup_available);
2314 if(cgroup_available != SIZE_MAX) available =
MIN(available, cgroup_available);
2333#define DT_SYS_MEM_PROBE_PERIOD_US 50000
2343 const gint64 now = g_get_monotonic_time();
2370#if defined(__linux__)
2371 size_t cgroup_limit = SIZE_MAX;
2372 size_t cgroup_available = SIZE_MAX;
2373 _probe_cgroup_v2(&cgroup_limit, &cgroup_available);
2374 return cgroup_limit;
2388 size_t cache_used = 0;
2389 size_t cache_max = 0;
2391 const size_t budget_left = cache_max - cache_used;
2400 if(sys_available == 0)
return budget_left;
2403 const size_t sys_room = ((sys_available > pressure_floor) ? sys_available - pressure_floor : 0)
2405 return MIN(budget_left, sys_room);
2431 if(container_limit != SIZE_MAX && (physical_memory == 0 || container_limit < physical_memory))
2434 "[MEMORY CONFIGURATION] container/cgroup memory limit detected: %" G_GSIZE_FORMAT
2435 " MiB — using it as the total RAM\n", container_limit / (1024 * 1024));
2436 physical_memory = container_limit;
2442 const size_t mem = resources->
total_memory / (1024 * 1024);
2443 const size_t bits = CHAR_BIT *
sizeof(
void *);
2444 const gboolean sufficient = (mem >= 4096 && threads >= 2);
2446 dt_print(
DT_DEBUG_MEMORY,
"[MEMORY CONFIGURATION] found a %s %" G_GSIZE_FORMAT
"-bit system with %" G_GSIZE_FORMAT
" cores\n",
2447 (sufficient) ?
"sufficient" :
"low performance", bits, threads);
2457 if(physical_memory > 0 && resources->
total_memory > physical_memory)
2460 "MEMORY WARNING: host_memory_limit (%" G_GSIZE_FORMAT
" MiB) exceeds the physical RAM "
2461 "(%" G_GSIZE_FORMAT
" MiB) and was clamped to it.\n",
2462 resources->
total_memory / (1024 * 1024), physical_memory / (1024 * 1024));
2489 int64_t pressure_floor =
dt_conf_get_int64(
"memory_pressure_floor") * 1024 * 1024;
2501 const size_t min_pipecache_memory = 6 * 6000 * 4000 * 4 *
sizeof(float);
2507 (int64_t)min_pipecache_memory);
2512 "MEMORY WARNING: your pixelpipe cache allocated RAM is too small for your typical raw size.\n"
2513 "MEMORY WARNING: reduce your OS/apps headroom, or your thumbnail cache size.\n"
2514 "MEMORY WARNING: you may also simply need more RAM or need to reset the config key host_memory.\n"
2515 "MEMORY WARNING: we shrank the thumbnails cache to the bare minimum to leave enough space for pixelpipe cache.\n");
2519 (int64_t)128 * 1024 * 1024);
2541 dt_control_log(_(
"CRITICAL WARNING: Ansel will not be able to use the RAM you allocated it.\n"
2542 "Review your memory settings or add more RAM to your system."));
2547 for(GList *capabilities =
darktable.
capabilities; capabilities; capabilities = g_list_next(capabilities))
2549 if(!strcmp(capabilities->data, capability))
2588 fprintf(stdout,
"[memory] Currently-free and reclaimable memory detected: %lu MiB\n",
dt_get_system_available_mem() / (1024 * 1024));
2590#if defined(__linux__)
2599 char pidstatus[128];
2600 snprintf(pidstatus,
sizeof(pidstatus),
"/proc/%u/status", (uint32_t)getpid());
2602 f = g_fopen(pidstatus,
"r");
2606 while(
getline(&line, &len,
f) != -1)
2608 if(!strncmp(line,
"VmPeak:", 7))
2609 g_strlcpy(vmpeak, line + 8,
sizeof(vmpeak));
2610 else if(!strncmp(line,
"VmSize:", 7))
2611 g_strlcpy(vmsize, line + 8,
sizeof(vmsize));
2612 else if(!strncmp(line,
"VmRSS:", 6))
2613 g_strlcpy(vmrss, line + 8,
sizeof(vmrss));
2614 else if(!strncmp(line,
"VmHWM:", 6))
2615 g_strlcpy(vmhwm, line + 8,
sizeof(vmhwm));
2620 fprintf(stderr,
"[memory] max address space (vmpeak): %15s"
2621 "[memory] cur address space (vmsize): %15s"
2622 "[memory] max used memory (vmhwm ): %15s"
2623 "[memory] cur used memory (vmrss ): %15s",
2624 vmpeak, vmsize, vmhwm, vmrss);
2626#elif defined(__APPLE__)
2627 struct task_basic_info t_info;
2628 mach_msg_type_number_t t_info_count = TASK_BASIC_INFO_COUNT;
2630 if(KERN_SUCCESS != task_info(mach_task_self(), TASK_BASIC_INFO, (task_info_t)&t_info, &t_info_count))
2632 fprintf(stderr,
"[memory] task memory info unknown.\n");
2637 fprintf(stderr,
"[memory] max address space (vmpeak): %15s\n"
2638 "[memory] cur address space (vmsize): %12llu kB\n"
2639 "[memory] max used memory (vmhwm ): %15s\n"
2640 "[memory] cur used memory (vmrss ): %12llu kB\n",
2641 "unknown", (
uint64_t)t_info.virtual_size / 1024,
"unknown", (
uint64_t)t_info.resident_size / 1024);
2642#elif defined (_WIN32)
2644 MEMORYSTATUSEX memInfo;
2645 memInfo.dwLength =
sizeof(MEMORYSTATUSEX);
2646 GlobalMemoryStatusEx(&memInfo);
2650 PROCESS_MEMORY_COUNTERS_EX pmc;
2651 GetProcessMemoryInfo(GetCurrentProcess(), (PROCESS_MEMORY_COUNTERS *)&pmc,
sizeof(pmc));
2652 size_t virtualMemUsedByMe = pmc.PagefileUsage;
2653 size_t virtualMemUsedByMeMax = pmc.PeakPagefileUsage;
2656 size_t physMemUsedByMeMax = pmc.PeakWorkingSetSize;
2659 size_t physMemUsedByMe = pmc.WorkingSetSize;
2662 fprintf(stderr,
"[memory] max address space (vmpeak): %12llu kB\n"
2663 "[memory] cur address space (vmsize): %12llu kB\n"
2664 "[memory] max used memory (vmhwm ): %12llu kB\n"
2665 "[memory] cur used memory (vmrss ): %12llu Kb\n",
2666 virtualMemUsedByMeMax / 1024, virtualMemUsedByMe / 1024, physMemUsedByMeMax / 1024,
2667 physMemUsedByMe / 1024);
2670 fprintf(stderr,
"dt_print_mem_usage() currently unsupported on this platform\n");
2676 g_strlcpy(destination, path,
sizeof(
char) *
DT_PATH_MAX);
2677 g_strlcat(destination, G_DIR_SEPARATOR_S,
sizeof(
char) *
DT_PATH_MAX);
2678 g_strlcat(destination, file,
sizeof(
char) *
DT_PATH_MAX);
void dt_accels_connect_accels(dt_accels_t *accels)
Actually enable accelerators after having loaded user config.
void dt_accels_cleanup(dt_accels_t *accels)
int dt_gui_gtk_init(dt_gui_gtk_t *gui)
static void error(char *msg)
void init(dt_imageio_module_format_t *self)
void dt_bauhaus_cleanup(dt_bauhaus_t *bauhaus)
dt_bauhaus_t * dt_bauhaus_init()
typedef void((*dt_cache_allocate_t)(void *userdata, dt_cache_entry_t *entry))
static const dt_adaptation_t kind
void dt_culling_mode_to_selection()
void dt_collection_cleanup_global(void)
void dt_colorlabels_cleanup(void)
void dt_colorprofiles_cleanup(void)
Persist the display/soft-proof settings to conf, flush the derived matrix/LUT memo,...
void dt_colorprofiles_init(void)
Build the module's single instance: register every built-in profile, load the color/in and color/out ...
The colour-profile module's API: which profiles exist, and how to apply one.
struct _GtkWidget GtkWidget
GtkWidget, opaque, spelled exactly as GTK spells it.
void dt_conf_cleanup(dt_conf_t *cf)
Free everything cf owns. No dt_conf_*() call is valid afterwards.
int dt_conf_get_bool(const char *name)
void dt_conf_init(dt_conf_t *cf, const char *filename, GSList *override_entries)
Populate cf from filename and from the generated defaults.
gchar * dt_conf_get_string(const char *name)
Read the stored string for name as a private copy.
void dt_conf_set_int(const char *name, int val)
int dt_conf_get_int(const char *name)
Integer for name, clamped to the bounds declared in the XML.
int64_t dt_conf_get_int64(const char *name)
64-bit integer for name, clamped to its declared bounds.
void dt_conf_set_string(const char *name, const char *val)
int32_t dt_image_import(const int32_t film_id, const char *filename, gboolean raise_signals)
void dt_image_xmp_mode_refresh_from_conf(void)
#define PACKAGE_BUGREPORT
#define DT_BUILD_CPU_MODE
#define DT_BUILD_CXX_COMPILER
#define DT_BUILD_C_COMPILER
const char darktable_package_string[]
#define DT_BUILD_CXX_FLAGS
const char darktable_last_commit_year[]
void dt_ctl_switch_mode_to(const char *mode)
void dt_control_init(dt_control_t *s)
void dt_toast_log(const char *msg,...)
void dt_control_set_mouse_over_id(int32_t value)
void dt_control_log(const char *msg,...)
void dt_control_queue_redraw_center()
Request a redraw of the centre view.
void dt_control_shutdown(dt_control_t *s)
void dt_control_cleanup(dt_control_t *s)
void dt_control_crawler_run_in_background(void)
void dt_printers_abort_discovery(void)
void dt_vprint(dt_debug_thread_t thread, const char *msg,...)
void dt_show_times(const dt_times_t *start, const char *prefix)
static void _preferences_changed(gpointer instance, gpointer user_data)
void dt_invalidate_system_available_mem(void)
int dt_get_num_openmp_threads(void)
Number of OpenMP threads the application decided to use.
int dt_load_from_string(const gchar *input, gboolean open_image_in_dr, gboolean *single_image)
static GLogWriterOutput _gtk_log_writer_filter(GLogLevelFlags log_level, const GLogField *fields, gsize n_fields, gpointer user_data)
size_t dt_get_system_available_mem(void)
struct dt_develop_t * dt_dev_get_global(void)
struct dt_undo_t * dt_undo_get_global(void)
double dt_get_start_wtime(void)
int32_t dt_get_debug_flags(void)
static void _database_renamed(const char *new_library_name)
struct dt_dbus_t * dt_dbus_get_global(void)
static gint64 _sys_mem_probe_time_us
static void _dt_drain_main_context(const int max_iters)
GList * dt_iop_get_modules_so(void)
struct dt_lib_t * dt_lib_get_global(void)
static void _doc_screenshot_lib_modules(void *inventory)
static void _pipeline_message(const char *message)
static void _image_imported(const int32_t imgid)
const char * dt_install_id(void)
void dt_print_mem_usage()
static const dt_pixelpipe_cache_observer_t _pixelpipe_cache_observer
static dt_mipmap_cache_settings_t _mipmap_settings_from_conf(void)
struct dt_view_manager_t * dt_view_manager_get_global(void)
static size_t _sys_mem_probe_value
static void _pixelpipe_cache_warn(const char *message)
void dt_dev_set_global(struct dt_develop_t *dev)
static dt_pthread_mutex_t _main_message_lock
dt_pthread_mutex_t * dt_pipeline_threadsafe_mutex(void)
void * dt_alloc_align(size_t size)
Allocate cacheline-aligned memory.
GList * dt_ioppr_get_iop_order_rules_global(void)
char * dt_get_main_message_copy(void)
void dt_capabilities_remove(char *capability)
static void _metadata_notify(const dt_metadata_notice_t kind, const char *message)
size_t dt_get_memory_pressure_floor(void)
int dt_init(int argc, char *argv[], const gboolean init_gui, const gboolean load_data)
struct dt_imageio_t * dt_imageio_get_global(void)
size_t dt_get_total_mem(void)
static void _metadata_geotags_changed(const GList *imgs)
struct dt_l10n_t * dt_l10n_get_global(void)
#define DT_SYS_MEM_PROBE_PERIOD_US
static const char * _history_operation_name(const char *operation)
size_t dt_get_mipmap_mem()
struct dt_gui_gtk_t * dt_gui_get_global(void)
const char * dt_session_id(void)
static void _pixelpipe_cache_ready(uint64_t hash, uint64_t producer_node_key)
static void _history_toast(const char *message)
struct dt_control_signal_t * dt_control_signal_get_global(void)
static void _history_notify(const char *message)
static size_t _get_total_memory()
int32_t dt_get_signal_debug_acts(void)
static void _pipeline_busy(const char *message_or_null)
char * dt_version_major_minor()
The application version, truncated to <major>.<minor>.
void dt_print_nts(dt_debug_thread_t thread, const char *msg,...)
struct dt_points_t * dt_points_get_global(void)
struct dt_control_t * dt_control_get_global(void)
static size_t _get_container_mem_limit(void)
void dt_configure_runtime_performance(dt_sys_resources_t *resources, gboolean init_gui)
void dt_gui_set_themes(GList *themes)
void dt_capabilities_add(char *capability)
void dt_concat_path_file(char destination[4096], const char path[4096], const char *const file)
Append a constant filename to a variable, stack-based, fixed-sized, directory, and add a / in-between...
struct dt_bauhaus_t * dt_bauhaus_get_global(void)
static GMutex _sys_mem_probe_lock
gboolean dt_supported_image(const gchar *filename)
static void _doc_screenshot_iop_modules(void *inventory)
void dt_capabilities_cleanup()
static void _history_changed(const dt_history_change_t what)
void dt_show_times_f(const dt_times_t *start, const char *prefix, const char *suffix,...)
GList * dt_gui_get_themes(void)
static gboolean _presets_can_autoapply(const gchar *operation)
size_t dt_get_available_mem()
int dt_capabilities_check(char *capability)
static int usage(const char *argv0)
static void _database_settings_from_conf(void)
void dt_print(dt_debug_thread_t thread, const char *msg,...)
gboolean dt_get_signal_debug(const int signal)
void dt_set_main_message(char *message)
static void _metadata_tags_changed(void)
static size_t _probe_system_available_mem(void)
static void _xmp_mode_preferences_changed(gpointer instance, gpointer user_data)
static void _updates_notify(const char *version, const char *url)
static void _history_images_changed(const GList *imgs)
void dt_database_set_renamed_handler(dt_database_renamed_handler_t handler)
void dt_database_optimize(void)
void dt_database_set_settings(const dt_database_settings_t *settings)
char ** dt_database_snaps_to_remove(void)
void dt_database_close(void)
gboolean dt_database_snapshot(void)
void dt_database_perform_maintenance(void)
void dt_database_cleanup_busy_statements(void)
gboolean dt_database_maybe_maintenance(const gboolean closing_time)
dt_database_open_result_t dt_database_open(const dt_database_params_t *params)
gboolean dt_database_maybe_snapshot(void)
dt_database_open_result_t
@ DT_DATABASE_OPEN_FAILED
@ DT_DATABASE_OPEN_LOCKED
void dt_database_gui_register_handlers(void)
gboolean dt_database_show_error(void)
void dt_dev_history_cleanup(void)
Cleanup cached statements or state used by history I/O.
void dt_dev_pixelpipe_cache_wait_dump_pending(const char *reason)
Dump pending GUI cache wait requests for lifecycle debugging.
gchar * directory
documentation root given after –doc, or NULL
void dt_gui_doc_screenshot_register_source(const char *section, dt_gui_doc_screenshot_source_t source)
void dt_gui_doc_screenshot_set_directory(const char *path)
void dt_gui_doc_screenshot_enable(void)
void dt_gui_doc_screenshot_add_target(void *inventory, GtkWidget *widget, const char *name)
GtkWidget * status
result of the last capture
static int dt_pthread_mutex_unlock(dt_pthread_mutex_t *mutex) RELEASE(mutex) NO_THREAD_SAFETY_ANALYSIS
static int dt_pthread_mutex_init(dt_pthread_mutex_t *mutex, const pthread_mutexattr_t *mutexattr)
Initialise a mutex. With mutexattr NULL – which is how 54 of the 56 call sites in this tree spell it ...
static int dt_pthread_mutex_destroy(dt_pthread_mutex_t *mutex)
static int dt_pthread_mutex_lock(dt_pthread_mutex_t *mutex) ACQUIRE(mutex) NO_THREAD_SAFETY_ANALYSIS
void dt_exif_set_exiv2_taglist()
What a photograph says about itself: the EXIF, IPTC and XMP tags a camera and a cataloguer write,...
void dt_loc_get_sharedir(char *sharedir, size_t bufsize)
void dt_loc_get_localedir(char *localedir, size_t bufsize)
void dt_loc_init(const char *datadir, const char *moduledir, const char *localedir, const char *configdir, const char *cachedir, const char *tmpdir, const char *kerneldir)
void dt_loc_get_user_config_dir(char *configdir, size_t bufsize)
int dt_film_new(dt_film_t *film, const char *directory)
int dt_film_open(const int32_t id)
void dt_film_set_folder_status()
int dt_film_import(const char *dirname)
dt_job_t * dt_pathlist_import_create(int argc, char *argv[])
void dt_folder_survey_cleanup()
Release folder survey state after control workers have stopped.
gboolean dt_folder_survey_session_was_active()
TRUE when the previous application session quit while monitoring.
void dt_folder_survey_stop()
Stop new scans before control workers begin shutting down.
void dt_folder_survey_init()
Initialize the folder survey state from the persisted configuration.
gboolean dt_folder_survey_propose_resume()
Propose to resume an interrupted studio session at application start.
ssize_t getline(char **lineptr, size_t *n, FILE *stream)
void dt_gui_presets_init()
void dt_gui_presets_cleanup()
void dt_gui_throttle_set_timeout_ms(guint timeout_ms)
int dt_gui_throttle_get_runtime_us(void)
void dt_gui_throttle_cleanup(void)
void dt_gui_throttle_init(int saved_runtime_us_in)
void dt_guides_cleanup(void)
void dt_history_set_operation_name_resolver(dt_history_operation_name_resolver_t resolver)
void dt_history_set_toast_handler(dt_history_toast_handler_t handler)
void dt_history_set_images_changed_handler(dt_history_images_changed_handler_t handler)
void dt_history_set_changed_handler(dt_history_changed_handler_t handler)
void dt_history_set_message_handler(dt_history_message_handler_t handler)
Install the handler, or NULL to remove it. Messages raised with none installed are dropped.
Everything the history, styles and presets code says to the outside world: messages for the user,...
dt_history_change_t
What changed. Each value stands for one signal this code used to raise itself.
@ DT_HISTORY_CHANGE_DEVELOP
@ DT_HISTORY_CHANGE_STYLES
void dt_presets_set_autoapply_resolver(dt_presets_autoapply_resolver_t resolver)
void dt_history_repository_cleanup(void)
void dt_image_cache_init(const gboolean verbose)
Initialise the cache.
void dt_image_cache_connect_info_changed_first(const struct dt_control_signal_t *ctlsig)
void dt_image_cache_cleanup(void)
gboolean dt_image_ext_is_supported(const char *ext)
void dt_image_notify_set_imported_handler(dt_image_imported_handler_t handler)
Install the handler, or NULL to remove it.
common/image.c states that an image entered the library; whoever is showing the collection decides wh...
void dt_imageio_cleanup(dt_imageio_t *iio)
void dt_imageio_init(dt_imageio_t *iio)
void dt_iop_set_darktable_iop_table()
const gchar * dt_iop_get_localized_name(const gchar *op)
void dt_iop_load_modules_so(void)
void dt_iop_unload_modules_so()
GList * dt_ioppr_get_iop_order_list(int32_t imgid, gboolean sorted)
Load the order list for an image from the DB.
GList * dt_ioppr_get_iop_order_rules()
Return the list of ordering rules (prev/next constraints).
int dt_ioppr_check_so_iop_order(GList *iop_list, GList *iop_order_list)
Check whether any module .so is missing an iop_order entry.
int dt_control_add_job(dt_control_t *control, dt_job_queue_t queue_id, _dt_job_t *job)
dt_l10n_t * dt_l10n_init(gboolean init_list)
gboolean dt_lib_presets_can_autoapply(dt_lib_module_t *mod)
void dt_lib_init(dt_lib_t *lib)
void dt_lib_cleanup(dt_lib_t *lib)
dt_debug_thread_t
Debug channels, selected at runtime with -d <channel>.
@ DT_DEBUG_CAMERA_SUPPORT
#define DT_DEBUG_SUPERVISOR
float *const restrict const size_t k
#define IS_NULL_PTR(p)
C is way too permissive with !=, == and if(var) checks, which can mean too many things depending on w...
static void * dt_alloc_align_internal(size_t size)
Platform back-end for dt_alloc_align(). Call dt_alloc_align() instead.
static void dt_free_gpointer(gpointer ptr)
g_free() one pointer, with the signature GDestroyNotify wants.
#define dt_free(ptr)
g_free() ptr and set it to NULL, skipping both if it is already NULL.
void dt_mipmap_cache_init(const dt_mipmap_cache_settings_t *settings, const gboolean verbose)
Initialise the cache.
void dt_mipmap_cache_cleanup(void)
void dt_mipmap_cache_set_settings(const dt_mipmap_cache_settings_t *settings)
Apply new settings to a running cache.
#define dt_mipmap_cache_get(B, C, D, E, F)
#define dt_mipmap_cache_release(B)
void dt_noiseprofile_set_path(const char *alternative)
void dt_noiseprofile_cleanup(void)
void dt_opencl_note_crash_backtrace(const char *backtrace, size_t backtrace_len)
Tell the OpenCL module that the process crashed, and let it judge whether the crash was its driver's ...
int dt_opencl_is_inited(void)
void dt_opencl_cleanup(void)
void dt_opencl_clear_driver_crash_streak(void)
gboolean dt_opencl_finish(const int devid)
void dt_opencl_init(const gboolean exclude_opencl, const gboolean print_statistics)
int dt_opencl_get_num_devices(void)
Number of usable OpenCL devices; 0 when OpenCL is unavailable.
#define omp_get_max_threads()
#define DT_PATH_MAX
Buffer size for a filesystem path anywhere in Ansel.
void dt_pipeline_set_message_handler(dt_pipeline_message_handler_t handler)
Install the handler, or NULL to remove it. Messages raised with none installed are dropped.
void dt_pipeline_set_busy_handler(dt_pipeline_busy_handler_t handler)
Everything the pixel pipeline says to whoever is watching: messages for the user, and the busy banner...
void dt_dev_pixelpipe_cache_cleanup(void)
void dt_dev_pixelpipe_cache_get_usage(size_t *current, size_t *max)
gboolean dt_dev_pixelpipe_cache_init(size_t max_memory, const gboolean verbose, const gboolean verbose_detail)
Reserve the cache's arena and start it.
void dt_dev_pixelpipe_cache_set_handlers(dt_pixelpipe_cache_warn_handler_t warn, dt_pixelpipe_cache_ready_handler_t ready, const dt_pixelpipe_cache_observer_t *observer)
Install the handlers. Call once, from the orchestrator, before any pipe runs.
gboolean dt_dev_pixelpipe_cache_is_ready(void)
Has the pixelpipe cache been initialised? Callers that run before dt_dev_pixelpipe_cache_init() succe...
static void dt_points_cleanup(dt_points_t *p)
static void dt_points_init(dt_points_t *p, const unsigned int num_threads)
void dt_privacy_ask_consent(const gboolean have_gui)
void dt_control_progress_init(struct dt_control_t *control)
void copy(TYPE *dest, TYPE *source, size_t num_el)
Copy a flat buffer used to initialize test matrices.
void dt_selection_cleanup_global(void)
void dt_sentry_shutdown(void)
void dt_sentry_init(const gboolean have_gui)
void dt_sentry_add_crash_observer(dt_sentry_crash_observer_t observer)
Register a function to be handed the backtrace when the process crashes.
void dt_control_signal_cleanup(dt_control_signal_t *ctlsig)
dt_control_signal_t * dt_control_signal_init()
void dt_control_signal_connect(const dt_control_signal_t *ctlsig, dt_signal_t signal, GCallback cb, gpointer user_data)
#define DT_DEBUG_CONTROL_SIGNAL_RAISE(ctlsig, signal,...)
@ DT_DEBUG_SIGNAL_ACT_DISCONNECT
@ DT_DEBUG_SIGNAL_ACT_CONNECT
@ DT_DEBUG_SIGNAL_ACT_RAISE
@ DT_DEBUG_SIGNAL_ACT_PRINT_TRACE
@ DT_SIGNAL_DEVELOP_INITIALIZE
This signal is raised when darktable.develop is initialized.
@ DT_SIGNAL_METADATA_CHANGED
This signal is raised when metadata status (shown/hidden) or value has changed.
@ DT_SIGNAL_VIEWMANAGER_THUMBTABLE_ACTIVATE
@ DT_SIGNAL_ACTIVE_IMAGES_CHANGE
This signal is raised when image shown in the main view change no param, no returned value.
@ DT_SIGNAL_CONTROL_REDRAW_ALL
This signal is raised when dt_control_queue_redraw() is called. no param, no returned value.
@ DT_SIGNAL_FOLDER_SURVEY_CHANGED
Raised when the folder survey starts or stops monitoring. no param, no returned value.
@ DT_SIGNAL_DEVELOP_HISTORY_CHANGE
This signal is raised when develop history is changed no param, no returned value.
@ DT_SIGNAL_DEVELOP_IMAGE_CHANGED
This signal is raised when image is changed in darkroom.
@ DT_SIGNAL_CONTROL_PROFILE_USER_CHANGED
This signal is raised when a profile is changed by the user 1 uint32_t : the profile type that has ch...
@ 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...
@ DT_SIGNAL_IMAGES_ORDER_CHANGE
This signal is raised to request image order change.
@ DT_SIGNAL_DEVELOP_PREVIEW_PIPE_FINISHED
This signal is raised when develop preview pipe process is finished no param, no returned value.
@ DT_SIGNAL_STYLE_CHANGED
This signal is raised when a style is added/deleted/changed
@ DT_SIGNAL_CACHELINE_READY
This signal is raised when one cacheline write lock is released. 1 : uint64_t cacheline hash no retur...
@ DT_SIGNAL_DARKROOM_UI_CHANGED
Signal that the darkroom GUI color changed.
@ DT_SIGNAL_DEVELOP_UI_PIPE_FINISHED
This signal is raised when pipe is finished and the gui is attached no param, no returned value.
@ DT_SIGNAL_FILMROLLS_CHANGED
This signal is raised when a filmroll is deleted/changed but not imported.
@ DT_SIGNAL_GEOTAG_CHANGED
This signal is raised when a geotag is added/deleted/changed
@ DT_SIGNAL_MOUSE_OVER_IMAGE_CHANGE
This signal is raised when mouse hovers over image thumbs both on lighttable and in the filmstrip....
@ DT_SIGNAL_CONTROL_TOAST_REDRAW
This signal is raised when dt_control_toast_redraw() is called. no param, no returned value.
@ DT_SIGNAL_DEVELOP_MODULE_MOVED
This signal is raised when order of modules in pipeline is changed.
@ DT_SIGNAL_IMAGE_INFO_CHANGED
This signal is raised when any of image info has changed
@ DT_SIGNAL_PREFERENCES_CHANGE
This signal is raised after preferences have been changed no parameters no return.
@ DT_SIGNAL_CONTROL_REDRAW_CENTER
This signal is raised when dt_control_queue_redraw_center() is called. no param, no returned value.
@ DT_SIGNAL_DEVELOP_MODULEGROUPS_SET
This signal is raised to request a modulegroups update. 1 : dt_iop_module_t *module,...
@ DT_SIGNAL_FILMROLLS_REMOVED
This signal is raised only when a filmroll is removed.
@ DT_SIGNAL_TAG_CHANGED
This signal is raised when a tag is added/deleted/changed
@ DT_SIGNAL_IMAGEIO_STORAGE_CHANGE
This signal is raised when a new storage module is loaded noparameters no return.
@ DT_SIGNAL_VIEWMANAGER_FILMSTRIP_ACTIVATE
This signal is raised when a thumb is single-clicked in the filmstrip. Views that want filmstrip clic...
@ DT_SIGNAL_DEVELOP_MODULE_REMOVE
This signal is raised when a module is removed from the history stack 1 module no returned value.
@ DT_SIGNAL_IMAGE_LOADED
This signal is raised when an asynchronous darkroom image load finishes. 1 : uint32_t the load reques...
@ DT_SIGNAL_SELECTION_CHANGED
This signal is raised when the selection is changed no param, no returned value.
@ DT_SIGNAL_CONTROL_PICKERDATA_READY
This signal is raised when new color picker data are available in darkroom. no param,...
@ DT_SIGNAL_CONTROL_PROFILE_CHANGED
This signal is raised when the screen profile has changed no param, no returned value.
@ DT_SIGNAL_VIEWMANAGER_FILMSTRIP_DRAG_BEGIN
This signal is raised when a drag starts from the filmstrip. Views that need filmstrip drags to commi...
@ DT_SIGNAL_IMAGE_IMPORT
This signal is raised when a new image is imported (not cloned) 1 uint32_t : the new image id no retu...
@ DT_SIGNAL_COLLECTION_CHANGED
This signal is raised when collection changed. To avoid leaking the list, dt_collection_t is connecte...
@ DT_SIGNAL_CONTROL_LOG_REDRAW
This signal is raised when dt_control_log_redraw() is called. no param, no returned value.
@ DT_SIGNAL_CONTROL_NAVIGATION_REDRAW
This signal is raised when dt_control_navigation_redraw() is called. no param, no returned value.
@ DT_SIGNAL_METADATA_UPDATE
@ DT_SIGNAL_DEVELOP_HISTORY_WILL_CHANGE
This signal is raised when develop history is about to be changed 1 : GList * the current history 2 :...
@ DT_SIGNAL_VIEWMANAGER_VIEW_CHANGED
This signal is raised by viewmanager when a view has changed. 1 : dt_view_t * the old view 2 : dt_vie...
void dt_gui_splash_close(void)
void dt_styles_cleanup(void)
unsigned __int64 uint64_t
int32_t unmuted_signal_dbg_acts
struct dt_imageio_t * imageio
int32_t num_openmp_threads
struct dt_gui_gtk_t * gui
struct dt_sys_resources_t dtresources
dt_pthread_mutex_t capabilities_threadsafe
struct dt_control_signal_t * signals
struct dt_bauhaus_t * bauhaus
struct dt_develop_t * develop
struct dt_points_t * points
dt_pthread_mutex_t pipeline_threadsafe
struct dt_view_manager_t * view_manager
gboolean unmuted_signal_dbg[DT_SIGNAL_COUNT]
struct dt_control_t * control
One key/value pair handed back by dt_conf_all_string_entries().
The whole configuration state. One instance lives at darktable.conf.
dt_pthread_mutex_t run_mutex
dt_pthread_mutex_t log_mutex
int maintenance_freepage_ratio
GDBusConnection * dbus_connection
Everything about the mipmap cache that the USER decides.
size_t max_memory
RAM budget for the thumbnail LRU, in bytes. A soft quota, not a hard limit.
int embedded_jpg
Whether to prefer the embedded JPEG over decoding (lighttable/embedded_jpg).
int cache_quality
JPEG quality for thumbnails written to disk (database_cache_quality).
gboolean disk_backend
Write generated thumbnails to the on-disk cache (cache_disk_backend).
The supervisor's view of the cache. All four may be NULL; active gates the other three so the cache p...
size_t pressure_floor_memory
void dt_supervisor_cacheline_delete(const uint64_t hash, const size_t size, const int owner_pipe_id, const char *name)
void dt_supervisor_init(void)
void dt_supervisor_rekey(const uint64_t old_hash, const uint64_t new_hash)
void dt_supervisor_cacheline_read(const uint64_t hash, const size_t size)
void dt_supervisor_cleanup(void)
static gboolean dt_supervisor_active(void)
#define DT_MEMORY_PRESSURE_FLOOR_DEFAULT
void dt_set_signal_handlers()
void dt_telemetry_shutdown(void)
void dt_telemetry_init(const gboolean have_gui)
static void dt_get_times(dt_times_t *t)
static double dt_get_wtime(void)
void dt_undo_cleanup(dt_undo_t *self)
dt_undo_t * dt_undo_init(void)
void dt_updates_init(const gboolean have_gui, dt_updates_notify_fn notify)
void dt_updates_shutdown(void)
The nightly update check.
gchar * dt_util_normalize_path(const gchar *_input)
void dt_view_manager_cleanup(dt_view_manager_t *vm)
void dt_view_manager_init(dt_view_manager_t *vm)
void dt_view_manager_gui_init(dt_view_manager_t *vm)
void dt_ui_cleanup_titlebar(dt_ui_t *ui)
void dt_ui_cleanup_main_table(dt_ui_t *ui)
void dt_ui_init_global_menu(dt_ui_t *ui)
GtkWidget * dt_ui_main_window(dt_ui_t *ui)