Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
masks_debug.c File Reference
+ Include dependency graph for masks_debug.c:

Go to the source code of this file.

Functions

float * dt_masks_debug_rasterise (dt_develop_t *dev, dt_masks_form_t *form, const int width, const int height)
 Rasterise form into a freshly allocated width*height float buffer, 0..1.
 
gboolean dt_masks_debug_write_outline_csv (dt_develop_t *dev, dt_masks_form_t *form, const char *path)
 Write the shape's outline buffers to path as CSV: index, centreline, border.
 

Function Documentation

◆ dt_masks_debug_rasterise()

float * dt_masks_debug_rasterise ( struct dt_develop_t dev,
struct dt_masks_form_t form,
int  width,
int  height 
)

Rasterise form into a freshly allocated width*height float buffer, 0..1.

No pipeline distortion is applied: the shape is drawn against the raw image geometry, which is what a geometry regression wants to see – a difference then means the mask code changed, not that some other module's distortion did.

Returns
the buffer (free with dt_free), or NULL. form may be a group.

Definition at line 37 of file masks_debug.c.

References double(), dt_calloc_align_float(), DT_DEBUG_ALWAYS, dt_dev_geometry_get_raw_size(), dt_free_align, dt_masks_get_mask_roi(), DT_MASKS_RASTER_ERROR, dt_print(), dt_develop_t::forms, dt_dev_pixelpipe_t::forms, height, dt_dev_pixelpipe_t::iheight, IS_NULL_PTR, dt_dev_pixelpipe_t::iwidth, dt_dev_pixelpipe_t::mask_rasterization_step, dt_masks_form_t::name, width, and dt_iop_roi_t::x.

Referenced by _paint_mask_backdrop(), _run_brush_nodes_at(), _run_case_at(), and _run_polygon_form_at().

◆ dt_masks_debug_write_outline_csv()

gboolean dt_masks_debug_write_outline_csv ( struct dt_develop_t dev,
struct dt_masks_form_t form,
const char *  path 
)

Write the shape's outline buffers to path as CSV: index, centreline, border.

The mask is the union of segments drawn from each centreline sample to its border sample, so when coverage goes missing the answer is in these two arrays and nowhere else – which sample stopped moving, where the border jumped, which directions were never visited. Reading them beats reasoning about the recursion that produced them: three theories about the cusp defect died against this data before the right one survived it.

Definition at line 87 of file masks_debug.c.

References DT_DEBUG_ALWAYS, dt_masks_get_points_border(), DT_MASKS_RASTER_ERROR, dt_pixelpipe_cache_free_align, dt_print(), f, FALSE, i, IS_NULL_PTR, MIN, n, and TRUE.

Referenced by _judge_raster(), and _run_case_at().