55 const int x1 = std::max(it.x - 1, 0);
57 const int x3 = std::min(it.x + 1, last_x);
58 const int y1 = std::max(it.y - 1, 0);
60 const int y3 = std::min(it.y + 1, last_y);
63 const float *color_org = it.in(IMAGE_INPUT_INDEX);
65 float color_mid_ok[4];
66 const float *in1 =
nullptr;
68#define TOT_DIV_ONE 1.0f
69#define TOT_DIV_CNR float(M_SQRT1_2)
71#define WTOT (TOT_DIV_ONE * 4 + TOT_DIV_CNR * 4)
73#define COLOR_ADD(fac) \
75 madd_v4_v4fl(color_mid, in1, fac); \
76 if (color_diff(in1, color_org, threshold_)) { \
78 madd_v4_v4fl(color_mid_ok, in1, fac); \
85 in1 = image->get_elem(x1, y1);
87 in1 = image->get_elem(x2, y1);
89 in1 = image->get_elem(x3, y1);
91 in1 = image->get_elem(x1, y2);
95 const float *in2 = image->get_elem(x2, y2);
99 in1 = image->get_elem(x3, y2);
101 in1 = image->get_elem(x1, y3);
103 in1 = image->get_elem(x2, y3);
105 in1 = image->get_elem(x3, y3);
111 if ((
w != 0.0f) && ((
w /
WTOT) > (threshold_neighbor_)) &&
114 const float factor = *it.in(FACTOR_INPUT_INDEX);