-
Notifications
You must be signed in to change notification settings - Fork 5
/
blurry.hpp
239 lines (163 loc) · 7.33 KB
/
blurry.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
// +build ignore.
#include <Halide.h>
#include <halide_image_io.h>
using namespace Halide;
using namespace Halide::Tools;
#ifndef BLURRY_H_
#define BLURRY_H_
Func kernel_sobel3x3_y();
Func kernel_sobel3x3_x();
Func kernel_emboss3x3();
Func kernel_laplacian3x3();
Func kernel_highpass3x3();
Func kernel_gradient3x3();
Func wrapFunc(Buffer<uint8_t> buf, const char* name);
Func wrapFunc(Buffer<float> buf, const char* name);
Func wrapFunc(Buffer<double> buf, const char* name);
Func wrapFunc_xy(Buffer<uint8_t> buf, const char* name);
Func wrapFunc_xy(Buffer<float> buf, const char* name);
Func wrapFunc_xy(Buffer<double> buf, const char* name);
Func wrapFunc_x(Buffer<uint8_t> buf, const char* name);
Func wrapFunc_x(Buffer<int16_t> buf, const char* name);
Func wrapFunc_x(Buffer<float> buf, const char* name);
Func wrapFunc_x(Buffer<double> buf, const char* name);
Func cloneimg_fn(Func input, Param<int32_t> width, Param<int32_t> height);
Func convert_from_abgr_fn(Func input, Param<int32_t> width, Param<int32_t> height);
Func convert_from_argb_fn(Func input, Param<int32_t> width, Param<int32_t> height);
Func convert_from_rabg_fn(Func input, Param<int32_t> width, Param<int32_t> height);
Func convert_from_bgra_fn(Func input, Param<int32_t> width, Param<int32_t> height);
Func convert_from_yuv_420_fn(Func in_y, Func in_u, Func in_v, Param<int32_t> width, Param<int32_t> height);
Func convert_from_yuv_444_fn(Func in_y, Func in_u, Func in_v, Param<int32_t> width, Param<int32_t> height);
Pipeline convert_to_yuv_420_fn(Func input, Param<int32_t> width, Param<int32_t> height);
Pipeline convert_to_yuv_444_fn(Func input, Param<int32_t> width, Param<int32_t> height);
Func rotate0_fn(Func input, Param<int32_t> width, Param<int32_t> height);
Func rotate90_fn(Func input, Param<int32_t> width, Param<int32_t> height);
Func rotate180_fn(Func input, Param<int32_t> width, Param<int32_t> height);
Func rotate270_fn(Func input, Param<int32_t> width, Param<int32_t> height);
Func flipV_fn(Func input, Param<int32_t> width, Param<int32_t> height);
Func flipH_fn(Func input, Param<int32_t> width, Param<int32_t> height);
Func crop_fn(
Func input,
Param<int32_t> width, Param<int32_t> height,
Param<int32_t> px, Param<int32_t> py, Param<int32_t> crop_width, Param<int32_t> crop_height
);
Func scale_fn(
Func input,
Param<int32_t> width, Param<int32_t> height,
Param<int32_t> scale_width, Param<int32_t> scale_height
);
Func scale_box_fn(
Func input,
Param<int32_t> width, Param<int32_t> height,
Param<int32_t> scale_width, Param<int32_t> scale_height
);
Func scale_linear_fn(
Func input,
Param<int32_t> width, Param<int32_t> height,
Param<int32_t> scale_width, Param<int32_t> scale_height
);
Func scale_gaussian_fn(
Func input,
Param<int32_t> width, Param<int32_t> height,
Param<int32_t> scale_width, Param<int32_t> scale_height
);
Func blend_normal_fn(
Func src0, Param<int32_t> width0, Param<int32_t> height0,
Func src1, Param<int32_t> width1, Param<int32_t> height1,
Param<int32_t> px, Param<int32_t> py
);
Func blend_sub_fn(
Func src0, Param<int32_t> width0, Param<int32_t> height0,
Func src1, Param<int32_t> width1, Param<int32_t> height1,
Param<int32_t> px, Param<int32_t> py
);
Func blend_add_fn(
Func src0, Param<int32_t> width0, Param<int32_t> height0,
Func src1, Param<int32_t> width1, Param<int32_t> height1,
Param<int32_t> px, Param<int32_t> py
);
Func blend_diff_fn(
Func src0, Param<int32_t> width0, Param<int32_t> height0,
Func src1, Param<int32_t> width1, Param<int32_t> height1,
Param<int32_t> px, Param<int32_t> py
);
Func erosion_fn(Func input, Param<int32_t> width, Param<int32_t> height, Param<int32_t> size);
Func dilation_fn(Func input, Param<int32_t> width, Param<int32_t> height, Param<int32_t> size);
Func morphology_open_fn(Func input, Param<int32_t> width, Param<int32_t> height, Param<int32_t> size);
Func morphology_close_fn(Func input, Param<int32_t> width, Param<int32_t> height, Param<int32_t> size);
Func morphology_gradient_fn(Func input, Param<int32_t> width, Param<int32_t> height, Param<int32_t> size);
Func grayscale_fn(Func input, Param<int32_t> width, Param<int32_t> height);
Func invert_fn(Func input, Param<int32_t> width, Param<int32_t> height);
Func brightness_fn(Func input, Param<int32_t> width, Param<int32_t> height, Param<float> factor);
Func gammacorrection_fn(Func input, Param<int32_t> width, Param<int32_t> height, Param<float> factor);
Func contrast_fn(Func input, Param<int32_t> width, Param<int32_t> height, Param<float> factor);
Func boxblur_fn(Func input, Param<int32_t> width, Param<int32_t> height, Param<uint8_t> size);
Func gaussianblur_fn(Func input, Param<int32_t> width, Param<int32_t> height, Param<float> sigma);
Func edge_fn(Func input, Param<int32_t> width, Param<int32_t> height);
Func sobel_fn(Func input, Param<int32_t> width, Param<int32_t> height);
Func canny_fn(
Func input, Param<int32_t> width, Param<int32_t> height,
Param<int32_t> threshold_max, Param<int32_t> threshold_min
);
Func canny_dilate_fn(
Func input, Param<int32_t> width, Param<int32_t> height,
Param<int32_t> threshold_max, Param<int32_t> threshold_min,
Param<int32_t> dilate_size
);
Func canny_morphology_open_fn(
Func input, Param<int32_t> width, Param<int32_t> height,
Param<int32_t> threshold_max, Param<int32_t> threshold_min,
Param<int32_t> morphology_size,
Param<int32_t> dilate_size
);
Func canny_morphology_close_fn(
Func input, Param<int32_t> width, Param<int32_t> height,
Param<int32_t> threshold_max, Param<int32_t> threshold_min,
Param<int32_t> morphology_size,
Param<int32_t> dilate_size
);
Func emboss_fn(Func input, Param<int32_t> width, Param<int32_t> height);
Func laplacian_fn(Func input, Param<int32_t> width, Param<int32_t> height);
Func highpass_fn(Func input, Param<int32_t> width, Param<int32_t> height);
Func gradient_fn(Func input, Param<int32_t> width, Param<int32_t> height);
Func blockmozaic_fn(Func input, Param<int32_t> width, Param<int32_t> height, Param<int32_t> block_size);
Func match_template_sad_fn(
Func input, Param<int32_t> width, Param<int32_t> height,
Func tpl, Param<int32_t> tpl_width, Param<int32_t> tpl_height
);
Func match_template_ssd_fn(
Func input, Param<int32_t> width, Param<int32_t> height,
Func tpl, Param<int32_t> tpl_width, Param<int32_t> tpl_height
);
Func match_template_ncc_fn(
Func input, Param<int32_t> width, Param<int32_t> height,
Func tpl, Param<int32_t> tpl_width, Param<int32_t> tpl_height
);
Func prepare_ncc_template_fn(
Func tpl, Param<int32_t> tpl_width, Param<int32_t> tpl_height
);
Func prepared_match_template_ncc_fn(
Func input, Param<int32_t> width, Param<int32_t> height,
Func buf_tpl_val, Func buf_tpl_sum,
Param<int32_t> tpl_width, Param<int32_t> tpl_height
);
Func match_template_zncc_fn(
Func input, Param<int32_t> width, Param<int32_t> height,
Func tpl, Param<int32_t> tpl_width, Param<int32_t> tpl_height
);
Func prepare_zncc_template_fn(
Func tpl, Param<int32_t> tpl_width, Param<int32_t> tpl_height
);
Func prepared_match_template_zncc_fn(
Func input, Param<int32_t> width, Param<int32_t> height,
Func buf_tpl_val, Func buf_tpl_stddev,
Param<int32_t> tpl_width, Param<int32_t> tpl_height
);
Func contour_fn(
Func input, Param<int32_t> width, Param<int32_t> height,
Param<uint8_t> threshold, Param<uint8_t> size
);
Func pcm16_decibel_fn(
Func input, Param<int32_t> length
);
#endif // BLURRY_H_