35 gboolean success =
TRUE;
36 gchar *clean_target_name = !
IS_NULL_PTR(target_module)
38 : g_strdup(_(
"export"));
40 ? g_strdup_printf(
"%s (%s)", clean_target_name, target_module->
multi_name)
41 : g_strdup(clean_target_name);
47 (!
IS_NULL_PTR(source_piece)) ?
"is defined" :
"is undefined",
48 (!
IS_NULL_PTR(current_piece)) ?
"is defined" :
"is undefined");
53 hint = g_strdup_printf(
54 _(
"- Check if the module providing the masks for the module %s has not been deleted.\n"),
60 hint = g_strdup_printf(_(
"- Check if the module %s (%s) providing the masks has not been moved above %s.\n"),
62 source_piece->module->multi_name, clean_target_name);
66 dt_pipeline_message(_(
"The %s module is trying to reuse a mask from a module but it can't be found.\n"
68 target_name, hint ? hint :
"");
75 if(success && !source_piece->
enabled)
78 gchar *source_name = g_strdup_printf(
"%s (%s)", clean_source_name, source_piece->module->multi_name);
79 dt_pipeline_message(_(
"The `%s` module is trying to reuse a mask from disabled module `%s`.\n"
80 "Disabled modules cannot provide their masks to other modules.\n"
81 "\n- Please enable `%s` or change the raster mask in `%s`."),
82 target_name, source_name, source_name, target_name);
85 target_name, source_name);
103 gchar *clean_target_name = !
IS_NULL_PTR(target_module)
105 : g_strdup(_(
"export"));
107 ? g_strdup_printf(
"%s (%s)", clean_target_name, target_module->
multi_name)
108 : g_strdup(clean_target_name);
112 dt_print(
DT_DEBUG_MASKS,
"[raster masks] The source module of the mask for %s was not found\n", target_name);
118 float *raster_mask = NULL;
122 GList *source_iter = NULL;
123 for(source_iter = g_list_last(pipe->
nodes); source_iter; source_iter = g_list_previous(source_iter))
126 if(candidate->module == target_module)
127 current_piece = candidate;
128 else if(candidate->module == raster_mask_source)
130 source_piece = candidate;
145 gchar *source_name = g_strdup_printf(
"%s (%s)", clean_source_name, source_piece->module->multi_name);
147 void *cache_data = NULL;
149 raster_hash, &cache_data, &raster_entry);
154 const size_t mask_size
161 FALSE, raster_entry);
174 memcpy(raster_mask, cache_data, mask_size);
176 FALSE, raster_entry);
178 FALSE, raster_entry);
181 "[raster masks] found cached mask id %i from %s for module %s"
182 " in pipe %s with hash %" PRIu64
"\n",
183 raster_mask_id, source_name, target_name,
type, raster_hash);
190 FALSE, raster_entry);
193 "[raster masks] missing source=%s instance=%d target=%s instance=%d"
194 " requested_id=%d cache_hash=%" PRIu64
" source_enabled=%d pipe=%s\n",
195 source_piece->module->op, source_piece->module->multi_priority,
198 raster_mask_id, raster_hash, source_piece->
enabled,
202 "[raster masks] mask id %i from %s for module %s could not be found"
203 " in the global cache for pipe %s.\n",
204 raster_mask_id, source_name, target_name,
type);
224 for(GList *iter = g_list_next(source_iter); iter; iter = g_list_next(iter))
231 if(module->module->distort_mask
232 && !(!strcmp(module->module->op,
"finalscale")
233 && module->roi_in.width == 0
234 && module->roi_in.height == 0))
237 (
size_t)module->roi_out.width * module->roi_out.height, 0);
250 module->module->distort_mask(module->module, pipe, module, raster_mask, transformed_mask,
251 &module->roi_in, &module->roi_out);
253 raster_mask = transformed_mask;
256 else if(!module->module->distort_mask
257 && (module->roi_in.width != module->roi_out.width
258 || module->roi_in.height != module->roi_out.height
259 || module->roi_in.x != module->roi_out.x
260 || module->roi_in.y != module->roi_out.y))
261 dt_print(
DT_DEBUG_MASKS,
"FIXME: module `%s' changed the roi from %d x %d @ %d / %d to %d x %d | %d / %d but doesn't have "
262 "distort_mask() implemented!\n", module->module->op, module->roi_in.width,
263 module->roi_in.height, module->roi_in.x, module->roi_in.y,
264 module->roi_out.width, module->roi_out.height, module->roi_out.x,
268 if(module->module == target_module)
272 raster_mask_id, source_name, clean_module_name,