97inline static void _copy_buffer(
const char *
const restrict input,
char *
const restrict output,
98 const size_t height,
const size_t o_width,
const size_t i_width,
99 const size_t x_offset,
const size_t y_offset,
100 const size_t stride,
const size_t bpp)
103#pragma omp parallel for default(none) \
104 dt_omp_firstprivate(input, output, bpp, o_width, i_width, height, x_offset, y_offset, stride) \
107 for(
size_t j = 0; j <
height; j++)
108 memcpy(output +
bpp * j * o_width,
109 input +
bpp * (x_offset + (y_offset + j) * i_width),
115 const size_t width,
const size_t height,
const size_t chan)
118#pragma omp parallel for simd default(none) \
119 aligned(input, output: 64) \
120 dt_omp_firstprivate(input, output, width, height, chan) \
125 const size_t index = k * chan;
127 output[index + 0] = (float)input[index + 2] / 255.f;
128 output[index + 1] = (float)input[index + 1] / 255.f;
129 output[index + 2] = (float)input[index + 0] / 255.f;
130 output[index + 3] = 0.f;
136 gboolean store_masks)
249 pipe->
icc_filename = g_strdup(icc_filename ? icc_filename :
"");
326 for(GList *nodes = pipe->
nodes; nodes; nodes = g_list_next(nodes))
330 piece->module->cleanup_pipe(piece->module, pipe, piece);
339 g_list_free(pipe->
nodes);
344 g_list_free(pipe->
iop);
355 g_assert(pipe->
nodes == NULL);
356 g_assert(pipe->
iop == NULL);
364 pipe->
iop = g_list_copy(dev->
iop);
365 for(GList *modules = pipe->
iop; modules; modules = g_list_next(modules))
369 piece->
enabled =
module->enabled;
371 piece->histogram_params.roi = NULL;
372 piece->histogram_params.bins_count = 256;
373 piece->histogram_stats.bins_count = 0;
374 piece->histogram_stats.pixels = 0;
376 = ((
module->default_colorspace(module, pipe, NULL) == IOP_CS_RAW) && (dt_image_is_raw(&pipe->image)))
379 piece->iscale = pipe->
iscale;
380 piece->iwidth = pipe->
iwidth;
381 piece->iheight = pipe->
iheight;
382 piece->module =
module;
386 piece->blendop_hash = 0;
387 piece->global_hash = 0;
388 piece->global_mask_hash = 0;
389 piece->bypass_cache =
FALSE;
390 piece->process_cl_ready = 0;
391 piece->process_tiling_ready = 0;
392 piece->raster_masks = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL,
dt_free_align_ptr);
393 memset(&piece->processed_roi_in, 0,
sizeof(piece->processed_roi_in));
394 memset(&piece->processed_roi_out, 0,
sizeof(piece->processed_roi_out));
397 memset(&piece->dsc_mask, 0,
sizeof(piece->dsc_mask));
398 piece->dsc_mask.channels = 1;
400 piece->dsc_mask.filters = 0;
403 pipe->
nodes = g_list_append(pipe->
nodes, piece);
426 return dt_hash(hash, (
const char *)&pos,
sizeof(
int));
443 distort_hash =
dt_hash(distort_hash, (
const char *)&distort_hash,
sizeof(
uint64_t));
446 gboolean bypass_cache =
FALSE;
448 for(GList *node = g_list_first(pipe->
nodes); node; node = g_list_next(node))
469 local_hash =
dt_hash(local_hash, (
const char *)&piece->module->request_mask_display,
sizeof(
int));
479 dt_print(
DT_DEBUG_PIPE,
"[pixelpipe] global hash for %s (%s) in pipe %i with hash %lu\n", piece->module->op, piece->module->multi_name, pipe->
type, (
long unsigned int)hash);
498 if(piece->module == hist->module)
524 for(GList *nodes = g_list_last(pipe->
nodes); nodes; nodes = g_list_previous(nodes))
544 dt_print(
DT_DEBUG_DEV,
"[pixelpipe] synch all modules with defaults_params for pipe %i called from %s\n", pipe->
type, caller_func);
545 dt_print(
DT_DEBUG_DEV,
"[pixelpipe] synch all modules with history for pipe %i called from %s\n", pipe->
type, caller_func);
551 for(GList *nodes = g_list_first(pipe->
nodes); nodes; nodes = g_list_next(nodes))
556 piece->
enabled = piece->module->default_enabled;
557 gboolean found_history =
FALSE;
561 for(GList *history = g_list_nth(dev->
history, history_end - 1);
563 history = g_list_previous(history))
568 found_history =
TRUE;
574 if(!found_history && piece->
enabled)
576 dt_iop_commit_params(piece->module, piece->module->default_params, piece->module->default_blendop_params,
578 dt_print(
DT_DEBUG_PIPE,
"[pixelpipe] info: committed default params for %s (%s) in pipe %i \n", piece->module->op, piece->module->multi_name, pipe->
type);
583 GList *last_item = g_list_nth(dev->
history, history_end - 1);
602 GList *first_item = NULL;
603 for(GList *history = last_item; history; history = g_list_previous(history))
606 first_item = history;
625 for(GList *history = first_item; history && history != fence_item; history = g_list_next(history))
652 dt_print(
DT_DEBUG_DEV,
"[dt_dev_pixelpipe_change] pipeline state changing for pipe %i, flag %i\n", pipe->
type, status);
693 dt_show_times_f(&start,
"[dt_dev_pixelpipe_change] pipeline resync on the current modules stack",
"for pipe %i", pipe->
type);
699 if(module)
return module->output_format(module, pipe, piece, dsc);
714 uint32_t **histogram, uint32_t *histogram_max)
721 if(histogram_params.
roi == NULL)
724 .
width = roi->
width, .height = roi->
height, .crop_x = 0, .crop_y = 0, .crop_width = 0, .crop_height = 0
727 histogram_params.
roi = &histogram_roi;
739 if(!strcmp(op,
"demosaic"))
741 else if(!strcmp(op,
"colorout"))
743 else if(!strcmp(op,
"gamma"))
756 if(!(
bpp == 4 *
sizeof(
float)))
return;
759 if(backbuf == NULL)
return;
760 if(backbuf->
hash == hash)
return;
763 if(backbuf->
buffer == NULL)
767 if(backbuf->
buffer == NULL)
785 if(backbuf->
buffer == NULL)
797 if(backbuf->
buffer == NULL)
805 backbuf->
hash = hash;
816 dt_show_times_f(&start,
"[dev_pixelpipe]",
"copying global histogram for %s", module->
op);
830 dt_aligned_pixel_t picked_color_min, dt_aligned_pixel_t picked_color_max,
844 for(
int k = 0; k < 4; k += 2) fbox[k] = sample->
box[k] * wd;
845 for(
int k = 1; k < 4; k += 2) fbox[k] = sample->
box[k] * ht;
849 fbox[0] = fbox[2] = sample->
point[0] * wd;
850 fbox[1] = fbox[3] = sample->
point[1] * ht;
864 box[0] = fminf(fbox[0], fbox[2]);
865 box[1] = fminf(fbox[1], fbox[3]);
866 box[2] = fmaxf(fbox[0], fbox[2]);
867 box[3] = fmaxf(fbox[1], fbox[3]);
872 for(
int k = 2; k < 4; k++) box[k] += 1;
876 if(box[0] >=
width || box[1] >=
height || box[2] < 0 || box[3] < 0)
return 1;
879 for(
int k = 0; k < 4; k += 2) box[k] =
MIN(
width - 1,
MAX(0, box[k]));
880 for(
int k = 1; k < 4; k += 2) box[k] =
MIN(
height - 1,
MAX(0, box[k]));
883 if(box[2] - box[0] < 1 || box[3] - box[1] < 1)
return 1;
889 const float *pixel,
const dt_iop_roi_t *roi,
float *picked_color,
890 float *picked_color_min,
float *picked_color_max,
897 for(
int k = 0; k < 4; k++)
899 picked_color_min[k] = INFINITY;
900 picked_color_max[k] = -INFINITY;
901 picked_color[k] = 0.0f;
907 dt_aligned_pixel_t min, max, avg;
908 for(
int k = 0; k < 4; k++)
919 for(
int k = 0; k < 4; k++)
921 picked_color_min[k] = min[k];
922 picked_color_max[k] = max[k];
923 picked_color[k] = avg[k];
981 module->input_colorspace(module, pipe, piece), &input_format->
cst,
989 module->histogram = realloc(module->histogram, buf_size);
991 module->histogram_stats = piece->histogram_stats;
999#define KILL_SWITCH_ABORT \
1000 if(dt_atomic_get_int(&pipe->shutdown)) \
1002 if(*cl_mem_output != NULL) \
1004 dt_opencl_release_mem_object(*cl_mem_output); \
1005 *cl_mem_output = NULL; \
1008 pipe->status = DT_DEV_PIXELPIPE_DIRTY; \
1014#define KILL_SWITCH_AND_FLUSH_CACHE \
1015 if(dt_atomic_get_int(&pipe->shutdown)) \
1017 dt_dev_pixelpipe_cache_remove(darktable.pixelpipe_cache, hash, TRUE, output_entry); \
1018 if(*cl_mem_output != NULL) \
1020 dt_opencl_release_mem_object(*cl_mem_output); \
1021 *cl_mem_output = NULL; \
1024 pipe->status = DT_DEV_PIXELPIPE_DIRTY; \
1042 module->input_colorspace(module, pipe, piece), &input_format->
cst,
1056 module->process_tiling(module, piece, input, *output, roi_in, roi_out, in_bpp);
1063 fprintf(stderr,
"[pixelpipe_process_on_CPU] Warning: processes `%s' even if memory requirements are not met\n", module->
op);
1065 module->process(module, piece, input, *output, roi_in, roi_out);
1071 pipe->
dsc.
cst =
module->output_colorspace(module, pipe, piece);
1078 input_format->
cst, blend_cst, &input_format->
cst,
1095 for(GList *node = g_list_last(pipe->
nodes); node; node = g_list_previous(node))
1098 if(piece->
enabled)
return piece;
1124 input_format->
cst, picker_cst, &input_format->
cst,
1142static void *_gpu_init_buffer(
int devid,
void *
const host_ptr,
const dt_iop_roi_t *roi,
const size_t bpp,
1146 void *cl_mem_input = dt_opencl_alloc_device_use_host_pointer(devid, roi->
width, roi->
height,
bpp, host_ptr,
1147 CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR);
1149 if(cl_mem_input == NULL)
1155 return cl_mem_input;
1159static void _gpu_clear_buffer(
void **cl_mem_buffer)
1161 if(*cl_mem_buffer != NULL)
1164 *cl_mem_buffer = NULL;
1168static gboolean _check_zero_memory(
void *cl_mem_pinned,
void *host_ptr,
dt_iop_module_t *module,
const char *message)
1170 if(cl_mem_pinned == host_ptr)
1172 printf(
"✅ Zero-copy: GPU is using your host memory directly for %s %s\n", module->
op, message);
1177 printf(
"❌ Not zero-copy: OpenCL made a temporary device-side copy for %s %s\n", module->
op, message);
1184static int _cl_pinned_memory_copy(
const int devid,
void *host_ptr,
void *cl_mem_buffer,
const dt_iop_roi_t *roi,
1187 void *cl_mem_pinned_input = dt_opencl_map_image(devid, cl_mem_buffer,
TRUE, cl_mode, roi->
width,
1189 dt_opencl_unmap_mem_object(devid, cl_mem_buffer, cl_mem_pinned_input);
1193 if(!_check_zero_memory(cl_mem_pinned_input, host_ptr, module, message))
1195 cl_int err = CL_SUCCESS;
1197 if(cl_mode == CL_MAP_WRITE)
1198 err = dt_opencl_write_host_to_device(devid, host_ptr, cl_mem_buffer, roi->
width, roi->
height,
bpp);
1199 else if(cl_mode == CL_MAP_READ)
1200 err = dt_opencl_read_host_from_device(devid, host_ptr, cl_mem_buffer, roi->
width, roi->
height,
bpp);
1202 if(err != CL_SUCCESS)
1205 module->
op, message);
1219 const size_t in_bpp,
const size_t bpp)
1230 gboolean success_opencl =
TRUE;
1233 const float required_factor_cl = fmaxf(1.0f, (cl_mem_input != NULL) ?
tiling->factor_cl - 1.0f :
tiling->factor_cl);
1237 required_factor_cl,
tiling->overhead);
1247 gboolean possible_cl = (
module->process_cl && piece->process_cl_ready
1248 && !(((pipe->type & DT_DEV_PIXELPIPE_PREVIEW) == DT_DEV_PIXELPIPE_PREVIEW
1249 || (pipe->type & DT_DEV_PIXELPIPE_PREVIEW2) == DT_DEV_PIXELPIPE_PREVIEW2)
1250 && (module->flags() & IOP_FLAGS_PREVIEW_NON_OPENCL))
1251 && (fits_on_device || piece->process_tiling_ready));
1253 if(possible_cl && !fits_on_device)
1258 const float border =
tiling->overlap + 1;
1262 const gboolean possible = (cl_px > dx * border) || (cl_px > dy * border) || (cl_px > border * border);
1266 module->
op, cl_px / 1e6f, dx*dy / 1e6f, (
int)dx, (
int)dy, (
int)
tiling->overlap);
1273 if(!possible_cl)
goto error;
1280 if(cl_mem_input == NULL)
1282 cl_mem_input = _gpu_init_buffer(pipe->
devid, input, roi_in, in_bpp, module,
"input");
1283 if(cl_mem_input == NULL)
goto error;
1284 if(_cl_pinned_memory_copy(pipe->
devid, input, cl_mem_input, roi_in, CL_MAP_WRITE, in_bpp, module,
1290 *cl_mem_output = _gpu_init_buffer(pipe->
devid, *output, roi_out,
bpp, module,
"output");
1291 if(*cl_mem_output == NULL)
goto error;
1294 if(!dt_ioppr_transform_image_colorspace_cl(
1295 module, piece->
pipe->devid, cl_mem_input, cl_mem_input, roi_in->
width, roi_in->
height, input_cst_cl,
1296 module->input_colorspace(module, pipe, piece), &input_cst_cl, work_profile))
1300 if(!module->process_cl(module, piece, cl_mem_input, *cl_mem_output, roi_in, roi_out))
1307 pipe->
dsc.
cst =
module->output_colorspace(module, pipe, piece);
1313 success_opencl &= dt_ioppr_transform_image_colorspace_cl(
1314 module, piece->
pipe->devid, cl_mem_input, cl_mem_input, roi_in->
width, roi_in->
height, input_cst_cl,
1315 blend_cst, &input_cst_cl, work_profile);
1316 success_opencl &= dt_ioppr_transform_image_colorspace_cl(
1317 module, piece->
pipe->devid, *cl_mem_output, *cl_mem_output, roi_out->
width, roi_out->
height,
1318 pipe->
dsc.
cst, blend_cst, &pipe->
dsc.
cst, work_profile);
1329 if(dt_develop_blend_process_cl(module, piece, cl_mem_input, *cl_mem_output, roi_in, roi_out))
1335 if(_cl_pinned_memory_copy(pipe->
devid, *output, *cl_mem_output, roi_out, CL_MAP_READ,
bpp, module,
1342 if(input_format->
cst != input_cst_cl)
1344 input_format->
cst = input_cst_cl;
1345 if(_cl_pinned_memory_copy(pipe->
devid, input, cl_mem_input, roi_in, CL_MAP_READ, in_bpp, module,
1346 "color-converted input"))
1353 _gpu_clear_buffer(&cl_mem_input);
1357 module->input_colorspace(module, pipe, piece), &input_format->
cst,
1361 if(!module->process_tiling_cl(module, piece, input, *output, roi_in, roi_out, in_bpp))
1368 pipe->
dsc.
cst =
module->output_colorspace(module, pipe, piece);
1375 input_format->
cst, blend_cst, &input_format->
cst,
1398 _gpu_clear_buffer(&cl_mem_input);
1411 _gpu_clear_buffer(cl_mem_output);
1412 _gpu_clear_buffer(&cl_mem_input);
1415 if(input != NULL && *output != NULL)
1417 piece,
tiling, pixelpipe_flow);
1426 char histogram_log[32] =
"";
1429 snprintf(histogram_log,
sizeof(histogram_log),
", collected histogram on %s",
1437 start,
"[dev_pixelpipe]",
"processed `%s' on %s%s%s, blended on %s [%s]", module_label,
1449 g_free(module_label);
1461 int hasinf = 0, hasnan = 0;
1462 dt_aligned_pixel_t min = { FLT_MAX };
1463 dt_aligned_pixel_t max = { FLT_MIN };
1465 for(
int k = 0; k < 4 * roi_out->
width * roi_out->
height; k++)
1469 float f = ((
float *)(output))[k];
1476 min[k & 3] = fmin(
f, min[k & 3]);
1477 max[k & 3] = fmax(
f, max[k & 3]);
1482 fprintf(stderr,
"[dev_pixelpipe] module `%s' outputs NaNs! [%s]\n", module_label,
1485 fprintf(stderr,
"[dev_pixelpipe] module `%s' outputs non-finite floats! [%s]\n", module_label,
1487 fprintf(stderr,
"[dev_pixelpipe] module `%s' min: (%f; %f; %f) max: (%f; %f; %f) [%s]\n", module_label,
1492 int hasinf = 0, hasnan = 0;
1493 float min = FLT_MAX;
1494 float max = FLT_MIN;
1496 for(
int k = 0; k < roi_out->
width * roi_out->
height; k++)
1498 float f = ((
float *)(output))[k];
1510 fprintf(stderr,
"[dev_pixelpipe] module `%s' outputs NaNs! [%s]\n", module_label,
1513 fprintf(stderr,
"[dev_pixelpipe] module `%s' outputs non-finite floats! [%s]\n", module_label,
1515 fprintf(stderr,
"[dev_pixelpipe] module `%s' min: (%f) max: (%f) [%s]\n", module_label, min, max,
1519 g_free(module_label);
1528 const gboolean bypass_cache,
1529 const size_t bufsize,
const size_t bpp)
1534 output, out_format, &cache_entry);
1535 if(*output == NULL)
return 1;
1541 if(bypass_cache || new_entry)
1561 else if(roi_in->
scale == 1.0f)
1565 const int in_x =
MAX(roi_in->
x, 0);
1566 const int in_y =
MAX(roi_in->
y, 0);
1570 if(cp_width > 0 && cp_height > 0)
1587 roi_in->
x /= roi_out->
scale;
1588 roi_in->
y /= roi_out->
scale;
1591 roi_in->
scale = 1.0f;
1599 "Base buffer init: scale %f != 1.0 but the input has %li bytes per pixel. This case is not "
1600 "covered by the pipeline, please report the bug.\n",
1630 if(strcmp(module->
op,
"gamma") == 0)
1647 const dt_iop_roi_t *roi_out, GList *modules, GList *pieces,
int pos)
1657 void *cl_mem_input = NULL;
1658 *cl_mem_output = NULL;
1664 module = (dt_iop_module_t *)modules->data;
1669 g_list_previous(modules), g_list_previous(pieces), pos - 1);
1676 const size_t bufsize = (size_t)
bpp * roi_out->
width * roi_out->
height;
1678 const gboolean bypass_cache = (module) ? piece->bypass_cache :
FALSE;
1688 && !bypass_cache && !pipe->
reentry
1694 dt_print(
DT_DEBUG_PIPE,
"[pipeline] found %lu (%s) for %s pipeline in cache\n", hash, (module) ? module->
op :
"noop",
1705 if(
_init_base_buffer(pipe, dev, output, cl_mem_output, out_format, &roi_in, roi_out, hash, bypass_cache, bufsize,
1716 memcpy(&roi_in, &piece->planned_roi_in,
sizeof(
dt_iop_roi_t));
1725 piece->processed_roi_in = roi_in;
1726 piece->processed_roi_out = *roi_out;
1729 g_list_previous(modules), g_list_previous(pieces), pos - 1))
1735 piece->dsc_out = piece->dsc_in = *input_format;
1736 module->output_format(module, pipe, piece, &piece->dsc_out);
1737 **out_format = pipe->
dsc = piece->dsc_out;
1745 if(strcmp(module->
op,
"gamma") != 0
1748 && (in_bpp == out_bpp)
1749 && !memcmp(&roi_in, roi_out,
sizeof(
struct dt_iop_roi_t)))
1752 **out_format = pipe->
dsc = piece->dsc_out = piece->dsc_in;
1761 char *
name = g_strdup_printf(
"module %s (%s) for pipe %i", module->
op, module->
multi_name, pipe->
type);
1763 output, out_format, &output_entry);
1765 if(*output == NULL || input == NULL)
1778 if(!pipe->
reentry && !new_entry)
1780 dt_print(
DT_DEBUG_PIPE,
"[pipeline] found %lu (%s) for %s pipeline in cache\n", hash, (module) ? module->
op :
"noop",
1784 _sample_all(pipe, dev, input, output, &roi_in, roi_out, input_format, out_format, module,
1785 piece, input_hash, hash, in_bpp,
bpp, input_entry, output_entry);
1793 module->tiling_callback(module, piece, &roi_in, roi_out, &tiling);
1817 assert(
tiling.factor > 0.0f);
1818 assert(
tiling.factor_cl > 0.0f);
1832 error = pixelpipe_process_on_GPU(pipe, dev, input, cl_mem_input, input_format, &roi_in, output, cl_mem_output,
1833 out_format, roi_out, module, piece, &
tiling, &pixelpipe_flow, in_bpp,
bpp);
1836 piece, &
tiling, &pixelpipe_flow);
1844 if(bypass_cache || pipe->
reentry)
1848 **out_format = piece->dsc_out = pipe->
dsc;
1867 _sample_all(pipe, dev, input, output, &roi_in, roi_out, input_format, out_format, module, piece, input_hash,
1868 hash, in_bpp,
bpp, input_entry, output_entry);
1890 int height,
double scale)
1893 GList *gammap = g_list_last(pipe->
nodes);
1895 while(strcmp(gamma->module->op,
"gamma"))
1898 gammap = g_list_previous(gammap);
1910 GList *nodes = g_list_last(pipe->
nodes);
1912 while(strcmp(piece->module->op, op))
1916 nodes = g_list_previous(nodes);
1924 GList *nodes = pipe->
nodes;
1926 while(strcmp(piece->module->op, op))
1930 nodes = g_list_next(nodes);
1936#define KILL_SWITCH_PIPE \
1937 if(dt_atomic_get_int(&pipe->shutdown)) \
1939 if(pipe->devid >= 0) \
1941 dt_opencl_unlock_device(pipe->devid); \
1944 pipe->status = DT_DEV_PIXELPIPE_DIRTY; \
1945 if(pipe->forms) g_list_free_full(pipe->forms, (void (*)(void *))dt_masks_free_form); \
1961 "[opencl] Too many opencl errors; disabling opencl for this session!\n");
1962 dt_control_log(_(
"Ansel discovered problems with your OpenCL setup; disabling OpenCL for this session!"));
1975 fprintf(stderr,
"[memory] before pixelpipe process\n");
1985 const guint pos = g_list_length(pipe->
iop);
1986 GList *modules = g_list_last(pipe->
iop);
1987 GList *pieces = g_list_last(pipe->
nodes);
2006 gboolean keep_running =
TRUE;
2007 int opencl_error = 0;
2020 void *cl_mem_out = NULL;
2030 dt_show_times(&start,
"[pixelpipe] pixel pipeline processing");
2034 _gpu_clear_buffer(&cl_mem_out);
2046 keep_running = (oclerr || (err && pipe->
opencl_error));
2091 if(pipe->
devid >= 0)
2110 && dev->
gui_module->operation_tags_filter() & current_module->operation_tags());
2115 const int width_in,
const int height_in,
2120 GList *modules = g_list_first(pipe->
iop);
2121 GList *pieces = g_list_first(pipe->
nodes);
2127 piece->buf_in = roi_in;
2133 module->modify_roi_out(module, piece, &roi_out, &roi_in);
2141 piece->buf_out = roi_out;
2144 modules = g_list_next(modules);
2145 pieces = g_list_next(pieces);
2163 GList *modules = g_list_last(pipe->
iop);
2164 GList *pieces = g_list_last(pipe->
nodes);
2170 piece->planned_roi_out = roi_out_temp;
2175 module->modify_roi_in(module, piece, &roi_out_temp, &roi_in);
2180 roi_in = roi_out_temp;
2183 piece->planned_roi_in = roi_in;
2184 roi_out_temp = roi_in;
2186 modules = g_list_previous(modules);
2187 pieces = g_list_previous(pieces);
2203 gboolean success =
TRUE;
2205 gchar *target_name = g_strdup_printf(
"%s (%s)", clean_target_name, target_module->
multi_name);
2207 if(source_piece == NULL || current_piece == NULL)
2209 fprintf(stderr,
"[raster masks] ERROR: source: %s, current: %s\n",
2210 (source_piece != NULL) ?
"is defined" :
"is undefined",
2211 (current_piece != NULL) ?
"is definded" :
"is undefined");
2214 if(source_piece == NULL)
2219 hint = g_strdup_printf(
2220 _(
"\n- Check if the module providing the masks for the module %s has not been deleted.\n"),
2223 else if(current_piece == NULL)
2229 hint = g_strdup_printf(_(
"\n- Check if the module %s (%s) providing the masks has not been moved above %s.\n"),
2230 delete_underscore(source_piece->module->name()), source_piece->module->multi_name, clean_target_name);
2233 dt_control_log(_(
"The %s module is trying to reuse a mask from a module but it can't be found.\n"
2234 "Masking in %s will be disabled until a mask is available.\n"
2236 target_name, target_name, hint ? hint :
"");
2239 fprintf(stderr,
"[raster masks] no source module for module %s could be found\n", target_name);
2243 if(success && !source_piece->
enabled)
2246 gchar *source_name = g_strdup_printf(
"%s (%s)", clean_source_name, source_piece->module->multi_name);
2248 dt_control_log(_(
"The `%s` module is trying to reuse a mask from disabled module `%s`.\n"
2249 "Disabled modules cannot provide their masks to other modules.\n"
2250 "Masking in `%s` will be disabled until `%s` is re-enabled."),
2251 target_name, source_name, target_name, source_name);
2253 fprintf(stderr,
"[raster masks] module %s trying to reuse a mask from disabled instance of %s\n",
2254 target_name, source_name);
2256 g_free(clean_source_name);
2257 g_free(source_name);
2261 g_free(clean_target_name);
2262 g_free(target_name);
2268 gboolean *free_mask,
int *
error)
2274 gchar *target_name = g_strdup_printf(
"%s (%s)", clean_target_name, target_module->
multi_name);
2276 if(!raster_mask_source)
2278 fprintf(stderr,
"[raster masks] The source module of the mask for %s was not found\n", target_name);
2279 g_free(clean_target_name);
2280 g_free(target_name);
2285 float *raster_mask = NULL;
2290 GList *source_iter = NULL;
2291 for(source_iter = g_list_last(pipe->
nodes); source_iter; source_iter = g_list_previous(source_iter))
2294 if(candidate->module == target_module)
2296 current_piece = candidate;
2298 else if(candidate->module == raster_mask_source)
2300 source_piece = candidate;
2315 gchar *source_name = g_strdup_printf(
"%s (%s)", clean_source_name, source_piece->module->multi_name);
2316 raster_mask = g_hash_table_lookup(source_piece->
raster_masks, GINT_TO_POINTER(raster_mask_id));
2322 "[raster masks] found in %s mask id %i from %s (%s) for module %s (%s) in pipe %i with hash %lu\n",
2324 raster_mask_id, source_name, source_piece->module->multi_name, target_name, target_module->
multi_name,
2325 pipe->
type, raster_hash);
2333 "[raster masks] mask id %i from %s for module %s could not be found in pipe %i. Pipe re-entry will be attempted.\n",
2334 raster_mask_id, source_name, target_name, pipe->
type);
2343 g_free(clean_target_name);
2344 g_free(target_name);
2349 for(GList *iter = g_list_next(source_iter); iter; iter = g_list_next(iter))
2357 if(module->module->distort_mask
2358 && !(!strcmp(module->module->
op,
"finalscale")
2359 && module->processed_roi_in.width == 0
2360 && module->processed_roi_in.height == 0))
2363 * module->processed_roi_out.height);
2364 if(!transformed_mask)
2366 fprintf(stderr,
"[raster masks] could not allocate memory for transformed mask\n");
2368 g_free(clean_target_name);
2369 g_free(target_name);
2373 module->module->distort_mask(module->module,
2377 &module->processed_roi_in,
2378 &module->processed_roi_out);
2381 raster_mask = transformed_mask;
2382 fprintf(stdout,
"doing transform\n");
2384 else if(!module->module->distort_mask &&
2385 (module->processed_roi_in.width != module->processed_roi_out.width ||
2386 module->processed_roi_in.height != module->processed_roi_out.height ||
2387 module->processed_roi_in.x != module->processed_roi_out.x ||
2388 module->processed_roi_in.y != module->processed_roi_out.y))
2389 fprintf(stderr,
"FIXME: module `%s' changed the roi from %d x %d @ %d / %d to %d x %d | %d / %d but doesn't have "
2390 "distort_mask() implemented!\n", module->module->
op, module->processed_roi_in.width,
2391 module->processed_roi_in.height, module->processed_roi_in.x, module->processed_roi_in.y,
2392 module->processed_roi_out.width, module->processed_roi_out.height, module->processed_roi_out.x,
2393 module->processed_roi_out.y);
2396 if(module->module == target_module)
2406 g_free(clean_target_name);
2407 g_free(target_name);
2422 if(p->rawdetail_mask_data)
2434 if((mask == NULL) || (tmp == NULL))
goto error;
2436 p->rawdetail_mask_data = mask;
2437 memcpy(&p->rawdetail_mask_roi, roi_in,
sizeof(
dt_iop_roi_t));
2439 dt_aligned_pixel_t wb = { piece->
pipe->dsc.temperature.coeffs[0],
2440 piece->
pipe->dsc.temperature.coeffs[1],
2441 piece->
pipe->dsc.temperature.coeffs[2] };
2444 wb[0] = wb[1] = wb[2] = 1.0f;
2452 fprintf(stderr,
"[dt_dev_write_rawdetail_mask] couldn't write detail mask\n");
2464 if(
p->rawdetail_mask_data)
2479 const int devid =
p->devid;
2481 cl_int err = CL_SUCCESS;
2483 if(mask == NULL)
goto error;
2484 out = dt_opencl_alloc_device(devid,
width,
height,
sizeof(
float));
2485 if(out == NULL)
goto error;
2486 tmp = dt_opencl_alloc_device_buffer(devid,
sizeof(
float) *
width *
height);
2487 if(tmp == NULL)
goto error;
2491 dt_aligned_pixel_t wb = { piece->
pipe->dsc.temperature.coeffs[0],
2492 piece->
pipe->dsc.temperature.coeffs[1],
2493 piece->
pipe->dsc.temperature.coeffs[2] };
2496 wb[0] = wb[1] = wb[2] = 1.0f;
2498 size_t sizes[3] = { ROUNDUPDWD(
width, devid), ROUNDUPDHT(
height, devid), 1 };
2507 if(err != CL_SUCCESS)
goto error;
2510 size_t sizes[3] = { ROUNDUPDWD(
width, devid), ROUNDUPDHT(
height, devid), 1 };
2517 if(err != CL_SUCCESS)
goto error;
2521 err = dt_opencl_read_host_from_device(devid, mask, out,
width,
height,
sizeof(
float));
2522 if(err != CL_SUCCESS)
goto error;
2525 p->rawdetail_mask_data =
mask;
2526 memcpy(&
p->rawdetail_mask_roi, roi_in,
sizeof(
dt_iop_roi_t));
2534 fprintf(stderr,
"[dt_dev_write_rawdetail_mask_cl] couldn't write detail mask: %i\n", err);
2548 gboolean valid =
FALSE;
2552 for(source_iter = pipe->
nodes; source_iter; source_iter = g_list_next(source_iter))
2567 if(!valid)
return NULL;
2570 float *resmask = src;
2571 float *inmask = src;
2574 for(GList *iter = source_iter; iter; iter = g_list_next(iter))
2580 if(module->module->distort_mask
2581 && !(!strcmp(module->module->
op,
"finalscale")
2582 && module->processed_roi_in.width == 0
2583 && module->processed_roi_in.height == 0))
2585 float *tmp =
dt_alloc_align_float((
size_t)module->processed_roi_out.width * module->processed_roi_out.height);
2586 dt_vprint(
DT_DEBUG_MASKS,
" %s %ix%i -> %ix%i\n", module->module->
op, module->processed_roi_in.width, module->processed_roi_in.height, module->processed_roi_out.width, module->processed_roi_out.height);
2587 module->module->distort_mask(module->module, module, inmask, tmp, &module->processed_roi_in, &module->processed_roi_out);
2592 else if(!module->module->distort_mask &&
2593 (module->processed_roi_in.width != module->processed_roi_out.width ||
2594 module->processed_roi_in.height != module->processed_roi_out.height ||
2595 module->processed_roi_in.x != module->processed_roi_out.x ||
2596 module->processed_roi_in.y != module->processed_roi_out.y))
2597 fprintf(stderr,
"FIXME: module `%s' changed the roi from %d x %d @ %d / %d to %d x %d | %d / %d but doesn't have "
2598 "distort_mask() implemented!\n", module->module->
op, module->processed_roi_in.width,
2599 module->processed_roi_in.height, module->processed_roi_in.x, module->processed_roi_in.y,
2600 module->processed_roi_out.width, module->processed_roi_out.height, module->processed_roi_out.x,
2601 module->processed_roi_out.y);
2603 if(module->module == target_module)
break;
static void error(char *msg)
Definition ashift_lsd.c:191
#define TRUE
Definition ashift_lsd.c:151
#define FALSE
Definition ashift_lsd.c:147
void dt_atomic_set_int(dt_atomic_int *var, int value)
Definition atomic.h:45
int dt_atomic_get_int(dt_atomic_int *var)
Definition atomic.h:46
int levels(struct dt_imageio_module_data_t *data)
Definition avif.c:685
int width
Definition bilateral.h:1
int height
Definition bilateral.h:1
int dt_develop_blend_process(struct dt_iop_module_t *self, struct dt_dev_pixelpipe_iop_t *piece, const void *const ivoid, void *const ovoid, const struct dt_iop_roi_t *const roi_in, const struct dt_iop_roi_t *const roi_out)
Definition blend.c:425
dt_iop_colorspace_type_t dt_develop_blend_colorspace(const dt_dev_pixelpipe_iop_t *const piece, dt_iop_colorspace_type_t cst)
Definition blend.c:133
void tiling_callback_blendop(struct dt_iop_module_t *self, struct dt_dev_pixelpipe_iop_t *piece, const dt_iop_roi_t *roi_in, const dt_iop_roi_t *roi_out, struct dt_develop_tiling_t *tiling)
Definition blend.c:1362
@ DEVELOP_MASK_DISABLED
Definition blend.h:94
typedef void((*dt_cache_allocate_t)(void *userdata, dt_cache_entry_t *entry))
dt_iop_colorspace_type_t
Definition color_conversion.h:24
@ IOP_CS_RAW
Definition color_conversion.h:26
@ IOP_CS_LCH
Definition color_conversion.h:29
@ IOP_CS_JZCZHZ
Definition color_conversion.h:31
@ IOP_CS_RGB
Definition color_conversion.h:28
@ IOP_CS_HSL
Definition color_conversion.h:30
@ IOP_CS_LAB
Definition color_conversion.h:27
@ IOP_CS_NONE
Definition color_conversion.h:25
void dt_color_picker_helper(const dt_iop_buffer_dsc_t *dsc, const float *const pixel, const dt_iop_roi_t *roi, const int *const box, dt_aligned_pixel_t picked_color, dt_aligned_pixel_t picked_color_min, dt_aligned_pixel_t picked_color_max, const dt_iop_colorspace_type_t image_cst, const dt_iop_colorspace_type_t picker_cst, const dt_iop_order_iccprofile_info_t *const profile)
Definition color_picker.c:605
dt_iop_colorspace_type_t dt_iop_color_picker_get_active_cst(dt_iop_module_t *module)
Definition color_picker_proxy.c:246
static float kernel(const float *x, const float *y)
Definition colorchecker.c:435
@ DT_LIB_COLORPICKER_SIZE_POINT
Definition colorpicker.h:26
@ DT_LIB_COLORPICKER_SIZE_BOX
Definition colorpicker.h:27
dt_iop_color_intent_t
Definition colorspaces.h:43
@ DT_INTENT_LAST
Definition colorspaces.h:48
dt_colorspaces_color_profile_type_t
Definition colorspaces.h:61
@ DT_COLORSPACE_NONE
Definition colorspaces.h:62
void dt_histogram_max_helper(const dt_dev_histogram_stats_t *const histogram_stats, const dt_iop_colorspace_type_t cst, const dt_iop_colorspace_type_t cst_to, uint32_t **histogram, uint32_t *histogram_max)
Definition common/histogram.c:396
void dt_histogram_helper(dt_dev_histogram_collection_params_t *histogram_params, dt_dev_histogram_stats_t *histogram_stats, const dt_iop_colorspace_type_t cst, const dt_iop_colorspace_type_t cst_to, const void *pixel, uint32_t **histogram, const int compensate_middle_grey, const dt_iop_order_iccprofile_info_t *const profile_info)
Definition common/histogram.c:365
gboolean dt_image_is_rawprepare_supported(const dt_image_t *img)
Definition common/image.c:190
int dt_image_is_raw(const dt_image_t *img)
Definition common/image.c:120
void dt_control_log(const char *msg,...)
Definition control.c:424
void dt_control_queue_redraw_widget(GtkWidget *widget)
threadsafe request of redraw of specific widget. Use this function if you need to redraw a specific w...
Definition control.c:550
void dt_vprint(dt_debug_thread_t thread, const char *msg,...)
Definition darktable.c:1420
void dt_show_times(const dt_times_t *start, const char *prefix)
Definition darktable.c:1433
darktable_t darktable
Definition darktable.c:111
void dt_print_mem_usage()
Definition darktable.c:1686
void dt_capabilities_remove(char *capability)
Definition darktable.c:1669
void dt_show_times_f(const dt_times_t *start, const char *prefix, const char *suffix,...)
Definition darktable.c:1447
void dt_print(dt_debug_thread_t thread, const char *msg,...)
Definition darktable.c:1395
#define UNKNOWN_IMAGE
Definition darktable.h:139
@ DT_DEBUG_OPENCL
Definition darktable.h:478
@ DT_DEBUG_PIPE
Definition darktable.h:497
@ DT_DEBUG_NAN
Definition darktable.h:482
@ DT_DEBUG_MEMORY
Definition darktable.h:480
@ DT_DEBUG_DEV
Definition darktable.h:474
@ DT_DEBUG_MASKS
Definition darktable.h:483
@ DT_DEBUG_TILING
Definition darktable.h:495
float dt_boundingbox_t[4]
Definition darktable.h:467
static float * dt_alloc_align_float(size_t pixels)
Definition darktable.h:345
#define dt_free_align_ptr
Definition darktable.h:335
static void dt_get_times(dt_times_t *t)
Definition darktable.h:693
static gchar * delete_underscore(const char *s)
Definition darktable.h:845
static uint64_t dt_hash(uint64_t hash, const char *str, size_t size)
Definition darktable.h:805
#define dt_free_align(A)
Definition darktable.h:334
#define DT_MAX_FILENAME_LEN
Definition darktable.h:814
int32_t dt_dev_get_history_end(struct dt_develop_t *dev)
Definition develop.c:1439
int dt_dev_distort_backtransform_plus(dt_develop_t *dev, dt_dev_pixelpipe_t *pipe, const double iop_order, const int transf_direction, float *points, size_t points_count)
Definition develop.c:1273
gchar * dt_history_item_get_name(const struct dt_iop_module_t *module)
Definition develop.c:1167
@ DT_DEV_PIXELPIPE_DISPLAY_NONE
Definition develop.h:81
@ DT_DEV_TRANSFORM_DIR_FORW_INCL
Definition develop.h:73
@ DT_DEV_TRANSFORM_DIR_FORW_EXCL
Definition develop.h:74
@ DT_DEV_DETAIL_MASK_DEMOSAIC
Definition develop.h:110
@ DT_DEV_DETAIL_MASK_REQUIRED
Definition develop.h:109
@ DT_DEV_DETAIL_MASK_RAWPREPARE
Definition develop.h:111
@ DT_DEV_DETAIL_MASK_NONE
Definition develop.h:108
static int dt_pthread_mutex_unlock(dt_pthread_mutex_t *mutex) RELEASE(mutex) NO_THREAD_SAFETY_ANALYSIS
Definition dtpthread.h:321
static int dt_pthread_mutex_init(dt_pthread_mutex_t *mutex, const pthread_mutexattr_t *mutexattr)
Definition dtpthread.h:306
static int dt_pthread_mutex_destroy(dt_pthread_mutex_t *mutex)
Definition dtpthread.h:326
static int dt_pthread_mutex_lock(dt_pthread_mutex_t *mutex) ACQUIRE(mutex) NO_THREAD_SAFETY_ANALYSIS
Definition dtpthread.h:311
static float f(const float t, const float c, const float x)
Definition graduatednd.c:173
@ IMAGEIO_RGB
Definition imageio.h:55
@ IMAGEIO_INT8
Definition imageio.h:47
void dt_iop_commit_params(dt_iop_module_t *module, dt_iop_params_t *params, dt_develop_blend_params_t *blendop_params, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
Definition imageop.c:1722
void dt_iop_init_pipe(struct dt_iop_module_t *module, struct dt_dev_pixelpipe_t *pipe, struct dt_dev_pixelpipe_iop_t *piece)
Definition imageop.c:442
void dt_iop_nap(int32_t usec)
Definition imageop.c:2431
@ DT_REQUEST_COLORPICK_OFF
Definition imageop.h:137
@ IOP_FLAGS_SUPPORTS_BLENDING
Definition imageop.h:108
@ IOP_TAG_DISTORT
Definition imageop.h:92
void dt_iop_clip_and_zoom(float *out, const float *const in, const dt_iop_roi_t *const roi_out, const dt_iop_roi_t *const roi_in, const int32_t out_stride, const int32_t in_stride)
Definition imageop_math.c:134
GList * dt_ioppr_iop_order_copy_deep(GList *iop_order_list)
Definition iop_order.c:1440
__DT_CLONE_TARGETS__ void dt_ioppr_transform_image_colorspace(struct dt_iop_module_t *self, const float *const image_in, float *const image_out, const int width, const int height, const int cst_from, const int cst_to, int *converted_cst, const dt_iop_order_iccprofile_info_t *const profile_info)
Definition iop_profile.c:1017
dt_iop_order_iccprofile_info_t * dt_ioppr_get_pipe_current_profile_info(dt_iop_module_t *module, struct dt_dev_pixelpipe_t *pipe)
Definition iop_profile.c:902
dt_iop_order_iccprofile_info_t * dt_ioppr_get_pipe_work_profile_info(struct dt_dev_pixelpipe_t *pipe)
Definition iop_profile.c:887
GList * dt_masks_dup_forms_deep(GList *forms, dt_masks_form_t *form)
Definition develop/masks/masks.c:71
void dt_masks_free_form(dt_masks_form_t *form)
Definition develop/masks/masks.c:982
void dt_masks_calc_rawdetail_mask(float *const src, float *const out, float *const tmp, const int width, const int height, const dt_aligned_pixel_t wb)
float iscale
Definition mipmap_cache.c:2
size_t size
Definition mipmap_cache.c:3
#define dt_mipmap_cache_get(A, B, C, D, E, F)
Definition mipmap_cache.h:110
@ DT_MIPMAP_BLOCKING
Definition mipmap_cache.h:50
#define dt_mipmap_cache_release(A, B)
Definition mipmap_cache.h:132
dt_mipmap_size_t
Definition mipmap_cache.h:30
mask
Definition dtstyle_to_xmp.py:54
static int dt_opencl_enqueue_kernel_2d(const int dev, const int kernel, const size_t *sizes)
Definition opencl.h:560
static size_t dt_opencl_get_device_available(const int devid)
Definition opencl.h:589
static int dt_opencl_set_kernel_arg(const int dev, const int kernel, const size_t size, const void *arg)
Definition opencl.h:556
static void dt_opencl_events_reset(const int devid)
Definition opencl.h:608
static void dt_opencl_unlock_device(const int dev)
Definition opencl.h:524
static int dt_opencl_update_settings(void)
Definition opencl.h:580
static void dt_opencl_check_tuning(const int devid)
Definition opencl.h:593
static int dt_opencl_is_inited(void)
Definition opencl.h:569
#define DT_OPENCL_MAX_ERRORS
Definition opencl.h:30
static int dt_opencl_lock_device(const int dev)
Definition opencl.h:520
static int dt_opencl_events_flush(const int devid, const int reset)
Definition opencl.h:614
static gboolean dt_opencl_image_fits_device(const int devid, const size_t width, const size_t height, const unsigned bpp, const float factor, const size_t overhead)
Definition opencl.h:584
static gboolean dt_opencl_finish(const int devid)
Definition opencl.h:512
static void dt_opencl_release_mem_object(void *mem)
Definition opencl.h:601
@ DT_REQUEST_ON
Definition pixelpipe.h:43
@ DT_REQUEST_ONLY_IN_GUI
Definition pixelpipe.h:44
@ DT_DEV_PIXELPIPE_THUMBNAIL
Definition pixelpipe.h:33
@ DT_DEV_PIXELPIPE_ANY
Definition pixelpipe.h:35
@ DT_DEV_PIXELPIPE_EXPORT
Definition pixelpipe.h:30
@ DT_DEV_PIXELPIPE_PREVIEW
Definition pixelpipe.h:32
@ DT_DEV_PIXELPIPE_FULL
Definition pixelpipe.h:31
int dt_dev_pixelpipe_cache_remove(dt_dev_pixelpipe_cache_t *cache, const uint64_t hash, const gboolean force, dt_pixel_cache_entry_t *cache_entry)
Arbitrarily remove the cache entry matching hash. Entries having a reference count > 0 (inter-thread ...
Definition pixelpipe_cache.c:112
void dt_dev_pixelpipe_cache_ref_count_entry(dt_dev_pixelpipe_cache_t *cache, const uint64_t hash, gboolean lock, dt_pixel_cache_entry_t *cache_entry)
Increase/Decrease the reference count on the cache line as to prevent LRU item removal....
Definition pixelpipe_cache.c:462
void dt_dev_pixelpipe_cache_rdlock_entry(dt_dev_pixelpipe_cache_t *cache, const uint64_t hash, gboolean lock, dt_pixel_cache_entry_t *cache_entry)
Lock or release the read lock on the entry.
Definition pixelpipe_cache.c:495
void dt_dev_pixelpipe_cache_wrlock_entry(dt_dev_pixelpipe_cache_t *cache, const uint64_t hash, gboolean lock, dt_pixel_cache_entry_t *cache_entry)
Lock or release the write lock on the entry.
Definition pixelpipe_cache.c:471
void dt_dev_pixelpipe_cache_print(dt_dev_pixelpipe_cache_t *cache)
Definition pixelpipe_cache.c:547
void dt_dev_pixel_pipe_cache_auto_destroy_apply(dt_dev_pixelpipe_cache_t *cache, const uint64_t hash, const int id, dt_pixel_cache_entry_t *cache_entry)
Definition pixelpipe_cache.c:531
uint64_t dt_dev_pixelpipe_cache_get_hash_data(dt_dev_pixelpipe_cache_t *cache, void *data, dt_pixel_cache_entry_t **entry)
Find the hash of the cache entry holding the buffer data.
Definition pixelpipe_cache.c:414
void dt_dev_pixelpipe_cache_flag_auto_destroy(dt_dev_pixelpipe_cache_t *cache, uint64_t hash, dt_pixel_cache_entry_t *cache_entry)
Flag the cache entry matching hash as "auto_destroy". This is useful for short-lived/disposable cache...
Definition pixelpipe_cache.c:519
int dt_dev_pixelpipe_cache_get_existing(dt_dev_pixelpipe_cache_t *cache, const uint64_t hash, void **data, dt_iop_buffer_dsc_t **dsc, dt_pixel_cache_entry_t **entry)
Get an existing cache line from the cache. This is similar to dt_dev_pixelpipe_cache_get,...
Definition pixelpipe_cache.c:335
int dt_dev_pixelpipe_cache_get(dt_dev_pixelpipe_cache_t *cache, const uint64_t hash, const size_t size, const char *name, const int id, void **data, dt_iop_buffer_dsc_t **dsc, dt_pixel_cache_entry_t **entry)
Get a cache line from the cache. This internally increases the reference count, so you have to manual...
Definition pixelpipe_cache.c:295
static uint64_t _node_hash(dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece, const dt_iop_roi_t *roi_out, const int pos)
Definition pixelpipe_hb.c:413
void dt_dev_pixelpipe_disable_before(dt_dev_pixelpipe_t *pipe, const char *op)
Definition pixelpipe_hb.c:1922
int dt_dev_pixelpipe_init_preview(dt_dev_pixelpipe_t *pipe)
Definition pixelpipe_hb.c:159
static void _sample_all(dt_dev_pixelpipe_t *pipe, dt_develop_t *dev, void *input, void **output, const dt_iop_roi_t *roi_in, const dt_iop_roi_t *roi_out, dt_iop_buffer_dsc_t *input_format, dt_iop_buffer_dsc_t **output_format, dt_iop_module_t *module, dt_dev_pixelpipe_iop_t *piece, const uint64_t input_hash, const uint64_t hash, const size_t in_bpp, const size_t bpp, dt_pixel_cache_entry_t *const input_entry, dt_pixel_cache_entry_t *const output_entry)
Definition pixelpipe_hb.c:1613
static void collect_histogram_on_CPU(dt_dev_pixelpipe_t *pipe, dt_develop_t *dev, float *input, const dt_iop_roi_t *roi_in, dt_iop_buffer_dsc_t *input_format, dt_iop_module_t *module, dt_dev_pixelpipe_iop_t *piece)
Definition pixelpipe_hb.c:967
gboolean _commit_history_to_node(dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece, dt_dev_history_item_t *hist)
Definition pixelpipe_hb.c:496
void dt_dev_pixelpipe_reset_reentry(dt_dev_pixelpipe_t *pipe)
Definition pixelpipe_hb.c:315
static dt_iop_colorspace_type_t _transform_for_picker(dt_iop_module_t *self, const dt_iop_colorspace_type_t cst)
Definition pixelpipe_hb.c:942
int dt_dev_pixelpipe_init_cached(dt_dev_pixelpipe_t *pipe)
Definition pixelpipe_hb.c:180
void dt_dev_pixelpipe_get_roi_out(dt_dev_pixelpipe_t *pipe, struct dt_develop_t *dev, const int width_in, const int height_in, int *width, int *height)
Definition pixelpipe_hb.c:2114
gboolean dt_dev_pixelpipe_has_reentry(dt_dev_pixelpipe_t *pipe)
Definition pixelpipe_hb.c:310
float * dt_dev_distort_detail_mask(const dt_dev_pixelpipe_t *pipe, float *src, const dt_iop_module_t *target_module)
Definition pixelpipe_hb.c:2545
dt_pixelpipe_flow_t
Definition pixelpipe_hb.c:50
@ PIXELPIPE_FLOW_HISTOGRAM_ON_GPU
Definition pixelpipe_hb.c:54
@ PIXELPIPE_FLOW_HISTOGRAM_NONE
Definition pixelpipe_hb.c:52
@ PIXELPIPE_FLOW_PROCESSED_ON_CPU
Definition pixelpipe_hb.c:55
@ PIXELPIPE_FLOW_PROCESSED_WITH_TILING
Definition pixelpipe_hb.c:57
@ PIXELPIPE_FLOW_PROCESSED_ON_GPU
Definition pixelpipe_hb.c:56
@ PIXELPIPE_FLOW_NONE
Definition pixelpipe_hb.c:51
@ PIXELPIPE_FLOW_BLENDED_ON_CPU
Definition pixelpipe_hb.c:58
@ PIXELPIPE_FLOW_HISTOGRAM_ON_CPU
Definition pixelpipe_hb.c:53
@ PIXELPIPE_FLOW_BLENDED_ON_GPU
Definition pixelpipe_hb.c:59
void dt_dev_pixelpipe_synch_top(dt_dev_pixelpipe_t *pipe, dt_develop_t *dev)
Definition pixelpipe_hb.c:591
gboolean dt_dev_write_rawdetail_mask(dt_dev_pixelpipe_iop_t *piece, float *const rgb, const dt_iop_roi_t *const roi_in, const int mode)
Definition pixelpipe_hb.c:2417
void dt_dev_pixelpipe_disable_after(dt_dev_pixelpipe_t *pipe, const char *op)
Definition pixelpipe_hb.c:1908
void dt_dev_pixelpipe_synch_all_real(dt_dev_pixelpipe_t *pipe, dt_develop_t *dev, const char *caller_func)
Find the last history item matching each pipeline node (module), in the order of pipeline execution....
Definition pixelpipe_hb.c:542
dt_backbuf_t * _get_backuf(dt_develop_t *dev, const char *op)
Definition pixelpipe_hb.c:737
static void pixelpipe_picker(dt_iop_module_t *module, dt_dev_pixelpipe_iop_t *piece, dt_iop_buffer_dsc_t *dsc, const float *pixel, const dt_iop_roi_t *roi, float *picked_color, float *picked_color_min, float *picked_color_max, const dt_iop_colorspace_type_t image_cst, dt_pixelpipe_picker_source_t picker_source)
Definition pixelpipe_hb.c:888
static void _print_perf_debug(dt_dev_pixelpipe_t *pipe, const dt_pixelpipe_flow_t pixelpipe_flow, dt_dev_pixelpipe_iop_t *piece, dt_iop_module_t *module, dt_times_t *start)
Definition pixelpipe_hb.c:1424
void dt_dev_pixelpipe_synch(dt_dev_pixelpipe_t *pipe, dt_develop_t *dev, GList *history)
Definition pixelpipe_hb.c:515
dt_pixelpipe_picker_source_t
Definition pixelpipe_hb.c:63
@ PIXELPIPE_PICKER_INPUT
Definition pixelpipe_hb.c:64
@ PIXELPIPE_PICKER_OUTPUT
Definition pixelpipe_hb.c:65
static gboolean _transform_for_blend(const dt_iop_module_t *const self, const dt_dev_pixelpipe_iop_t *const piece)
Definition pixelpipe_hb.c:928
static gboolean _dt_dev_raster_mask_check(dt_dev_pixelpipe_iop_t *source_piece, dt_dev_pixelpipe_iop_t *current_piece, const dt_iop_module_t *target_module)
Checks the validity of the raster mask source and target modules, outputs errors if necessary....
Definition pixelpipe_hb.c:2200
static void _print_nan_debug(dt_dev_pixelpipe_t *pipe, void *cl_mem_output, void *output, const dt_iop_roi_t *roi_out, dt_iop_buffer_dsc_t *out_format, dt_iop_module_t *module, const size_t bpp)
Definition pixelpipe_hb.c:1453
#define KILL_SWITCH_ABORT
Definition pixelpipe_hb.c:999
void dt_dev_pixelpipe_set_icc(dt_dev_pixelpipe_t *pipe, dt_colorspaces_color_profile_type_t icc_type, const gchar *icc_filename, dt_iop_color_intent_t icc_intent)
Definition pixelpipe_hb.c:244
void dt_dev_pixelpipe_create_nodes(dt_dev_pixelpipe_t *pipe, dt_develop_t *dev)
Definition pixelpipe_hb.c:352
int dt_dev_pixelpipe_process_no_gamma(dt_dev_pixelpipe_t *pipe, dt_develop_t *dev, int x, int y, int width, int height, double scale)
Definition pixelpipe_hb.c:1889
static void _print_opencl_errors(int error, dt_dev_pixelpipe_t *pipe)
Definition pixelpipe_hb.c:1951
static dt_dev_pixelpipe_iop_t * _last_node_in_pipe(dt_dev_pixelpipe_t *pipe)
Definition pixelpipe_hb.c:1093
int dt_dev_pixelpipe_init_export(dt_dev_pixelpipe_t *pipe, int32_t width, int32_t height, int levels, gboolean store_masks)
Definition pixelpipe_hb.c:135
void dt_dev_pixelpipe_get_roi_in(dt_dev_pixelpipe_t *pipe, struct dt_develop_t *dev, const struct dt_iop_roi_t roi_out)
Definition pixelpipe_hb.c:2151
static int dt_dev_pixelpipe_process_rec(dt_dev_pixelpipe_t *pipe, dt_develop_t *dev, void **output, void **cl_mem_output, dt_iop_buffer_dsc_t **out_format, const dt_iop_roi_t *roi_out, GList *modules, GList *pieces, int pos)
Definition pixelpipe_hb.c:1645
int dt_dev_pixelpipe_init_dummy(dt_dev_pixelpipe_t *pipe, int32_t width, int32_t height)
Definition pixelpipe_hb.c:152
static void get_output_format(dt_iop_module_t *module, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece, dt_develop_t *dev, dt_iop_buffer_dsc_t *dsc)
Definition pixelpipe_hb.c:696
static char * _pipe_type_to_str(int pipe_type)
Definition pixelpipe_hb.c:73
static void _sample_color_picker(dt_dev_pixelpipe_t *pipe, dt_develop_t *dev, float *input, dt_iop_buffer_dsc_t *input_format, const dt_iop_roi_t *roi_in, void **output, dt_iop_buffer_dsc_t **out_format, const dt_iop_roi_t *roi_out, dt_iop_module_t *module, dt_dev_pixelpipe_iop_t *piece)
Definition pixelpipe_hb.c:1104
void dt_dev_pixelpipe_set_input(dt_dev_pixelpipe_t *pipe, dt_develop_t *dev, int32_t imgid, int width, int height, float iscale, dt_mipmap_size_t size)
Definition pixelpipe_hb.c:230
float * dt_dev_get_raster_mask(dt_dev_pixelpipe_t *pipe, const dt_iop_module_t *raster_mask_source, const int raster_mask_id, const dt_iop_module_t *target_module, gboolean *free_mask, int *error)
Definition pixelpipe_hb.c:2266
static uint64_t _default_pipe_hash(dt_dev_pixelpipe_t *pipe)
Definition pixelpipe_hb.c:407
#define KILL_SWITCH_PIPE
Definition pixelpipe_hb.c:1936
void dt_dev_pixelpipe_cleanup(dt_dev_pixelpipe_t *pipe)
Definition pixelpipe_hb.c:253
gboolean dt_dev_pixelpipe_unset_reentry(dt_dev_pixelpipe_t *pipe, uint64_t hash)
Remove the re-entry pipeline flag, only if the object identifier is the one that set it....
Definition pixelpipe_hb.c:297
static void histogram_collect(dt_dev_pixelpipe_iop_t *piece, const void *pixel, const dt_iop_roi_t *roi, uint32_t **histogram, uint32_t *histogram_max)
Definition pixelpipe_hb.c:713
static void _copy_buffer(const char *const restrict input, char *const restrict output, const size_t height, const size_t o_width, const size_t i_width, const size_t x_offset, const size_t y_offset, const size_t stride, const size_t bpp)
Definition pixelpipe_hb.c:97
gboolean dt_dev_pixelpipe_activemodule_disables_currentmodule(struct dt_develop_t *dev, struct dt_iop_module_t *current_module)
Definition pixelpipe_hb.c:2105
int dt_dev_pixelpipe_init_thumbnail(dt_dev_pixelpipe_t *pipe, int32_t width, int32_t height)
Definition pixelpipe_hb.c:145
static int pixelpipe_process_on_CPU(dt_dev_pixelpipe_t *pipe, dt_develop_t *dev, float *input, dt_iop_buffer_dsc_t *input_format, const dt_iop_roi_t *roi_in, void **output, dt_iop_buffer_dsc_t **out_format, const dt_iop_roi_t *roi_out, dt_iop_module_t *module, dt_dev_pixelpipe_iop_t *piece, dt_develop_tiling_t *tiling, dt_pixelpipe_flow_t *pixelpipe_flow)
Definition pixelpipe_hb.c:1028
int dt_dev_pixelpipe_init(dt_dev_pixelpipe_t *pipe)
Definition pixelpipe_hb.c:170
static void _uint8_to_float(const uint8_t *const input, float *const output, const size_t width, const size_t height, const size_t chan)
Definition pixelpipe_hb.c:114
#define KILL_SWITCH_AND_FLUSH_CACHE
Definition pixelpipe_hb.c:1014
static void pixelpipe_get_histogram_backbuf(dt_dev_pixelpipe_t *pipe, dt_develop_t *dev, void *output, const dt_iop_roi_t *roi, dt_iop_module_t *module, dt_dev_pixelpipe_iop_t *piece, const uint64_t hash, const size_t bpp)
Definition pixelpipe_hb.c:749
gboolean dt_dev_pixelpipe_set_reentry(dt_dev_pixelpipe_t *pipe, uint64_t hash)
Set the re-entry pipeline flag, only if no object is already capturing it. Re-entered pipelines run w...
Definition pixelpipe_hb.c:283
void dt_dev_pixelpipe_change(dt_dev_pixelpipe_t *pipe, struct dt_develop_t *dev)
Definition pixelpipe_hb.c:642
static int pixelpipe_picker_helper(dt_iop_module_t *module, const dt_iop_roi_t *roi, dt_aligned_pixel_t picked_color, dt_aligned_pixel_t picked_color_min, dt_aligned_pixel_t picked_color_max, dt_pixelpipe_picker_source_t picker_source, int *box)
Definition pixelpipe_hb.c:829
void dt_pixelpipe_get_global_hash(dt_dev_pixelpipe_t *pipe, dt_develop_t *dev)
Definition pixelpipe_hb.c:431
static int _init_base_buffer(dt_dev_pixelpipe_t *pipe, dt_develop_t *dev, void **output, void **cl_mem_output, dt_iop_buffer_dsc_t **out_format, dt_iop_roi_t *roi_in, const dt_iop_roi_t *roi_out, const uint64_t hash, const gboolean bypass_cache, const size_t bufsize, const size_t bpp)
Definition pixelpipe_hb.c:1524
void dt_dev_clear_rawdetail_mask(dt_dev_pixelpipe_t *pipe)
Definition pixelpipe_hb.c:2411
int dt_dev_pixelpipe_process(dt_dev_pixelpipe_t *pipe, dt_develop_t *dev, int x, int y, int width, int height, double scale)
Definition pixelpipe_hb.c:1970
void dt_dev_pixelpipe_cleanup_nodes(dt_dev_pixelpipe_t *pipe)
Definition pixelpipe_hb.c:323
dt_dev_pixelpipe_change_t
Definition pixelpipe_hb.h:103
@ DT_DEV_PIPE_SYNCH
Definition pixelpipe_hb.h:107
@ DT_DEV_PIPE_TOP_CHANGED
Definition pixelpipe_hb.h:105
@ DT_DEV_PIPE_REMOVE
Definition pixelpipe_hb.h:106
@ DT_DEV_PIPE_UNCHANGED
Definition pixelpipe_hb.h:104
#define dt_dev_pixelpipe_synch_all(pipe, dev)
Definition pixelpipe_hb.h:289
@ DT_DEV_PIXELPIPE_DIRTY
Definition pixelpipe_hb.h:114
void output_format(dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece, dt_iop_buffer_dsc_t *dsc)
Definition rawprepare.c:274
#define DT_DEBUG_CONTROL_SIGNAL_RAISE(ctlsig, signal,...)
Definition signal.h:276
@ DT_SIGNAL_CONTROL_PICKERDATA_READY
This signal is raised when new color picker data are available in the pixelpipe. 1 module 2 piece no ...
Definition signal.h:229
unsigned __int64 uint64_t
Definition strptime.c:71
struct dt_lib_t * lib
Definition darktable.h:537
struct dt_dev_pixelpipe_cache_t * pixelpipe_cache
Definition darktable.h:556
struct dt_mipmap_cache_t * mipmap_cache
Definition darktable.h:542
struct dt_control_signal_t * signals
Definition darktable.h:540
struct dt_opencl_t * opencl
Definition darktable.h:551
int32_t unmuted
Definition darktable.h:526
struct dt_develop_t * develop
Definition darktable.h:536
size_t height
Definition develop.h:135
uint64_t hash
Definition develop.h:136
size_t width
Definition develop.h:134
void * buffer
Definition develop.h:133
size_t bpp
Definition develop.h:138
Definition colorpicker.h:42
dt_lib_colorpicker_size_t size
Definition colorpicker.h:49
dt_boundingbox_t box
Definition colorpicker.h:48
float point[2]
Definition colorpicker.h:47
Definition pixelpipe.h:49
const struct dt_histogram_roi_t * roi
Definition pixelpipe.h:51
uint32_t bins_count
Definition pixelpipe.h:62
Definition dev_history.h:30
uint64_t hash
Definition dev_history.h:42
dt_iop_params_t * params
Definition dev_history.h:33
char multi_name[128]
Definition dev_history.h:38
struct dt_develop_blend_params_t * blend_params
Definition dev_history.h:34
struct dt_iop_module_t *gboolean enabled
Definition dev_history.h:31
Definition pixelpipe_hb.h:46
gboolean enabled
Definition pixelpipe_hb.h:62
uint32_t histogram_max[4]
Definition pixelpipe_hb.h:68
dt_dev_request_flags_t request_histogram
Definition pixelpipe_hb.h:64
uint64_t blendop_hash
Definition pixelpipe_hb.h:75
struct dt_iop_module_t *struct dt_dev_pixelpipe_t * pipe
Definition pixelpipe_hb.h:48
uint64_t global_hash
Definition pixelpipe_hb.h:79
uint64_t hash
Definition pixelpipe_hb.h:74
dt_iop_buffer_dsc_t dsc_in
Definition pixelpipe_hb.h:94
uint32_t * histogram
Definition pixelpipe_hb.h:66
dt_dev_histogram_stats_t histogram_stats
Definition pixelpipe_hb.h:67
uint64_t global_mask_hash
Definition pixelpipe_hb.h:82
dt_iop_roi_t planned_roi_out
Definition pixelpipe_hb.h:89
gboolean bypass_cache
Definition pixelpipe_hb.h:97
int process_tiling_ready
Definition pixelpipe_hb.h:91
GHashTable * raster_masks
Definition pixelpipe_hb.h:99
dt_dev_histogram_collection_params_t histogram_params
Definition pixelpipe_hb.h:65
void * data
Definition pixelpipe_hb.h:49
void * blendop_data
Definition pixelpipe_hb.h:61
dt_iop_roi_t planned_roi_in
Definition pixelpipe_hb.h:89
Definition pixelpipe_hb.h:127
dt_colorspaces_color_profile_type_t icc_type
Definition pixelpipe_hb.h:200
struct dt_iop_order_iccprofile_info_t * work_profile_info
Definition pixelpipe_hb.h:146
struct dt_iop_order_iccprofile_info_t * input_profile_info
Definition pixelpipe_hb.h:148
int iwidth
Definition pixelpipe_hb.h:133
int want_detail_mask
Definition pixelpipe_hb.h:171
float backbuf_zoom_x
Definition pixelpipe_hb.h:160
GList * iop
Definition pixelpipe_hb.h:204
int opencl_error
Definition pixelpipe_hb.h:183
struct dt_iop_order_iccprofile_info_t * output_profile_info
Definition pixelpipe_hb.h:150
int running
Definition pixelpipe_hb.h:177
uint64_t backbuf_hash
Definition pixelpipe_hb.h:161
gchar * icc_filename
Definition pixelpipe_hb.h:201
int processed_width
Definition pixelpipe_hb.h:137
dt_dev_pixelpipe_change_t changed
Definition pixelpipe_hb.h:155
uint64_t last_history_hash
Definition pixelpipe_hb.h:215
dt_pthread_mutex_t busy_mutex
Definition pixelpipe_hb.h:162
gboolean flush_cache
Definition pixelpipe_hb.h:233
int mask_display
Definition pixelpipe_hb.h:187
float backbuf_scale
Definition pixelpipe_hb.h:159
GList * nodes
Definition pixelpipe_hb.h:153
dt_dev_pixelpipe_status_t status
Definition pixelpipe_hb.h:143
dt_imageio_levels_t levels
Definition pixelpipe_hb.h:194
uint8_t * backbuf
Definition pixelpipe_hb.h:157
gboolean reentry
Definition pixelpipe_hb.h:221
dt_mipmap_size_t size
Definition pixelpipe_hb.h:130
dt_iop_color_intent_t icc_intent
Definition pixelpipe_hb.h:202
dt_image_t image
Definition pixelpipe_hb.h:198
float * rawdetail_mask_data
Definition pixelpipe_hb.h:169
dt_atomic_int shutdown
Definition pixelpipe_hb.h:179
int output_backbuf_width
Definition pixelpipe_hb.h:165
dt_iop_buffer_dsc_t dsc
Definition pixelpipe_hb.h:141
uint64_t reentry_hash
Definition pixelpipe_hb.h:227
int opencl_enabled
Definition pixelpipe_hb.h:181
float backbuf_zoom_y
Definition pixelpipe_hb.h:160
int output_backbuf_height
Definition pixelpipe_hb.h:165
uint8_t * output_backbuf
Definition pixelpipe_hb.h:164
dt_dev_pixelpipe_type_t type
Definition pixelpipe_hb.h:192
float iscale
Definition pixelpipe_hb.h:135
int processed_height
Definition pixelpipe_hb.h:137
int32_t imgid
Definition pixelpipe_hb.h:129
gboolean store_all_raster_masks
Definition pixelpipe_hb.h:210
dt_pthread_mutex_t backbuf_mutex
Definition pixelpipe_hb.h:162
int bypass_blendif
Definition pixelpipe_hb.h:189
int tiling
Definition pixelpipe_hb.h:185
int backbuf_width
Definition pixelpipe_hb.h:158
int iheight
Definition pixelpipe_hb.h:133
struct dt_iop_roi_t rawdetail_mask_roi
Definition pixelpipe_hb.h:170
GList * forms
Definition pixelpipe_hb.h:208
int devid
Definition pixelpipe_hb.h:196
int processing
Definition pixelpipe_hb.h:175
int output_imgid
Definition pixelpipe_hb.h:173
GList * iop_order_list
Definition pixelpipe_hb.h:206
int backbuf_height
Definition pixelpipe_hb.h:158
int input_timestamp
Definition pixelpipe_hb.h:191
uint32_t mask_mode
Definition blend.h:183
float details
Definition blend.h:209
int32_t gui_attached
Definition develop.h:144
GList * iop_order_list
Definition develop.h:179
dt_image_t image_storage
Definition develop.h:164
dt_backbuf_t display_histogram
Definition develop.h:209
GList * iop
Definition develop.h:173
dt_backbuf_t output_histogram
Definition develop.h:208
struct dt_iop_module_t * gui_module
Definition develop.h:150
struct dt_dev_pixelpipe_t * preview_pipe
Definition develop.h:156
GList * history
Definition develop.h:169
dt_pthread_mutex_t history_mutex
Definition develop.h:167
dt_backbuf_t raw_histogram
Definition develop.h:207
GList * forms
Definition develop.h:189
float factor
Definition tiling.h:32
unsigned overhead
Definition tiling.h:40
float maxbuf
Definition tiling.h:36
Definition histogram.h:35
int width
Definition histogram.h:36
Definition common/image.h:195
dt_iop_buffer_dsc_t buf_dsc
Definition common/image.h:234
char filename[DT_MAX_FILENAME_LEN]
Definition common/image.h:218
Definition develop/format.h:36
int cst
Definition develop/format.h:62
unsigned int channels
Definition develop/format.h:38
dt_iop_buffer_type_t datatype
Definition develop/format.h:40
dt_aligned_pixel_t processed_maximum
Definition develop/format.h:59
dt_dev_request_colorpick_flags_t request_color_pick
Definition imageop.h:200
dt_aligned_pixel_t picked_output_color_min
Definition imageop.h:212
GtkWidget * widget
Definition imageop.h:268
char multi_name[128]
Definition imageop.h:294
struct dt_develop_t * dev
Definition imageop.h:227
GModule *dt_dev_operation_t op
Definition imageop.h:192
dt_dev_request_flags_t request_histogram
Definition imageop.h:202
int iop_order
Definition imageop.h:196
dt_aligned_pixel_t picked_output_color_max
Definition imageop.h:212
uint32_t histogram_max[4]
Definition imageop.h:218
dt_aligned_pixel_t picked_output_color
Definition imageop.h:212
gboolean enabled
Definition imageop.h:229
dt_aligned_pixel_t picked_color_min
Definition imageop.h:210
dt_aligned_pixel_t picked_color_max
Definition imageop.h:210
uint32_t * histogram
Definition imageop.h:214
dt_aligned_pixel_t picked_color
Definition imageop.h:210
Definition iop_profile.h:41
int x
Definition imageop.h:33
double scale
Definition imageop.h:34
int width
Definition imageop.h:33
int height
Definition imageop.h:33
int y
Definition imageop.h:33
struct dt_iop_color_picker_t * picker_proxy
Definition libs/lib.h:54
struct dt_lib_module_t *struct dt_colorpicker_sample_t * primary_sample
Definition libs/lib.h:53
struct dt_lib_t::@51 proxy
struct dt_lib_t::@51::@52 colorpicker
Definition mipmap_cache.h:58
int32_t height
Definition mipmap_cache.h:61
uint8_t * buf
Definition mipmap_cache.h:63
int32_t width
Definition mipmap_cache.h:61
int error_count
Definition opencl.h:498
int stopped
Definition opencl.h:497
Definition pixelpipe_cache.c:29
Definition darktable.h:605
#define dt_alloc_align(B)
Definition tests/cache.c:22
#define MIN(a, b)
Definition thinplate.c:23
#define MAX(a, b)
Definition thinplate.c:20
int dt_tiling_piece_fits_host_memory(const size_t width, const size_t height, const unsigned bpp, const float factor, const size_t overhead)
Definition tiling.c:2045