MCPcopy Create free account
hub / github.com/creatale/node-dv / kernelGetElement

Function kernelGetElement

deps/leptonica/src/kernel.c:210–230  ·  view source on GitHub ↗

----------------------------------------------------------------------* * Accessors * *----------------------------------------------------------------------*/ ! * \brief kernelGetElement() * * \param[in] kel * \param[in] row * \param[in] col * \param[out] pval * \return 0 if OK; 1 on error */

Source from the content-addressed store, hash-verified

208 * \return 0 if OK; 1 on error
209 */
210l_int32
211kernelGetElement(L_KERNEL *kel,
212 l_int32 row,
213 l_int32 col,
214 l_float32 *pval)
215{
216 PROCNAME("kernelGetElement");
217
218 if (!pval)
219 return ERROR_INT("&val not defined", procName, 1);
220 *pval = 0;
221 if (!kel)
222 return ERROR_INT("kernel not defined", procName, 1);
223 if (row < 0 || row >= kel->sy)
224 return ERROR_INT("kernel row out of bounds", procName, 1);
225 if (col < 0 || col >= kel->sx)
226 return ERROR_INT("kernel col out of bounds", procName, 1);
227
228 *pval = kel->data[row][col];
229 return 0;
230}
231
232
233/*!

Callers 2

pixMultMatrixColorFunction · 0.85
kernelDisplayInPixFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected