19#ifndef DT_DEVELOP_MASKS_MASKS_TOUCHED_H
20#define DT_DEVELOP_MASKS_MASKS_TOUCHED_H
41 if(touched == NULL)
return;
46 touched->
scale = 1.0f;
51 if(touched == NULL)
return;
56 touched->
scale = 1.0f;
64 if(touched == NULL)
return;
69 if(x1 < x0 || y1 < y0)
76 touched->
width = x1 - x0 + 1;
77 touched->
height = y1 - y0 + 1;
78 touched->
scale = 1.0f;
83 return touched == NULL || touched->
width <= 0 || touched->
height <= 0;
95 const int x0 = into->
x < other->
x ? into->
x : other->
x;
96 const int y0 = into->
y < other->
y ? into->
y : other->
y;
97 const int ix1 = into->
x + into->
width - 1;
98 const int ox1 = other->
x + other->
width - 1;
99 const int iy1 = into->
y + into->
height - 1;
100 const int oy1 = other->
y + other->
height - 1;
101 const int x1 = ix1 > ox1 ? ix1 : ox1;
102 const int y1 = iy1 > oy1 ? iy1 : oy1;
105 into->
width = x1 - x0 + 1;
106 into->
height = y1 - y0 + 1;
113 for(
int y = touched->
y; y < touched->
y + touched->
height; y++)
114 memset(buffer + (
size_t)y *
width + touched->
x, 0,
sizeof(float) * (
size_t)touched->
width);
static int dt_masks_touched_is_empty(const dt_iop_roi_t *touched)
static void dt_masks_touched_set(dt_iop_roi_t *touched, int x0, int y0, int x1, int y1, const int width, const int height)
static void dt_masks_touched_full(dt_iop_roi_t *touched, const int width, const int height)
static void dt_masks_touched_clear(float *const buffer, const int width, const dt_iop_roi_t *touched)
static void dt_masks_touched_none(dt_iop_roi_t *touched)
static void dt_masks_touched_union(dt_iop_roi_t *into, const dt_iop_roi_t *other)
Region of interest passed through the pixelpipe.