Returns specifed element of nD array
| 2125 | |
| 2126 | // Returns specifed element of nD array |
| 2127 | CV_IMPL double |
| 2128 | cvGetRealND( const CvArr* arr, const int* idx ) |
| 2129 | { |
| 2130 | double value = 0; |
| 2131 | int type = 0; |
| 2132 | uchar* ptr; |
| 2133 | |
| 2134 | if( !CV_IS_SPARSE_MAT( arr )) |
| 2135 | ptr = cvPtrND( arr, idx, &type ); |
| 2136 | else |
| 2137 | ptr = icvGetNodePtr( (CvSparseMat*)arr, idx, &type, 0, 0 ); |
| 2138 | |
| 2139 | if( ptr ) |
| 2140 | { |
| 2141 | if( CV_MAT_CN( type ) > 1 ) |
| 2142 | CV_Error( CV_BadNumChannels, "cvGetReal* support only single-channel arrays" ); |
| 2143 | |
| 2144 | value = icvGetReal( ptr, type ); |
| 2145 | } |
| 2146 | |
| 2147 | return value; |
| 2148 | } |
| 2149 | |
| 2150 | |
| 2151 | // Assigns new value to specifed element of nD array given linear index |
nothing calls this directly
no test coverage detected