17 const int left_offset = (it.x == 0) ? 0 : -image->elem_stride;
18 const int right_offset = (it.x == last_x) ? 0 : image->elem_stride;
19 const int down_offset = (it.y == 0) ? 0 : -image->row_stride;
20 const int up_offset = (it.y == last_y) ? 0 : image->row_stride;
26 const float *color = center_color + down_offset + left_offset;
30 color = center_color + down_offset;
34 color = center_color + down_offset + right_offset;
38 color = center_color + left_offset;
43 float rgb_filtered[3];
49 color = center_color + right_offset;
53 color = center_color + up_offset + left_offset;
57 color = center_color + up_offset;
62 color = center_color + up_offset + right_offset;
63 float rgb_filtered[3];
69 it.out[0] =
sqrt(res1[0] * res1[0] + res2[0] * res2[0]);
70 it.out[1] =
sqrt(res1[1] * res1[1] + res2[1] * res2[1]);
71 it.out[2] =
sqrt(res1[2] * res1[2] + res2[2] * res2[2]);
74 const float factor_ = 1.0f - factor;
75 it.out[0] = it.out[0] * factor + center_color[0] * factor_;
76 it.out[1] = it.out[1] * factor + center_color[1] * factor_;
77 it.out[2] = it.out[2] * factor + center_color[2] * factor_;
79 it.out[3] = center_color[3];