Returns specifed element of 3D array
| 2097 | |
| 2098 | // Returns specifed element of 3D array |
| 2099 | CV_IMPL double |
| 2100 | cvGetReal3D( const CvArr* arr, int z, int y, int x ) |
| 2101 | { |
| 2102 | double value = 0; |
| 2103 | int type = 0; |
| 2104 | uchar* ptr; |
| 2105 | |
| 2106 | if( !CV_IS_SPARSE_MAT( arr )) |
| 2107 | ptr = cvPtr3D( arr, z, y, x, &type ); |
| 2108 | else |
| 2109 | { |
| 2110 | int idx[] = { z, y, x }; |
| 2111 | ptr = icvGetNodePtr( (CvSparseMat*)arr, idx, &type, 0, 0 ); |
| 2112 | } |
| 2113 | |
| 2114 | if( ptr ) |
| 2115 | { |
| 2116 | if( CV_MAT_CN( type ) > 1 ) |
| 2117 | CV_Error( CV_BadNumChannels, "cvGetReal* support only single-channel arrays" ); |
| 2118 | |
| 2119 | value = icvGetReal( ptr, type ); |
| 2120 | } |
| 2121 | |
| 2122 | return value; |
| 2123 | } |
| 2124 | |
| 2125 | |
| 2126 | // Returns specifed element of nD array |
nothing calls this directly
no test coverage detected