| 2276 | |
| 2277 | |
| 2278 | CV_IMPL void |
| 2279 | cvSetReal2D( CvArr* arr, int y, int x, double value ) |
| 2280 | { |
| 2281 | int type = 0; |
| 2282 | uchar* ptr; |
| 2283 | |
| 2284 | if( CV_IS_MAT( arr )) |
| 2285 | { |
| 2286 | CvMat* mat = (CvMat*)arr; |
| 2287 | |
| 2288 | if( (unsigned)y >= (unsigned)(mat->rows) || |
| 2289 | (unsigned)x >= (unsigned)(mat->cols) ) |
| 2290 | CV_Error( CV_StsOutOfRange, "index is out of range" ); |
| 2291 | |
| 2292 | type = CV_MAT_TYPE(mat->type); |
| 2293 | ptr = mat->data.ptr + (size_t)y*mat->step + x*CV_ELEM_SIZE(type); |
| 2294 | } |
| 2295 | else if( !CV_IS_SPARSE_MAT( arr )) |
| 2296 | { |
| 2297 | ptr = cvPtr2D( arr, y, x, &type ); |
| 2298 | } |
| 2299 | else |
| 2300 | { |
| 2301 | int idx[] = { y, x }; |
| 2302 | ptr = icvGetNodePtr( (CvSparseMat*)arr, idx, &type, -1, 0 ); |
| 2303 | } |
| 2304 | if( CV_MAT_CN( type ) > 1 ) |
| 2305 | CV_Error( CV_BadNumChannels, "cvSetReal* support only single-channel arrays" ); |
| 2306 | |
| 2307 | if( ptr ) |
| 2308 | icvSetReal( value, ptr, type ); |
| 2309 | } |
| 2310 | |
| 2311 | |
| 2312 | CV_IMPL void |
nothing calls this directly
no test coverage detected