49 template <
typename dType>
52 void *restrict pMinVal,
53 void *restrict pMaxVal,
54 void *restrict pMinCount,
55 void *restrict pMaxCount,
56 void *restrict pMinLocCapacity,
57 void *restrict pMaxLocCapacity,
58 void *restrict pMinLoc,
59 void *restrict pMaxLoc,
60 void *restrict pStartX,
61 void *restrict pStartY)
71 dType restrict *pInLocal = (dType *) pIn;
72 dType restrict *pMinValLocal = (dType *) pMinVal;
73 dType restrict *pMaxValLocal = (dType *) pMaxVal;
74 uint32_t restrict *pMinCountLocal = (uint32_t *) pMinCount;
75 uint32_t restrict *pMaxCountLocal = (uint32_t *) pMaxCount;
76 uint32_t restrict *pMinLocLocal = (uint32_t *) pMinLoc;
77 uint32_t restrict *pMaxLocLocal = (uint32_t *) pMaxLoc;
78 uint32_t restrict *pStartXLocal = (uint32_t *) pStartX;
79 uint32_t restrict *pStartYLocal = (uint32_t *) pStartY;
80 uint32_t restrict *minLocCapacity = (uint32_t *) pMinLocCapacity;
81 uint32_t restrict *maxLocCapacity = (uint32_t *) pMaxLocCapacity;
86 uint32_t width = pKerPrivArgs->
width;
87 uint32_t height = pKerPrivArgs->
height;
89 uint32_t x, y, srcIndex;
91 dType min = *pMinValLocal;
92 dType max = *pMaxValLocal;
96 mincnt = *pMinCountLocal;
99 maxcnt = *pMaxCountLocal;
102 for (y = 0; y < height; y++) {
104 for (x = 0; x < width; x++) {
106 srcIndex = (y * strideInElements) + x;
108 if (pInLocal[srcIndex] > max) {
109 max = pInLocal[srcIndex];
112 pMaxLocLocal[0] = x + (*pStartXLocal);
113 pMaxLocLocal[1] = y + (*pStartYLocal);
116 else if (pInLocal[srcIndex] == max) {
117 if (pMaxLocLocal && maxcnt < *maxLocCapacity) {
118 pMaxLocLocal[2 * maxcnt] = x + (*pStartXLocal);
119 pMaxLocLocal[(2 * maxcnt) + 1] = y + (*pStartYLocal);
127 if (pInLocal[srcIndex] < min) {
128 min = pInLocal[srcIndex];
131 pMinLocLocal[0] = x + (*pStartXLocal);
132 pMinLocLocal[1] = y + (*pStartYLocal);
135 else if (pInLocal[srcIndex] == min) {
136 if (pMinLocLocal && mincnt < *minLocCapacity) {
137 pMinLocLocal[2 * mincnt] = x + (*pStartXLocal);
138 pMinLocLocal[2 * mincnt + 1] = y + (*pStartYLocal);
150 if (pMinCountLocal) {
151 *pMinCountLocal = mincnt;
153 if (pMaxCountLocal) {
154 *pMaxCountLocal = maxcnt;
169 void *restrict pMinVal,
170 void *restrict pMaxVal,
171 void *restrict pMinCount,
172 void *restrict pMaxCount,
173 void *restrict pMinLocCapacity,
174 void *restrict pMaxLocCapacity,
175 void *restrict pMinLoc,
176 void *restrict pMaxLoc,
177 void *restrict pStartX,
178 void *restrict pStartY);
182 void *restrict pMinVal,
183 void *restrict pMaxVal,
184 void *restrict pMinCount,
185 void *restrict pMaxCount,
186 void *restrict pMinLocCapacity,
187 void *restrict pMaxLocCapacity,
188 void *restrict pMinLoc,
189 void *restrict pMaxLoc,
190 void *restrict pStartX,
191 void *restrict pStartY);
195 void *restrict pMinVal,
196 void *restrict pMaxVal,
197 void *restrict pMinCount,
198 void *restrict pMaxCount,
199 void *restrict pMinLocCapacity,
200 void *restrict pMaxLocCapacity,
201 void *restrict pMinLoc,
202 void *restrict pMaxLoc,
203 void *restrict pStartX,
204 void *restrict pStartY);
208 void *restrict pMinVal,
209 void *restrict pMaxVal,
210 void *restrict pMinCount,
211 void *restrict pMaxCount,
212 void *restrict pMinLocCapacity,
213 void *restrict pMaxLocCapacity,
214 void *restrict pMinLoc,
215 void *restrict pMaxLoc,
216 void *restrict pStartX,
217 void *restrict pStartY);
VXLIB_STATUS VXLIB_minMaxLoc_exec_cn(VXLIB_kernelHandle handle, void *restrict pIn, void *restrict pMinVal, void *restrict pMaxVal, void *restrict pMinCount, void *restrict pMaxCount, void *restrict pMinLocCapacity, void *restrict pMaxLocCapacity, void *restrict pMinLoc, void *restrict pMaxLoc, void *restrict pStartX, void *restrict pStartY)
This function is the main execution function for the natural C implementation of the kernel....
template VXLIB_STATUS VXLIB_minMaxLoc_exec_cn< VXLIB_MINMAXLOC_TYPENAME_8U >(VXLIB_kernelHandle handle, void *restrict pIn, void *restrict pMinVal, void *restrict pMaxVal, void *restrict pMinCount, void *restrict pMaxCount, void *restrict pMinLocCapacity, void *restrict pMaxLocCapacity, void *restrict pMinLoc, void *restrict pMaxLoc, void *restrict pStartX, void *restrict pStartY)
template VXLIB_STATUS VXLIB_minMaxLoc_exec_cn< VXLIB_MINMAXLOC_TYPENAME_16U >(VXLIB_kernelHandle handle, void *restrict pIn, void *restrict pMinVal, void *restrict pMaxVal, void *restrict pMinCount, void *restrict pMaxCount, void *restrict pMinLocCapacity, void *restrict pMaxLocCapacity, void *restrict pMinLoc, void *restrict pMaxLoc, void *restrict pStartX, void *restrict pStartY)
template VXLIB_STATUS VXLIB_minMaxLoc_exec_cn< VXLIB_MINMAXLOC_TYPENAME_16S >(VXLIB_kernelHandle handle, void *restrict pIn, void *restrict pMinVal, void *restrict pMaxVal, void *restrict pMinCount, void *restrict pMaxCount, void *restrict pMinLocCapacity, void *restrict pMaxLocCapacity, void *restrict pMinLoc, void *restrict pMaxLoc, void *restrict pStartX, void *restrict pStartY)
template VXLIB_STATUS VXLIB_minMaxLoc_exec_cn< VXLIB_MINMAXLOC_TYPENAME_8S >(VXLIB_kernelHandle handle, void *restrict pIn, void *restrict pMinVal, void *restrict pMaxVal, void *restrict pMinCount, void *restrict pMaxCount, void *restrict pMinLocCapacity, void *restrict pMaxLocCapacity, void *restrict pMinLoc, void *restrict pMaxLoc, void *restrict pStartX, void *restrict pStartY)
Header file for kernel's internal use. For the kernel's interface, please see VXLIB_minMaxLoc.
void * VXLIB_kernelHandle
Handle type for VXLIB operations.
VXLIB_STATUS_NAME
The enumeration of all status codes.
#define VXLIB_DEBUGPRINTFN(N, fmt,...)
Structure that is reserved for internal use by the kernel.
uint32_t strideInElements
Stride of input0 in elements.
uint32_t height
Height of image
uint32_t width
Width of image