88#include <glib/gstdio.h>
129#ifdef GDK_WINDOWING_QUARTZ
132#include <gdk/gdkkeysyms.h>
138#include <sys/types.h>
147#define G_SOURCE_FUNC(f) ((GSourceFunc) (void (*)(void)) (f))
156 double full_delta[2];
160#define DARKROOM_EDGE_PAN_INTERVAL_MS 64
161#define DARKROOM_EDGE_PAN_MARGIN_PX DT_PIXEL_APPLY_DPI(50)
162#define DARKROOM_EDGE_PAN_SPEED_PX_PER_S 360.0f
191 if(module && module->show_popup)
192 module->show_popup(module);
213 running ? _(
"Autoset is running on selected modules")
214 : _(
"Run autoset on selected modules\nRight click for options"));
224 return _(
"Darkroom");
274 "darkroom-cleanup-autoset-manager");
301 const int fd = GPOINTER_TO_INT(closure);
302 ssize_t
res = write(fd, data, length);
304 return CAIRO_STATUS_WRITE_ERROR;
305 return CAIRO_STATUS_SUCCESS;
315 return !is_primary_sample && selected_sample && !display_samples;
329 memcpy(box, sample->
box,
sizeof(
float) * 4);
346 int32_t
width, int32_t
height, int32_t pozx, int32_t pozy,
347 GSList *samples, gboolean is_primary_sample)
359 const double lw = 1.0 / scale;
360 const double dashes[1] = {
lw * 4.0 };
365 cairo_set_line_cap(cri, CAIRO_LINE_CAP_SQUARE);
368 const gboolean only_selected_sample
372 for( ; samples; samples = g_slist_next(samples))
375 if(only_selected_sample && (sample != selected_sample))
382 double half_px = 0.5;
383 const double min_half_px_device = 4.0;
385 gboolean show_preview_pixel_scale =
TRUE;
390 float image_box[4] = { 0.0f };
392 double x = image_box[0] * wd, y = image_box[1] * ht,
393 w = image_box[2] * wd, h = image_box[3] * ht;
394 cairo_user_to_device(cri, &
x, &y);
395 cairo_user_to_device(cri, &w, &h);
400 cairo_device_to_user(cri, &
x, &y);
401 cairo_device_to_user(cri, &w, &h);
402 cairo_rectangle(cri,
x, y, w -
x, h - y);
403 if(is_primary_sample)
406 const double hw = 5. / scale;
407 cairo_rectangle(cri,
x - hw, y - hw, 2. * hw, 2. * hw);
408 cairo_rectangle(cri,
x - hw, h - hw, 2. * hw, 2. * hw);
409 cairo_rectangle(cri, w - hw, y - hw, 2. * hw, 2. * hw);
410 cairo_rectangle(cri, w - hw, h - hw, 2. * hw, 2. * hw);
416 float image_point[2] = { 0.0f };
418 double x = image_point[0] * wd;
419 double y = image_point[1] * ht;
420 cairo_user_to_device(cri, &
x, &y);
424 half_px = round(half_px * scale);
425 if(half_px < min_half_px_device)
427 half_px = min_half_px_device;
428 show_preview_pixel_scale =
FALSE;
431 double crosshair = (is_primary_sample ? 4. : 5.) * half_px;
432 if(sample == selected_sample) crosshair *= 2;
433 cairo_device_to_user(cri, &
x, &y);
434 cairo_device_to_user_distance(cri, &crosshair, &half_px);
437 if(is_primary_sample)
438 cairo_arc(cri,
x, y, crosshair, 0., 2. *
M_PI);
440 cairo_move_to(cri,
x - crosshair, y);
441 cairo_line_to(cri,
x + crosshair, y);
442 cairo_move_to(cri,
x, y - crosshair);
443 cairo_line_to(cri,
x, y + crosshair);
448 const double line_scale = (sample == selected_sample ? 2.0 : 1.0);
449 cairo_set_line_width(cri,
lw * 3.0 * line_scale);
450 cairo_set_source_rgba(cri, 0.0, 0.0, 0.0, 0.4);
451 cairo_stroke_preserve(cri);
453 const gboolean draw_dashed = !is_primary_sample
454 && sample != selected_sample
456 cairo_set_line_width(cri,
lw * line_scale);
457 cairo_set_dash(cri, dashes, draw_dashed, 0.0);
459 cairo_set_source_rgba(cri, 1.0, 1.0, 1.0, 0.8);
471 float image_point[2] = { 0.0f };
473 if(sample == selected_sample)
474 cairo_arc(cri, image_point[0] * wd, image_point[1] * ht, half_px * 2., 0., 2. *
M_PI);
475 else if(show_preview_pixel_scale)
476 cairo_rectangle(cri, image_point[0] * wd - half_px, image_point[1] * ht - half_px, half_px * 2., half_px * 2.);
478 cairo_arc(cri, image_point[0] * wd, image_point[1] * ht, half_px, 0., 2. *
M_PI);
495#ifndef DARKROOM_EXPOSE_DUMB_DEBUG
496#define DARKROOM_EXPOSE_DUMB_DEBUG 0
499#if DARKROOM_EXPOSE_DUMB_DEBUG
502static void _darkroom_debug_restart_cache_wait(gpointer user_data)
514 cairo_set_source_rgb(cr, bg_color[0], bg_color[1], bg_color[2]);
527 &_darkroom_main_debug_wait,
528 _darkroom_debug_restart_cache_wait, dev))
533 const int bw = (int)published.
width;
534 const int bh = (int)published.
height;
535 if(bw <= 0 || bh <= 0)
541 const int stride = cairo_format_stride_for_width(CAIRO_FORMAT_RGB24, bw);
542 const size_t required_size = (size_t)stride * (
size_t)bh;
550 cairo_surface_t *surface = cairo_image_surface_create_for_data((
unsigned char *)data, CAIRO_FORMAT_RGB24,
552 if(
IS_NULL_PTR(surface) || cairo_surface_status(surface) != CAIRO_STATUS_SUCCESS)
554 if(surface) cairo_surface_destroy(surface);
559 float image_box[4] = { 0.0f };
561 const int wd = image_box[2];
562 const int ht = image_box[3];
563 cairo_translate(cr, image_box[0], image_box[1]);
566 cairo_rectangle(cr, 0, 0, wd, ht);
567 cairo_set_source_surface(cr, surface, 0, 0);
570 cairo_surface_destroy(surface);
608#if DARKROOM_EXPOSE_DUMB_DEBUG
634 cairo_set_source_rgb(cr, bg_color[0], bg_color[1], bg_color[2]);
640 const float preview_wd = wd / ppd;
641 const float preview_ht = ht / ppd;
643 float image_box[4] = { 0.0f };
650 if(image_box[2] > 0 && image_box[3] > 0)
653 cairo_translate(cr, image_box[0], image_box[1]);
665 const float roi_width = fminf(
width, preview_wd * preview_scale);
666 const float roi_height = fminf(
height, preview_ht * preview_scale);
667 const float rec_x = fmaxf(border, (
width - roi_width) * 0.5f);
668 const float rec_y = fmaxf(border, (
height - roi_height) * 0.5f);
669 const float rec_w = fminf(
width - 2 * border, roi_width);
670 const float rec_h = fminf(
height - 2 * border, roi_height);
671 cairo_rectangle(cr, rec_x, rec_y, rec_w, rec_h);
676 cairo_translate(cr, tx, ty);
677 cairo_scale(cr, preview_scale, preview_scale);
678 cairo_rectangle(cr, 0, 0, preview_wd, preview_ht);
685 cairo_pattern_set_filter(cairo_get_source(cr), CAIRO_FILTER_NEAREST);
705static void _paint_all(cairo_t *cri, cairo_t *cr, cairo_surface_t *image_surface)
709 cairo_set_source_surface(cri, image_surface, 0, 0);
741 key =
dt_hash(
key, (
const char *)&source_hash,
sizeof(source_hash));
742 key =
dt_hash(
key, (
const char *)&zoom_hash,
sizeof(zoom_hash));
743 key =
dt_hash(
key, (
const char *)bg_color, 3 *
sizeof(
float));
784 hash =
dt_hash(hash, (
const char *)&viewport,
sizeof(viewport));
806 &&
state->main_zoom_hash == zoom_hash;
815 state->main_zoom_hash = 0;
817 state->composed_key = 0;
836 return _darkroom_compose_key(source_hash, c->zoom_hash, c->bg_color, c->border, c->dev->iso_12646.enabled,
837 c->width, c->height);
842 return c->state->composed_key ==
key && c->state->image_surface_imgid == c->dev->image_storage.id;
853 c->state->composed_key =
key;
865 c->state->composed_key =
key;
893 state->composed_key = 0;
914#if DARKROOM_EXPOSE_DUMB_DEBUG
917 _render_main_direct_debug(cri, dev,
width,
height, border, bg_color_dbg);
924 .image_surface_height = 0,
926 .image_surface_has_main =
FALSE,
951 const uint64_t preview_backbuf_hash = preview_published.
hash;
957 const gboolean main_backbuf_is_newer
959 const gboolean main_ready_for_current_view
961 const gboolean preview_matches_full_image
963 && full_width > 0 && full_height > 0
964 && preview_published.
width == (size_t)full_width
965 && preview_published.
height == (
size_t)full_height;
966 const gboolean full_image_backbuf_ready = main_ready_for_current_view || preview_matches_full_image;
969 const char *draw_source =
"background only";
971 gboolean drawn =
FALSE;
972 gboolean drawn_from_main =
FALSE;
976 .height =
height, .border = border, .zoom_hash = zoom_hash,
977 .bg_color = bg_color };
995 if(full_image_backbuf_ready)
1002 if(main_ready_for_current_view)
1014 drawn_from_main =
TRUE;
1015 draw_source =
"fresh main backbuf";
1018 else if(main_backbuf_is_newer && expose_state.
pending_main_hash != main_backbuf_hash)
1034 if(!drawn && preview_matches_full_image)
1037 "darkroom-preview",
FALSE)
1047 drawn_from_main =
TRUE;
1048 draw_source =
"fresh full-size preview backbuf";
1056 if(!drawn && roi_changed && !full_image_backbuf_ready && preview_has_backbuf)
1059 "darkroom-preview",
TRUE)
1066 drawn_from_main =
FALSE;
1067 draw_source =
"fresh preview fallback";
1075 if(!drawn && roi_changed && !full_image_backbuf_ready
1082 drawn_from_main =
FALSE;
1083 draw_source =
"reused preview fallback";
1096 drawn_from_main =
TRUE;
1097 draw_source =
"reused last main backbuf";
1109 draw_source, draw_hash);
1117 :
"reused last preview surface";
1121 draw_source, draw_hash);
1127 cairo_set_source_rgb(cr, bg_color[0], bg_color[1], bg_color[2]);
1132 draw_source, draw_hash);
1235 dt_control_log(_(
"Could not read image information from the database."));
1247 if(request_id == 0)
return;
1310 else if(num_selected > 1)
1312 dt_control_log(_(
"The current selection contains more than one image, which is ambiguous.\n"
1313 "Select exactly one image to enter the darkroom."));
1319 "Select exactly one image to enter the darkroom."));
1405 gtk_color_chooser_get_rgba(GTK_COLOR_CHOOSER(widget), &
color);
1417 gtk_color_chooser_get_rgba(GTK_COLOR_CHOOSER(widget), &
color);
1436 dt_conf_set_bool(
"plugins/darkroom/colorbalancergb/mask_preview/greyscaled",
1437 gtk_toggle_button_get_active(toggle));
1465static void _overlay_cycle_callback(dt_action_t *action)
1468 const int nextval = (currentval + 1) % 6;
1474static void _toggle_mask_visibility_callback(dt_action_t *action)
1483 if(mod && strcmp(mod->
so->
op,
"spots") != 0 && strcmp(mod->
so->
op,
"retouch") != 0)
1499 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(bd->masks_edit), bd->masks_shown !=
DT_MASKS_EDIT_OFF);
1504 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(bd->masks_shapes[
n]),
FALSE);
1515 GdkModifierType modifier, gpointer data)
1522 GdkModifierType modifier, gpointer data)
1528 GList *current_item = g_list_find(current_collection, GINT_TO_POINTER(current_img));
1530 if(current_item && current_item->next)
1532 int32_t next_img = GPOINTER_TO_INT(current_item->next->data);
1533 g_list_free(current_collection);
1534 current_collection = NULL;
1539 g_list_free(current_collection);
1540 current_collection = NULL;
1547 GdkModifierType modifier, gpointer data)
1553 GList *current_item = g_list_find(current_collection, GINT_TO_POINTER(current_img));
1555 if(current_item && current_item->prev)
1557 int32_t prev_img = GPOINTER_TO_INT(current_item->prev->data);
1558 g_list_free(current_collection);
1559 current_collection = NULL;
1564 g_list_free(current_collection);
1565 current_collection = NULL;
1575 const gboolean autoset_running_before
1593 const gboolean autoset_running_after
1598 if(cache_ready && !autoset_running_after)
1600 const gboolean autoset_just_finished = autoset_running_before && !autoset_running_after;
1601 if(!autoset_running_before || autoset_just_finished)
1626 fprintf(stdout,
"lauching autoset\n");
1632 gchar *label = g_strdup_printf(
"%s (%i)", clean_name, module->
multi_priority);
1648 for(GList *child = children; child; child = g_list_next(child))
1649 gtk_widget_destroy(GTK_WIDGET(child->data));
1650 g_list_free(children);
1652 GtkWidget *title = gtk_label_new(_(
"Module instances to autoset"));
1656 for(GList *modules = g_list_last(dev->
iop); modules; modules = g_list_previous(modules))
1662 GtkWidget *toggle = gtk_check_button_new_with_label(label);
1692 N_(
"Switch to the next picture"), GDK_KEY_Right, GDK_MOD1_MASK, _(
"Triggers the action"));
1694 N_(
"Switch to the previous picture"), GDK_KEY_Left, GDK_MOD1_MASK, _(
"Triggers the action"));
1778 G_N_ELEMENTS(darkroom_toolbox_buttons));
1780 darkroom_toolbox_buttons, G_N_ELEMENTS(darkroom_toolbox_buttons));
1791 N_(
"Rendering size"),
1792 _(
"Choose at what size the main preview is rendered.\n"
1793 "Full resolution renders the pipeline at the raw original resolution.\n"
1794 "It is pixel-perfect, especially regarding denoising and deblurring, but very slow.\n"
1795 "Scaled renders at screen resolution and is the best trade-off.\n"
1796 "Pixel-level accuracy is guaranteed only when zoomed-in at 100%."),
1799 N_(
"full resolution (slow)"),
1800 N_(
"scaled (default)")
1802 gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(rendering),
TRUE,
TRUE, 0);
1805 const int rasterization_index = (!
IS_NULL_PTR(rasterization) && !strcmp(rasterization,
"never")) ? 1 : 0;
1806 g_free(rasterization);
1810 N_(
"Fast drawn mask rasterization"),
1811 _(
"Choose how finely brush and polygon masks are drawn in the darkroom.\n"
1812 "Auto samples one point per displayed pixel: zoomed out costs less,\n"
1813 "and at 100% or closer masks are pixel-accurate.\n"
1814 "Never keeps pixel accuracy at every zoom level, at some cost when zoomed out.\n"
1815 "Exports, thumbnails and snapshots are always pixel-accurate either way."),
1816 rasterization_index,
1818 N_(
"auto (default)"),
1821 gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(mask_rasterization),
TRUE,
TRUE, 0);
1827 GtkWidget *checker_1 = gtk_color_button_new();
1828 GdkRGBA checker_color = {
1834 gtk_color_chooser_set_rgba(GTK_COLOR_CHOOSER(checker_1), &checker_color);
1835 gtk_color_chooser_set_use_alpha(GTK_COLOR_CHOOSER(checker_1),
FALSE);
1836 gtk_color_button_set_title(GTK_COLOR_BUTTON(checker_1),
1837 _(
"Select color of the checkerboard from a swatch"));
1839 gtk_box_pack_start(GTK_BOX(checker_1_row), checker_1,
FALSE,
FALSE, 0);
1840 gtk_box_pack_start(GTK_BOX(vbox), checker_1_row,
FALSE,
FALSE, 0);
1844 GtkWidget *checker_2 = gtk_color_button_new();
1845 checker_color.red =
dt_conf_get_float(
"plugins/darkroom/colorbalancergb/checker2/red");
1846 checker_color.green =
dt_conf_get_float(
"plugins/darkroom/colorbalancergb/checker2/green");
1847 checker_color.blue =
dt_conf_get_float(
"plugins/darkroom/colorbalancergb/checker2/blue");
1848 gtk_color_chooser_set_rgba(GTK_COLOR_CHOOSER(checker_2), &checker_color);
1849 gtk_color_chooser_set_use_alpha(GTK_COLOR_CHOOSER(checker_2),
FALSE);
1850 gtk_color_button_set_title(GTK_COLOR_BUTTON(checker_2),
1851 _(
"Select color of the checkerboard from a swatch"));
1853 gtk_box_pack_start(GTK_BOX(checker_2_row), checker_2,
FALSE,
FALSE, 0);
1854 gtk_box_pack_start(GTK_BOX(vbox), checker_2_row,
FALSE,
FALSE, 0);
1862 g_signal_connect(G_OBJECT(checker_size),
"value-changed",
1864 gtk_box_pack_start(GTK_BOX(vbox), checker_size,
TRUE,
TRUE, 0);
1866 GtkWidget *black_and_white = gtk_check_button_new_with_label(_(
"Show a greyscaled mask image"));
1867 gtk_toggle_button_set_active(
1868 GTK_TOGGLE_BUTTON(black_and_white),
1869 dt_conf_get_bool(
"plugins/darkroom/colorbalancergb/mask_preview/greyscaled"));
1870 g_signal_connect(G_OBJECT(black_and_white),
"toggled",
1872 gtk_box_pack_start(GTK_BOX(vbox), black_and_white,
FALSE,
FALSE, 0);
1874 gtk_widget_show_all(vbox);
1884 N_(
"Show the pipeline node graph"), 0, 0,
1885 _(
"Triggers the action"));
1893 _(
"toggle guide lines\nright click for guides options"));
1906 N_(
"Toggle guide lines"), 0, 0,
1907 _(
"Triggers the action"));
1910 N_(
"Focus guide lines options"), 0, 0,
1911 _(
"Shows the options popover"));
1922 gtk_widget_set_tooltip_text(
_darkroom_autoset_button, _(
"Run autoset on selected modules\nRight click for options"));
1967 GtkAccelKey
key = { 0 };
1968 return gtk_accel_map_lookup_entry(accel_path, &
key)
2012 for(
const GList *modules = g_list_first(dev->
iop); modules; modules = g_list_next(modules))
2022 if(module->multi_priority == 0)
2024 snprintf(option,
sizeof(option),
"plugins/darkroom/%s/expanded", module->op);
2025 module->gui->expanded = dt_conf_get_bool(option);
2028 if(active_plugin && !strcmp(module->op, active_plugin))
2077 "darkroom-leave-autoset");
2117 for(GList *
m = dev->
iop;
m;
m = g_list_next(
m))
2120 if(mod && mod->quiesce) mod->quiesce(mod);
2197 dev->
iop = g_list_delete_link(dev->
iop, dev->
iop);
2268 gboolean handled =
FALSE;
2298 float image_box[4] = { 0.0f };
2301 return _is_in_frame(image_box[2], image_box[3], round(
x - image_box[0]), round(y - image_box[1]));
2383 module = dev->gui_module;
2400 else if(was_transient)
2431 if(near_edge <= 0.0)
return 0.0f;
2433 const float edge_distance =
CLAMPF(near_edge / margin, 0.0f, 1.0f);
2434 const float velocity = 0.10f + 0.90f * edge_distance * edge_distance;
2435 return position < margin ? -velocity : velocity;
2447 return creating_shape_mode || mouse_action;
2458 const double pointer_x,
2459 const double pointer_y,
2479 float image_box[4] = { 0.0f };
2481 const double image_x = pointer_x - image_box[0];
2482 const double image_y = pointer_y - image_box[1];
2488 && image_box[2] > 0.0f && image_box[3] > 0.0f;
2489 edge->
margin = inside_action_area
2494 && (image_x < edge->
margin
2496 || image_y < edge->margin
2497 || image_y > (
double)image_box[3] - edge->
margin);
2513 const double pointer_x,
2514 const double pointer_y,
2560 const gint64 now_us = g_get_monotonic_time();
2609 GdkSeat *seat =
IS_NULL_PTR(display) ? NULL : gdk_display_get_default_seat(display);
2610 GdkDevice *pointer =
IS_NULL_PTR(seat) ? NULL : gdk_seat_get_pointer(seat);
2613 GtkAllocation allocation = { 0 };
2622 gdk_window_get_device_position(
window, pointer, &pointer_x, &pointer_y, NULL);
2623 gtk_widget_get_allocation(center, &allocation);
2638 gboolean handled =
FALSE;
2639 gboolean masks_handled =
FALSE;
2647 gboolean sample_changed =
FALSE;
2648 float mouse_point[2] = { (float)
x, (
float)y };
2650 const float delta[2] = {
2657 float anchor[2] = { 0.0f };
2659 const float box[4] = {
2660 fmaxf(0.0,
MIN(anchor[0], mouse_point[0]) -
delta[0]),
2661 fmaxf(0.0,
MIN(anchor[1], mouse_point[1]) -
delta[1]),
2662 fminf(1.0,
MAX(anchor[0], mouse_point[0]) +
delta[0]),
2663 fminf(1.0,
MAX(anchor[1], mouse_point[1]) +
delta[1])
2668 for(
int k = 0;
k < 4;
k++)
2669 sample_changed |= (image_box[
k] != box[
k]);
2676 float image_point[2] = { 0.0f };
2678 sample_changed = memcmp(image_point, mouse_point,
sizeof(mouse_point)) != 0;
2685 else if(picker_active)
2695 masks_handled =
TRUE;
2877 which,
type,
x, y, pressure);
2891 float point[2] = { (float)
x, (
float)y };
2895 float handle[2] = { 6.0f, 6.0f };
2905 const float delta_x = 0.01f;
2915 memcpy(sample->
point, raw_point,
sizeof(raw_point));
2921 gboolean on_corner_prev_box =
TRUE;
2922 float opposite[2] = { 0.0f };
2924 if(fabsf(
point[0] - image_box[0]) <= handle[0])
2925 opposite[0] = image_box[2];
2926 else if(fabsf(
point[0] - image_box[2]) <= handle[0])
2927 opposite[0] = image_box[0];
2929 on_corner_prev_box =
FALSE;
2931 if(fabsf(
point[1] - image_box[1]) <= handle[1])
2932 opposite[1] = image_box[3];
2933 else if(fabsf(
point[1] - image_box[3]) <= handle[1])
2934 opposite[1] = image_box[1];
2936 on_corner_prev_box =
FALSE;
2938 if(on_corner_prev_box)
2940 float raw_opposite[2] = { opposite[0], opposite[1] };
2942 memcpy(sample->
point, raw_opposite,
sizeof(raw_opposite));
2947 fmaxf(0.0,
point[0] - delta_x),
2948 fmaxf(0.0,
point[1] - delta_y),
2949 fminf(1.0,
point[0] + delta_x),
2950 fminf(1.0,
point[1] + delta_y)
2980 if(
point[0] < live_box[0] ||
point[0] > live_box[2]
2981 ||
point[1] < live_box[1] ||
point[1] > live_box[3])
2989 MAX(26.0f, roundf(3.0f * zoom_scale)),
2990 MAX(26.0f, roundf(3.0f * zoom_scale))
2995 float live_point[2] = { live_sample->
point[0], live_sample->
point[1] };
2997 if(fabsf(
point[0] - live_point[0]) > slop[0]
2998 || fabsf(
point[1] - live_point[1]) > slop[1])
3040 float new_scale = 1.f;
3048 const float point[2] = {
x, y };
3060 const float epsilon = fabsf(old_scaling - new_scaling);
3061 if(fabsf(new_scaling - 1.0f) < epsilon)
3069 float center[2] = { 0.0f };
3070 float mouse_offset[2] = {
point[0],
point[1] };
3072 mouse_offset[0] -= center[0];
3073 mouse_offset[1] -= center[1];
3080 if(old_zoom <= 1e-6f || new_zoom <= 1e-6f)
3087 int proc_w = 0.f, proc_h = 0.f;
3091 anchored.
center_x + mouse_offset[0] * (1.f / old_zoom - 1.f / new_zoom) / proc_w,
3092 anchored.
center_y + mouse_offset[1] * (1.f / old_zoom - 1.f / new_zoom) / proc_h);
3111 const float step = 1.02f;
3113 const float point[2] = {
x, y };
3125 up,
x, y,
state, delta_y);
3189 const gboolean shift =
dt_modifier_is(event->state, GDK_SHIFT_MASK);
3196 const float zoom_step = 1.1f;
3197 float center[2] = { 0.0f };
3209 float multiplier = (shift) ? 4.f :
3213 float delta[2] = { 10.f * multiplier, 10.f * multiplier };
3250 case GDK_KEY_Escape:
void dt_accels_connect_accels(dt_accels_t *accels)
Actually enable accelerators after having loaded user config.
void dt_accels_connect_active_group(dt_accels_t *accels, const gchar *group)
Connect the contextual active accels group to the window. Views can declare their own set of contextu...
void dt_accels_disconnect_active_group(dt_accels_t *accels)
Disconnect the contextual active accels group from the window.
void dt_accels_new_virtual_shortcut(dt_accels_t *accels, GtkAccelGroup *accel_group, const gchar *accel_path, GtkWidget *widget, guint key_val, GdkModifierType accel_mods)
Add a new virtual shortcut. Virtual shortcuts are immutable, read-only and don't trigger any action....
gchar * dt_accels_build_path(const gchar *scope, const gchar *feature)
void dt_accels_attach_scroll_handler(dt_accels_t *accels, gboolean(*callback)(GdkEventScroll event, void *data), void *data)
Attach a new global scroll event callback. So far this is used in darkroom to redirect scroll events ...
void dt_accels_detach_scroll_handler(dt_accels_t *accels)
Handle default and user-set shortcuts (accelerators)
#define dt_accels_new_darkroom_action(a, b, w, c, d, e, f, g)
struct dt_accels_t * dt_gui_get_accels(void)
struct dt_ui_t * dt_gui_get_ui(void)
GtkWidget * dt_gui_center_widget(void)
void dt_gui_refocus_center()
void dt_atomic_set_int(dt_atomic_int *var, int value)
int dt_atomic_get_int(dt_atomic_int *var)
int dt_atomic_add_int(dt_atomic_int *var, int incr)
float dt_bauhaus_slider_get(GtkWidget *widget)
int dt_bauhaus_combobox_get(GtkWidget *widget)
void dt_bauhaus_slider_set(GtkWidget *widget, float pos)
void dt_bauhaus_widget_set_label(GtkWidget *widget, const char *label)
GtkWidget * dt_bauhaus_slider_new_with_range(dt_bauhaus_t *bh, dt_gui_module_t *self, float min, float max, float step, float defval, int digits)
void dt_bauhaus_slider_set_format(GtkWidget *widget, const char *format)
#define DT_BAUHAUS_COMBOBOX_NEW_FULL(bauhaus, widget, action, label, tip, pos, callback, data,...)
The blending panel's GUI state and API, cut out of develop/blend.h.
typedef void((*dt_cache_allocate_t)(void *userdata, dt_cache_entry_t *entry))
static const float scaling
dt_collection_t * dt_collection_get_global(void)
GList * dt_collection_get_all(const dt_collection_t *collection, int limit)
void dt_iop_color_picker_init(void)
void dt_iop_color_picker_cleanup(void)
void dt_iop_color_picker_reset(dt_iop_module_t *module, gboolean keep)
gboolean dt_iop_color_picker_is_visible(const dt_develop_t *dev)
@ DT_LIB_COLORPICKER_SIZE_POINT
@ DT_LIB_COLORPICKER_SIZE_BOX
struct _GtkWidget GtkWidget
GtkWidget, opaque, spelled exactly as GTK spells it.
void dt_conf_set_bool(const char *name, int val)
int dt_conf_get_bool(const char *name)
void dt_conf_set_float(const char *name, float val)
float dt_conf_get_float(const char *name)
Float for name, clamped to its declared bounds.
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.
void dt_conf_set_string(const char *name, const char *val)
const char * dt_conf_get_string_const(const char *name)
Borrow the stored string for name without copying it.
void dt_image_check_camera_missing_sample(const struct dt_image_t *img)
void dt_ctl_switch_mode_to(const char *mode)
int32_t dt_control_get_mouse_over_id()
void dt_control_mouse_is_dragging(gboolean state)
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_log_busy_leave()
void dt_control_mouse_is_painting(gboolean state)
void dt_control_commit_cursor()
void dt_control_queue_cursor_by_name(const char *curs_str)
Queue a GTK named cursor for the next cursor commit.
gboolean dt_control_button_down(int which)
Is mouse button which currently held down?
void dt_control_set_keyboard_over_id(int32_t value)
#define dt_control_change_cursor(cursor)
#define dt_control_queue_cursor(cursor)
#define dt_control_set_cursor_visible(visible)
struct dt_control_t * dt_control_get_global(void)
static void _publish_mask_edit_transient(dt_develop_t *dev)
void init(dt_view_t *self)
static dt_darkroom_layout_t _lib_darkroom_get_layout(dt_view_t *self)
static uint64_t _darkroom_compose_key(const uint64_t source_hash, const uint64_t zoom_hash, const dt_aligned_pixel_t bg_color, const int border, const gboolean iso, const int width, const int height)
static uint64_t _darkroom_compose_key_of(const _darkroom_compose_t *const c, const uint64_t source_hash)
static gboolean _darkroom_autoset_button_is_running
static gboolean mouse_in_actionarea(dt_view_t *self, double x, double y)
static gboolean _darkroom_edge_pan_tick(gpointer user_data)
Move the darkroom ROI while a drag stays in the center-widget edge band.
static void _darkroom_ioporder_quickbutton_clicked(GtkButton *button, gpointer user_data)
void leave(dt_view_t *self)
static void _darkroom_sample_raw_point_to_image_norm(const dt_colorpicker_sample_t *const sample, float point[2])
static uint64_t _darkroom_preview_fallback_backbuf_hash
static void _darkroom_image_loaded_callback(gpointer instance, guint request_id, guint result, gpointer user_data)
#define DARKROOM_EDGE_PAN_SPEED_PX_PER_S
static int _darkroom_preview_fallback_height
static dt_dev_pixelpipe_cache_wait_t _darkroom_preview_wait
static gboolean _is_scroll_captured_by_widget()
int button_pressed(dt_view_t *self, double x, double y, double pressure, int which, int type, uint32_t state)
static void _release_expose_source_caches(void)
static void _darkroom_change_mask_rasterization(GtkWidget *combobox, gpointer user_data)
static void _autoset_popover_preshow(gpointer user_data)
static void _guides_quickbutton_clicked(GtkWidget *widget, gpointer user_data)
gboolean _switch_to_prev_picture(GtkAccelGroup *accel_group, GObject *accelerable, guint keyval, GdkModifierType modifier, gpointer data)
void cleanup(dt_view_t *self)
static dt_iop_module_t * _darkroom_pending_focus_module
#define DARKROOM_EDGE_PAN_INTERVAL_MS
static cairo_status_t _write_snapshot_data(void *closure, const unsigned char *data, unsigned int length)
static void display_mask_checker_1_callback(GtkColorButton *widget, gpointer user_data)
Persist the global mask-preview appearance and resynchronize every node using it.
static gboolean _darkroom_is_only_selected_sample(gboolean is_primary_sample, dt_colorpicker_sample_t *selected_sample, gboolean display_samples)
static void display_mask_black_and_white_callback(GtkToggleButton *toggle, gpointer user_data)
static gboolean mouse_in_imagearea(dt_view_t *self, double x, double y)
static gboolean _is_in_frame(const int width, const int height, const int x, const int y)
static gboolean _darkroom_compose_fallback(const _darkroom_compose_t *const c)
static int _darkroom_preview_fallback_width
void reset(dt_view_t *self)
static gboolean _darkroom_locked_main_valid_for_zoom(const darkroom_expose_state_t *state, const uint64_t zoom_hash)
static void display_mask_checker_2_callback(GtkColorButton *widget, gpointer user_data)
static dt_dev_locked_surface_t _darkroom_preview_locked
static gboolean _render_preview_fallback_surface(cairo_t *cr)
static dt_iop_module_t * _pending_mask_commit_module
#define DARKROOM_EDGE_PAN_MARGIN_PX
static void _dev_change_image(dt_view_t *self, const int32_t imgid)
static GtkWidget * _darkroom_ioporder_button
static void _darkroom_set_default_cursor(dt_view_t *self, double x, double y)
static gboolean _darkroom_edge_pan_apply(dt_view_t *self, const double pointer_x, const double pointer_y, const int width, const int height)
Apply one edge-pan step when the current drag is still eligible.
static void _preview_pipe_finished(gpointer instance, gpointer user_data)
static void _darkroom_edge_pan_update_state(dt_view_t *self, const double pointer_x, const double pointer_y, const int width, const int height, darkroom_edge_pan_test_t *edge)
Test every condition that allows edge-pan for the current pointer.
int scrolled(dt_view_t *self, double x, double y, int up, int state, int delta_y)
static gboolean _build_preview_fallback_surface(dt_develop_t *dev, const int width, const int height, const int border, const dt_aligned_pixel_t bg_color, const uint64_t zoom_hash)
static dt_dev_locked_surface_t _darkroom_main_locked
static void _delayed_history_commit(gpointer data)
static gboolean _darkroom_compose_locked(const _darkroom_compose_t *const c, dt_dev_locked_surface_t *locked)
static void _guides_popover_preshow(gpointer user_data)
int key_pressed(dt_view_t *self, GdkEventKey *event)
static GtkWidget * _darkroom_autoset_popover
static uint64_t _darkroom_preview_fallback_zoom_hash
static void _key_scroll(dt_develop_t *dev)
static gboolean _darkroom_composed_already(const _darkroom_compose_t *const c, const uint64_t key)
static void _release_preview_fallback_surface(void)
gboolean _focus_main_image(GtkAccelGroup *accel_group, GObject *accelerable, guint keyval, GdkModifierType modifier, gpointer data)
static gboolean _center_view_free_zoom(dt_view_t *self, double x, double y, int up, int state, int flow)
void mouse_leave(dt_view_t *self)
static void _darkroom_reset_expose_state(darkroom_expose_state_t *state)
void mouse_moved(dt_view_t *self, double x, double y, double pressure, int which)
void configure(dt_view_t *self, int wd, int ht)
static void _darkroom_log_image_load_error(const int ret)
int button_released(dt_view_t *self, double x, double y, int which, uint32_t state)
static void _view_darkroom_filmstrip_activate_callback(gpointer instance, int32_t imgid, gpointer user_data)
static dt_autoset_manager_t * _autoset_manager
static void _reset_edge_pan()
static void _guides_view_changed(gpointer instance, dt_view_t *old_view, dt_view_t *new_view, dt_lib_module_t *self)
void enter(dt_view_t *self)
static void _darkroom_change_rendering_size(GtkWidget *combobox, gpointer user_data)
static cairo_surface_t * _darkroom_preview_fallback_surface
static void display_mask_checker_size_callback(GtkWidget *slider, gpointer user_data)
static float _darkroom_edge_pan_velocity(const double position, const double size, const float margin)
static GtkWidget * _darkroom_autoset_list
static void _darkroom_autoset_popover_rebuild(dt_develop_t *dev)
static void _darkroom_autoset_quickbutton_clicked(GtkButton *button, gpointer user_data)
static void _queue_delayed_history_commit(dt_develop_t *dev)
static dt_dev_pixelpipe_cache_wait_t _darkroom_main_wait
void expose(dt_view_t *self, cairo_t *cri, int32_t width, int32_t height, int32_t pointerx, int32_t pointery)
static void _darkroom_sample_raw_box_to_image_norm(const dt_colorpicker_sample_t *const sample, float box[4])
static int _change_scaling(dt_develop_t *dev, const float point[2], const float new_scaling)
gboolean _switch_to_next_picture(GtkAccelGroup *accel_group, GObject *accelerable, guint keyval, GdkModifierType modifier, gpointer data)
static gchar * _darkroom_autoset_label(const dt_iop_module_t *module)
static int32_t _darkroom_preview_fallback_imgid
static gboolean _darkroom_edge_pan_enable_check(dt_develop_t *dev)
static void _paint_all(cairo_t *cri, cairo_t *cr, cairo_surface_t *image_surface)
static void _darkroom_autoset_popover_refresh(gpointer instance, gpointer user_data)
void gui_init(dt_view_t *self)
static void _darkroom_autoset_button_set_running(const gboolean running)
Reflect autoset processing state on the darkroom quick button.
static GtkWidget * _darkroom_autoset_button
gboolean _scroll_on_focus(GdkEventScroll event, void *data)
int try_enter(dt_view_t *self)
void mouse_enter(dt_view_t *self)
static int32_t _darkroom_pending_imgid
static void _darkroom_autoset_module_toggled(GtkToggleButton *toggle, gpointer user_data)
static gboolean _darkroom_center_pan_drag
static void _darkroom_prepare_image_surface(dt_develop_t *dev, const int width, const int height, darkroom_expose_state_t *state)
static void _darkroom_pickers_draw(dt_view_t *self, cairo_t *cri, int32_t width, int32_t height, int32_t pozx, int32_t pozy, GSList *samples, gboolean is_primary_sample)
Draw colorpicker samples overlays in darkroom view.
static uint64_t _darkroom_zoom_hash(const dt_develop_t *dev)
The frame-validity key for the locked main surface.
static gboolean _darkroom_preview_fallback_valid(const dt_develop_t *dev, const int width, const int height, const uint64_t zoom_hash)
struct dt_develop_t * dt_dev_get_global(void)
struct dt_lib_t * dt_lib_get_global(void)
struct dt_view_manager_t * dt_view_manager_get_global(void)
void dt_dev_set_global(struct dt_develop_t *dev)
struct dt_gui_gtk_t * dt_gui_get_global(void)
struct dt_bauhaus_t * dt_bauhaus_get_global(void)
void dt_dev_draw_iso12646_border(cairo_t *cr, double width, double height, int border)
gboolean dt_dev_lock_pipe_surface(dt_develop_t *dev, dt_dev_pixelpipe_t *pipe, dt_dev_locked_surface_t *locked, dt_dev_pixelpipe_cache_wait_t *wait, const char *wait_owner_tag, gboolean keep_previous_on_fail)
gboolean dt_dev_render_locked_surface(cairo_t *cr, const dt_develop_t *dev, dt_dev_locked_surface_t *locked, const int width, const int height, const int border, const dt_aligned_pixel_t bg_color)
void dt_dev_get_background_color(const dt_develop_t *dev, dt_aligned_pixel_t bg_color)
void dt_dev_release_locked_surface(dt_dev_locked_surface_t *locked)
void dt_dev_draw_profile_mode_label(cairo_t *cri, int height)
int32_t dt_dev_geometry_processed_height(const dt_develop_t *dev)
dt_dev_image_geometry_t dt_dev_geometry_snapshot(const dt_develop_t *dev)
int32_t dt_dev_geometry_processed_width(const dt_develop_t *dev)
void dt_dev_transient_params_clear(dt_iop_module_t *module)
Drop the transient slot if it belongs to module.
void dt_dev_transient_params_set(dt_iop_module_t *module, const void *params, const size_t params_size, const void *blend_params, const size_t blend_size)
Out-of-history transient param channel.
void dt_dev_history_free_history(dt_develop_t *dev) REQUIRES(dev -> history_mutex)
Free the whole history list attached to dev->history.
void dt_dev_pop_history_items(dt_develop_t *dev)
Thread-safe wrapper around dt_dev_pop_history_items_ext(), then update GUI.
gboolean dt_dev_transient_params_active(dt_develop_t *dev, const dt_iop_module_t *module)
#define dt_dev_add_history_item(dev, module, enable, redraw)
void dt_dev_history_drop_pending_commits(struct dt_develop_t *dev)
Discard every history commit still queued for dev, without running it.
void dt_dev_history_gui_update(struct dt_develop_t *dev)
Apply history-loaded params to module GUIs.
void dt_dev_history_flush_pending_commits(struct dt_develop_t *dev)
Run every history commit still queued for dev, now.
void dt_dev_history_gui_init(void)
Install the history engine's GUI handlers. Called once from dt_init() beside the other handler instal...
The GTK half of the history engine, following the blend.c/blend_gui.c pattern.
void dt_dev_pixelpipe_cache_wait_cleanup(dt_dev_pixelpipe_cache_wait_t *wait, const char *reason)
Cancel one pending GUI cache wait request and clear its runtime state.
gboolean dt_dev_pixelpipe_is_backbufer_valid(dt_dev_pixelpipe_t *pipe)
void dt_dev_pixelpipe_cache_wait_dump_pending(const char *reason)
Dump pending GUI cache wait requests for lifecycle debugging.
void dt_dev_pixelpipe_change_zoom_main(dt_develop_t *dev)
void dt_dev_pixelpipe_cache_wait_set_owner(dt_dev_pixelpipe_cache_wait_t *wait, const char *owner_tag, gpointer owner_object)
Attach debug ownership metadata to one cache wait request.
gboolean dt_dev_pixelpipe_cache_peek_gui(dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece, void **data, dt_pixel_cache_entry_t **cache_entry, dt_dev_pixelpipe_cache_wait_t *wait, dt_dev_pixelpipe_cache_ready_callback_t restart, gpointer restart_data)
#define dt_dev_pixelpipe_rebuild_all(dev)
#define dt_dev_pixelpipe_resync_history_main(dev)
#define dt_dev_pixelpipe_update_history_main(dev)
#define dt_dev_pixelpipe_update_history_preview(dev)
int32_t dt_dev_roi_request_preview_height(const dt_develop_t *dev)
float dt_dev_roi_request_natural_scale(const dt_develop_t *dev)
int32_t dt_dev_roi_request_preview_width(const dt_develop_t *dev)
uint64_t dt_dev_roi_request_publish(dt_develop_t *dev)
Recompute the derived members from the viewport and the geometry record, and publish if anything chan...
dt_dev_roi_request_t dt_dev_roi_request_get(const dt_develop_t *dev)
gboolean dt_dev_viewport_set_border(dt_develop_t *dev, const int32_t border_size)
gboolean dt_dev_viewport_set_center(dt_develop_t *dev, const float center_x, const float center_y)
gboolean dt_dev_viewport_set_widget_size(dt_develop_t *dev, const int32_t widget_width, const int32_t widget_height)
float dt_dev_viewport_center_y(const dt_develop_t *dev)
gboolean dt_dev_viewport_set_scaling(dt_develop_t *dev, const float scaling)
float dt_dev_viewport_center_x(const dt_develop_t *dev)
int32_t dt_dev_viewport_border_size(const dt_develop_t *dev)
float dt_dev_viewport_scaling(const dt_develop_t *dev)
dt_dev_viewport_state_t dt_dev_viewport_get(const dt_develop_t *dev)
void dt_dev_get_processed_size(const dt_develop_t *dev, int *procw, int *proch)
int dt_dev_get_thumbnail_size(dt_develop_t *dev)
void dt_dev_get_image_box_in_widget(const dt_develop_t *dev, const int32_t width, const int32_t height, float *box)
Get the displayed image rectangle in darkroom widget coordinates.
void dt_dev_get_widget_center(const dt_develop_t *dev, float *point)
Get the center of the darkroom widget in logical coordinates.
void dt_dev_cleanup(dt_develop_t *dev)
float dt_dev_get_overlay_scale(dt_develop_t *dev)
Get the overlay scale factor in GUI logical coordinates.
dt_dev_image_storage_t dt_dev_load_image(dt_develop_t *dev, const int32_t imgid)
gboolean dt_dev_masks_manager_is_visible(dt_develop_t *dev)
void dt_dev_init(dt_develop_t *dev, int32_t gui_attached)
void dt_dev_undo_start_record(dt_develop_t *dev)
gboolean dt_dev_clamp_viewport_center(dt_develop_t *dev)
Clamp the viewport centre against the box currently visible at this zoom.
void dt_dev_coordinates_raw_norm_to_image_norm(dt_develop_t *dev, float *points, size_t num_points)
void dt_dev_check_zoom_pos_bounds(dt_develop_t *dev, float *dev_x, float *dev_y, float *box_w, float *box_h)
Ensure that the current ROI position is within allowed bounds .
gboolean dt_dev_check_zoom_scale_bounds(dt_develop_t *dev)
Ensure that the current zoom level is within allowed bounds (for scrolling).
void dt_dev_reset_roi(dt_develop_t *dev)
GList * dt_dev_load_modules(dt_develop_t *dev)
void dt_dev_set_backbuf(dt_backbuf_t *backbuf, const int width, const int height, const size_t bpp, const int64_t hash, const int64_t history_hash)
float dt_dev_get_widget_zoom_scale(const dt_develop_t *dev, const float scaling)
Convert a darkroom scaling factor to GUI logical zoom.
void dt_dev_coordinates_image_norm_to_raw_norm(dt_develop_t *dev, float *points, size_t num_points)
gboolean dt_dev_pipelines_share_preview_output(dt_develop_t *dev)
Tell whether the darkroom main and preview pipes currently target the same GUI output.
void dt_dev_masks_update_hash(dt_develop_t *dev)
gboolean dt_dev_clip_roi(dt_develop_t *dev, cairo_t *cr, int32_t width, int32_t height)
Clip the view to the ROI. WARNING: this must be done before any translation.
void dt_dev_undo_end_record(dt_develop_t *dev)
gboolean dt_dev_rescale_roi(dt_develop_t *dev, cairo_t *cr, int32_t width, int32_t height)
Scale the ROI to fit within given width/height, centered.
void dt_dev_coordinates_widget_delta_to_image_delta(dt_develop_t *dev, float *points, size_t num_points)
Convert a widget-space distance to processed-image pixels.
float dt_dev_get_fit_scale(dt_develop_t *dev)
Get the scale factor that maps preview-buffer pixels to GUI coordinates.
void dt_dev_coordinates_widget_to_image_norm(dt_develop_t *dev, float *points, size_t num_points)
Coordinate conversion helpers between widget, normalized image, and absolute image spaces.
gchar * dt_history_item_get_name(const struct dt_iop_module_t *module)
void dt_dev_start_all_pipelines(dt_develop_t *dev)
@ DT_DEV_IMAGE_STORAGE_DB_NOT_READ
@ DT_DEV_IMAGE_STORAGE_MIPMAP_NOT_FOUND
GtkWidget * geometry
its size, under the preview
GtkWidget * view
the tree view
static void set_color(cairo_t *cr, GdkRGBA color)
static int dt_pthread_rwlock_wrlock(dt_pthread_rwlock_t *rwlock) ACQUIRE(rwlock) NO_THREAD_SAFETY_ANALYSIS
static int dt_pthread_rwlock_unlock(dt_pthread_rwlock_t *rwlock) RELEASE_GENERIC(rwlock) NO_THREAD_SAFETY_ANALYSIS
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
static guint dt_keys_mainpad_alternatives(const guint key_val)
Remap keypad keys to usual mainpad ones.
void dt_gui_throttle_cancel(gpointer source)
void dt_gui_throttle_queue(gpointer source, dt_gui_throttle_callback_t callback, gpointer user_data)
void dt_guides_draw(cairo_t *cr, const float left, const float top, const float width, const float height, const float zoom_scale)
void dt_guides_update_popover_values()
void dt_guides_set_overlay_colors()
GtkWidget * dt_guides_popover(dt_view_t *self, GtkWidget *button)
void dt_guides_button_toggled(gboolean active)
void dt_guides_update_button_state()
static uint64_t dt_hash(uint64_t hash, const char *str, size_t size)
float dt_boundingbox_t[4]
void dt_iop_cleanup_module(dt_iop_module_t *module)
void dt_iop_nap(int32_t usec)
gboolean dt_iop_is_hidden(dt_iop_module_t *module)
void dt_iop_gui_cleanup_module(dt_iop_module_t *module)
void dt_iop_gui_set_expander(dt_iop_module_t *module)
void dt_iop_gui_init(dt_iop_module_t *module)
void dt_iop_gui_update_expanded(dt_iop_module_t *module)
void dt_iop_request_focus(dt_iop_module_t *module)
Move darkroom focus to module, or clear it with NULL.
@ IOP_FLAGS_GUIDES_SPECIAL_DRAW
void dt_bauhaus_value_changed_default_callback(GtkWidget *widget)
int dt_iop_autoset_advance(struct dt_develop_t *dev, dt_autoset_manager_t *manager)
gboolean dt_iop_autoset_module_is_enabled(const dt_iop_module_t *module)
void dt_iop_autoset_build_list(struct dt_develop_t *dev, dt_autoset_manager_t *manager)
void dt_iop_autoset_module_set_enabled(const dt_iop_module_t *module, const gboolean enabled)
void dt_control_flush_jobs_queue(dt_control_t *control, dt_job_queue_t queue_id)
GtkWidget * dt_ui_section_label_new(const gchar *str)
GtkWidget * dt_ui_label_new(const gchar *str)
void dt_lib_colorpicker_set_box_area(dt_lib_t *lib, const dt_boundingbox_t box)
void dt_lib_colorpicker_set_point(dt_lib_t *lib, const float pos[2])
_lib_location_type_t type
int32_t dt_get_debug_flags(void)
void dt_print(dt_debug_thread_t thread, const char *msg,...) __attribute__((format(printf
Print to stdout when thread is enabled, prefixed with seconds since startup.
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...
dt_masks_form_t * dt_masks_get_from_id(dt_develop_t *dev, int id)
void dt_masks_set_edit_mode(struct dt_iop_module_t *module, dt_masks_edit_mode_t value)
void dt_masks_events_post_expose(dt_develop_t *dev, struct dt_iop_module_t *module, cairo_t *cr, int32_t width, int32_t height, int32_t pointerx, int32_t pointery)
int dt_masks_events_button_released(dt_develop_t *dev, struct dt_iop_module_t *module, double x, double y, int button, uint32_t state)
int dt_masks_events_button_pressed(dt_develop_t *dev, struct dt_iop_module_t *module, double x, double y, double pressure, int button, int event_type, uint32_t state)
int dt_masks_events_mouse_moved(dt_develop_t *dev, struct dt_iop_module_t *module, double x, double y, double pressure, int which)
dt_masks_form_t * dt_masks_get_visible_form(const dt_develop_t *dev)
Return the currently visible form used by the masks GUI.
int dt_masks_events_mouse_leave(struct dt_iop_module_t *module)
gboolean dt_masks_gui_is_dragging(const dt_masks_form_gui_t *gui)
int dt_masks_events_mouse_enter(struct dt_iop_module_t *module)
void dt_masks_gui_cleanup(dt_develop_t *dev)
int dt_masks_events_key_pressed(dt_develop_t *dev, struct dt_iop_module_t *module, GdkEventKey *event)
void dt_masks_overlay_queue_redraw(GtkWidget *widget)
int dt_masks_events_mouse_scrolled(dt_develop_t *dev, struct dt_iop_module_t *module, double x, double y, int scroll_up, uint32_t key_state, int scrolling_delta)
void dt_masks_gui_init(dt_develop_t *dev)
The interactive half of the masks subsystem: the editing state (dt_masks_form_gui_t),...
void dt_masks_release_all_forms(dt_develop_t *dev)
#define DEVELOP_MASKS_NB_SHAPES
#define CLAMPF(a, mn, mx)
#define dt_free_align(ptr)
Release memory from dt_alloc_align() and set ptr to NULL.
static void * dt_calloc_align(size_t size)
dt_alloc_align() followed by a zero fill.
#define dt_free(ptr)
g_free() ptr and set it to NULL, skipping both if it is already NULL.
dt_mipmap_size_t dt_mipmap_cache_get_fitting_size(const int32_t width, const int32_t height, const uint32_t imgid)
#define dt_mipmap_cache_get(B, C, D, E, F)
#define dt_mipmap_cache_release(B)
#define DT_MODULE(MODVER)
Instantiate the version handshake every module must export. Use once, at file scope,...
void * dt_pixel_cache_entry_get_data(dt_pixel_cache_entry_t *entry)
void dt_dev_pixelpipe_cache_rdlock_entry(gboolean lock, dt_pixel_cache_entry_t *cache_entry)
Lock or release the read lock on the entry.
void dt_dev_pixelpipe_cache_flush_clmem_for_pipe(const int devid)
Like dt_dev_pixelpipe_cache_flush_clmem(), for callers that do not hold the device lock (dt_opencl_re...
size_t dt_pixel_cache_entry_get_size(dt_pixel_cache_entry_t *entry)
Peek the size (in bytes) reserved for the host buffer of a cache entry.
void dt_dev_pixelpipe_cache_unref_hash(const uint64_t hash)
Find the entry matching hash, and decrease its ref_count if found.
#define DT_PIXELPIPE_CACHE_HASH_INVALID
void dt_dev_pixelpipe_cleanup_nodes(dt_dev_pixelpipe_t *pipe)
static void dt_dev_pixelpipe_or_changed(dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_change_t flags)
@ DT_DEV_PIPE_TOP_CHANGED
static dt_backbuf_state_t dt_dev_backbuf_snapshot(const dt_backbuf_t *backbuf)
Read the whole record as one publication.
static void dt_dev_backbuf_set_hash(dt_backbuf_t *backbuf, const uint64_t hash)
static uint64_t dt_dev_backbuf_get_hash(const dt_backbuf_t *backbuf)
static cairo_surface_t * dt_cairo_image_surface_create(cairo_format_t format, int width, int height)
int32_t dt_selection_get_first_id(struct dt_selection_t *selection)
struct dt_selection_t * dt_selection_get_global(void)
int dt_selection_get_length(struct dt_selection_t *selection)
void dt_selection_clear(dt_selection_t *selection)
void dt_selection_select_single(dt_selection_t *selection, int32_t imgid)
#define DT_DEBUG_CONTROL_SIGNAL_DISCONNECT(ctlsig, cb, user_data)
#define DT_DEBUG_CONTROL_SIGNAL_RAISE(ctlsig, signal,...)
struct dt_control_signal_t * dt_control_signal_get_global(void)
@ DT_SIGNAL_DEVELOP_INITIALIZE
This signal is raised when darktable.develop is initialized.
@ DT_SIGNAL_VIEWMANAGER_THUMBTABLE_ACTIVATE
@ 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_DEVELOP_PREVIEW_PIPE_FINISHED
This signal is raised when develop preview pipe process is finished no param, no returned value.
@ 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_VIEWMANAGER_VIEW_CHANGED
This signal is raised by viewmanager when a view has changed. 1 : dt_view_t * the old view 2 : dt_vie...
#define DT_DEBUG_CONTROL_SIGNAL_CONNECT(ctlsig, signal, cb, user_data)
DT_ALIGNED_PIXEL float dt_aligned_pixel_t[4]
const float uint32_t state[4]
unsigned __int64 uint64_t
darkroom_expose_state_t * state
uint64_t pending_main_hash
uint64_t image_surface_hash
int32_t image_surface_imgid
gboolean image_surface_has_main
gboolean progress_cursor_active
One coherent publication, by value.
void(* default_value_changed_callback)(GtkWidget *widget)
dt_lib_colorpicker_size_t size
Objective facts about the image a dev is working on.
struct dt_pixel_cache_entry_t * entry
cairo_surface_t * surface
dt_pthread_mutex_t busy_mutex
The coherent set of numbers a darkroom pipe plans its ROI from.
What the darkroom view asks the pipeline to show: the window onto the image.
cairo_surface_t * image_surface
struct dt_colorpicker_sample_t * primary_sample
dt_backbuf_t display_histogram
dt_backbuf_t output_histogram
struct dt_develop_t::@13 color_picker
Authoritative darkroom color-picker state.
struct dt_develop_t::@17 display
struct dt_iop_module_t * gui_module
dt_pthread_rwlock_t history_mutex
GtkWidget * floating_window
struct dt_dev_pixelpipe_t * preview_pipe
struct dt_develop_t::@15 overexposed
gboolean pipelines_started
struct dt_develop_t::@14::@21 snapshot
struct dt_develop_t::@19 profile
dt_aligned_pixel_t wb_coeffs
struct dt_iop_module_t *struct dt_iop_color_picker_t * picker
dt_backbuf_t raw_histogram
struct dt_masks_form_gui_t * form_gui
struct dt_colorpicker_sample_t * selected_sample
struct dt_develop_t::@18 iso_12646
struct dt_develop_t::@14 proxy
struct dt_develop_t::@16 rawoverexposed
struct dt_dev_pixelpipe_t * pipe
struct dt_gui_gtk_t::@33 mouse
gboolean block_normal_pan
struct dt_gui_gtk_t::@32 pan_edge
dt_iop_module_t *dt_iop_color_picker_kind_t kind
struct dt_develop_blend_params_t * blend_params
One consumer's outstanding request, owned by that consumer, not by the queue.
GtkWidget * guides_popover
dt_darkroom_layout_t(* get_layout)(struct dt_view_t *view)
void(* set_default_cursor)(struct dt_view_t *view, double x, double y)
struct dt_view_manager_t::@60 proxy
struct dt_view_manager_t::@60::@63 darkroom
GtkWidget * guides_toggle
typedef double((*spd)(unsigned long int wavelength, double TempK))
int dt_thumbtable_scroll_to_selection(dt_thumbtable_t *table)
Scroll to show selected content.
void dt_thumbtable_update_parent(dt_thumbtable_t *table)
A widget to manage and display image thumbnails in Ansel's lighttable and filmstrip views.
#define dt_thumbtable_refresh_thumbnail(table, imgid, reinit)
static void dt_thumbtable_show(dt_thumbtable_t *table)
Show the thumbnail table widget.
static void dt_thumbtable_hide(dt_thumbtable_t *table)
Hide the thumbnail table widget.
void dt_show_times(const dt_times_t *start, const char *prefix)
static void dt_get_times(dt_times_t *t)
static double dt_get_wtime(void)
void dt_show_times_f(const dt_times_t *start, const char *prefix, const char *suffix,...) __attribute__((format(printf
void dt_undo_clear(dt_undo_t *self, uint32_t filter)
dt_undo_t * dt_undo_get_global(void)
void dt_view_manager_module_toolbox_add(dt_view_manager_t *vm, GtkWidget *tool, dt_view_type_flags_t views)
void dt_view_active_images_add(int32_t imgid, gboolean raise)
void dt_view_active_images_reset(gboolean raise)
int dt_view_manager_switch(dt_view_manager_t *vm, const char *view_name)
void dt_view_image_info_update(int32_t imgid)
int32_t dt_view_active_images_get_first()
const dt_view_t * dt_view_manager_get_current_view(dt_view_manager_t *vm)
@ VIEW_FLAGS_PAINTS_WHOLE_AREA
@ DT_DARKROOM_LAYOUT_EDITING