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

Function pointList

src/api/c/confidence_connected.cpp:46–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44/// Index corner points of given seed points
45template<typename T>
46Array<T> pointList(const Array<T>& in, const Array<uint>& x,
47 const Array<uint>& y) {
48
49 // TODO: Temporary Fix, must fix handling subarrays upstream
50 // Array<T> has to be a basic array, to be accepted as af_index
51 Array<uint> x_ = (x.getOffset() == 0 && x.isLinear()) ? x : copyArray(x);
52 Array<uint> y_ = (y.getOffset() == 0 && y.isLinear()) ? y : copyArray(y);
53
54 af_array xcoords = getHandle<uint>(x_);
55 af_array ycoords = getHandle<uint>(y_);
56
57 std::array<af_index_t, AF_MAX_DIMS> idxrs = {{{{xcoords}, false, false},
58 {{ycoords}, false, false},
59 createSpanIndex(),
60 createSpanIndex()}};
61
62 Array<T> retVal = detail::index(in, idxrs.data());
63
64 // detail::index fn keeps a reference to detail::Array
65 // created from the xcoords/ycoords passed via idxrs.
66 // Hence, it is safe to release xcoords, ycoords
67 releaseHandle<uint>(xcoords);
68 releaseHandle<uint>(ycoords);
69
70 return retVal;
71}
72
73/// Returns the sum of all values given the four corner points of the region of
74/// interest in the integral-image/summed-area-table of an input image.

Callers 2

sumFunction · 0.85
ccHelperFunction · 0.85

Calls 5

createSpanIndexFunction · 0.85
copyArrayFunction · 0.70
indexFunction · 0.50
getOffsetMethod · 0.45
isLinearMethod · 0.45

Tested by

no test coverage detected