38 gboolean success =
TRUE;
39 gchar *clean_target_name = !
IS_NULL_PTR(target_module)
41 : g_strdup(_(
"export"));
43 ? g_strdup_printf(
"%s (%s)", clean_target_name, target_module->
multi_name)
44 : g_strdup(clean_target_name);
50 (!
IS_NULL_PTR(source_piece)) ?
"is defined" :
"is undefined",
51 (!
IS_NULL_PTR(current_piece)) ?
"is defined" :
"is undefined");
58 _(
"A module is trying to reuse a mask from a module but it can't be found.\n"
59 "\n- Check if the module providing its masks has not been deleted."),
66 gchar *source_name = g_strdup_printf(
"%s (%s)", clean_source_name, source_piece->module->multi_name);
67 gchar *item = g_strdup_printf(_(
"`%s`, mask from `%s`, on %s"), target_name, source_name,
70 _(
"A module is trying to reuse a mask from a module but it can't be found.\n"
71 "\n- Check if the module providing its masks has not been moved above it."),
82 if(success && !source_piece->
enabled)
85 gchar *source_name = g_strdup_printf(
"%s (%s)", clean_source_name, source_piece->module->multi_name);
86 gchar *item = g_strdup_printf(_(
"`%s`, mask from `%s`, on %s"), target_name, source_name,
89 _(
"A module is trying to reuse a mask from a disabled module.\n"
90 "Disabled modules cannot provide their masks to other modules.\n"
91 "\n- Please enable the module providing the mask or change the raster mask in the "
92 "module reusing it."),
97 target_name, source_name);
115 gchar *clean_target_name = !
IS_NULL_PTR(target_module)
117 : g_strdup(_(
"export"));
119 ? g_strdup_printf(
"%s (%s)", clean_target_name, target_module->
multi_name)
120 : g_strdup(clean_target_name);
124 dt_print(
DT_DEBUG_MASKS,
"[raster masks] The source module of the mask for %s was not found\n", target_name);
130 float *raster_mask = NULL;
134 GList *source_iter = NULL;
135 for(source_iter = g_list_last(
pipe->
nodes); source_iter; source_iter = g_list_previous(source_iter))
138 if(candidate->module == target_module)
139 current_piece = candidate;
140 else if(candidate->module == raster_mask_source)
142 source_piece = candidate;
157 gchar *source_name = g_strdup_printf(
"%s (%s)", clean_source_name, source_piece->module->multi_name);
159 void *cache_data = NULL;
161 raster_hash, &cache_data, &raster_entry);
166 const size_t mask_size
173 FALSE, raster_entry);
186 memcpy(raster_mask, cache_data, mask_size);
188 FALSE, raster_entry);
190 FALSE, raster_entry);
193 "[raster masks] found cached mask id %i from %s for module %s"
194 " in pipe %s with hash %" PRIu64
"\n",
195 raster_mask_id, source_name, target_name,
type, raster_hash);
202 FALSE, raster_entry);
205 "[raster masks] missing source=%s instance=%d target=%s instance=%d"
206 " requested_id=%d cache_hash=%" PRIu64
" source_enabled=%d pipe=%s\n",
207 source_piece->module->op, source_piece->module->multi_priority,
210 raster_mask_id, raster_hash, source_piece->
enabled,
214 "[raster masks] mask id %i from %s for module %s could not be found"
215 " in the global cache for pipe %s.\n",
216 raster_mask_id, source_name, target_name,
type);
236 for(GList *iter = g_list_next(source_iter); iter; iter = g_list_next(iter))
243 if(module->module->distort_mask
244 && !(!strcmp(module->module->op,
"finalscale")
245 && module->roi_in.width == 0
246 && module->roi_in.height == 0))
249 (
size_t)module->roi_out.width * module->roi_out.height, 0);
262 module->module->distort_mask(module->module, pipe, module, raster_mask, transformed_mask,
263 &module->roi_in, &module->roi_out);
265 raster_mask = transformed_mask;
268 else if(!module->module->distort_mask
269 && (module->roi_in.width != module->roi_out.width
270 || module->roi_in.height != module->roi_out.height
271 || module->roi_in.x != module->roi_out.x
272 || module->roi_in.y != module->roi_out.y))
273 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 "
274 "distort_mask() implemented!\n", module->module->op, module->roi_in.width,
275 module->roi_in.height, module->roi_in.x, module->roi_in.y,
276 module->roi_out.width, module->roi_out.height, module->roi_out.x,
280 if(module->module == target_module)
284 raster_mask_id, source_name, clean_module_name,