MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / af_maxfilt

Function af_maxfilt

src/api/c/filters.cpp:176–201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

174}
175
176af_err af_maxfilt(af_array *out, const af_array in, const dim_t wind_length,
177 const dim_t wind_width, const af_border_type edge_pad) {
178 try {
179 ARG_ASSERT(2, (wind_length == wind_width));
180 ARG_ASSERT(2, (wind_length > 0));
181 ARG_ASSERT(3, (wind_width > 0));
182 ARG_ASSERT(4, (edge_pad == AF_PAD_ZERO));
183
184 const ArrayInfo &info = getInfo(in);
185 af::dim4 dims = info.dims();
186
187 dim_t input_ndims = dims.ndims();
188 DIM_ASSERT(1, (input_ndims >= 2));
189
190 af_array mask;
191 dim_t wdims[] = {wind_length, wind_width};
192 AF_CHECK(af_constant(&mask, 1, 2, wdims, info.getType()));
193
194 AF_CHECK(af_dilate(out, in, mask));
195
196 AF_CHECK(af_release_array(mask));
197 }
198 CATCHALL;
199
200 return AF_SUCCESS;
201}

Callers 1

maxfiltFunction · 0.50

Calls 6

af_constantFunction · 0.70
af_dilateFunction · 0.70
af_release_arrayFunction · 0.70
dimsMethod · 0.45
ndimsMethod · 0.45
getTypeMethod · 0.45

Tested by

no test coverage detected