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

Function af_bilateral

src/api/c/bilateral.cpp:37–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35}
36
37af_err af_bilateral(af_array *out, const af_array in, const float ssigma,
38 const float csigma, const bool iscolor) {
39 UNUSED(iscolor);
40 try {
41 const ArrayInfo &info = getInfo(in);
42 af_dtype type = info.getType();
43 af::dim4 dims = info.dims();
44
45 DIM_ASSERT(1, (dims.ndims() >= 2));
46
47 af_array output = nullptr;
48 switch (type) {
49 case f64: output = bilateral<double>(in, ssigma, csigma); break;
50 case f32: output = bilateral<float>(in, ssigma, csigma); break;
51 case b8: output = bilateral<char>(in, ssigma, csigma); break;
52 case s32: output = bilateral<int>(in, ssigma, csigma); break;
53 case u32: output = bilateral<uint>(in, ssigma, csigma); break;
54 case s8: output = bilateral<schar>(in, ssigma, csigma); break;
55 case u8: output = bilateral<uchar>(in, ssigma, csigma); break;
56 case s16: output = bilateral<short>(in, ssigma, csigma); break;
57 case u16: output = bilateral<ushort>(in, ssigma, csigma); break;
58 default: TYPE_ERROR(1, type);
59 }
60 std::swap(*out, output);
61 }
62 CATCHALL;
63
64 return AF_SUCCESS;
65}

Callers 4

bilateralTestFunction · 0.50
bilateralDataTestFunction · 0.50
TYPED_TESTFunction · 0.50
bilateralFunction · 0.50

Calls 4

swapFunction · 0.85
getTypeMethod · 0.45
dimsMethod · 0.45
ndimsMethod · 0.45

Tested by

no test coverage detected