65#if defined __DragonFly__ || defined __FreeBSD__ || defined __NetBSD__ || defined __OpenBSD__
68#elif !defined _XOPEN_SOURCE && !defined _WIN32
69#define _XOPEN_SOURCE 700
73#define __STDC_FORMAT_MACROS
80#include "external/ThreadSafetyAnalysis.h"
92#include <sys/resource.h>
96#include <glib/gstdio.h>
97#include <glib/gi18n.h>
99#include <json-glib/json-glib.h>
104#include <sys/types.h>
120#define DT_MODULE_VERSION 23
125#define DT_CURRENT_PERFORMANCE_CONFIGURE_VERSION 11
126#define DT_PERF_INFOSIZE 4096
130#define DT_MODULE(MODVER) \
131 int dt_module_dt_version() \
133 return -DT_MODULE_VERSION; \
135 int dt_module_mod_version() \
140#define DT_MODULE(MODVER) \
141 int dt_module_dt_version() \
143 return DT_MODULE_VERSION; \
145 int dt_module_mod_version() \
151#define DT_MODULE_INTROSPECTION(MODVER, PARAMSTYPE) DT_MODULE(MODVER)
179#define STR_HELPER(x) #x
182#define STR(x) STR_HELPER(x)
184#define DT_IMAGE_DBLOCKS 64
190#define DT_RESTRICT restrict
194#define UNKNOWN_IMAGE -1
213#include <mach/mach.h>
214#include <sys/sysctl.h>
217#if defined(__DragonFly__) || defined(__FreeBSD__)
218typedef unsigned int u_int;
219#include <sys/sysctl.h>
220#include <sys/types.h>
222#if defined(__NetBSD__) || defined(__OpenBSD__)
223#include <sys/param.h>
224#include <sys/sysctl.h>
227#if defined(__aarch64__)
231#if defined(__x86_64__) || defined(__i386__)
232#include <xmmintrin.h>
238#ifndef dt_omp_nontemporal
242#if (__clang__+0 >= 10 || __GNUC__ >= 9)
243# define dt_omp_nontemporal(...) nontemporal(__VA_ARGS__)
246# define dt_omp_nontemporal(var, ...)
250#define OMP_PRAGMA(x) _Pragma(#x)
251#define __OMP_PARALLEL__(...) OMP_PRAGMA(omp parallel default(firstprivate) __VA_ARGS__)
252#define __OMP_PARALLEL_FOR__(...) OMP_PRAGMA(omp parallel for default(firstprivate) schedule(static) __VA_ARGS__)
253#define __OMP_PARALLEL_FOR_SIMD__(...) OMP_PRAGMA(omp parallel for simd default(firstprivate) schedule(simd:static) __VA_ARGS__)
254#define __OMP_FOR_SIMD__(...) OMP_PRAGMA(omp for simd schedule(simd:static) __VA_ARGS__)
255#define __OMP_FOR__(...) OMP_PRAGMA(omp for schedule(static) __VA_ARGS__)
256#define __OMP_SIMD__(...) OMP_PRAGMA(omp simd __VA_ARGS__)
257#define __OMP_DECLARE_SIMD__(...) OMP_PRAGMA(omp declare simd __VA_ARGS__)
262#define __OMP_PARALLEL_FOR_CPP__(...) OMP_PRAGMA(omp parallel for default(none) schedule(static) __VA_ARGS__)
266# define omp_get_max_threads() 1
267# define omp_get_thread_num() 0
269#define __OMP_PARALLEL__(...)
270#define __OMP_PARALLEL_FOR__(...)
271#define __OMP_PARALLEL_FOR_SIMD__(...)
272#define __OMP_FOR_SIMD__(...)
273#define __OMP_FOR__(...)
274#define __OMP_SIMD__(...)
275#define __OMP_DECLARE_SIMD__(...)
277#define __OMP_PARALLEL_FOR_CPP__(...)
293#define IS_NULL_PTR(p) \
295 __typeof__(p) _tmp = (p); \
297 (__builtin_classify_type(_tmp) == 5) ? 1 : -1 \
315#if __has_attribute(target_clones) && !defined(_WIN32) && !defined(NATIVE_ARCH) && !defined(_DEBUG)
328 #if defined(__APPLE__)
330 #if defined(__aarch64__) || defined(__arm64__)
331 #define __DT_CLONE_TARGETS__
333 #elif defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__x86_64)
343 #if defined(DT_APPLE_X86_TARGET_CLONES)
344 #define __DT_CLONE_TARGETS__ \
345 __attribute__((target_clones( \
353 #define __DT_CLONE_TARGETS__
357 #define __DT_CLONE_TARGETS__
360 #elif defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__x86_64)
361 #define __DT_CLONE_TARGETS__ \
362 __attribute__((target_clones( \
370 #elif defined(__PPC64__)
372 #define __DT_CLONE_TARGETS__ __attribute__((target_clones("default","cpu=power9")))
375 #define __DT_CLONE_TARGETS__
379 #define __DT_CLONE_TARGETS__
383#define DT_IS_ALIGNED(x) __builtin_assume_aligned(x, DT_CACHELINE_BYTES)
387#if defined(__APPLE__) && defined(__aarch64__)
388 #define DT_CACHELINE_BYTES 128
389 #define DT_CACHELINE_FLOATS 32
390 #define DT_CACHELINE_PIXELS 8
392 #define DT_CACHELINE_BYTES 64
393 #define DT_CACHELINE_FLOATS 16
394 #define DT_CACHELINE_PIXELS 4
400#define DT_ALIGNED_ARRAY __attribute__((aligned(DT_CACHELINE_BYTES)))
401#define DT_ALIGNED_PIXEL __attribute__((aligned(16)))
406 return (uintptr_t)pointer % byte_count == 0;
412 return ((
size % alignment) == 0) ?
size : ((
size - 1) / alignment + 1) * alignment;
425#if defined(__FreeBSD_version) && __FreeBSD_version < 700013
426 return malloc(aligned_size);
428 return _aligned_malloc(aligned_size, alignment);
431 if(posix_memalign(&ptr, alignment, aligned_size))
return NULL;
440#define DT_STRINGIFY_HELPER(x) #x
441#define DT_STRINGIFY(x) DT_STRINGIFY_HELPER(x)
445#define dt_pixelpipe_cache_alloc_align_cache(size, id) \
446 dt_pixelpipe_cache_alloc_align_cache_impl(darktable.pixelpipe_cache, (size), (id), __FILE__ ":" DT_STRINGIFY(__LINE__))
448#ifndef dt_pixelpipe_cache_alloc_align
449#define dt_pixelpipe_cache_alloc_align(size, pipe) \
450 dt_pixelpipe_cache_alloc_align_cache((size), (pipe)->type)
453#ifndef dt_pixelpipe_cache_alloc_align_float
454#define dt_pixelpipe_cache_alloc_align_float(pixels, pipe) \
455 ((float *)dt_pixelpipe_cache_alloc_align((size_t)(pixels) * sizeof(float), (pipe)))
458#ifndef dt_pixelpipe_cache_alloc_align_float_cache
459#define dt_pixelpipe_cache_alloc_align_float_cache(pixels, id) \
460 ((float *)dt_pixelpipe_cache_alloc_align_cache((size_t)(pixels) * sizeof(float), (id)))
463#ifndef dt_pixelpipe_cache_alloc_align_int
464#define dt_pixelpipe_cache_alloc_align_int(count, pipe) \
465 ((int *)dt_pixelpipe_cache_alloc_align((size_t)(count) * sizeof(int), (pipe)))
468#ifndef dt_pixelpipe_cache_alloc_align_double
469#define dt_pixelpipe_cache_alloc_align_double(count, pipe) \
470 ((double *)dt_pixelpipe_cache_alloc_align((size_t)(count) * sizeof(double), (pipe)))
475#define dt_pixelpipe_cache_free_align(mem) \
476 dt_pixelpipe_cache_free_align_cache(darktable.pixelpipe_cache, (void **)&(mem), __FILE__ ":" DT_STRINGIFY(__LINE__));
478#define dt_free(ptr) \
479 if(!IS_NULL_PTR(ptr)) \
481 g_free((void *)(ptr)); \
482 *(void **)(&(ptr)) = NULL; \
503#define dt_free_align(ptr) \
504 if(!IS_NULL_PTR(ptr)) \
506 dt_free_align_ptr((void *)(ptr)); \
507 *(void **)(&(ptr)) = NULL; \
513 if(buf) memset(buf, 0,
size);
522 float *
const buf = (
float*)
dt_alloc_align(pixels *
sizeof(
float));
523 if(buf) memset(buf, 0, pixels *
sizeof(
float));
546typedef float dt_aligned_pixel_simd_t
__attribute__((vector_size(16), aligned(16)));
553static inline __attribute__((always_inline)) dt_aligned_pixel_simd_t
554dt_simd_abs(
const dt_aligned_pixel_simd_t
value)
556 dt_aligned_pixel_simd_t
out =
value;
557 for(
int c = 0;
c < 4;
c++)
562static inline __attribute__((always_inline)) dt_aligned_pixel_simd_t
563dt_simd_max_zero(
const dt_aligned_pixel_simd_t
value)
565 dt_aligned_pixel_simd_t
out =
value;
566 for(
int c = 0;
c < 4;
c++)
571static inline __attribute__((always_inline)) dt_aligned_pixel_simd_t
572dt_simd_copysign(
const dt_aligned_pixel_simd_t magnitude,
const dt_aligned_pixel_simd_t
sign)
574 dt_aligned_pixel_simd_t
out = magnitude;
575 for(
int c = 0; c < 4; c++)
576 out[c] = copysignf(magnitude[c],
sign[c]);
580static inline __attribute__((always_inline)) dt_aligned_pixel_simd_t
581dt_simd_pow(
const dt_aligned_pixel_simd_t base,
const dt_aligned_pixel_simd_t
exponent)
583 dt_aligned_pixel_simd_t
out = base;
584 for(
int c = 0; c < 4; c++)
589static inline __attribute__((always_inline)) dt_aligned_pixel_simd_t
590dt_load_simd(
const float *
const pixel)
592 dt_aligned_pixel_simd_t
out;
593 __builtin_memcpy(&
out, pixel,
sizeof(
out));
600 __builtin_memcpy(pixel, &
value,
sizeof(
value));
603static inline __attribute__((always_inline)) dt_aligned_pixel_simd_t
604dt_load_simd_aligned(
const float *
const pixel)
606 const float *
const in = (
const float *
const)__builtin_assume_aligned(pixel, 16);
607 return dt_load_simd(in);
613 float *
const out = (
float *
const)__builtin_assume_aligned(pixel, 16);
618dt_store_simd_nontemporal(
float *
const pixel,
const dt_aligned_pixel_simd_t
value)
620 float *
const out = (
float *
const)__builtin_assume_aligned(pixel, 16);
622#if defined(__x86_64__) || defined(__i386__)
625 dt_aligned_pixel_simd_t simd;
627 } cast = { .simd =
value };
628 _mm_stream_ps(
out, cast.sse);
629#elif defined(__aarch64__)
632 dt_aligned_pixel_simd_t simd;
634 } cast = { .simd =
value };
635 vst1q_f32(
out, cast.neon);
636#elif (__clang__+0 > 7) && (__clang__+0 < 10)
643static inline __attribute__((always_inline)) dt_aligned_pixel_simd_t
644dt_mat3x4_mul_vec4(
const dt_aligned_pixel_simd_t in,
const dt_aligned_pixel_simd_t
row0,
645 const dt_aligned_pixel_simd_t
row1,
const dt_aligned_pixel_simd_t
row2)
649 dt_aligned_pixel_simd_t
out =
row0 * in[0];
657#ifdef DT_NO_VECTORIZATION
658#define DT_PIXEL_SIMD_CHANNELS 3
660#define DT_PIXEL_SIMD_CHANNELS 4
673#if defined(_OPENMP) && defined(OPENMP_SIMD_) && !defined(DT_NO_SIMD_HINTS)
675#define _DT_Pragma_(x) _Pragma(#x)
676#define _DT_Pragma(x) _DT_Pragma_(x)
677#define for_each_channel(_var, ...) \
678 _DT_Pragma(omp simd __VA_ARGS__) \
679 for (size_t _var = 0; _var < DT_PIXEL_SIMD_CHANNELS; _var++)
680#define for_four_channels(_var, ...) \
681 _DT_Pragma(omp simd __VA_ARGS__) \
682 for (size_t _var = 0; _var < 4; _var++)
684#define for_each_channel(_var, ...) \
685 for (size_t _var = 0; _var < DT_PIXEL_SIMD_CHANNELS; _var++)
686#define for_four_channels(_var, ...) \
687 for (size_t _var = 0; _var < 4; _var++)
700 float *
const __restrict__
out,
701 const float *
const __restrict__ in)
703 dt_store_simd_nontemporal(
out, dt_load_simd(in));
710static inline void copy_pixel(
float *
const __restrict__
out,
const float *
const __restrict__ in)
774#define DT_DEBUG_SUPERVISOR ((int32_t)(1u << 31))
876int dt_init(
int argc,
char *argv[],
const gboolean init_gui,
const gboolean load_data);
900#define dt_gui_freeze_begin() dt_gui_freeze_begin_(__FILE__, __LINE__)
901#define dt_gui_freeze_end() dt_gui_freeze_end_(__FILE__, __LINE__)
911#define DT_FREEZE_CAT_(a, b) a##b
912#define DT_FREEZE_CAT(a, b) DT_FREEZE_CAT_(a, b)
913#define dt_gui_widget_freeze() \
914 dt_gui_freeze_token_t DT_FREEZE_CAT(_dt_freeze_guard_, __LINE__) \
915 __attribute__((cleanup(dt_gui_freeze_release_))) = { __FILE__, __LINE__ }; \
916 dt_gui_freeze_begin_(__FILE__, __LINE__)
947 for(
size_t k = 0;
k <
size /
sizeof(
unsigned char);
k++) {
948 unsigned char *
const item = (
unsigned char *
const)buffer +
k;
955static inline gboolean
dt_modifier_is(
const GdkModifierType
state,
const GdkModifierType desired_modifier_mask)
957 const GdkModifierType modifiers = gtk_accelerator_get_default_mod_mask();
959 return (
state & modifiers) == desired_modifier_mask;
966 const GdkModifierType modifiers = gtk_accelerator_get_default_mod_mask();
968 return (
state & (modifiers & desired_modifier_mask)) == desired_modifier_mask;
979 gettimeofday(&time, NULL);
980 return time.tv_sec - 1290608000 + (1.0 / 1000000.0) * time.tv_usec;
1000#define g_list_is_singleton(list) ((list) && (!(list)->next))
1007 if (!list)
return TRUE;
1008 list = g_list_next(list);
1016 return g_list_next(list) ? g_list_next(list) : list;
1021 return g_list_next(list) ? g_list_next(list) : head;
1028 return g_list_previous(list) ? g_list_previous(list) : g_list_last((GList*)list);
1037int dt_load_from_string(
const gchar *image_to_load, gboolean open_image_in_dr, gboolean *single_image);
1039#define dt_unreachable_codepath_with_desc(D) \
1040 dt_unreachable_codepath_with_caller(D, __FILE__, __LINE__, __FUNCTION__)
1041#define dt_unreachable_codepath() dt_unreachable_codepath_with_caller("unreachable", __FILE__, __LINE__, __FUNCTION__)
1043 const int line,
const char *function)
1045 fprintf(stderr,
"[dt_unreachable_codepath] {%s} %s:%d (%s) - we should not be here. please report this to "
1048 __builtin_unreachable();
1058 const size_t alloc_size =
n * objsize;
1067#ifndef dt_pixelpipe_cache_alloc_perthread
1068#define dt_pixelpipe_cache_alloc_perthread(n, objsize, padded_size) \
1069 ((void *)dt_pixelpipe_cache_alloc_perthread_impl((n), (objsize), (padded_size), __FILE__ ":" DT_STRINGIFY(__LINE__)))
1080#ifndef dt_pixelpipe_cache_calloc_perthread
1081#define dt_pixelpipe_cache_calloc_perthread(n, objsize, padded_size) \
1082 ((void *)dt_pixelpipe_cache_calloc_perthread_impl((n), (objsize), (padded_size), __FILE__ ":" DT_STRINGIFY(__LINE__)))
1091#ifndef dt_pixelpipe_cache_alloc_perthread_float
1092#define dt_pixelpipe_cache_alloc_perthread_float(n, padded_size) \
1093 ((float *)dt_pixelpipe_cache_alloc_perthread_float_impl((n), (padded_size), __FILE__ ":" DT_STRINGIFY(__LINE__)))
1097#define dt_get_perthread(buf, padsize) DT_IS_ALIGNED((buf) + ((padsize) * dt_get_thread_num()))
1100#define dt_get_bythread(buf, padsize, tnum) DT_IS_ALIGNED((buf) + ((padsize) * (tnum)))
1114#define DT_SIPROUND \
1117 v0 += v1; v1 = (v1 << 13) | (v1 >> 51); v1 ^= v0; v0 = (v0 << 32) | (v0 >> 32); \
1118 v2 += v3; v3 = (v3 << 16) | (v3 >> 48); v3 ^= v2; \
1119 v0 += v3; v3 = (v3 << 21) | (v3 >> 43); v3 ^= v0; \
1120 v2 += v1; v1 = (v1 << 17) | (v1 >> 47); v1 ^= v2; v2 = (v2 << 32) | (v2 >> 32); \
1129 const uint64_t k1 = 0x9e3779b97f4a7c15ULL;
1132 uint64_t v1 = 0x646f72616e646f6dULL ^ k1;
1134 uint64_t v3 = 0x7465646279746573ULL ^ k1;
1136 const uint8_t *in = (
const uint8_t *)str;
1137 const size_t blocks =
size & ~(size_t)7;
1139 for(;
i < blocks;
i += 8)
1142 __builtin_memcpy(&
m, in +
i,
sizeof(
m));
1174 return v0 ^ v1 ^ v2 ^ v3;
1179#define DT_MAX_FILENAME_LEN 256
1189#define PATH_MAX 4096
1198#define DT_MAX_PATH_FOR_PARAMS 4096
1203 gchar **split = g_strsplit(
string, to_replace, -1);
1204 gchar *text = g_strjoinv(
"", split);
1226 PangoAttrList *attrs = NULL;
1227 gchar *plain = NULL;
1229 const gchar *underscore =
"_";
1230 gunichar mnemonic = underscore[0];
1231 if(!pango_parse_markup(s, -1, mnemonic, &attrs, &plain, NULL, NULL))
1234 pango_attr_list_unref(attrs);
const char ** description(struct dt_iop_module_t *self)
return vector dt_simd_set1(valid ?(scaling+NORM_MIN) :NORM_MIN)
dt_store_simd_aligned(out, dt_mat3x4_mul_vec4(vin, dt_colormatrix_row_to_simd(matrix, 0), dt_colormatrix_row_to_simd(matrix, 1), dt_colormatrix_row_to_simd(matrix, 2)))
static const dt_aligned_pixel_simd_t const dt_aligned_pixel_simd_t row1
dt_store_simd(out, value)
static void memset_zero(void *const buffer, size_t size)
Set the memory buffer to zero as a pack of unsigned char.
void dt_show_times(const dt_times_t *start, const char *prefix)
static gchar * dt_string_replace(const char *string, const char *to_replace)
static float * dt_calloc_align_float(size_t pixels)
static void * dt_calloc_align(size_t size)
static gboolean dt_modifiers_include(const GdkModifierType state, const GdkModifierType desired_modifier_mask)
@ DT_DEBUG_CAMERA_SUPPORT
void dt_pixelpipe_cache_free_align_cache(struct dt_dev_pixelpipe_cache_t *cache, void **mem, const char *message)
void gboolean dt_supported_image(const gchar *filename)
check if file is a supported image
static void copy_pixel(float *const __restrict__ out, const float *const __restrict__ in)
static void dt_free_align_ptr(void *mem)
#define for_each_channel(_var,...)
float dt_boundingbox_t[4]
static float * dt_alloc_align_float(size_t pixels)
static size_t dt_round_size_sse(const size_t size)
void dt_gui_freeze_reset(void)
void void dt_print_nts(dt_debug_thread_t thread, const char *msg,...) __attribute__((format(printf
static void dt_gui_freeze_release_(dt_gui_freeze_token_t *t)
static void * dt_check_sse_aligned(void *pointer)
const char * dt_install_id(void)
static gchar * strip_markup(const char *s)
Remove Pango/Gtk markup and accels mnemonics from text labels. If the markup parsing fails,...
static void * dt_alloc_align_internal(size_t size)
void dt_print_mem_usage()
void dt_gui_freeze_end_(const char *file, int line)
static void dt_free_gpointer(gpointer ptr)
float dt_aligned_pixel_simd_t __attribute__((vector_size(16), aligned(16)))
Enable aggressive floating-point arithmetic optimizations, in denormals handling. Set through user pr...
static void copy_pixel_nontemporal(float *const __restrict__ out, const float *const __restrict__ in)
static void * dt_pixelpipe_cache_alloc_perthread_impl(const size_t n, const size_t objsize, size_t *padded_size, const char *message)
static const GList * g_list_next_wraparound(const GList *list, const GList *head)
static const dt_aligned_pixel_simd_t sign
static int dt_get_thread_num()
void * dt_alloc_align(size_t size)
void dt_capabilities_remove(char *capability)
void dt_print(dt_debug_thread_t thread, const char *msg,...) __attribute__((format(printf
void void void gboolean dt_gui_widgets_suppressed(void)
static void dt_get_times(dt_times_t *t)
int dt_init(int argc, char *argv[], const gboolean init_gui, const gboolean load_data)
static float * dt_pixelpipe_cache_alloc_perthread_float_impl(const size_t n, size_t *padded_size, const char *message)
#define omp_get_thread_num()
static const GList * g_list_prev_wraparound(const GList *list)
void void void dt_vprint(dt_debug_thread_t thread, const char *msg,...) __attribute__((format(printf
static gchar * delete_underscore(const char *s)
static uint64_t dt_hash(uint64_t hash, const char *str, size_t size)
size_t dt_get_mipmap_mem()
static size_t dt_round_size(const size_t size, const size_t alignment)
static void dt_unreachable_codepath_with_caller(const char *description, const char *file, const int line, const char *function)
int dt_load_from_string(const gchar *image_to_load, gboolean open_image_in_dr, gboolean *single_image)
const char * dt_session_id(void)
#define DT_MODULE_VERSION
static const dt_aligned_pixel_simd_t const dt_aligned_pixel_simd_t const dt_aligned_pixel_simd_t row2
static GList * g_list_next_bounded(GList *list)
char * dt_version_major_minor()
void dt_configure_runtime_performance(dt_sys_resources_t *resources, gboolean init_gui)
static const dt_aligned_pixel_simd_t value
void dt_capabilities_add(char *capability)
void dt_concat_path_file(char destination[4096], const char path[4096], const char *const file)
Append a constant filename to a variable, stack-based, fixed-sized, directory, and add a / in-between...
static double dt_get_wtime(void)
static void * dt_pixelpipe_cache_calloc_perthread_impl(const size_t n, const size_t objsize, size_t *padded_size, const char *message)
void dt_capabilities_cleanup()
static gboolean dt_is_aligned(const void *pointer, size_t byte_count)
static const dt_aligned_pixel_simd_t exponent
void * dt_pixelpipe_cache_alloc_align_cache_impl(struct dt_dev_pixelpipe_cache_t *cache, size_t size, int id, const char *name)
static gboolean dt_modifier_is(const GdkModifierType state, const GdkModifierType desired_modifier_mask)
void dt_show_times_f(const dt_times_t *start, const char *prefix, const char *suffix,...) __attribute__((format(printf
static const dt_aligned_pixel_simd_t row0
size_t dt_get_available_mem()
int dt_capabilities_check(char *capability)
#define IS_NULL_PTR(p)
C is way too permissive with !=, == and if(var) checks, which can mean too many things depending on w...
#define DT_CACHELINE_BYTES
void dt_gui_freeze_begin_(const char *file, int line)
static gboolean g_list_shorter_than(const GList *list, unsigned len)
int getrusage(int who, struct rusage *usage)
float *const restrict const size_t k
c< 3;c++) acc+=v_1[c] *v_2[c];return acc;}static inline float sqf(const float x){ return x *x;}static inline float euclidean_norm(const dt_aligned_pixel_t vector){ return fmaxf(sqrtf(sqf(vector[0])+sqf(vector[1])+sqf(vector[2])), 1.52587890625e-05f);}static inline void downscale_vector(dt_aligned_pixel_t vector, const float scaling){ const int valid=(scaling > 1.52587890625e-05f) &&!isnan(scaling);for(size_t c=0;c< 3;c++) vector[c]=(valid) ? vector[c]/(scaling+1.52587890625e-05f) :vector[c]/1.52587890625e-05f ;}static inline void upscale_vector(dt_aligned_pixel_t vector, const float scaling){ const int valid=(scaling > 1.52587890625e-05f) &&!isnan(scaling);for(size_t c=0;c< 3;c++) vector[c]=(valid) ? vector[c] *(scaling+1.52587890625e-05f) :vector[c] *1.52587890625e-05f ;}static inline float dt_log2f(const float f){ return logf(f)/logf(2.0f);}union float_int { float f;int k;};static inline float dt_fast_hypotf(const float x, const float y){ return sqrtf(x *x+y *y);}static inline float dt_fast_expf(const float x){ const int i1=0x3f800000u;const int i2=0x402DF854u;const int k0=i1+x *(i2 - i1);union float_int u;u.k=k0 > k0
float dt_aligned_pixel_t[4]
const float uint32_t state[4]
unsigned __int64 uint64_t
dt_pthread_mutex_t readFile_mutex
int32_t unmuted_signal_dbg_acts
struct dt_imageio_t * imageio
struct dt_dev_pixelpipe_cache_t * pixelpipe_cache
int32_t num_openmp_threads
struct dt_gui_gtk_t * gui
dt_pthread_rwlock_t database_threadsafe
struct dt_colorspaces_t * color_profiles
struct dt_collection_t * collection
struct dt_mipmap_cache_t * mipmap_cache
struct dt_selection_t * selection
dt_pthread_mutex_t exiv2_threadsafe
struct dt_sys_resources_t dtresources
dt_pthread_mutex_t plugin_threadsafe
dt_pthread_mutex_t capabilities_threadsafe
const struct dt_database_t * db
struct dt_control_signal_t * signals
struct dt_bauhaus_t * bauhaus
struct dt_opencl_t * opencl
struct dt_image_cache_t * image_cache
struct dt_develop_t * develop
struct dt_points_t * points
dt_pthread_mutex_t pipeline_threadsafe
struct dt_view_manager_t * view_manager
JsonParser * noiseprofile_parser
gboolean unmuted_signal_dbg[DT_SIGNAL_COUNT]
const struct dt_pwstorage_t * pwstorage
struct dt_control_t * control