41 int32_t raw_width = 0;
42 int32_t raw_height = 0;
67 module.iop_order = 0.0;
91 float *points = NULL, *border = NULL;
92 int points_count = 0, border_count = 0;
97 &border, &border_count,
98 &skips, &skip_count, 0, NULL);
99 dt_print(
DT_DEBUG_ALWAYS,
"[masks debug] outline: status=%d points=%d border=%d\n", st, points_count, border_count);
102 FILE *
f = fopen(path,
"w");
111 fprintf(
f,
"# points=%d border=%d skips=%d\n", points_count, border_count, skip_count);
112 for(
int i = 0;
i < skip_count;
i++)
113 fprintf(
f,
"# skip %d..%d\n", skips[
i].jump_from, skips[
i].resume_at);
114 fprintf(
f,
"i,px,py,bx,by\n");
115 const int n =
MIN(points_count, border_count);
116 for(
int i = 0;
i <
n;
i++)
117 fprintf(
f,
"%d,%.4f,%.4f,%.4f,%.4f\n",
i, points[
i * 2], points[
i * 2 + 1],
118 border[
i * 2], border[
i * 2 + 1]);
gboolean dt_dev_geometry_get_raw_size(const dt_develop_t *dev, int32_t *width, int32_t *height)
void dt_print(dt_debug_thread_t thread, const char *msg,...) __attribute__((format(printf
Print to stdout when thread is enabled, prefixed with seconds since startup.
#define IS_NULL_PTR(p)
C is way too permissive with !=, == and if(var) checks, which can mean too many things depending on w...
dt_masks_raster_result_t dt_masks_get_points_border(dt_develop_t *develop, dt_masks_form_t *mask_form, float **point_buffer, int *point_count, float **border_buffer, int *border_count, dt_masks_skip_range_t **border_skips, int *border_skip_count, int source, dt_iop_module_t *module)
dt_masks_raster_result_t dt_masks_get_mask_roi(const dt_iop_module_t *const module, dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *const piece, dt_masks_form_t *const form, const dt_iop_roi_t *roi, float *buffer, dt_iop_roi_t *touched)
dt_masks_raster_result_t
What a rasterisation attempt produced.
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.
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.
Render a mask's rasterisation and its GUI overlay to an image file, headlessly.
The per-shape function table, private to the masks implementation.
The interactive half of the masks subsystem: the editing state (dt_masks_form_gui_t),...
static float * dt_calloc_align_float(size_t pixels)
dt_alloc_align_float() followed by a zero fill.
#define dt_free_align(ptr)
Release memory from dt_alloc_align() and set ptr to NULL.
#define dt_pixelpipe_cache_free_align(mem)
int mask_rasterization_step
Rasterisation step for drawn masks, in image pixels. Always >= 1.
Region of interest passed through the pixelpipe.
One cut in a shape's border outline: while walking the border buffer forward, on reaching index jump_...
typedef double((*spd)(unsigned long int wavelength, double TempK))