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

Function cvSetReal2D

deps/opencv/modules/core/src/array.cpp:2278–2309  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2276
2277
2278CV_IMPL void
2279cvSetReal2D( 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
2312CV_IMPL void

Callers

nothing calls this directly

Calls 3

cvPtr2DFunction · 0.85
icvGetNodePtrFunction · 0.85
icvSetRealFunction · 0.85

Tested by

no test coverage detected