19 changes: 10 additions & 9 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ vertama
Arch Ont
Bernhard
Báthory Péter
Matteo Mardegan
Michel Leblond
Nicolas Auffray
jpellegrini
Alejandro Criado-Pérez
Cyril Richard
DWXXX
Danilo Bargen
Denny Biasiolli
Diederik ter Rahe
Jakub Filipowicz
Marko Vertainen
Matteo Mardegan
Michel Leblond
Miroslav Fikar
criadoperez
mrleemon
Expand All @@ -42,28 +42,29 @@ Hubert Kowalski
Diederik ter Rahe
Jeronimo Pellegrini
Dan Torop
Chris.Elston
Philippe Weyland
Chris.Elston
hanno@schwalm-bremen.de
Heiko Bauke
EdgarLux
Harold le Clément de Saint-Marcq
Mark-64
Bill Ferguson
Nicolas Auffray
Harold le Clément de Saint-Marcq
rawfiner
Bill Ferguson
David-Tillmann Schaefer
Miloš Komarčević
rawfiner
Ralf Brown
darkelectron
Matt Maguire
Ralf Brown
Martin Straeten
Alexis Mousset
dterrahe
Andreas Schneider
Martin Straeten
Hanno Schwalm
Timur Davletshin
Chris Elston
Philipp Lutz
matt-maguire

* Sub-module rawspeed contributors (at least 1 commit):
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ function(generate_version_gen_c)

add_custom_target(
create_version_gen ALL
COMMAND ${CMAKE_SOURCE_DIR}/tools/create_version_c.sh ${DARKTABLE_BINDIR}/version_gen.c ${_VERSION}
COMMAND sh ${CMAKE_SOURCE_DIR}/tools/create_version_c.sh ${DARKTABLE_BINDIR}/version_gen.c ${_VERSION}
DEPENDS ${CMAKE_SOURCE_DIR}/tools/create_version_c.sh
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMENT "Updating version string (${_TYPE})"
Expand Down
340 changes: 54 additions & 286 deletions RELEASE_NOTES.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ SUDO=""

PRINT_HELP=0

FEATURES="CAMERA COLORD FLICKR GRAPHICSMAGICK KWALLET LIBSECRET LUA MAP MAC_INTEGRATION NLS OPENCL OPENEXR OPENMP UNITY WEBP GAME"
FEATURES="CAMERA COLORD FLICKR GRAPHICSMAGICK IMAGEMAGICK KWALLET LIBSECRET LUA MAP MAC_INTEGRATION NLS OPENCL OPENEXR OPENMP UNITY WEBP GAME"

# prepare a lowercase version with a space before and after
# it's very important for parse_feature, has no impact in for loop expansions
Expand Down
6 changes: 3 additions & 3 deletions data/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ file(GLOB PO_FILES "${CMAKE_CURRENT_SOURCE_DIR}/../po/*.po")
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/darktable.desktop
SOURCE ${CMAKE_CURRENT_BINARY_DIR}/darktable.desktop.in
COMMAND ${intltool_merge_BIN} --desktop-style ${CMAKE_CURRENT_SOURCE_DIR}/../po ${CMAKE_CURRENT_BINARY_DIR}/darktable.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/darktable.desktop
COMMAND sh -c "${intltool_merge_BIN} --desktop-style ${CMAKE_CURRENT_SOURCE_DIR}/../po ${CMAKE_CURRENT_BINARY_DIR}/darktable.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/darktable.desktop"
MAIN_DEPENDENCY ${CMAKE_CURRENT_BINARY_DIR}/darktable.desktop.in
DEPENDS ${PO_FILES}
)
Expand All @@ -63,7 +63,7 @@ if(${VALIDATE_APPDATA_FILE})
OUTPUT ${DARKTABLE_SHAREDIR}/appdata/darktable.appdata.xml
SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/darktable.appdata.xml.in
COMMAND ${CMAKE_COMMAND} -E make_directory ${DARKTABLE_SHAREDIR}/appdata
COMMAND ${intltool_merge_BIN} --xml-style ${CMAKE_CURRENT_SOURCE_DIR}/../po ${CMAKE_CURRENT_SOURCE_DIR}/darktable.appdata.xml.in ${DARKTABLE_SHAREDIR}/appdata/darktable.appdata.xml
COMMAND sh -c "${intltool_merge_BIN} --xml-style ${CMAKE_CURRENT_SOURCE_DIR}/../po ${CMAKE_CURRENT_SOURCE_DIR}/darktable.appdata.xml.in ${DARKTABLE_SHAREDIR}/appdata/darktable.appdata.xml"
COMMAND ${appstream_util_BIN} validate --nonet ${DARKTABLE_SHAREDIR}/appdata/darktable.appdata.xml
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/darktable.appdata.xml.in
DEPENDS ${PO_FILES}
Expand All @@ -73,7 +73,7 @@ else()
OUTPUT ${DARKTABLE_SHAREDIR}/appdata/darktable.appdata.xml
SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/darktable.appdata.xml.in
COMMAND ${CMAKE_COMMAND} -E make_directory ${DARKTABLE_SHAREDIR}/appdata
COMMAND ${intltool_merge_BIN} --xml-style ${CMAKE_CURRENT_SOURCE_DIR}/../po ${CMAKE_CURRENT_SOURCE_DIR}/darktable.appdata.xml.in ${DARKTABLE_SHAREDIR}/appdata/darktable.appdata.xml
COMMAND sh -c "${intltool_merge_BIN} --xml-style ${CMAKE_CURRENT_SOURCE_DIR}/../po ${CMAKE_CURRENT_SOURCE_DIR}/darktable.appdata.xml.in ${DARKTABLE_SHAREDIR}/appdata/darktable.appdata.xml"
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/darktable.appdata.xml.in
DEPENDS ${PO_FILES}
)
Expand Down
1 change: 1 addition & 0 deletions data/darktable.appdata.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
</screenshots>
<content_rating type="oars-1.1" />
<releases>
<release date="2020-12-24" version="3.4.0"/>
<release date="2020-08-10" version="3.2.1"/>
<release date="2020-04-18" version="3.0.2"/>
<release date="2020-03-09" version="3.0.1"/>
Expand Down
2 changes: 1 addition & 1 deletion data/darktableconfig.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -2501,7 +2501,7 @@
<shortdescription>colorbalance slider block layout</shortdescription>
<longdescription>choose how to organise the slider blocks for lift, gamma and gain:\nlist - all sliders are shown in one long list (with headers),\ntabs - use tabs to switch between the blocks of sliders,\ncolumns - the blocks of sliders are shown next to each other (in narrow columns)</longdescription>
</dtconfig>
<dtconfig prefs="darkroom" section="general">
<dtconfig prefs="darkroom" section="modules">
<name>darkroom/ui/hide_header_buttons</name>
<type>
<enum>
Expand Down
244 changes: 244 additions & 0 deletions data/noiseprofiles.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions data/themes/darktable-elegant-dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
/* Lighttable and film-strip */
@define-color thumbnail_bg_color @grey_55;
@define-color thumbnail_star_bg_color @grey_40;
@define-color thumbnail_star_hover_color @grey_85;
@define-color thumbnail_fg_color @grey_60;
@define-color thumbnail_selected_bg_color @grey_75;
@define-color thumbnail_hover_bg_color @grey_90;
Expand Down
8 changes: 7 additions & 1 deletion data/themes/darktable-elegant-darker.css
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ button,
notebook tabs,
#modules-tabs,
#blending-tabs,
tooltip label
tooltip label,
.active-menu-item * /* needed for some Pango issues not rendering synthetic bold for all OS */
{
font-family: "Roboto",
"Segoe UI",
Expand All @@ -113,3 +114,8 @@ tooltip label
"Cantarell",
sans-serif;
}

.active-menu-item * /* this is optional, omitting it will make the selected menu item slightly less visible */
{
font-weight: bold;
}
11 changes: 10 additions & 1 deletion data/themes/darktable-elegant-grey.css
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
@define-color lighttable_bg_font_color @grey_95;

/* Lighttable and film-strip */
@define-color thumbnail_font_color @grey_35;
@define-color thumbnail_font_color @grey_40;
@define-color thumbnail_bg_color @grey_70;
@define-color thumbnail_fg_color @grey_60;
@define-color thumbnail_selected_bg_color @grey_80;
Expand Down Expand Up @@ -151,3 +151,12 @@
{
background-image: linear-gradient(rgba(246, 246, 246, 0.4) 0%, rgba(246, 246, 246, 0.2) 5%, rgba(226, 226, 226, 0) 100%);
}

/* Make inactive stars more discrete when not hovered */
.dt_overlays_always #thumb_star,
.dt_overlays_always_extended #thumb_star,
.dt_overlays_mixed #thumb_star,
.dt_overlays_hover_block #thumb_star
{
color: shade(@thumbnail_font_color, 1.5);
}
43 changes: 35 additions & 8 deletions data/themes/darktable.css
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,10 @@
@define-color lighttable_bg_font_color @grey_75;

/* Lighttable and film-strip */
@define-color thumbnail_font_color @grey_25;
@define-color thumbnail_font_color @grey_30;
@define-color thumbnail_bg_color @grey_50;
@define-color thumbnail_star_bg_color @grey_35;
@define-color thumbnail_star_hover_color @grey_80;
@define-color thumbnail_fg_color @grey_55;
@define-color thumbnail_bg50_color @grey_100;
@define-color thumbnail_selected_bg_color @grey_70;
Expand Down Expand Up @@ -306,6 +307,7 @@ textview
min-height: 0;
min-width: 0;
padding: 0px;
font-family: sans;
}

entry
Expand Down Expand Up @@ -480,7 +482,7 @@ overshoot.right
#lib-plugin-ui-main,
#blending-box
{
padding: 0.75em;
padding: 0.66em;
}

/* icon buttons in modules main body */
Expand Down Expand Up @@ -744,7 +746,7 @@ dialog .dialog-vbox scrolledwindow
dialog button
{
padding: 2px;
margin: 1px 2px;
margin: 1px;
}

dialog headerbar
Expand Down Expand Up @@ -832,6 +834,12 @@ dialog .dialog-vbox notebook stack box box checkbutton label /* fix a margin on
padding: 2px;
}

/* preferences module dialog window */
.dialog-action-box
{
margin-top: 5px;
}

/*--------------------------------------------------------
- Bauhaus controls (sliders and comboboxes in modules) -
--------------------------------------------------------*/
Expand Down Expand Up @@ -914,6 +922,12 @@ dialog combobox window,
background-color: @tooltip_bg_color;
}

menuitem arrow
{
border: 0;
margin-right: 2px;
}

popover
{
padding: 0.4em;
Expand Down Expand Up @@ -1473,7 +1487,7 @@ filechooser .sidebar row:selected:hover .sidebar-label,
#preferences_box .sidebar row,
#preferences_box .sidebar row:selected
{
border-left: 2px solid @plugin_bg_color; /* be sure border is set but not visible if category on sidebar not selected but keep same size and type for selected category ; color needs to be same as sidebar scrolledwindow background-color few lines above */
border-left: 2px solid @bg_color; /* be sure border is set but not visible if category on sidebar not selected but keep same size and type for selected category ; color needs to be same as sidebar scrolledwindow background-color few lines above */
}

filechooser row:selected .sidebar-icon, /* set icon instead of border for filechooser dialog window */
Expand Down Expand Up @@ -1518,7 +1532,9 @@ filechooser widget treeview
color: @field_fg;
}

treeview header button,
treeview header widget button,
#iop-plugin-ui treeview header button,
#lib-plugin-ui treeview header button,
#preferences_notebook header button,
.accels_window_list header button
{
Expand All @@ -1531,6 +1547,8 @@ treeview header button,
}

treeview header label,
#iop-plugin-ui treeview header label,
#lib-plugin-ui treeview header label,
#preferences_notebook header button label,
.accels_window_list header button label
{
Expand Down Expand Up @@ -2296,7 +2314,7 @@ spinbutton>button
{
color: transparent;
}
#thumb_main:active #thumb_cursor
#thumbtable_filmstrip #thumb_main:active #thumb_cursor
{
color: @border_color;
}
Expand Down Expand Up @@ -2377,6 +2395,15 @@ spinbutton>button
background-color: transparent;
}

/* Make inactive stars more discrete when not hovered */
.dt_overlays_always #thumb_star,
.dt_overlays_always_extended #thumb_star,
.dt_overlays_mixed #thumb_star,
.dt_overlays_hover_block #thumb_star
{
color: shade(@thumbnail_font_color, 1.4);
}

/* Set hover and selected color icons, extension name and text infos */
.dt_overlays_always #thumb_main:hover #thumb_ext,
.dt_overlays_always #thumb_main:selected #thumb_ext,
Expand Down Expand Up @@ -2430,7 +2457,7 @@ spinbutton>button
.dt_overlays_mixed #thumb_star:active,
.dt_overlays_hover_block #thumb_image:hover #thumb_star:active
{
color: @thumbnail_selected_bg_color;
color: @thumbnail_font_color;
background-color: @thumbnail_font_color;
}

Expand All @@ -2442,7 +2469,7 @@ spinbutton>button
.dt_overlays_mixed #thumb_main:hover #thumb_star:hover,
.dt_overlays_hover_block #thumb_main:hover #thumb_star:hover
{
color: @thumbnail_hover_fg_color;
color: @thumbnail_star_hover_color;
background-color: @thumbnail_star_bg_color;
}

Expand Down
6 changes: 3 additions & 3 deletions doc/man/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ macro(add_manpage pod)
set(target ${CMAKE_CURRENT_BINARY_DIR}/${manpage})
add_custom_command(
OUTPUT ${target}
COMMAND ${CMAKE_SOURCE_DIR}/tools/makeman.sh ${source} ${CMAKE_CURRENT_SOURCE_DIR}/../../AUTHORS ${target}
COMMAND sh ${CMAKE_SOURCE_DIR}/tools/makeman.sh ${source} ${CMAKE_CURRENT_SOURCE_DIR}/../../AUTHORS ${target}
DEPENDS ${source} ${CMAKE_CURRENT_SOURCE_DIR}/../../AUTHORS ${CMAKE_SOURCE_DIR}/tools/makeman.sh
)
add_custom_target(manpage_${manpage} ALL DEPENDS ${target})
Expand Down Expand Up @@ -57,14 +57,14 @@ else()
# create translated .pod
add_custom_command(
OUTPUT ${tmppod}
COMMAND ${po4a-translate_BIN} -f pod -m ${pod} -p ${pofile} -l ${tmppod} -k 0
COMMAND sh -c "${po4a-translate_BIN} -f pod -m ${pod} -p ${pofile} -l ${tmppod} -k 0"
DEPENDS ${pofile} ${pod}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
# turn the .pod into a manpage
add_custom_command(
OUTPUT ${target}
COMMAND ${CMAKE_SOURCE_DIR}/tools/makeman.sh ${tmppod} ${CMAKE_CURRENT_SOURCE_DIR}/../../AUTHORS ${target}
COMMAND sh ${CMAKE_SOURCE_DIR}/tools/makeman.sh ${tmppod} ${CMAKE_CURRENT_SOURCE_DIR}/../../AUTHORS ${target}
DEPENDS ${tmppod} ${CMAKE_CURRENT_SOURCE_DIR}/../../AUTHORS ${CMAKE_SOURCE_DIR}/tools/makeman.sh
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
Expand Down
2 changes: 1 addition & 1 deletion doc/man/po/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ else()
set(pofile "${language}.po")
add_custom_command(
OUTPUT ${pofile}
COMMAND ${po4a-updatepo_BIN} -f pod ${files} -p po/${pofile}
COMMAND sh -c "${po4a-updatepo_BIN} -f pod ${files} -p po/${pofile}"
DEPENDS ${deps}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../
)
Expand Down
6 changes: 3 additions & 3 deletions doc/usermanual/darkroom/panels/histogram.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
<indexterm>
<primary>RGB parade</primary>
</indexterm>

<indexterm>
<!-- item non useful
<indexterm>
<primary>scopes</primary>
</indexterm>

-->
<sect3>

<title>Overview</title>
Expand Down
2 changes: 1 addition & 1 deletion doc/usermanual/darktable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
]>
<book lang="en">

<title>darktable 3.2</title>
<title>darktable 3.4</title>

<bookinfo>

Expand Down
11,216 changes: 5,914 additions & 5,302 deletions doc/usermanual/po/fr.po

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions packaging/macosx/BUILD.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,23 @@ How to make disk image with darktable application bundle (64 bit Intel only):
(practice showed that support for versions older than 10.7 isn't viable)
and this line to /opt/local/etc/macports/variants.conf:
+no_gnome +no_x11 +quartz -x11 -gnome
You will also need to add patches for gnutls, python (https://trac.macports.org/ticket/51736), GraphicsMagick, ImageMagick, pugixml, librsvg and gmic
You will also need to add patches for gnutls, python (https://trac.macports.org/ticket/51736), GraphicsMagick, ImageMagick, libusb, pugixml, librsvg, and gmic
(all fixes except for gmic are required due to set deployment target, gmic patch removes extra dependencies):
$ mkdir -p ~/ports/devel/gnutls/files ~/ports/lang/python37/files ~/ports/lang/python38/files ~/ports/graphics/GraphicsMagick/files ~/ports/graphics/ImageMagick/files ~/ports/textproc ~/ports/science
$ mkdir -p ~/ports/devel/gnutls/files ~/ports/lang/python{37,38,39}/files ~/ports/graphics/GraphicsMagick/files ~/ports/graphics/ImageMagick/files ~/ports/textproc ~/ports/science
$ cp -R "$(port dir gnutls)" ~/ports/devel
$ curl -Lo ~/ports/devel/gnutls/files/patch.diff https://raw.github.com/darktable-org/darktable/master/packaging/macosx/gnutls-disable-connectx.diff
$ cp -R "$(port dir python37)" ~/ports/lang
$ curl -Lo ~/ports/lang/python37/files/patch.diff https://raw.github.com/darktable-org/darktable/master/packaging/macosx/python36-stack_size.diff
$ cp -R "$(port dir python38)" ~/ports/lang
$ curl -Lo ~/ports/lang/python38/files/patch.diff https://raw.github.com/darktable-org/darktable/master/packaging/macosx/python38-stack_size.diff
$ cp -R "$(port dir python39)" ~/ports/lang
$ curl -Lo ~/ports/lang/python39/files/patch.diff https://raw.github.com/darktable-org/darktable/master/packaging/macosx/python38-stack_size.diff
$ cp -R "$(port dir GraphicsMagick)" ~/ports/graphics
$ curl -Lo ~/ports/graphics/GraphicsMagick/files/patch.diff https://raw.github.com/darktable-org/darktable/master/packaging/macosx/gm-deployment_target.diff
$ cp -R "$(port dir ImageMagick)" ~/ports/graphics
$ curl -Lo ~/ports/graphics/ImageMagick/files/patch.diff https://raw.github.com/darktable-org/darktable/master/packaging/macosx/im-stdlib.diff
$ cp -R "$(port dir libusb)" ~/ports/devel
$ curl -Lo ~/ports/devel/libusb/files/patch.diff https://raw.github.com/darktable-org/darktable/master/packaging/macosx/libusb-no-clock_gettime.diff
$ cp -R "$(port dir pugixml)" ~/ports/textproc
$ curl -L https://raw.github.com/darktable-org/darktable/master/packaging/macosx/pugixml-stdlib.patch | patch -d ~/ports -p0
$ cp -R "$(port dir librsvg)" ~/ports/graphics
Expand Down
24 changes: 24 additions & 0 deletions packaging/macosx/libusb-no-clock_gettime.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
--- configure.ac.orig 2021-01-02 19:30:48.000000000 +0300
+++ configure.ac 2021-01-02 19:32:23.000000000 +0300
@@ -198,21 +198,6 @@
dnl headers not available on all platforms but required on others
AC_CHECK_HEADERS([sys/time.h])

-if test "x$platform" = xposix; then
- dnl the clock_gettime() function needs certain clock IDs defined
- AC_CHECK_FUNCS([clock_gettime], [have_clock_gettime=yes], [have_clock_gettime=])
- if test "x$have_clock_gettime" = xyes; then
- AC_CHECK_DECL([CLOCK_MONOTONIC], [], [AC_MSG_ERROR([C library headers missing definition for CLOCK_MONOTONIC])], [[#include <time.h>]])
- dnl use the monotonic clock for condition variable timed waits if possible
- AC_CHECK_FUNCS([pthread_condattr_setclock], [need_clock_realtime=], [need_clock_realtime=yes])
- if test "x$need_clock_realtime" = xyes; then
- AC_CHECK_DECL([CLOCK_REALTIME], [], [AC_MSG_ERROR([C library headers missing definition for CLOCK_REALTIME])], [[#include <time.h>]])
- fi
- elif test "x$backend" != xdarwin; then
- AC_MSG_ERROR([clock_gettime() is required on this platform])
- fi
-fi
-
dnl eventfd support
if test "x$backend" = xlinux || test "x$backend" = xsunos; then
AC_ARG_ENABLE([eventfd],
6 changes: 3 additions & 3 deletions po/de.po
Original file line number Diff line number Diff line change
Expand Up @@ -4947,7 +4947,7 @@ msgid "do you really want to remove %d image from the collection?"
msgid_plural "do you really want to remove %d images from the collection?"
msgstr[0] "Soll %d Bild aus der Sammlung entfernt werden?"
msgstr[1] ""
"Sollen wirklich %d ausgewählte Bilder aus der Sammlung entfernt werden?"
"Sollen %d ausgewählte Bilder aus der Sammlung entfernt werden?"

#: ../src/control/jobs/control_jobs.c:1507
msgid "remove images?"
Expand All @@ -4965,15 +4965,15 @@ msgid "do you really want to send %d image to trash?"
msgid_plural "do you really want to send %d images to trash?"
msgstr[0] "Soll %d Bild in den Papierkorb verschoben werden?"
msgstr[1] ""
"Soll wirklich %d ausgewähltes Bild in den Papierkorb verschoben werden?"
"Sollen %d ausgewählte Bilder in den Papierkorb verschoben werden?"

#: ../src/control/jobs/control_jobs.c:1545
#, c-format
msgid "do you really want to physically delete %d image from disk?"
msgid_plural "do you really want to physically delete %d images from disk?"
msgstr[0] "Soll %d Bild physisch von der Festplatte gelöscht werden?"
msgstr[1] ""
"Soll wirklich %d ausgewähltes Bild physisch von der Festplatte gelöscht "
"Sollen %d ausgewählte Bilder physisch von der Festplatte gelöscht "
"werden?"

#: ../src/control/jobs/control_jobs.c:1552
Expand Down
107 changes: 64 additions & 43 deletions po/it.po

Large diffs are not rendered by default.

1,072 changes: 538 additions & 534 deletions po/pt_BR.po

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/bauhaus/bauhaus.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ static void combobox_popup_scroll(int amt)
GtkAllocation allocation_w;
gtk_widget_get_allocation(w, &allocation_w);
const int ht = allocation_w.height;
const int skip = ht;
const int skip = darktable.bauhaus->line_height;
gdk_window_get_origin(gtk_widget_get_window(w), &wx, &wy);
const dt_bauhaus_combobox_data_t *d = &darktable.bauhaus->current->data.combobox;
int new_value = CLAMP(d->active + amt, 0, d->num_labels - 1);
Expand Down Expand Up @@ -856,7 +856,7 @@ void dt_bauhaus_slider_enable_soft_boundaries(GtkWidget *widget, float hard_min,

void dt_bauhaus_widget_set_label(GtkWidget *widget, const char *section_orig, const char *label_orig)
{
const char *section = _(section_orig);
const char *section = section_orig ? _(section_orig) : NULL;
const char *label = _(label_orig);

dt_bauhaus_widget_t *w = DT_BAUHAUS_WIDGET(widget);
Expand Down Expand Up @@ -2100,7 +2100,7 @@ void dt_bauhaus_show_popup(dt_bauhaus_widget_t *w)
GtkAllocation allocation_w;
gtk_widget_get_allocation(GTK_WIDGET(w), &allocation_w);
const int ht = allocation_w.height;
const int skip = ht + darktable.bauhaus->line_height;
const int skip = darktable.bauhaus->line_height;
offset = -d->active * darktable.bauhaus->line_height;
darktable.bauhaus->mouse_x = 0;
darktable.bauhaus->mouse_y = d->active * skip + ht / 2;
Expand Down
11 changes: 9 additions & 2 deletions src/common/collection.c
Original file line number Diff line number Diff line change
Expand Up @@ -1369,13 +1369,19 @@ void dt_collection_get_makermodels(const gchar *filter, GList **sanitized, GList
{
sqlite3_stmt *stmt;
gchar *needle = NULL;
gboolean wildcard = FALSE;

GHashTable *names = NULL;
if (sanitized)
names = g_hash_table_new(g_str_hash, g_str_equal);

if (filter && filter[0] != '\0')
{
needle = g_utf8_strdown(filter, -1);
wildcard = (needle && needle[strlen(needle) - 1] == '%') ? TRUE : FALSE;
if(wildcard)
needle[strlen(needle) - 1] = '\0';
}

DT_DEBUG_SQLITE3_PREPARE_V2(dt_database_get(darktable.db),
"SELECT maker, model FROM main.images GROUP BY maker, model",
Expand All @@ -1388,7 +1394,8 @@ void dt_collection_get_makermodels(const gchar *filter, GList **sanitized, GList
gchar *makermodel = dt_collection_get_makermodel(exif_maker, exif_model);

gchar *haystack = g_utf8_strdown(makermodel, -1);
if (!needle || g_strrstr(haystack, needle) != NULL)
if (!needle || (wildcard && g_strrstr(haystack, needle) != NULL)
|| (!wildcard && !g_strcmp0(haystack, needle)))
{
if (exif)
{
Expand Down Expand Up @@ -1720,7 +1727,7 @@ static gchar *get_query_string(const dt_collection_properties_t property, const
for (l = list; l != NULL; l = l->next)
l->data = dt_util_dstrcat(query, "(filename LIKE '%%%s%%')", (char *)l->data);

query = dt_util_glist_to_str(" OR ", list);
query = dt_util_dstrcat(NULL, "(%s)", dt_util_glist_to_str(" OR ", list));
g_list_free(list);

break;
Expand Down
26 changes: 2 additions & 24 deletions src/common/colorspaces.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "common/darktable.h"
#include "common/debug.h"
#include "common/file_location.h"
#include "common/math.h"
#include "common/srgb_tone_curve_values.h"
#include "control/conf.h"
#include "control/control.h"
Expand Down Expand Up @@ -139,29 +140,6 @@ generate_mat3inv_body(double, A, B)
#undef generate_mat3inv_body


static void mat3mulv(float *dst, const float *const mat, const float *const v)
{
for(int k = 0; k < 3; k++)
{
float x = 0.0f;
for(int i = 0; i < 3; i++) x += mat[3 * k + i] * v[i];
dst[k] = x;
}
}

static void mat3mul(float *dst, const float *const m1, const float *const m2)
{
for(int k = 0; k < 3; k++)
{
for(int i = 0; i < 3; i++)
{
float x = 0.0f;
for(int j = 0; j < 3; j++) x += m1[3 * k + j] * m2[3 * j + i];
dst[3 * k + i] = x;
}
}
}

static const dt_colorspaces_color_profile_t *_get_profile(dt_colorspaces_t *self,
dt_colorspaces_color_profile_type_t type,
const char *filename,
Expand Down Expand Up @@ -315,7 +293,7 @@ static cmsHPROFILE _create_lcms_profile(const char *desc, const char *dmdd,
cmsToneCurve *out_curves[3] = { trc, trc, trc };
cmsHPROFILE profile = cmsCreateRGBProfile(whitepoint, primaries, out_curves);

if(v2) cmsSetProfileVersion(profile, 2.1);
if(v2) cmsSetProfileVersion(profile, 2.4);

cmsSetHeaderFlags(profile, cmsEmbeddedProfileTrue);

Expand Down
2 changes: 1 addition & 1 deletion src/common/database.c
Original file line number Diff line number Diff line change
Expand Up @@ -1330,7 +1330,7 @@ static int _upgrade_library_schema_step(dt_database_t *db, int version)
}

g_list_free(item_list);
g_list_free(iop_order_list);
g_list_free_full(iop_order_list, free);

item_list = NULL;
}
Expand Down
7 changes: 5 additions & 2 deletions src/common/dtpthread.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ static inline double dt_pthread_get_wtime()


#define TOPN 3
typedef struct dt_pthread_mutex_t
typedef struct CAPABILITY("mutex") dt_pthread_mutex_t
{
pthread_mutex_t mutex;
char name[256];
Expand All @@ -52,7 +52,7 @@ typedef struct dt_pthread_mutex_t
double top_locked_sum[TOPN];
char top_wait_name[TOPN][256];
double top_wait_sum[TOPN];
} dt_pthread_mutex_t;
} CAPABILITY("mutex") dt_pthread_mutex_t;

typedef struct dt_pthread_rwlock_t
{
Expand Down Expand Up @@ -108,6 +108,7 @@ static inline int dt_pthread_mutex_init_with_caller(dt_pthread_mutex_t *mutex,
#define dt_pthread_mutex_lock(A) dt_pthread_mutex_lock_with_caller(A, __FILE__, __LINE__, __FUNCTION__)
static inline int dt_pthread_mutex_lock_with_caller(dt_pthread_mutex_t *mutex, const char *file,
const int line, const char *function)
ACQUIRE(mutex) NO_THREAD_SAFETY_ANALYSIS
{
const double t0 = dt_pthread_get_wtime();
const int ret = pthread_mutex_lock(&(mutex->mutex));
Expand Down Expand Up @@ -135,6 +136,7 @@ static inline int dt_pthread_mutex_lock_with_caller(dt_pthread_mutex_t *mutex, c
#define dt_pthread_mutex_trylock(A) dt_pthread_mutex_trylock_with_caller(A, __FILE__, __LINE__, __FUNCTION__)
static inline int dt_pthread_mutex_trylock_with_caller(dt_pthread_mutex_t *mutex, const char *file,
const int line, const char *function)
TRY_ACQUIRE(0, mutex)
{
const double t0 = dt_pthread_get_wtime();
const int ret = pthread_mutex_trylock(&(mutex->mutex));
Expand Down Expand Up @@ -163,6 +165,7 @@ static inline int dt_pthread_mutex_trylock_with_caller(dt_pthread_mutex_t *mutex
#define dt_pthread_mutex_unlock(A) dt_pthread_mutex_unlock_with_caller(A, __FILE__, __LINE__, __FUNCTION__)
static inline int dt_pthread_mutex_unlock_with_caller(dt_pthread_mutex_t *mutex, const char *file,
const int line, const char *function)
RELEASE(mutex) NO_THREAD_SAFETY_ANALYSIS
{
const double t0 = dt_pthread_get_wtime();
const double locked = t0 - mutex->time_locked;
Expand Down
43 changes: 18 additions & 25 deletions src/common/exif.cc
Original file line number Diff line number Diff line change
Expand Up @@ -711,19 +711,6 @@ static void _find_datetime_taken(Exiv2::ExifData &exifData, Exiv2::ExifData::con
}
}

static void mat3mul(float *dst, const float *const m1, const float *const m2)
{
for(int k = 0; k < 3; k++)
{
for(int i = 0; i < 3; i++)
{
float x = 0.0f;
for(int j = 0; j < 3; j++) x += m1[3 * k + j] * m2[3 * j + i];
dst[3 * k + i] = x;
}
}
}

static bool _exif_decode_exif_data(dt_image_t *img, Exiv2::ExifData &exifData)
{
try
Expand Down Expand Up @@ -1074,7 +1061,10 @@ static bool _exif_decode_exif_data(dt_image_t *img, Exiv2::ExifData &exifData)
if(FIND_EXIF_TAG("Exif.Photo.UserComment"))
{
std::string str = pos->print(&exifData);
dt_metadata_set_import(img->id, "Xmp.dc.description", str.c_str());
Exiv2::CommentValue value(str);
std::string str2 = value.comment();
if(str2 != "binary comment")
dt_metadata_set_import(img->id, "Xmp.dc.description", str2.c_str());
}

if(FIND_EXIF_TAG("Exif.Image.Copyright"))
Expand Down Expand Up @@ -2215,7 +2205,7 @@ static GList *read_history_v1(const std::string &xmpPacket, const char *filename
doc.select_node("//darktable:multi_priority/rdf:Seq");
pugi::xpath_node multi_name = superold ?
doc.select_node("//darktable:multi_name/rdf:Bag"):
doc.select_node("//darktable:multi_name/rdf:Bag");
doc.select_node("//darktable:multi_name/rdf:Seq");
#else
pugi::xpath_node modversion = superold ?
doc.select_single_node("//darktable:history_modversion/rdf:Bag"):
Expand All @@ -2240,7 +2230,7 @@ static GList *read_history_v1(const std::string &xmpPacket, const char *filename
doc.select_single_node("//darktable:multi_priority/rdf:Seq");
pugi::xpath_node multi_name = superold ?
doc.select_single_node("//darktable:multi_name/rdf:Bag"):
doc.select_single_node("//darktable:multi_name/rdf:Bag");
doc.select_single_node("//darktable:multi_name/rdf:Seq");
#endif

// fill the list of history entries. we are iterating over history_operation as we know that it's there.
Expand Down Expand Up @@ -3613,17 +3603,20 @@ static void _exif_xmp_read_data_export(Exiv2::XmpData &xmpData, const int imgid,
}
g_list_free_full(iop_list, free);

// Store datetime_taken as DateTimeOriginal to take into account the user's selected date/time
if (!(metadata->flags & DT_META_EXIF))
xmpData["Xmp.exif.DateTimeOriginal"] = datetime_taken;
if(metadata->flags & DT_META_METADATA)
{
// Store datetime_taken as DateTimeOriginal to take into account the user's selected date/time
if (!(metadata->flags & DT_META_EXIF))
xmpData["Xmp.exif.DateTimeOriginal"] = datetime_taken;

// We have to erase the old ratings first as exiv2 seems to not change it otherwise.
Exiv2::XmpData::iterator pos = xmpData.findKey(Exiv2::XmpKey("Xmp.xmp.Rating"));
if(pos != xmpData.end()) xmpData.erase(pos);
xmpData["Xmp.xmp.Rating"] = dt_image_get_xmp_rating_from_flags(stars);
// We have to erase the old ratings first as exiv2 seems to not change it otherwise.
Exiv2::XmpData::iterator pos = xmpData.findKey(Exiv2::XmpKey("Xmp.xmp.Rating"));
if(pos != xmpData.end()) xmpData.erase(pos);
xmpData["Xmp.xmp.Rating"] = dt_image_get_xmp_rating_from_flags(stars);

// The original file name
if(filename) xmpData["Xmp.xmpMM.DerivedFrom"] = filename;
// The original file name
if(filename) xmpData["Xmp.xmpMM.DerivedFrom"] = filename;
}

// GPS data
if (metadata->flags & DT_META_GEOTAG)
Expand Down
14 changes: 8 additions & 6 deletions src/common/file_location.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,31 +207,33 @@ void dt_loc_init_plugindir(const char* application_directory, const char *plugin
dt_check_opendir("darktable.plugindir", darktable.plugindir);
}

void dt_check_opendir(const char* text, const char* directory)
void dt_check_opendir(const char* context, const char* directory)
{
if (!directory)
{
fprintf(stderr, "directory for %s has not been set.\n", text);
fprintf(stderr, "directory for %s has not been set.\n", context);
exit(EXIT_FAILURE);
}

#if _WIN32
DWORD attribs = GetFileAttributesA(directory);
wchar_t *wdirectory = g_utf8_to_utf16 (directory, -1, NULL, NULL, NULL);
DWORD attribs = GetFileAttributesW(wdirectory);
g_free(wdirectory);
if (attribs != INVALID_FILE_ATTRIBUTES &&
(attribs & FILE_ATTRIBUTE_DIRECTORY))
{
dt_print(DT_DEBUG_DEV, "%s: %s\n", text, directory);
dt_print(DT_DEBUG_DEV, "%s: %s\n", context, directory);
}
else
{
fprintf(stderr, "%s: directory '%s' fails to open.'\n", text, directory);
fprintf(stderr, "%s: directory '%s' fails to open.'\n", context, directory);
exit(EXIT_FAILURE);
}
#else
DIR* dir = opendir(directory);
if (dir)
{
dt_print(DT_DEBUG_DEV, "%s: %s\n", text, directory);
dt_print(DT_DEBUG_DEV, "%s: %s\n", context, directory);
closedir(dir);
}
else
Expand Down
2 changes: 2 additions & 0 deletions src/common/guided_filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#pragma once

#if defined(__SSE__)
#ifdef __PPC64__
#ifdef NO_WARN_X86_INTRINSICS
#include <xmmintrin.h>
Expand All @@ -29,6 +30,7 @@
#else
#include <xmmintrin.h>
#endif // __PPC64__
#endif

#include "common/darktable.h"
#include "common/opencl.h"
Expand Down
37 changes: 22 additions & 15 deletions src/common/history.c
Original file line number Diff line number Diff line change
Expand Up @@ -1353,31 +1353,38 @@ static gsize _history_hash_compute_from_db(const int32_t imgid, guint8 **hash)
}
sqlite3_finalize(stmt);

// get history
// get history. the active history for an image are all the latest operations (MAX(num))
// which are enabled. this is important here as we want the hash to represent the actual
// developement of the image.
gboolean history_on = FALSE;
DT_DEBUG_SQLITE3_PREPARE_V2(dt_database_get(darktable.db),
"SELECT operation, op_params, blendop_params"
"SELECT operation, op_params, blendop_params, enabled, MAX(num)"
" FROM main.history"
" WHERE imgid = ?1 AND enabled = 1 AND num <= ?2"
" WHERE imgid = ?1 AND num <= ?2"
" GROUP BY operation, multi_priority"
" ORDER BY num",
-1, &stmt, NULL);
DT_DEBUG_SQLITE3_BIND_INT(stmt, 1, imgid);
DT_DEBUG_SQLITE3_BIND_INT(stmt, 2, history_end);

while(sqlite3_step(stmt) == SQLITE_ROW)
{
// operation
char *buf = (char *)sqlite3_column_text(stmt, 0);
if(buf) g_checksum_update(checksum, (const guchar *)buf, -1);
// op_params
buf = (char *)sqlite3_column_blob(stmt, 1);
int params_len = sqlite3_column_bytes(stmt, 1);
if(buf) g_checksum_update(checksum, (const guchar *)buf, params_len);
// blendop_params
buf = (char *)sqlite3_column_blob(stmt, 2);
params_len = sqlite3_column_bytes(stmt, 2);
if(buf) g_checksum_update(checksum, (const guchar *)buf, params_len);
history_on = TRUE;
const int enabled = sqlite3_column_int(stmt, 3);
if(enabled)
{
// operation
char *buf = (char *)sqlite3_column_text(stmt, 0);
if(buf) g_checksum_update(checksum, (const guchar *)buf, -1);
// op_params
buf = (char *)sqlite3_column_blob(stmt, 1);
int params_len = sqlite3_column_bytes(stmt, 1);
if(buf) g_checksum_update(checksum, (const guchar *)buf, params_len);
// blendop_params
buf = (char *)sqlite3_column_blob(stmt, 2);
params_len = sqlite3_column_bytes(stmt, 2);
if(buf) g_checksum_update(checksum, (const guchar *)buf, params_len);
history_on = TRUE;
}
}
sqlite3_finalize(stmt);

Expand Down
11 changes: 6 additions & 5 deletions src/common/image.c
Original file line number Diff line number Diff line change
Expand Up @@ -1189,7 +1189,7 @@ GList* dt_image_find_duplicates(const char* filename)
}

// Search for duplicate's sidecar files and import them if found and not in DB yet
static void _image_read_duplicates(const uint32_t id, const char *filename)
static int _image_read_duplicates(const uint32_t id, const char *filename)
{
int count_xmps_processed = 0;
gchar pattern[PATH_MAX] = { 0 };
Expand Down Expand Up @@ -1274,6 +1274,7 @@ static void _image_read_duplicates(const uint32_t id, const char *filename)
}

g_list_free_full(files, g_free);
return count_xmps_processed;
}

static uint32_t _image_import_internal(const int32_t film_id, const char *filename,
Expand Down Expand Up @@ -1504,7 +1505,10 @@ static uint32_t _image_import_internal(const int32_t film_id, const char *filena
// write through to db, but not to xmp.
dt_image_cache_write_release(darktable.image_cache, img, DT_IMAGE_CACHE_RELAXED);

if(res != 0)
// read all sidecar files
const int nb_xmp = _image_read_duplicates(id, normalized_filename);

if((res != 0) && (nb_xmp == 0))
{
// Search for Lightroom sidecar file, import tags if found
dt_lightroom_import(id, NULL, TRUE);
Expand All @@ -1523,9 +1527,6 @@ static uint32_t _image_import_internal(const int32_t film_id, const char *filena
// make sure that there are no stale thumbnails left
dt_mipmap_cache_remove(darktable.mipmap_cache, id);

// read all sidecar files
_image_read_duplicates(id, normalized_filename);

//synch database entries to xmp
dt_image_synch_all_xmp(normalized_filename);

Expand Down
9 changes: 8 additions & 1 deletion src/common/imageio_gm.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,14 @@ dt_imageio_retval_t dt_imageio_open_gm(dt_image_t *img, const char *filename, dt
goto error;
}

fprintf(stderr, "[GraphicsMagick_open] image `%s' loading\n", img->filename);
dt_print(DT_DEBUG_IMAGEIO, "[GraphicsMagick_open] image `%s' loading\n", img->filename);

if(IsCMYKColorspace(image->colorspace))
{
fprintf(stderr, "[GraphicsMagick_open] error: CMYK images are not supported.\n");
err = DT_IMAGEIO_FILE_CORRUPTED;
goto error;
}

width = image->columns;
height = image->rows;
Expand Down
13 changes: 12 additions & 1 deletion src/common/imageio_im.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,18 @@ dt_imageio_retval_t dt_imageio_open_im(dt_image_t *img, const char *filename, dt
err = DT_IMAGEIO_FILE_NOT_FOUND;
goto error;
}
fprintf(stderr, "[ImageMagick_open] image `%s' loading\n", img->filename);
dt_print(DT_DEBUG_IMAGEIO, "[ImageMagick_open] image `%s' loading\n", img->filename);

ColorspaceType colorspace;

colorspace = MagickGetImageColorspace(image);

if((colorspace == CMYColorspace) || (colorspace == CMYKColorspace))
{
fprintf(stderr, "[ImageMagick_open] error: CMY(K) images are not supported.\n");
err = DT_IMAGEIO_FILE_CORRUPTED;
goto error;
}

img->width = MagickGetImageWidth(image);
img->height = MagickGetImageHeight(image);
Expand Down
16 changes: 14 additions & 2 deletions src/common/imageio_tiff.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,10 @@ static void _warning_error_handler(const char *type, const char* module, const c

static void _warning_handler(const char* module, const char* fmt, va_list ap)
{
_warning_error_handler("warning", module, fmt, ap);
if(darktable.unmuted & DT_DEBUG_IMAGEIO)
{
_warning_error_handler("warning", module, fmt, ap);
}
}

static void _error_handler(const char* module, const char* fmt, va_list ap)
Expand All @@ -331,6 +334,7 @@ dt_imageio_retval_t dt_imageio_open_tiff(dt_image_t *img, const char *filename,
tiff_t t;
uint16_t config;
uint16_t photometric;
uint16_t inkset;

t.image = img;

Expand All @@ -351,12 +355,20 @@ dt_imageio_retval_t dt_imageio_open_tiff(dt_image_t *img, const char *filename,
TIFFGetFieldDefaulted(t.tiff, TIFFTAG_SAMPLEFORMAT, &t.sampleformat);
TIFFGetField(t.tiff, TIFFTAG_PLANARCONFIG, &config);
TIFFGetField(t.tiff, TIFFTAG_PHOTOMETRIC, &photometric);
TIFFGetField(t.tiff, TIFFTAG_INKSET, &inkset);

if(inkset == INKSET_CMYK || inkset == INKSET_MULTIINK)
{
fprintf(stderr, "[tiff_open] error: CMYK (or multiink) TIFFs are not supported.\n");
TIFFClose(t.tiff);
return DT_IMAGEIO_FILE_CORRUPTED;
}

if(TIFFRasterScanlineSize(t.tiff) != TIFFScanlineSize(t.tiff)) return DT_IMAGEIO_FILE_CORRUPTED;

t.scanlinesize = TIFFScanlineSize(t.tiff);

dt_print(DT_DEBUG_CAMERA_SUPPORT, "[tiff_open] %dx%d %dbpp, %d samples per pixel.\n", t.width, t.height, t.bpp, t.spp);
dt_print(DT_DEBUG_IMAGEIO, "[tiff_open] %dx%d %dbpp, %d samples per pixel.\n", t.width, t.height, t.bpp, t.spp);

// we only support 8/16 and 32 bits per pixel formats.
if(t.bpp != 8 && t.bpp != 16 && t.bpp != 32)
Expand Down
48 changes: 14 additions & 34 deletions src/common/iop_profile.h
Original file line number Diff line number Diff line change
Expand Up @@ -234,40 +234,20 @@ static inline float eval_exp(const float coeff[3], const float x)

#ifdef _OPENMP
#pragma omp declare simd \
aligned(rgb_in, rgb_out, unbounded_coeffs_in:16) \
aligned(lut_in:64) \
uniform(rgb_in, rgb_out, unbounded_coeffs_in, lut_in)
#endif
static inline void _apply_trc_in(const float rgb_in[3], float rgb_out[3],
float *const lut_in[3],
const float unbounded_coeffs_in[3][3],
const int lutsize)
{
for(int c = 0; c < 3; c++)
{
rgb_out[c] = (lut_in[c][0] >= 0.0f) ? ((rgb_in[c] < 1.0f) ? extrapolate_lut(lut_in[c], rgb_in[c], lutsize)
: eval_exp(unbounded_coeffs_in[c], rgb_in[c]))
: rgb_in[c];
}
}


#ifdef _OPENMP
#pragma omp declare simd \
aligned(rgb_in, rgb_out, unbounded_coeffs_out:16) \
aligned(lut_out:64) \
uniform(rgb_in, rgb_out, unbounded_coeffs_out, lut_out)
aligned(rgb_in, rgb_out, unbounded_coeffs:16) \
aligned(lut:64) \
uniform(rgb_in, rgb_out, unbounded_coeffs, lut)
#endif
static inline void _apply_trc_out(const float rgb_in[3], float rgb_out[3],
float *const lut_out[3],
const float unbounded_coeffs_out[3][3],
const int lutsize)
static inline void _apply_trc(const float rgb_in[3], float rgb_out[3],
float *const lut[3],
const float unbounded_coeffs[3][3],
const int lutsize)
{
for(int c = 0; c < 3; c++)
{
rgb_out[c] = (lut_out[c][0] >= 0.0f) ? ((rgb_in[c] < 1.0f) ? extrapolate_lut(lut_out[c], rgb_in[c], lutsize)
: eval_exp(unbounded_coeffs_out[c], rgb_in[c]))
: rgb_in[c];
rgb_out[c] = (lut[c][0] >= 0.0f) ? ((rgb_in[c] < 1.0f) ? extrapolate_lut(lut[c], rgb_in[c], lutsize)
: eval_exp(unbounded_coeffs[c], rgb_in[c]))
: rgb_in[c];
}
}

Expand Down Expand Up @@ -320,7 +300,7 @@ static inline float dt_ioppr_get_rgb_matrix_luminance(const float rgb[3],
if(nonlinearlut)
{
float linear_rgb[3] DT_ALIGNED_PIXEL;
_apply_trc_in(rgb, linear_rgb, lut_in, unbounded_coeffs_in, lutsize);
_apply_trc(rgb, linear_rgb, lut_in, unbounded_coeffs_in, lutsize);
luminance = matrix_in[3] * linear_rgb[0] + matrix_in[4] * linear_rgb[1] + matrix_in[5] * linear_rgb[2];
}
else
Expand All @@ -344,7 +324,7 @@ static inline void dt_ioppr_rgb_matrix_to_xyz(const float rgb[3], float xyz[3],
if(nonlinearlut)
{
float linear_rgb[3] DT_ALIGNED_PIXEL;
_apply_trc_in(rgb, linear_rgb, lut_in, unbounded_coeffs_in, lutsize);
_apply_trc(rgb, linear_rgb, lut_in, unbounded_coeffs_in, lutsize);
_ioppr_linear_rgb_matrix_to_xyz(linear_rgb, xyz, matrix_in);
}
else
Expand All @@ -366,7 +346,7 @@ static inline void dt_ioppr_xyz_to_rgb_matrix(const float xyz[3], float rgb[3],
{
float linear_rgb[3] DT_ALIGNED_PIXEL;
_ioppr_xyz_to_linear_rgb_matrix(xyz, linear_rgb, matrix_out);
_apply_trc_out(linear_rgb, rgb, lut_out, unbounded_coeffs_out, lutsize);
_apply_trc(linear_rgb, rgb, lut_out, unbounded_coeffs_out, lutsize);
}
else
_ioppr_xyz_to_linear_rgb_matrix(xyz, rgb, matrix_out);
Expand All @@ -391,7 +371,7 @@ static inline void dt_ioppr_lab_to_rgb_matrix(const float lab[3], float rgb[3],
{
float linear_rgb[3] DT_ALIGNED_PIXEL;
_ioppr_xyz_to_linear_rgb_matrix(xyz, linear_rgb, matrix_out);
_apply_trc_out(linear_rgb, rgb, lut_out, unbounded_coeffs_out, lutsize);
_apply_trc(linear_rgb, rgb, lut_out, unbounded_coeffs_out, lutsize);
}
else
{
Expand Down
104 changes: 104 additions & 0 deletions src/common/math.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,114 @@

#pragma once

#include <math.h>
#include <stdint.h>

// work around missing standard math.h symbols
/** ln(10) */
#ifndef M_LN10
#define M_LN10 2.30258509299404568402
#endif /* !M_LN10 */

/** PI */
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif /* !M_PI */


#define DT_M_PI_F (3.14159265358979324f)
#define DT_M_PI (3.14159265358979324)

#define DT_M_LN2f (0.6931471805599453f)

static inline float clamp_range_f(const float x, const float low, const float high)
{
return x > high ? high : (x < low ? low : x);
}

static inline float Log2(float x)
{
if(x > 0.0f)
{
return logf(x) / logf(2.0f);
}
else
{
return x;
}
}

static inline float Log2Thres(float x, float Thres)
{
if(x > Thres)
{
return logf(x) / logf(2.0f);
}
else
{
return logf(Thres) / logf(2.0f);
}
}

// ensure that any changes here are synchronized with data/kernels/extended.cl
static inline float fastlog2(float x)
{
union { float f; uint32_t i; } vx = { x };
union { uint32_t i; float f; } mx = { (vx.i & 0x007FFFFF) | 0x3f000000 };

float y = vx.i;

y *= 1.1920928955078125e-7f;

return y - 124.22551499f
- 1.498030302f * mx.f
- 1.72587999f / (0.3520887068f + mx.f);
}

// ensure that any changes here are synchronized with data/kernels/extended.cl
static inline float
fastlog (float x)
{
return 0.69314718f * fastlog2 (x);
}

// multiply 3x3 matrix with 3x1 vector
// dest needs to be different from v
static inline void mat3mulv(float *const __restrict__ dest, const float *const mat, const float *const __restrict__ v)
{
for(int k = 0; k < 3; k++)
{
float x = 0.0f;
for(int i = 0; i < 3; i++)
x += mat[3 * k + i] * v[i];
dest[k] = x;
}
}

// multiply two 3x3 matrices
// dest needs to be different from m1 and m2
static inline void mat3mul(float *const __restrict__ dest, const float *const __restrict__ m1, const float *const __restrict__ m2)
{
for(int k = 0; k < 3; k++)
{
for(int i = 0; i < 3; i++)
{
float x = 0.0f;
for(int j = 0; j < 3; j++)
x += m1[3 * k + j] * m2[3 * j + i];
dest[3 * k + i] = x;
}
}
}

static inline void mul_mat_vec_2(const float *m, const float *p, float *o)
{
o[0] = p[0] * m[0] + p[1] * m[1];
o[1] = p[0] * m[2] + p[1] * m[3];
}


// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.sh
// vim: shiftwidth=2 expandtab tabstop=2 cindent
// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;

23 changes: 1 addition & 22 deletions src/common/matrices.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
along with darktable. If not, see <http://www.gnu.org/licenses/>.
*/

#include "common/math.h"
#include "common/matrices.h"

/** inverts the given 3x3 matrix */
Expand Down Expand Up @@ -49,28 +50,6 @@ int mat3inv(float *const dst, const float *const src)
return 0;
}

static void mat3mulv(float *dst, const float *const mat, const float *const v)
{
for(int k = 0; k < 3; k++)
{
float x = 0.0f;
for(int i = 0; i < 3; i++) x += mat[3 * k + i] * v[i];
dst[k] = x;
}
}

static void mat3mul(float *dst, const float *const m1, const float *const m2)
{
for(int k = 0; k < 3; k++)
{
for(int i = 0; i < 3; i++)
{
float x = 0.0f;
for(int j = 0; j < 3; j++) x += m1[3 * k + j] * m2[3 * j + i];
dst[3 * k + i] = x;
}
}
}
// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.sh
// vim: shiftwidth=2 expandtab tabstop=2 cindent
// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
3 changes: 3 additions & 0 deletions src/common/presets.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,9 @@ static int get_preset_element_float(xmlDocPtr doc, gchar *name)
int dt_presets_import_from_file(const char *preset_path)
{
xmlDocPtr doc = xmlParseFile(preset_path);
if(!doc)
return FALSE;

gchar *name = get_preset_element(doc, "name");
gchar *description = get_preset_element(doc, "description");
gchar *operation = get_preset_element(doc, "operation");
Expand Down
2 changes: 1 addition & 1 deletion src/common/undo.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ typedef enum dt_undo_type_t
DT_UNDO_METADATA = 1 << 6,
DT_UNDO_LT_HISTORY = 1 << 7,
DT_UNDO_FLAGS = 1 << 8,
DT_UNDO_DEVELOP = DT_UNDO_HISTORY | DT_UNDO_MASK | DT_UNDO_TAGS,
DT_UNDO_DEVELOP = DT_UNDO_HISTORY | DT_UNDO_MASK | DT_UNDO_TAGS | DT_UNDO_RATINGS | DT_UNDO_COLORLABELS,
DT_UNDO_LIGHTTABLE = DT_UNDO_RATINGS | DT_UNDO_COLORLABELS | DT_UNDO_TAGS | DT_UNDO_METADATA
| DT_UNDO_LT_HISTORY | DT_UNDO_GEOTAG | DT_UNDO_FLAGS,
DT_UNDO_MAP = DT_UNDO_GEOTAG | DT_UNDO_TAGS,
Expand Down
62 changes: 31 additions & 31 deletions src/common/usermanual_url.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
This file is part of darktable,
Copyright (C) 2018-2020 darktable developers.
Copyright (C) 2018-2021 darktable developers.

darktable is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -67,64 +67,64 @@ char *dt_get_help_url(char *name)
if(!strcmp(name, "softproof")) return "darkroom_bottom_panel.html#softproof";
if(!strcmp(name, "gamut")) return "darkroom_bottom_panel.html#gamutcheck";
// iop links
if(!strcmp(name, "ashift")) return "technical_group.html#perspective_correction";
if(!strcmp(name, "ashift")) return "modules.html#perspective_correction";
if(!strcmp(name, "atrous")) return "effects_group.html#equalizer";
if(!strcmp(name, "basecurve")) return "technical_group.html#base_curve";
if(!strcmp(name, "bilateral")) return "technical_group.html#denoise_bilateral";
if(!strcmp(name, "basecurve")) return "modules.html#base_curve";
if(!strcmp(name, "bilateral")) return "modules.html#denoise_bilateral";
if(!strcmp(name, "bilat")) return "effects_group.html#local_contrast";
if(!strcmp(name, "bloom")) return "effects_group.html#bloom";
if(!strcmp(name, "borders")) return "effects_group.html#framing";
if(!strcmp(name, "cacorrect")) return "technical_group.html#chromatic_aberrations";
if(!strcmp(name, "cacorrect")) return "modules.html#chromatic_aberrations";
if(!strcmp(name, "channelmixer")) return "grading_group.html#channel_mixer";
if(!strcmp(name, "clahe")) return NULL; // deprecated, replaced by bilat.c
if(!strcmp(name, "clipping")) return "technical_group.html#crop_and_rotate";
if(!strcmp(name, "clipping")) return "modules.html#crop_and_rotate";
if(!strcmp(name, "colisa")) return "grading_group.html#contrast_brightness_saturation";
if(!strcmp(name, "colorbalance")) return "grading_group.html#color_balance";
if(!strcmp(name, "colorchecker")) return "technical_group.html#color_look_up_table";
if(!strcmp(name, "colorchecker")) return "modules.html#color_look_up_table";
if(!strcmp(name, "colorcontrast")) return "grading_group.html#color_contrast";
if(!strcmp(name, "colorcorrection")) return "grading_group.html#color_correction";
if(!strcmp(name, "colorin")) return "technical_group.html#input_color_profile";
if(!strcmp(name, "colorin")) return "modules.html#input_color_profile";
if(!strcmp(name, "colorize")) return "grading_group.html#colorize";
if(!strcmp(name, "colormapping")) return "effects_group.html#color_mapping";
if(!strcmp(name, "colorout")) return "technical_group.html#output_color_profile";
if(!strcmp(name, "colorreconstruct")) return "technical_group.html#color_reconstruction";
if(!strcmp(name, "colorout")) return "modules.html#output_color_profile";
if(!strcmp(name, "colorreconstruct")) return "modules.html#color_reconstruction";
if(!strcmp(name, "colortransfer")) return NULL; // deprecated
if(!strcmp(name, "colorzones")) return "grading_group.html#color_zones";
if(!strcmp(name, "defringe")) return "technical_group.html#defringe";
if(!strcmp(name, "demosaic")) return "technical_group.html#demosaic";
if(!strcmp(name, "denoiseprofile")) return "technical_group.html#denoise_profiled";
if(!strcmp(name, "dither")) return "technical_group.html#dithering";
if(!strcmp(name, "defringe")) return "modules.html#defringe";
if(!strcmp(name, "demosaic")) return "modules.html#demosaic";
if(!strcmp(name, "denoiseprofile")) return "modules.html#denoise_profiled";
if(!strcmp(name, "dither")) return "modules.html#dithering";
if(!strcmp(name, "equalizer")) return NULL; // deprecated, replaced by atrous.c
if(!strcmp(name, "exposure")) return "technical_group.html#exposure";
if(!strcmp(name, "filmic")) return "technical_group.html#filmic";
if(!strcmp(name, "filmicrgb")) return "technical_group.html#filmic";
if(!strcmp(name, "flip")) return "technical_group.html#orientation";
if(!strcmp(name, "exposure")) return "modules.html#exposure";
if(!strcmp(name, "filmic")) return "modules.html#filmic";
if(!strcmp(name, "filmicrgb")) return "modules.html#filmic";
if(!strcmp(name, "flip")) return "modules.html#orientation";
if(!strcmp(name, "globaltonemap")) return "grading_group.html#global_tonemap";
if(!strcmp(name, "graduatednd")) return "grading_group.html#graduated_density";
if(!strcmp(name, "grain")) return "effects_group.html#grain";
if(!strcmp(name, "hazeremoval")) return "technical_group.html#haze_removal";
if(!strcmp(name, "highlights")) return "technical_group.html#highlight_reconstruction";
if(!strcmp(name, "hazeremoval")) return "modules.html#haze_removal";
if(!strcmp(name, "highlights")) return "modules.html#highlight_reconstruction";
if(!strcmp(name, "highpass")) return "effects_group.html#highpass";
if(!strcmp(name, "hotpixels")) return "technical_group.html#hotpixels";
if(!strcmp(name, "invert")) return "technical_group.html#invert";
if(!strcmp(name, "lens")) return "technical_group.html#lens_correction";
if(!strcmp(name, "hotpixels")) return "modules.html#hotpixels";
if(!strcmp(name, "invert")) return "modules.html#invert";
if(!strcmp(name, "lens")) return "modules.html#lens_correction";
if(!strcmp(name, "levels")) return "grading_group.html#levels";
if(!strcmp(name, "liquify")) return "effects_group.html#liquify";
if(!strcmp(name, "lowlight")) return "effects_group.html#low_light";
if(!strcmp(name, "lowpass")) return "effects_group.html#lowpass";
if(!strcmp(name, "lut3d")) return "technical_group.html#lut3d";
if(!strcmp(name, "lut3d")) return "modules.html#lut3d";
if(!strcmp(name, "monochrome")) return "effects_group.html#monochrome";
if(!strcmp(name, "negadoctor")) return "technical_group.html#negadoctor";
if(!strcmp(name, "nlmeans")) return "technical_group.html#denoise_non_local_means";
if(!strcmp(name, "profile_gamma")) return "technical_group.html#unbreak_input_profile";
if(!strcmp(name, "rawdenoise")) return "technical_group.html#raw_denoise";
if(!strcmp(name, "rawprepare")) return "technical_group.html#raw_black_white_point";
if(!strcmp(name, "negadoctor")) return "modules.html#negadoctor";
if(!strcmp(name, "nlmeans")) return "modules.html#denoise_non_local_means";
if(!strcmp(name, "profile_gamma")) return "modules.html#unbreak_input_profile";
if(!strcmp(name, "rawdenoise")) return "modules.html#raw_denoise";
if(!strcmp(name, "rawprepare")) return "modules.html#raw_black_white_point";
if(!strcmp(name, "relight")) return "grading_group.html#fill_light";
if(!strcmp(name, "retouch")) return "effects_group.html#retouch";
if(!strcmp(name, "rgbcurve")) return "grading_group.html#rgbcurve";
if(!strcmp(name, "rgblevels")) return "grading_group.html#rgblevels";
if(!strcmp(name, "rotatepixels")) return "technical_group.html#rotate_pixels";
if(!strcmp(name, "scalepixels")) return "technical_group.html#scale_pixels";
if(!strcmp(name, "rotatepixels")) return "modules.html#rotate_pixels";
if(!strcmp(name, "scalepixels")) return "modules.html#scale_pixels";
if(!strcmp(name, "shadhi")) return "grading_group.html#shadows_and_highlights";
if(!strcmp(name, "sharpen")) return "effects_group.html#sharpen";
if(!strcmp(name, "soften")) return "effects_group.html#soften";
Expand Down
1 change: 1 addition & 0 deletions src/common/variables.c
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,7 @@ static void grow_buffer(char **result, char **result_iter, size_t *result_length
static char *expand(dt_variables_params_t *params, char **source, char extra_stop)
{
char *result = g_strdup("");
if(!*source) return result;
char *result_iter = result;
size_t result_length = 0;
char *source_iter = *source;
Expand Down
5 changes: 3 additions & 2 deletions src/control/crawler.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,9 @@ void dt_control_crawler_show_image_list(GList *images)
GtkTreeIter iter;
dt_control_crawler_result_t *item = list_iter->data;
char timestamp_db[64], timestamp_xmp[64];
strftime(timestamp_db, sizeof(timestamp_db), "%c", localtime(&item->timestamp_db));
strftime(timestamp_xmp, sizeof(timestamp_xmp), "%c", localtime(&item->timestamp_xmp));
struct tm tm_stamp;
strftime(timestamp_db, sizeof(timestamp_db), "%c", localtime_r(&item->timestamp_db, &tm_stamp));
strftime(timestamp_xmp, sizeof(timestamp_xmp), "%c", localtime_r(&item->timestamp_xmp, &tm_stamp));
gtk_list_store_append(store, &iter);
gtk_list_store_set(store, &iter,
DT_CONTROL_CRAWLER_COL_SELECTED, 0,
Expand Down
8 changes: 7 additions & 1 deletion src/control/jobs/camera_jobs.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/
#include "control/jobs/camera_jobs.h"
#include "common/darktable.h"
#include "common/collection.h"
#include "common/import_session.h"
#include "common/utility.h"
#include "control/conf.h"
Expand Down Expand Up @@ -282,7 +283,7 @@ void _camera_import_image_downloaded(const dt_camera_t *camera, const char *file
{
// Import downloaded image to import filmroll
dt_camera_import_t *t = (dt_camera_import_t *)data;
dt_image_import(dt_import_session_film_id(t->shared.session), filename, FALSE);
const int32_t imgid = dt_image_import(dt_import_session_film_id(t->shared.session), filename, FALSE);
dt_control_queue_redraw_center();
gchar *basename = g_path_get_basename(filename);
dt_control_log(ngettext("%d/%d imported to %s", "%d/%d imported to %s", t->import_count + 1),
Expand All @@ -293,6 +294,11 @@ void _camera_import_image_downloaded(const dt_camera_t *camera, const char *file

dt_control_job_set_progress(t->job, t->fraction);

if((imgid & 3) == 3)
{
dt_collection_update_query(darktable.collection, DT_COLLECTION_CHANGE_NEW_QUERY, NULL);
}

if(t->import_count + 1 == g_list_length(t->images))
{
// only redraw at the end, to not spam the cpu with exposure events
Expand Down
8 changes: 6 additions & 2 deletions src/control/jobs/film_jobs.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/
#include "control/jobs/film_jobs.h"
#include "common/darktable.h"
#include "common/collection.h"
#include "common/film.h"
#include <stdlib.h>

Expand Down Expand Up @@ -253,12 +254,15 @@ static void dt_film_import1(dt_job_t *job, dt_film_t *film)
g_free(cdn);

/* import image */
dt_image_import(cfr->id, (const gchar *)image->data, FALSE);
const int32_t imgid = dt_image_import(cfr->id, (const gchar *)image->data, FALSE);

fraction += 1.0 / total;
dt_control_job_set_progress(job, fraction);


if((imgid & 3) == 3)
{
dt_collection_update_query(darktable.collection, DT_COLLECTION_CHANGE_NEW_QUERY, NULL);
}
} while((image = g_list_next(image)) != NULL);

g_list_free_full(images, g_free);
Expand Down
21 changes: 4 additions & 17 deletions src/develop/blend_gui.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "bauhaus/bauhaus.h"
#include "common/debug.h"
#include "common/dtpthread.h"
#include "common/math.h"
#include "common/opencl.h"
#include "common/iop_profile.h"
#include "control/control.h"
Expand All @@ -35,7 +36,6 @@

#include <assert.h>
#include <gmodule.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
Expand Down Expand Up @@ -1534,7 +1534,6 @@ static void _blendif_options_callback(GtkButton *button, GdkEventButton *event,
if(module_cst == DEVELOP_BLEND_CS_LAB || module_cst == DEVELOP_BLEND_CS_RGB_DISPLAY
|| module_cst == DEVELOP_BLEND_CS_RGB_SCENE)
{
char *markup;

mi = gtk_menu_item_new_with_label(_("reset to default blend colorspace"));
g_object_set_data_full(G_OBJECT(mi), "dt-blend-cst", GINT_TO_POINTER(DEVELOP_BLEND_CS_NONE), NULL);
Expand All @@ -1547,34 +1546,22 @@ static void _blendif_options_callback(GtkButton *button, GdkEventButton *event,
{
mi = gtk_menu_item_new_with_label(_("Lab"));
if(module_blend_cst == DEVELOP_BLEND_CS_LAB)
{
markup = g_markup_printf_escaped("<span weight=\"bold\">%s</span>", _("Lab"));
gtk_label_set_markup(GTK_LABEL(gtk_bin_get_child(GTK_BIN(mi))), markup);
g_free(markup);
}
gtk_style_context_add_class(gtk_widget_get_style_context(mi), "active-menu-item");
g_object_set_data_full(G_OBJECT(mi), "dt-blend-cst", GINT_TO_POINTER(DEVELOP_BLEND_CS_LAB), NULL);
g_signal_connect(G_OBJECT(mi), "activate", G_CALLBACK(_blendif_select_colorspace), module);
gtk_menu_shell_append(GTK_MENU_SHELL(menu), mi);
}

mi = gtk_menu_item_new_with_label(_("RGB (display)"));
if(module_blend_cst == DEVELOP_BLEND_CS_RGB_DISPLAY)
{
markup = g_markup_printf_escaped("<span weight=\"bold\">%s</span>", _("RGB (display)"));
gtk_label_set_markup(GTK_LABEL(gtk_bin_get_child(GTK_BIN(mi))), markup);
g_free(markup);
}
gtk_style_context_add_class(gtk_widget_get_style_context(mi), "active-menu-item");
g_object_set_data_full(G_OBJECT(mi), "dt-blend-cst", GINT_TO_POINTER(DEVELOP_BLEND_CS_RGB_DISPLAY), NULL);
g_signal_connect(G_OBJECT(mi), "activate", G_CALLBACK(_blendif_select_colorspace), module);
gtk_menu_shell_append(GTK_MENU_SHELL(menu), mi);

mi = gtk_menu_item_new_with_label(_("RGB (scene)"));
if(module_blend_cst == DEVELOP_BLEND_CS_RGB_SCENE)
{
markup = g_markup_printf_escaped("<span weight=\"bold\">%s</span>", _("RGB (scene)"));
gtk_label_set_markup(GTK_LABEL(gtk_bin_get_child(GTK_BIN(mi))), markup);
g_free(markup);
}
gtk_style_context_add_class(gtk_widget_get_style_context(mi), "active-menu-item");
g_object_set_data_full(G_OBJECT(mi), "dt-blend-cst", GINT_TO_POINTER(DEVELOP_BLEND_CS_RGB_SCENE), NULL);
g_signal_connect(G_OBJECT(mi), "activate", G_CALLBACK(_blendif_select_colorspace), module);
gtk_menu_shell_append(GTK_MENU_SHELL(menu), mi);
Expand Down
1 change: 0 additions & 1 deletion src/develop/develop.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ void dt_dev_cleanup(dt_develop_t *dev)
if(!dev) return;
// image_cache does not have to be unref'd, this is done outside develop module.
dt_pthread_mutex_destroy(&dev->pipe_mutex);
dt_pthread_mutex_destroy(&dev->pipe_mutex);
dt_pthread_mutex_destroy(&dev->preview_pipe_mutex);
dt_pthread_mutex_destroy(&dev->preview2_pipe_mutex);
dev->proxy.chroma_adaptation = NULL;
Expand Down
13 changes: 8 additions & 5 deletions src/develop/imageop.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
This file is part of darktable,
Copyright (C) 2009-2020 darktable developers.
Copyright (C) 2009-2021 darktable developers.

darktable is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -20,6 +20,7 @@
#include "bauhaus/bauhaus.h"
#include "common/debug.h"
#include "common/exif.h"
#include "common/collection.h"
#include "common/dtpthread.h"
#include "common/imageio_rawspeed.h"
#include "common/interpolation.h"
Expand Down Expand Up @@ -1073,7 +1074,8 @@ static gboolean _rename_module_resize(GtkWidget *entry, GdkEventKey *event, dt_i

static void _iop_gui_rename_module(dt_iop_module_t *module)
{
if(gtk_container_get_focus_child(GTK_CONTAINER(module->header))) return;
GtkWidget *focused = gtk_container_get_focus_child(GTK_CONTAINER(module->header));
if(focused && GTK_IS_ENTRY(focused)) return;

GtkWidget *entry = gtk_entry_new();

Expand Down Expand Up @@ -2083,8 +2085,8 @@ void dt_iop_request_focus(dt_iop_module_t *module)
/* redraw the expander */
gtk_widget_queue_draw(darktable.develop->gui_module->expander);

/* and finally remove hinter messages */
dt_control_hinter_message(darktable.control, "");
/* and finally collection restore hinter messages */
dt_collection_hint_message(darktable.collection);

// we also remove the focus css class
GtkWidget *iop_w = gtk_widget_get_parent(dt_iop_gui_get_pluginui(darktable.develop->gui_module));
Expand Down Expand Up @@ -2383,7 +2385,8 @@ static void header_size_callback(GtkWidget *widget, GdkRectangle *allocation, Gt
gboolean dt_iop_show_hide_header_buttons(GtkWidget *header, GdkEventCrossing *event, gboolean show_buttons, gboolean always_hide)
{
// check if Entry widget for module name edit exists
if(gtk_container_get_focus_child(GTK_CONTAINER(header))) return TRUE;
GtkWidget *focused = gtk_container_get_focus_child(GTK_CONTAINER(header));
if(focused && GTK_IS_ENTRY(focused)) return TRUE;

if(event && (darktable.develop->darkroom_skip_mouse_events ||
event->detail == GDK_NOTIFY_INFERIOR ||
Expand Down
4 changes: 4 additions & 0 deletions src/dtgtk/button.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,15 @@ GType dtgtk_button_get_type()

void dtgtk_button_set_paint(GtkDarktableButton *button, DTGTKCairoPaintIconFunc paint, gint paintflags, void *paintdata)
{
g_return_if_fail(button != NULL);
button->icon = paint;
button->icon_flags = paintflags;
button->icon_data = paintdata;
}

void dtgtk_button_set_active(GtkDarktableButton *button, gboolean active)
{
g_return_if_fail(button != NULL);
if(active)
button->icon_flags |= CPF_ACTIVE;
else
Expand All @@ -169,6 +171,7 @@ void dtgtk_button_set_active(GtkDarktableButton *button, gboolean active)

void dtgtk_button_override_color(GtkDarktableButton *button, GdkRGBA *color)
{
g_return_if_fail(button != NULL);
if(color)
{
button->fg = *color;
Expand All @@ -180,6 +183,7 @@ void dtgtk_button_override_color(GtkDarktableButton *button, GdkRGBA *color)

void dtgtk_button_override_background_color(GtkDarktableButton *button, GdkRGBA *color)
{
g_return_if_fail(button != NULL);
if(color)
{
button->bg = *color;
Expand Down
2 changes: 1 addition & 1 deletion src/dtgtk/culling.c
Original file line number Diff line number Diff line change
Expand Up @@ -1549,7 +1549,7 @@ void dt_culling_full_redraw(dt_culling_t *table, gboolean force)
}
l = g_list_next(l);
}
if(!in_list)
if(!in_list && table->list && g_list_length(table->list) > 0)
{
dt_thumbnail_t *thumb = (dt_thumbnail_t *)g_list_nth_data(table->list, 0);
dt_control_set_mouse_over_id(thumb->imgid);
Expand Down
51 changes: 47 additions & 4 deletions src/dtgtk/gradientslider.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ static inline gint _get_active_marker(GtkDarktableGradientSlider *gslider)

static inline void _clamp_marker(GtkDarktableGradientSlider *gslider, const gint selected)
{
g_return_if_fail(gslider != NULL);

const gdouble min = (selected == 0) ? 0.0f : gslider->position[selected - 1];
const gdouble max = (selected == gslider->positions - 1) ? 1.0f : gslider->position[selected + 1];
gslider->position[selected] = CLAMP(gslider->position[selected], min, max);
Expand Down Expand Up @@ -168,6 +170,8 @@ static gint _get_active_marker_from_screen(GtkWidget *widget, const gdouble x, c

static gdouble _slider_move(GtkWidget *widget, gint k, gdouble value, gint direction)
{
g_return_val_if_fail(DTGTK_IS_GRADIENT_SLIDER(widget), value);

GtkDarktableGradientSlider *gslider = DTGTK_GRADIENT_SLIDER(widget);

gdouble newvalue = value;
Expand Down Expand Up @@ -219,6 +223,8 @@ static gdouble _slider_move(GtkWidget *widget, gint k, gdouble value, gint direc

static gboolean _gradient_slider_add_delta_internal(GtkWidget *widget, gdouble delta, guint state, const gint selected)
{
g_return_val_if_fail(DTGTK_IS_GRADIENT_SLIDER(widget), TRUE);

GtkDarktableGradientSlider *gslider = DTGTK_GRADIENT_SLIDER(widget);

if(selected == -1) return TRUE;
Expand Down Expand Up @@ -258,6 +264,8 @@ static float _default_linear_scale_callback(GtkWidget *self, float value, int di

static gboolean _gradient_slider_enter_notify_event(GtkWidget *widget, GdkEventCrossing *event)
{
g_return_val_if_fail(DTGTK_IS_GRADIENT_SLIDER(widget), FALSE);

GtkDarktableGradientSlider *gslider = DTGTK_GRADIENT_SLIDER(widget);
gtk_widget_set_state_flags(widget, GTK_STATE_FLAG_PRELIGHT, TRUE);
gslider->is_entered = TRUE;
Expand All @@ -267,6 +275,8 @@ static gboolean _gradient_slider_enter_notify_event(GtkWidget *widget, GdkEventC

static gboolean _gradient_slider_leave_notify_event(GtkWidget *widget, GdkEventCrossing *event)
{
g_return_val_if_fail(DTGTK_IS_GRADIENT_SLIDER(widget), FALSE);

GtkDarktableGradientSlider *gslider = DTGTK_GRADIENT_SLIDER(widget);
if(!(gslider->is_dragging))
{
Expand All @@ -280,6 +290,8 @@ static gboolean _gradient_slider_leave_notify_event(GtkWidget *widget, GdkEventC

static gboolean _gradient_slider_button_press(GtkWidget *widget, GdkEventButton *event)
{
g_return_val_if_fail(DTGTK_IS_GRADIENT_SLIDER(widget), FALSE);

GtkDarktableGradientSlider *gslider = DTGTK_GRADIENT_SLIDER(widget);

// reset slider
Expand Down Expand Up @@ -337,6 +349,8 @@ static gboolean _gradient_slider_button_press(GtkWidget *widget, GdkEventButton

static gboolean _gradient_slider_motion_notify(GtkWidget *widget, GdkEventMotion *event)
{
g_return_val_if_fail(DTGTK_IS_GRADIENT_SLIDER(widget), FALSE);

GtkDarktableGradientSlider *gslider = DTGTK_GRADIENT_SLIDER(widget);

if(gslider->is_dragging == TRUE && gslider->selected != -1 && gslider->do_reset == FALSE)
Expand Down Expand Up @@ -364,6 +378,8 @@ static gboolean _gradient_slider_motion_notify(GtkWidget *widget, GdkEventMotion

static gboolean _gradient_slider_button_release(GtkWidget *widget, GdkEventButton *event)
{
g_return_val_if_fail(DTGTK_IS_GRADIENT_SLIDER(widget), FALSE);

GtkDarktableGradientSlider *gslider = DTGTK_GRADIENT_SLIDER(widget);
const gint selected = _get_active_marker(gslider);

Expand All @@ -388,6 +404,8 @@ static gboolean _gradient_slider_button_release(GtkWidget *widget, GdkEventButto

static gboolean _gradient_slider_scroll_event(GtkWidget *widget, GdkEventScroll *event)
{
g_return_val_if_fail(DTGTK_IS_GRADIENT_SLIDER(widget), TRUE);

if(dt_gui_ignore_scroll(event)) return FALSE;

GtkDarktableGradientSlider *gslider = DTGTK_GRADIENT_SLIDER(widget);
Expand All @@ -408,6 +426,8 @@ static gboolean _gradient_slider_scroll_event(GtkWidget *widget, GdkEventScroll

static gboolean _gradient_slider_key_press_event(GtkWidget *widget, GdkEventKey *event)
{
g_return_val_if_fail(DTGTK_IS_GRADIENT_SLIDER(widget), TRUE);

GtkDarktableGradientSlider *gslider = DTGTK_GRADIENT_SLIDER(widget);

const gint selected = _get_active_marker(gslider);
Expand Down Expand Up @@ -457,6 +477,8 @@ static void _gradient_slider_class_init(GtkDarktableGradientSliderClass *klass)

static void _gradient_slider_init(GtkDarktableGradientSlider *gslider)
{
g_return_if_fail(gslider != NULL);

GtkWidget *widget = GTK_WIDGET(gslider);
gtk_widget_add_events(widget,
GDK_EXPOSURE_MASK |
Expand All @@ -475,6 +497,8 @@ static void _gradient_slider_init(GtkDarktableGradientSlider *gslider)

static void _gradient_slider_get_preferred_height(GtkWidget *widget, gint *min_height, gint *nat_height)
{
g_return_if_fail(widget != NULL);

GtkStyleContext *context = gtk_widget_get_style_context(widget);
GtkStateFlags state = gtk_widget_get_state_flags(widget);

Expand All @@ -489,6 +513,8 @@ static void _gradient_slider_get_preferred_height(GtkWidget *widget, gint *min_h

static void _gradient_slider_get_preferred_width(GtkWidget *widget, gint *min_width, gint *nat_width)
{
g_return_if_fail(DTGTK_IS_GRADIENT_SLIDER(widget));

GtkStyleContext *context = gtk_widget_get_style_context(widget);
GtkStateFlags state = gtk_widget_get_state_flags(widget);

Expand All @@ -506,7 +532,6 @@ static void _gradient_slider_get_preferred_width(GtkWidget *widget, gint *min_wi

static void _gradient_slider_destroy(GtkWidget *widget)
{
g_return_if_fail(widget != NULL);
g_return_if_fail(DTGTK_IS_GRADIENT_SLIDER(widget));

GtkDarktableGradientSlider *gslider = DTGTK_GRADIENT_SLIDER(widget);
Expand All @@ -526,13 +551,11 @@ static void _gradient_slider_destroy(GtkWidget *widget)

static gboolean _gradient_slider_draw(GtkWidget *widget, cairo_t *cr)
{
g_return_val_if_fail(DTGTK_IS_GRADIENT_SLIDER(widget), FALSE);
GtkDarktableGradientSlider *gslider = DTGTK_GRADIENT_SLIDER(widget);

assert(gslider->position > 0);

g_return_val_if_fail(widget != NULL, FALSE);
g_return_val_if_fail(DTGTK_IS_GRADIENT_SLIDER(widget), FALSE);

GtkStyleContext *context = gtk_widget_get_style_context(widget);
GtkStateFlags state = gtk_widget_get_state_flags(widget);

Expand Down Expand Up @@ -655,6 +678,8 @@ gint _list_find_by_position(gconstpointer a, gconstpointer b)

static void _gradient_slider_set_defaults(GtkDarktableGradientSlider *gslider)
{
g_return_if_fail(gslider != NULL);

gslider->is_dragging = gslider->is_changed = gslider->do_reset = gslider->is_entered = 0;
gslider->timeout_handle = 0;
gslider->selected = gslider->positions == 1 ? 0 : -1;
Expand Down Expand Up @@ -739,6 +764,7 @@ GtkWidget *dtgtk_gradient_slider_multivalue_new_with_color_and_name(GdkRGBA star
void dtgtk_gradient_slider_multivalue_set_stop(GtkDarktableGradientSlider *gslider, gfloat position,
GdkRGBA color)
{
g_return_if_fail(gslider != NULL);
const gfloat rawposition = gslider->scale_callback((GtkWidget *)gslider, position, GRADIENT_SLIDER_SET);
// First find color at position, if exists update color, otherwise create a new stop at position.
GList *current = g_list_find_custom(gslider->colors, (gpointer)&rawposition, _list_find_by_position);
Expand All @@ -758,6 +784,7 @@ void dtgtk_gradient_slider_multivalue_set_stop(GtkDarktableGradientSlider *gslid

void dtgtk_gradient_slider_multivalue_clear_stops(GtkDarktableGradientSlider *gslider)
{
g_return_if_fail(gslider != NULL);
g_list_free_full(gslider->colors, g_free);
gslider->colors = NULL;
}
Expand All @@ -776,12 +803,14 @@ gdouble dtgtk_gradient_slider_multivalue_get_value(GtkDarktableGradientSlider *g

void dtgtk_gradient_slider_multivalue_get_values(GtkDarktableGradientSlider *gslider, gdouble *values)
{
g_return_if_fail(gslider != NULL);
for(int k = 0; k < gslider->positions; k++)
values[k] = gslider->scale_callback((GtkWidget *)gslider, gslider->position[k], GRADIENT_SLIDER_GET);
}

void dtgtk_gradient_slider_multivalue_set_value(GtkDarktableGradientSlider *gslider, gdouble value, gint pos)
{
g_return_if_fail(gslider != NULL);
assert(pos <= gslider->positions);

gslider->position[pos] = CLAMP_RANGE(gslider->scale_callback((GtkWidget *)gslider, value, GRADIENT_SLIDER_SET), 0.0, 1.0);
Expand All @@ -792,6 +821,8 @@ void dtgtk_gradient_slider_multivalue_set_value(GtkDarktableGradientSlider *gsli

void dtgtk_gradient_slider_multivalue_set_values(GtkDarktableGradientSlider *gslider, gdouble *values)
{
g_return_if_fail(gslider != NULL);
g_return_if_fail(values != NULL);
for(int k = 0; k < gslider->positions; k++)
gslider->position[k] = CLAMP_RANGE(gslider->scale_callback((GtkWidget *)gslider, values[k], GRADIENT_SLIDER_SET), 0.0, 1.0);
gslider->selected = gslider->positions == 1 ? 0 : -1;
Expand All @@ -801,6 +832,7 @@ void dtgtk_gradient_slider_multivalue_set_values(GtkDarktableGradientSlider *gsl

void dtgtk_gradient_slider_multivalue_set_marker(GtkDarktableGradientSlider *gslider, gint mark, gint pos)
{
g_return_if_fail(gslider != NULL);
assert(pos <= gslider->positions);

gslider->marker[pos] = mark;
Expand All @@ -809,13 +841,15 @@ void dtgtk_gradient_slider_multivalue_set_marker(GtkDarktableGradientSlider *gsl

void dtgtk_gradient_slider_multivalue_set_markers(GtkDarktableGradientSlider *gslider, gint *markers)
{
g_return_if_fail(gslider != NULL);
for(int k = 0; k < gslider->positions; k++) gslider->marker[k] = markers[k];
gtk_widget_queue_draw(GTK_WIDGET(gslider));
}

void dtgtk_gradient_slider_multivalue_set_resetvalue(GtkDarktableGradientSlider *gslider, gdouble value,
gint pos)
{
g_return_if_fail(gslider != NULL);
assert(pos <= gslider->positions);

gslider->resetvalue[pos] = gslider->scale_callback((GtkWidget *)gslider, value, GRADIENT_SLIDER_SET);
Expand All @@ -831,13 +865,15 @@ gdouble dtgtk_gradient_slider_multivalue_get_resetvalue(GtkDarktableGradientSlid

void dtgtk_gradient_slider_multivalue_set_resetvalues(GtkDarktableGradientSlider *gslider, gdouble *values)
{
g_return_if_fail(gslider != NULL);
for(int k = 0; k < gslider->positions; k++)
gslider->resetvalue[k] = gslider->scale_callback((GtkWidget *)gslider, values[k], GRADIENT_SLIDER_SET);
gslider->is_resettable = TRUE;
}

void dtgtk_gradient_slider_multivalue_set_picker(GtkDarktableGradientSlider *gslider, gdouble value)
{
g_return_if_fail(gslider != NULL);
gslider->picker[0] = gslider->picker[1] = gslider->picker[2]
= gslider->scale_callback((GtkWidget *)gslider, value, GRADIENT_SLIDER_SET);
gtk_widget_queue_draw(GTK_WIDGET(gslider));
Expand All @@ -846,6 +882,7 @@ void dtgtk_gradient_slider_multivalue_set_picker(GtkDarktableGradientSlider *gsl
void dtgtk_gradient_slider_multivalue_set_picker_meanminmax(GtkDarktableGradientSlider *gslider, gdouble mean,
gdouble min, gdouble max)
{
g_return_if_fail(gslider != NULL);
gslider->picker[0] = gslider->scale_callback((GtkWidget *)gslider, mean, GRADIENT_SLIDER_SET);
gslider->picker[1] = gslider->scale_callback((GtkWidget *)gslider, min, GRADIENT_SLIDER_SET);
gslider->picker[2] = gslider->scale_callback((GtkWidget *)gslider, max, GRADIENT_SLIDER_SET);
Expand All @@ -854,11 +891,13 @@ void dtgtk_gradient_slider_multivalue_set_picker_meanminmax(GtkDarktableGradient

gboolean dtgtk_gradient_slider_multivalue_is_dragging(GtkDarktableGradientSlider *gslider)
{
g_return_val_if_fail(gslider != NULL, FALSE);
return gslider->is_dragging;
}

void dtgtk_gradient_slider_multivalue_set_increment(GtkDarktableGradientSlider *gslider, gdouble value)
{
g_return_if_fail(gslider != NULL);
gslider->increment = value;
}

Expand Down Expand Up @@ -970,6 +1009,7 @@ gdouble dtgtk_gradient_slider_get_resetvalue(GtkDarktableGradientSlider *gslider

void dtgtk_gradient_slider_set_picker(GtkDarktableGradientSlider *gslider, gdouble value)
{
g_return_if_fail(gslider != NULL);
gslider->picker[0] = gslider->picker[1] = gslider->picker[2]
= gslider->scale_callback((GtkWidget *)gslider, value, GRADIENT_SLIDER_SET);
gtk_widget_queue_draw(GTK_WIDGET(gslider));
Expand All @@ -978,6 +1018,7 @@ void dtgtk_gradient_slider_set_picker(GtkDarktableGradientSlider *gslider, gdoub
void dtgtk_gradient_slider_set_picker_meanminmax(GtkDarktableGradientSlider *gslider, gdouble mean,
gdouble min, gdouble max)
{
g_return_if_fail(gslider != NULL);
gslider->picker[0] = gslider->scale_callback((GtkWidget *)gslider, mean, GRADIENT_SLIDER_SET);
gslider->picker[1] = gslider->scale_callback((GtkWidget *)gslider, min, GRADIENT_SLIDER_SET);
gslider->picker[2] = gslider->scale_callback((GtkWidget *)gslider, max, GRADIENT_SLIDER_SET);
Expand All @@ -986,11 +1027,13 @@ void dtgtk_gradient_slider_set_picker_meanminmax(GtkDarktableGradientSlider *gsl

gboolean dtgtk_gradient_slider_is_dragging(GtkDarktableGradientSlider *gslider)
{
g_return_val_if_fail(gslider != NULL, FALSE);
return gslider->is_dragging;
}

void dtgtk_gradient_slider_set_increment(GtkDarktableGradientSlider *gslider, gdouble value)
{
g_return_if_fail(gslider != NULL);
gslider->increment = value;
}

Expand Down
1 change: 1 addition & 0 deletions src/dtgtk/icon.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ GType dtgtk_icon_get_type()

void dtgtk_icon_set_paint(GtkWidget *icon, DTGTKCairoPaintIconFunc paint, gint paintflags, void *paintdata)
{
g_return_if_fail(icon != NULL);
DTGTK_ICON(icon)->icon = paint;
DTGTK_ICON(icon)->icon_flags = paintflags;
DTGTK_ICON(icon)->icon_data = paintdata;
Expand Down
2 changes: 1 addition & 1 deletion src/dtgtk/paint.c
Original file line number Diff line number Diff line change
Expand Up @@ -1354,7 +1354,7 @@ void dtgtk_cairo_paint_audio(cairo_t *cr, gint x, gint y, gint w, gint h, gint f

void dtgtk_cairo_paint_label_flower(cairo_t *cr, gint x, gint y, gint w, gint h, gint flags, void *data)
{
PREAMBLE(1, 0, 0)
PREAMBLE(1.1, 0, 0)

const float r = 0.18;

Expand Down
7 changes: 6 additions & 1 deletion src/dtgtk/thumbnail_btn.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ static void _thumbnail_btn_init(GtkDarktableThumbnailBtn *button)

static gboolean _thumbnail_btn_draw(GtkWidget *widget, cairo_t *cr)
{
g_return_val_if_fail(widget != NULL, FALSE);
g_return_val_if_fail(DTGTK_IS_THUMBNAIL_BTN(widget), FALSE);

if(gtk_widget_get_allocated_height(widget) < 2 || gtk_widget_get_allocated_height(widget) < 2) return TRUE;
Expand Down Expand Up @@ -102,6 +101,8 @@ static gboolean _thumbnail_btn_draw(GtkWidget *widget, cairo_t *cr)

static gboolean _thumbnail_btn_enter_notify_callback(GtkWidget *widget, GdkEventCrossing *event)
{
g_return_val_if_fail(widget != NULL, FALSE);

int flags = gtk_widget_get_state_flags(widget);
flags |= GTK_STATE_FLAG_PRELIGHT;

Expand All @@ -111,6 +112,8 @@ static gboolean _thumbnail_btn_enter_notify_callback(GtkWidget *widget, GdkEvent
}
static gboolean _thumbnail_btn_leave_notify_callback(GtkWidget *widget, GdkEventCrossing *event)
{
g_return_val_if_fail(widget != NULL, FALSE);

int flags = gtk_widget_get_state_flags(widget);
flags &= ~GTK_STATE_FLAG_PRELIGHT;

Expand Down Expand Up @@ -162,6 +165,8 @@ GType dtgtk_thumbnail_btn_get_type()

gboolean dtgtk_thumbnail_btn_is_hidden(GtkWidget *widget)
{
g_return_val_if_fail(DTGTK_IS_THUMBNAIL_BTN(widget), TRUE);

return DTGTK_THUMBNAIL_BTN(widget)->hidden;
}
// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.sh
Expand Down
51 changes: 49 additions & 2 deletions src/dtgtk/thumbtable.c
Original file line number Diff line number Diff line change
Expand Up @@ -1345,7 +1345,53 @@ static void _dt_collection_changed_callback(gpointer instance, dt_collection_cha
}

// get the new rowid of the new offset image
const int nrow = _thumb_get_rowid(newid);
int nrow = _thumb_get_rowid(newid);

// if we don't have a valid rowid that means the image with newid doesn't exist in the new
// memory.collected_images as we still have the "old" list of images available in table->list, let's found the
// next valid image inside
if(nrow <= 0)
{
l = table->list;
gboolean after = FALSE;
while(l)
{
dt_thumbnail_t *thumb = (dt_thumbnail_t *)l->data;
if(after)
{
nrow = _thumb_get_rowid(thumb->imgid);
if(nrow > 0)
{
newid = thumb->imgid;
break;
}
}
if(thumb->imgid == newid) after = TRUE;
l = g_list_next(l);
}
}
// last chance if still not valid, we search the first previous valid image
if(nrow <= 0)
{
l = g_list_last(table->list);
gboolean before = FALSE;
while(l)
{
dt_thumbnail_t *thumb = (dt_thumbnail_t *)l->data;
if(before)
{
nrow = _thumb_get_rowid(thumb->imgid);
if(nrow > 0)
{
newid = thumb->imgid;
break;
}
}
if(thumb->imgid == newid) before = TRUE;
l = g_list_previous(l);
}
}

const gboolean offset_changed = (MAX(1, nrow) != table->offset);
if(nrow >= 1)
table->offset_imgid = newid;
Expand All @@ -1358,7 +1404,8 @@ static void _dt_collection_changed_callback(gpointer instance, dt_collection_cha

dt_thumbtable_full_redraw(table, TRUE);

if(offset_changed) dt_view_lighttable_change_offset(darktable.view_manager, FALSE, newid);
if(offset_changed)
dt_view_lighttable_change_offset(darktable.view_manager, FALSE, table->offset_imgid);
else
{
// if we are in culling or preview mode, ensure to refresh active images
Expand Down
3 changes: 3 additions & 0 deletions src/dtgtk/togglebutton.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,15 @@ GType dtgtk_togglebutton_get_type()
void dtgtk_togglebutton_set_paint(GtkDarktableToggleButton *button, DTGTKCairoPaintIconFunc paint,
gint paintflags, void *paintdata)
{
g_return_if_fail(button != NULL);
button->icon = paint;
button->icon_flags = paintflags;
button->icon_data = paintdata;
}

void dtgtk_togglebutton_override_color(GtkDarktableToggleButton *button, GdkRGBA *color)
{
g_return_if_fail(button != NULL);
if(color)
{
button->fg = *color;
Expand All @@ -206,6 +208,7 @@ void dtgtk_togglebutton_override_color(GtkDarktableToggleButton *button, GdkRGBA

void dtgtk_togglebutton_override_background_color(GtkDarktableToggleButton *button, GdkRGBA *color)
{
g_return_if_fail(button != NULL);
if(color)
{
button->bg = *color;
Expand Down
422 changes: 422 additions & 0 deletions src/external/wb_presets.c

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions src/gui/gtk.c
Original file line number Diff line number Diff line change
Expand Up @@ -654,8 +654,13 @@ gboolean dt_gui_get_scroll_unit_deltas(const GdkEventScroll *event, int *delta_x
// accumulate trackpad/touch scrolls until they make a unit
// scroll, and only then tell caller that there is a scroll to
// handle
#ifdef GDK_WINDOWING_QUARTZ // on macOS deltas need to be scaled
acc_x += event->delta_x / 50;
acc_y += event->delta_y / 50;
#else
acc_x += event->delta_x;
acc_y += event->delta_y;
#endif
const gdouble amt_x = trunc(acc_x);
const gdouble amt_y = trunc(acc_y);
if(amt_x != 0 || amt_y != 0)
Expand Down Expand Up @@ -1222,6 +1227,8 @@ int dt_gui_gtk_init(dt_gui_gtk_t *gui)
/* lets zero mem */
memset(gui, 0, sizeof(dt_gui_gtk_t));

dt_pthread_mutex_init(&gui->mutex, NULL);

// force gtk3 to use normal scroll bars instead of the popup thing. they get in the way of controls
// the alternative would be to gtk_scrolled_window_set_overlay_scrolling(..., FALSE); every single widget
// that might have scroll bars
Expand Down
32 changes: 9 additions & 23 deletions src/gui/presets.c
Original file line number Diff line number Diff line change
Expand Up @@ -1241,36 +1241,22 @@ static void dt_gui_presets_popup_menu_show_internal(dt_dev_operation_t op, int32
MIN(bl_params_size, sizeof(dt_develop_blend_params_t))))
isdefault = TRUE;

gchar *label;
if(isdefault)
label = g_strdup_printf("%s %s", name, _("(default)"));
else
label = g_strdup_printf("%s", name);
mi = gtk_menu_item_new_with_label(label);
g_free(label);

if(module
&& !memcmp(params, op_params, MIN(op_params_size, params_size))
&& !memcmp(bl_params, blendop_params, MIN(bl_params_size, sizeof(dt_develop_blend_params_t)))
&& module->enabled == enabled)
{
active_preset = cnt;
writeprotect = sqlite3_column_int(stmt, 2);
char *markup;
mi = gtk_menu_item_new_with_label("");
if(isdefault)
{
markup = g_markup_printf_escaped("<span weight=\"bold\">%s %s</span>", name, _("(default)"));
}
else
markup = g_markup_printf_escaped("<span weight=\"bold\">%s</span>", name);
gtk_label_set_markup(GTK_LABEL(gtk_bin_get_child(GTK_BIN(mi))), markup);
g_free(markup);
}
else
{
if(isdefault)
{
char *markup;
mi = gtk_menu_item_new_with_label("");
markup = g_markup_printf_escaped("%s %s", name, _("(default)"));
gtk_label_set_markup(GTK_LABEL(gtk_bin_get_child(GTK_BIN(mi))), markup);
g_free(markup);
}
else
mi = gtk_menu_item_new_with_label((const char *)name);
gtk_style_context_add_class(gtk_widget_get_style_context(mi), "active-menu-item");
}

if(isdisabled)
Expand Down
8 changes: 4 additions & 4 deletions src/imageio/format/avif.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ int write_image(struct dt_imageio_module_data_t *data,
break;
}
default:
dt_control_log(_("Invalid AVIF bit depth!"));
dt_control_log(_("invalid AVIF bit depth!"));
rc = 1;
goto out;
}
Expand Down Expand Up @@ -833,7 +833,7 @@ void gui_init(dt_imageio_module_format_t *self)
dt_bauhaus_combobox_set(gui->color_mode, color_mode);

gtk_widget_set_tooltip_text(gui->color_mode,
_("Saving as grayscale will reduce the size for black & white images"));
_("saving as grayscale will reduce the size for black & white images"));

gtk_box_pack_start(GTK_BOX(self->widget),
gui->color_mode,
Expand Down Expand Up @@ -908,8 +908,8 @@ void gui_init(dt_imageio_module_format_t *self)
"pixelformat based on quality:\n"
"\n"
" 91% - 100% -> YUV444\n"
" 81% - 90% => YUV422\n"
" 5% - 80% => YUV420\n"));
" 81% - 90% -> YUV422\n"
" 5% - 80% -> YUV420\n"));

if (quality > 0 && quality <= 100) {
dt_bauhaus_slider_set(gui->quality, quality);
Expand Down
28 changes: 1 addition & 27 deletions src/iop/ashift.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "common/colorspaces_inline_conversions.h"
#include "common/debug.h"
#include "common/interpolation.h"
#include "common/math.h"
#include "common/opencl.h"
#include "control/control.h"
#include "develop/develop.h"
Expand Down Expand Up @@ -534,33 +535,6 @@ int legacy_params(dt_iop_module_t *self, const void *const old_params, const int
return 1;
}

// multiply 3x3 matrix with 3x1 vector
// dst needs to be different from v
static inline void mat3mulv(float *dst, const float *const mat, const float *const v)
{
for(int k = 0; k < 3; k++)
{
float x = 0.0f;
for(int i = 0; i < 3; i++) x += mat[3 * k + i] * v[i];
dst[k] = x;
}
}

// multiply two 3x3 matrices
// dst needs to be different from m1 and m2
static inline void mat3mul(float *dst, const float *const m1, const float *const m2)
{
for(int k = 0; k < 3; k++)
{
for(int i = 0; i < 3; i++)
{
float x = 0.0f;
for(int j = 0; j < 3; j++) x += m1[3 * k + j] * m2[3 * j + i];
dst[3 * k + i] = x;
}
}
}

// normalized product of two 3x1 vectors
// dst needs to be different from v1 and v2
static inline void vec3prodn(float *dst, const float *const v1, const float *const v2)
Expand Down
13 changes: 1 addition & 12 deletions src/iop/ashift_lsd.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,20 +140,9 @@

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <limits.h>
#include <float.h>
//#include "lsd.h"

/** ln(10) */
#ifndef M_LN10
#define M_LN10 2.30258509299404568402
#endif /* !M_LN10 */

/** PI */
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif /* !M_PI */
#include "common/math.h"

#ifndef FALSE
#define FALSE 0
Expand Down
142 changes: 103 additions & 39 deletions src/iop/channelmixerrgb.c
Original file line number Diff line number Diff line change
Expand Up @@ -556,87 +556,132 @@ static inline void loop_switch(const float *const restrict in, float *const rest

for(size_t c = 0; c < 3; c++)
temp_two[c] = (clip) ? fmaxf(in[k + c], 0.0f) : in[k + c];
float Y = 1.f;

/* WE START IN PIPELINE RGB */

switch(kind)
{
case DT_ADAPTATION_FULL_BRADFORD:
{
// Convert from RGB to XYZ
dot_product(temp_two, RGB_to_XYZ, temp_one);
Y = temp_one[1];
const float Y = temp_one[1];

// Do white balance in LMS
downscale_vector(temp_one, Y);
convert_XYZ_to_bradford_LMS(temp_one, temp_two);
// Convert to LMS
convert_XYZ_to_bradford_LMS(temp_one, temp_two);
{
// Do white balance
downscale_vector(temp_two, Y);
bradford_adapt_D50(temp_two, illuminant, p, TRUE, temp_one);
convert_bradford_LMS_to_XYZ(temp_one, temp_two);
upscale_vector(temp_two, Y);
upscale_vector(temp_one, Y);

// Compute the 3D mix - this is a rotation + homothety of the vector base
dot_product(temp_one, MIX, temp_two);
}
convert_bradford_LMS_to_XYZ(temp_two, temp_one);

break;
}
case DT_ADAPTATION_LINEAR_BRADFORD:
{
// Convert from RGB to XYZ
dot_product(temp_two, RGB_to_XYZ, temp_one);
Y = temp_one[1];
const float Y = temp_one[1];

// Do white balance in LMS
downscale_vector(temp_one, Y);
convert_XYZ_to_bradford_LMS(temp_one, temp_two);
// Convert to LMS
convert_XYZ_to_bradford_LMS(temp_one, temp_two);
{
// Do white balance
downscale_vector(temp_two, Y);
bradford_adapt_D50(temp_two, illuminant, p, FALSE, temp_one);
convert_bradford_LMS_to_XYZ(temp_one, temp_two);
upscale_vector(temp_two, Y);
upscale_vector(temp_one, Y);

// Compute the 3D mix - this is a rotation + homothety of the vector base
dot_product(temp_one, MIX, temp_two);
}
convert_bradford_LMS_to_XYZ(temp_two, temp_one);

break;
}
case DT_ADAPTATION_CAT16:
{
// Convert from RGB to XYZ
dot_product(temp_two, RGB_to_XYZ, temp_one);
Y = temp_one[1];
const float Y = temp_one[1];

// Do white balance in LMS
downscale_vector(temp_one, Y);
convert_XYZ_to_CAT16_LMS(temp_one, temp_two);
// Convert to LMS
convert_XYZ_to_CAT16_LMS(temp_one, temp_two);
{
// Do white balance
downscale_vector(temp_two, Y);
CAT16_adapt_D50(temp_two, illuminant, 1.0f, TRUE, temp_one); // force full-adaptation
convert_CAT16_LMS_to_XYZ(temp_one, temp_two);
upscale_vector(temp_two, Y);
upscale_vector(temp_one, Y);

// Compute the 3D mix - this is a rotation + homothety of the vector base
dot_product(temp_one, MIX, temp_two);
}
convert_CAT16_LMS_to_XYZ(temp_two, temp_one);

break;
}
case DT_ADAPTATION_XYZ:
{
// Convert from RGB to XYZ
dot_product(temp_two, RGB_to_XYZ, temp_one);
Y = temp_one[1];
const float Y = temp_one[1];

// Do white balance in XYZ
downscale_vector(temp_one, Y);
XYZ_adapt_D50(temp_one, illuminant, temp_two);
upscale_vector(temp_two, Y);

// Compute the 3D mix in XYZ - this is a rotation + homothety of the vector base
dot_product(temp_two, MIX, temp_one);

break;
}
case DT_ADAPTATION_RGB:
case DT_ADAPTATION_LAST:
{
// Convert from RGB to XYZ
dot_product(temp_two, RGB_to_XYZ, temp_one);
for(size_t c = 0; c < 3; ++c) temp_two[c] = temp_one[c];
// No white balance.

// Compute the 3D mix in RGB - this is a rotation + homothety of the vector base
dot_product(temp_two, MIX, temp_one);

// Convert from RGB to XYZ
dot_product(temp_one, RGB_to_XYZ, temp_two);

for(size_t c = 0; c < 3; ++c) temp_one[c] = temp_two[c];
break;
}
}

// Compute the 3D mix in LMS - this is a rotation + homothety of the vector base
convert_any_XYZ_to_LMS(temp_two, temp_one, kind);
dot_product(temp_one, MIX, temp_two);
convert_any_LMS_to_XYZ(temp_two, temp_one, kind);
/* FROM HERE WE ARE MANDATORILY IN XYZ - DATA IS IN temp_one */

// Gamut mapping happens in XYZ space no matter what
gamut_mapping(temp_one, gamut, clip, temp_two);
convert_any_XYZ_to_LMS(temp_two, temp_one, kind);

// convert to LMS, XYZ or pipeline RGB
switch(kind)
{
case DT_ADAPTATION_FULL_BRADFORD:
case DT_ADAPTATION_LINEAR_BRADFORD:
case DT_ADAPTATION_CAT16:
case DT_ADAPTATION_XYZ:
{
convert_any_XYZ_to_LMS(temp_two, temp_one, kind);
break;
}
case DT_ADAPTATION_RGB:
case DT_ADAPTATION_LAST:
{
// Convert from XYZ to RGB
dot_product(temp_two, XYZ_to_RGB, temp_one);
break;
}
}

/* FROM HERE WE ARE IN LMS, XYZ OR PIPELINE RGB depending on user param - DATA IS IN temp_one */

// Clip in LMS
if(clip) for(size_t c = 0; c < 3; c++) temp_one[c] = fmaxf(temp_one[c], 0.0f);
Expand All @@ -647,23 +692,42 @@ static inline void loop_switch(const float *const restrict in, float *const rest
// Clip in LMS
if(clip) for(size_t c = 0; c < 3; c++) temp_two[c] = fmaxf(temp_two[c], 0.0f);

// Convert back LMS to XYZ
convert_any_LMS_to_XYZ(temp_two, temp_one, kind);

// Clip in XYZ
if(clip) for(size_t c = 0; c < 3; c++) temp_one[c] = fmaxf(temp_one[c], 0.0f);

// Save
if(apply_grey)
{
// Turn RGB into monochrome
const float grey_mix = fmaxf(scalar_product(temp_one, grey), 0.0f);
// Turn LMS, XYZ or pipeline RGB into monochrome
const float grey_mix = fmaxf(scalar_product(temp_two, grey), 0.0f);

out[k] = out[k + 1] = out[k + 2] = grey_mix;
out[k + 3] = in[k + 3]; // alpha mask
}
else
{
// Convert back to XYZ
switch(kind)
{
case DT_ADAPTATION_FULL_BRADFORD:
case DT_ADAPTATION_LINEAR_BRADFORD:
case DT_ADAPTATION_CAT16:
case DT_ADAPTATION_XYZ:
{
convert_any_LMS_to_XYZ(temp_two, temp_one, kind);
break;
}
case DT_ADAPTATION_RGB:
case DT_ADAPTATION_LAST:
{
// Convert from RBG to XYZ
dot_product(temp_two, RGB_to_XYZ, temp_one);
break;
}
}

/* FROM HERE WE ARE MANDATORILY IN XYZ - DATA IS IN temp_one */

// Clip in XYZ
if(clip) for(size_t c = 0; c < 3; c++) temp_one[c] = fmaxf(temp_one[c], 0.0f);

// Convert back to RGB
dot_product(temp_one, XYZ_to_RGB, temp_two);

Expand Down Expand Up @@ -1185,9 +1249,9 @@ void commit_params(struct dt_iop_module_t *self, dt_iop_params_t *p1, dt_dev_pix
for(int i = 0; i < 3; i++)
{
d->MIX[0][i] = p->red[i] / norm_R;
d->MIX[1][i] = p->green[i] / norm_B;
d->MIX[2][i] = p->blue[i] / norm_G;
d->saturation[i] = -p->saturation[i] - norm_sat;
d->MIX[1][i] = p->green[i] / norm_G;
d->MIX[2][i] = p->blue[i] / norm_B;
d->saturation[i] = -p->saturation[i] + norm_sat;
d->lightness[i] = p->lightness[i] - norm_light;
d->grey[i] = p->grey[i] / norm_grey; // = NaN if (norm_grey == 0.f) but we don't care since (d->apply_grey == FALSE)
}
Expand Down
12 changes: 3 additions & 9 deletions src/iop/clipping.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "bauhaus/bauhaus.h"
#include "common/debug.h"
#include "common/interpolation.h"
#include "common/math.h"
#include "common/opencl.h"
#include "control/conf.h"
#include "control/control.h"
Expand All @@ -39,7 +40,6 @@
#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>
#include <inttypes.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>

Expand Down Expand Up @@ -290,12 +290,6 @@ typedef struct dt_iop_clipping_global_data_t
static void commit_box(dt_iop_module_t *self, dt_iop_clipping_gui_data_t *g, dt_iop_clipping_params_t *p);


static inline void mul_mat_vec_2(const float *m, const float *p, float *o)
{
o[0] = p[0] * m[0] + p[1] * m[1];
o[1] = p[0] * m[2] + p[1] * m[3];
}

// helper to count corners in for loops:
static inline void get_corner(const float *aabb, const int i, float *p)
{
Expand Down Expand Up @@ -2590,9 +2584,9 @@ void gui_post_expose(struct dt_iop_module_t *self, cairo_t *cr, int32_t width, i
layout = pango_cairo_create_layout(cr);
pango_layout_set_font_description(layout, desc);
const float bzx = g->button_down_zoom_x + .5f, bzy = g->button_down_zoom_y + .5f;
cairo_arc(cr, bzx * wd, bzy * ht, DT_PIXEL_APPLY_DPI(3), 0, 2.0 * M_PI);
cairo_arc(cr, bzx * wd, bzy * ht, DT_PIXEL_APPLY_DPI(3) * pr_d, 0, 2.0 * M_PI);
cairo_stroke(cr);
cairo_arc(cr, pzx * wd, pzy * ht, DT_PIXEL_APPLY_DPI(3), 0, 2.0 * M_PI);
cairo_arc(cr, pzx * wd, pzy * ht, DT_PIXEL_APPLY_DPI(3) * pr_d, 0, 2.0 * M_PI);
cairo_stroke(cr);
cairo_move_to(cr, bzx * wd, bzy * ht);
cairo_line_to(cr, pzx * wd, pzy * ht);
Expand Down
20 changes: 1 addition & 19 deletions src/iop/colorchecker.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/
#include "bauhaus/bauhaus.h"
#include "common/colorspaces.h"
#include "common/math.h"
#include "common/opencl.h"
#include "common/exif.h"
#include "control/control.h"
Expand Down Expand Up @@ -418,25 +419,6 @@ static inline v4sf kerneldist4(const float *x, const float *y)
}
#endif

static inline float
fastlog2 (float x)
{
union { float f; uint32_t i; } vx = { x };
union { uint32_t i; float f; } mx = { (vx.i & 0x007FFFFF) | 0x3f000000 };
float y = vx.i;
y *= 1.1920928955078125e-7f;

return y - 124.22551499f
- 1.498030302f * mx.f
- 1.72587999f / (0.3520887068f + mx.f);
}

static inline float
fastlog (float x)
{
return 0.69314718f * fastlog2 (x);
}

// static inline float
// fasterlog(float x)
// {
Expand Down
13 changes: 0 additions & 13 deletions src/iop/colorin.c
Original file line number Diff line number Diff line change
Expand Up @@ -1436,19 +1436,6 @@ void process_sse2(struct dt_iop_module_t *self, dt_dev_pixelpipe_iop_t *piece, c
}
#endif

static void mat3mul(float *dst, const float *const m1, const float *const m2)
{
for(int k = 0; k < 3; k++)
{
for(int i = 0; i < 3; i++)
{
float x = 0.0f;
for(int j = 0; j < 3; j++) x += m1[3 * k + j] * m2[3 * j + i];
dst[3 * k + i] = x;
}
}
}

void commit_params(struct dt_iop_module_t *self, dt_iop_params_t *p1, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
{
const dt_iop_colorin_params_t *p = (dt_iop_colorin_params_t *)p1;
Expand Down
40 changes: 1 addition & 39 deletions src/iop/filmic.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "bauhaus/bauhaus.h"
#include "common/colorspaces_inline_conversions.h"
#include "common/darktable.h"
#include "common/math.h"
#include "common/opencl.h"
#include "control/control.h"
#include "develop/develop.h"
Expand Down Expand Up @@ -370,45 +371,6 @@ void init_presets(dt_iop_module_so_t *self)
self->version(), &p, sizeof(p), 1, DEVELOP_BLEND_CS_RGB_DISPLAY);
}

static inline float Log2(float x)
{
if(x > 0.0f)
{
return logf(x) / logf(2.0f);
}
else
{
return x;
}
}

static inline float Log2Thres(float x, float Thres)
{
if(x > Thres)
{
return logf(x) / logf(2.f);
}
else
{
return logf(Thres) / logf(2.f);
}
}


// From data/kernels/extended.cl
static inline float fastlog2(float x)
{
union { float f; unsigned int i; } vx = { x };
union { unsigned int i; float f; } mx = { (vx.i & 0x007FFFFF) | 0x3f000000 };
float y = vx.i;

y *= 1.1920928955078125e-7f;

return y - 124.22551499f
- 1.498030302f * mx.f
- 1.72587999f / (0.3520887068f + mx.f);
}

static inline float gaussian(float x, float std)
{
return expf(- (x * x) / (2.0f * std * std)) / (std * powf(2.0f * M_PI, 0.5f));
Expand Down
8 changes: 5 additions & 3 deletions src/iop/liquify.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
This file is part of darktable,
Copyright (C) 2014-2020 darktable developers.
Copyright (C) 2014-2021 darktable developers.

darktable is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -23,6 +23,7 @@
#include "common/interpolation.h"
#include "common/opencl.h"
#include "common/math.h"
#include "common/collection.h"
#include "control/conf.h"
#include "control/control.h"
#include "develop/imageop.h"
Expand Down Expand Up @@ -919,7 +920,8 @@ static void build_round_stamp(float complex **pstamp,
// circle in quadrants and doing only the inside we have to calculate
// hypotf only for PI / 16 = 0.196 of the stamp area.
// We don't do octants to avoid false sharing of cache lines between threads.
#ifdef _OPENMP
// doesn't work for OSX see issue #7349
#if defined(_OPENMP) && !defined(__APPLE__)
#pragma omp parallel for schedule(static) default(none) \
dt_omp_firstprivate(iradius, strength, abs_strength, table_size) \
dt_omp_sharedconst(center, warp, stamp_extent, lookup_table, LOOKUP_OVERSAMPLE)
Expand Down Expand Up @@ -2668,7 +2670,7 @@ void gui_focus(struct dt_iop_module_t *module, gboolean in)
{
if(!in)
{
dt_control_hinter_message(darktable.control, "");
dt_collection_hint_message(darktable.collection);
btn_make_radio_callback(NULL, NULL, module);
}
}
Expand Down
40 changes: 1 addition & 39 deletions src/iop/profile_gamma.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "bauhaus/bauhaus.h"
#include "common/colorspaces_inline_conversions.h"
#include "common/darktable.h"
#include "common/math.h"
#include "common/opencl.h"
#include "control/control.h"
#include "develop/develop.h"
Expand Down Expand Up @@ -185,30 +186,6 @@ int legacy_params(dt_iop_module_t *self, const void *const old_params, const int
return 1;
}

static inline float Log2(float x)
{
if(x > 0.)
{
return logf(x) / logf(2.f);
}
else
{
return x;
}
}

static inline float Log2Thres(float x, float Thres)
{
if(x > Thres)
{
return logf(x) / logf(2.f);
}
else
{
return logf(Thres) / logf(2.f);
}
}


#ifdef HAVE_OPENCL
int process_cl(struct dt_iop_module_t *self, dt_dev_pixelpipe_iop_t *piece, cl_mem dev_in, cl_mem dev_out,
Expand Down Expand Up @@ -278,21 +255,6 @@ int process_cl(struct dt_iop_module_t *self, dt_dev_pixelpipe_iop_t *piece, cl_m
}
#endif

// From data/kernels/extended.cl
static inline float fastlog2(float x)
{
union { float f; unsigned int i; } vx = { x };
union { unsigned int i; float f; } mx = { (vx.i & 0x007FFFFF) | 0x3f000000 };

float y = vx.i;

y *= 1.1920928955078125e-7f;

return y - 124.22551499f
- 1.498030302f * mx.f
- 1.72587999f / (0.3520887068f + mx.f);
}

void process(dt_iop_module_t *self, dt_dev_pixelpipe_iop_t *piece, const void *const ivoid, void *const ovoid,
const dt_iop_roi_t *const roi_in, const dt_iop_roi_t *const roi_out)
{
Expand Down
2 changes: 1 addition & 1 deletion src/iop/retouch.c
Original file line number Diff line number Diff line change
Expand Up @@ -1417,7 +1417,7 @@ static gboolean rt_display_wavelet_scale_callback(GtkToggleButton *togglebutton,
}
dt_pthread_mutex_unlock(&g->lock);

dt_iop_refresh_center(self);
dt_dev_reprocess_center(self->dev);

gtk_toggle_button_set_active(togglebutton, g->display_wavelet_scale);
return TRUE;
Expand Down
8 changes: 1 addition & 7 deletions src/iop/rotatepixels.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
#endif
#include "bauhaus/bauhaus.h"
#include "common/interpolation.h"
#include "common/math.h"
#include "develop/develop.h"
#include "develop/imageop.h"
#include "develop/tiling.h"
#include "gui/gtk.h"
#include "iop/iop_api.h"

#include <math.h>
#include <stdlib.h>

DT_MODULE_INTROSPECTION(1, dt_iop_rotatepixels_params_t)
Expand All @@ -50,12 +50,6 @@ typedef struct dt_iop_rotatepixels_data_t

dt_iop_rotatepixels_gui_data_t dummy;

static void mul_mat_vec_2(const float *m, const float *p, float *o)
{
o[0] = p[0] * m[0] + p[1] * m[1];
o[1] = p[0] * m[2] + p[1] * m[3];
}

// helper to count corners in for loops:
static void get_corner(const float *aabb, const int i, float *p)
{
Expand Down
Loading