----------------------------------------------------------------------* * Accessors * *----------------------------------------------------------------------*/ ! * \brief kernelGetElement() * * \param[in] kel * \param[in] row * \param[in] col * \param[out] pval * \return 0 if OK; 1 on error */
| 208 | * \return 0 if OK; 1 on error |
| 209 | */ |
| 210 | l_int32 |
| 211 | kernelGetElement(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 | /*! |
no outgoing calls
no test coverage detected