Lines Matching refs:arr
98 CvMat* arr = 0; in cvCreateMat() local
104 CV_CALL( arr = cvCreateMatHeader( height, width, type )); in cvCreateMat()
105 CV_CALL( cvCreateData( arr )); in cvCreateMat()
110 cvReleaseMat( &arr ); in cvCreateMat()
112 return arr; in cvCreateMat()
116 static void icvCheckHuge( CvMat* arr ) in icvCheckHuge() argument
118 if( (int64)arr->step*arr->rows > INT_MAX ) in icvCheckHuge()
119 arr->type &= ~CV_MAT_CONT_FLAG; in icvCheckHuge()
126 CvMat* arr = 0; in cvCreateMatHeader() local
142 CV_CALL( arr = (CvMat*)cvAlloc( sizeof(*arr))); in cvCreateMatHeader()
144 arr->step = rows == 1 ? 0 : cvAlign(min_step, CV_DEFAULT_MAT_ROW_ALIGN); in cvCreateMatHeader()
145 arr->type = CV_MAT_MAGIC_VAL | type | in cvCreateMatHeader()
146 (arr->step == 0 || arr->step == min_step ? CV_MAT_CONT_FLAG : 0); in cvCreateMatHeader()
147 arr->rows = rows; in cvCreateMatHeader()
148 arr->cols = cols; in cvCreateMatHeader()
149 arr->data.ptr = 0; in cvCreateMatHeader()
150 arr->refcount = 0; in cvCreateMatHeader()
151 arr->hdr_refcount = 1; in cvCreateMatHeader()
153 icvCheckHuge( arr ); in cvCreateMatHeader()
158 cvReleaseMat( &arr ); in cvCreateMatHeader()
160 return arr; in cvCreateMatHeader()
166 cvInitMatHeader( CvMat* arr, int rows, int cols, in cvInitMatHeader() argument
175 if( !arr ) in cvInitMatHeader()
185 arr->type = type | CV_MAT_MAGIC_VAL; in cvInitMatHeader()
186 arr->rows = rows; in cvInitMatHeader()
187 arr->cols = cols; in cvInitMatHeader()
188 arr->data.ptr = (uchar*)data; in cvInitMatHeader()
189 arr->refcount = 0; in cvInitMatHeader()
190 arr->hdr_refcount = 0; in cvInitMatHeader()
192 mask = (arr->rows <= 1) - 1; in cvInitMatHeader()
194 min_step = arr->cols*pix_size & mask; in cvInitMatHeader()
200 arr->step = step & mask; in cvInitMatHeader()
204 arr->step = min_step; in cvInitMatHeader()
207 arr->type = CV_MAT_MAGIC_VAL | type | in cvInitMatHeader()
208 (arr->step == min_step ? CV_MAT_CONT_FLAG : 0); in cvInitMatHeader()
210 icvCheckHuge( arr ); in cvInitMatHeader()
214 return arr; in cvInitMatHeader()
231 CvMat* arr = *array; in cvReleaseMat() local
233 if( !CV_IS_MAT_HDR(arr) && !CV_IS_MATND_HDR(arr) ) in cvReleaseMat()
238 cvDecRefData( arr ); in cvReleaseMat()
239 cvFree( &arr ); in cvReleaseMat()
337 CvMatND* arr = 0; in cvCreateMatND() local
343 CV_CALL( arr = cvCreateMatNDHeader( dims, sizes, type )); in cvCreateMatND()
344 CV_CALL( cvCreateData( arr )); in cvCreateMatND()
349 cvReleaseMatND( &arr ); in cvCreateMatND()
351 return arr; in cvCreateMatND()
359 CvMatND* arr = 0; in cvCreateMatNDHeader() local
369 CV_CALL( arr = (CvMatND*)cvAlloc( sizeof(*arr) )); in cvCreateMatNDHeader()
371 CV_CALL( cvInitMatNDHeader( arr, dims, sizes, type, 0 )); in cvCreateMatNDHeader()
372 arr->hdr_refcount = 1; in cvCreateMatNDHeader()
377 cvReleaseMatND( &arr ); in cvCreateMatNDHeader()
379 return arr; in cvCreateMatNDHeader()
417 cvGetMatND( const CvArr* arr, CvMatND* matnd, int* coi ) in cvGetMatND() argument
428 if( !matnd || !arr ) in cvGetMatND()
431 if( CV_IS_MATND_HDR(arr)) in cvGetMatND()
433 if( !((CvMatND*)arr)->data.ptr ) in cvGetMatND()
436 result = (CvMatND*)arr; in cvGetMatND()
440 CvMat stub, *mat = (CvMat*)arr; in cvGetMatND()
504 const CvArr* arr = i < count ? arrs[i] : mask; in cvInitNArrayIterator() local
507 if( !arr ) in cvInitNArrayIterator()
514 if( CV_IS_MATND( arr )) in cvInitNArrayIterator()
515 hdr = (CvMatND*)arr; in cvInitNArrayIterator()
519 CV_CALL( hdr = cvGetMatND( arr, stubs + i, &coi )); in cvInitNArrayIterator()
641 CvSparseMat* arr = 0; in cvCreateSparseMat() local
668 CV_CALL( arr = (CvSparseMat*)cvAlloc(sizeof(*arr)+MAX(0,dims-CV_MAX_DIM)*sizeof(arr->size[0]))); in cvCreateSparseMat()
670 arr->type = CV_SPARSE_MAT_MAGIC_VAL | type; in cvCreateSparseMat()
671 arr->dims = dims; in cvCreateSparseMat()
672 arr->refcount = 0; in cvCreateSparseMat()
673 arr->hdr_refcount = 1; in cvCreateSparseMat()
674 memcpy( arr->size, sizes, dims*sizeof(sizes[0])); in cvCreateSparseMat()
676 arr->valoffset = (int)cvAlign(sizeof(CvSparseNode), pix_size1); in cvCreateSparseMat()
677 arr->idxoffset = (int)cvAlign(arr->valoffset + pix_size, sizeof(int)); in cvCreateSparseMat()
678 size = (int)cvAlign(arr->idxoffset + dims*sizeof(int), sizeof(CvSetElem)); in cvCreateSparseMat()
681 CV_CALL( arr->heap = cvCreateSet( 0, sizeof(CvSet), size, storage )); in cvCreateSparseMat()
683 arr->hashsize = CV_SPARSE_HASH_SIZE0; in cvCreateSparseMat()
684 size = arr->hashsize*sizeof(arr->hashtable[0]); in cvCreateSparseMat()
686 CV_CALL( arr->hashtable = (void**)cvAlloc( size )); in cvCreateSparseMat()
687 memset( arr->hashtable, 0, size ); in cvCreateSparseMat()
692 cvReleaseSparseMat( &arr ); in cvCreateSparseMat()
694 return arr; in cvCreateSparseMat()
711 CvSparseMat* arr = *array; in cvReleaseSparseMat() local
713 if( !CV_IS_SPARSE_MAT_HDR(arr) ) in cvReleaseSparseMat()
718 cvReleaseMemStorage( &arr->heap->storage ); in cvReleaseSparseMat()
719 cvFree( &arr->hashtable ); in cvReleaseSparseMat()
720 cvFree( &arr ); in cvReleaseSparseMat()
952 cvCreateData( CvArr* arr ) in cvCreateData() argument
958 if( CV_IS_MAT_HDR( arr )) in cvCreateData()
961 CvMat* mat = (CvMat*)arr; in cvCreateData()
975 else if( CV_IS_IMAGE_HDR(arr)) in cvCreateData()
977 IplImage* img = (IplImage*)arr; in cvCreateData()
1004 else if( CV_IS_MATND_HDR( arr )) in cvCreateData()
1006 CvMatND* mat = (CvMatND*)arr; in cvCreateData()
1045 cvSetData( CvArr* arr, void* data, int step ) in cvSetData() argument
1053 if( CV_IS_MAT_HDR(arr) || CV_IS_MATND_HDR(arr) ) in cvSetData()
1054 cvReleaseData( arr ); in cvSetData()
1056 if( CV_IS_MAT_HDR( arr )) in cvSetData()
1058 CvMat* mat = (CvMat*)arr; in cvSetData()
1080 else if( CV_IS_IMAGE_HDR( arr )) in cvSetData()
1082 IplImage* img = (IplImage*)arr; in cvSetData()
1111 else if( CV_IS_MATND_HDR( arr )) in cvSetData()
1113 CvMatND* mat = (CvMatND*)arr; in cvSetData()
1143 cvReleaseData( CvArr* arr ) in cvReleaseData() argument
1149 if( CV_IS_MAT_HDR( arr ) || CV_IS_MATND_HDR( arr )) in cvReleaseData()
1151 CvMat* mat = (CvMat*)arr; in cvReleaseData()
1154 else if( CV_IS_IMAGE_HDR( arr )) in cvReleaseData()
1156 IplImage* img = (IplImage*)arr; in cvReleaseData()
1180 cvGetRawData( const CvArr* arr, uchar** data, int* step, CvSize* roi_size ) in cvGetRawData() argument
1186 if( CV_IS_MAT( arr )) in cvGetRawData()
1188 CvMat *mat = (CvMat*)arr; in cvGetRawData()
1199 else if( CV_IS_IMAGE( arr )) in cvGetRawData()
1201 IplImage* img = (IplImage*)arr; in cvGetRawData()
1221 else if( CV_IS_MATND( arr )) in cvGetRawData()
1223 CvMatND* mat = (CvMatND*)arr; in cvGetRawData()
1261 cvGetElemType( const CvArr* arr ) in cvGetElemType() argument
1269 if( CV_IS_MAT_HDR(arr) || CV_IS_MATND_HDR(arr) || CV_IS_SPARSE_MAT_HDR(arr)) in cvGetElemType()
1271 type = CV_MAT_TYPE( ((CvMat*)arr)->type ); in cvGetElemType()
1273 else if( CV_IS_IMAGE(arr)) in cvGetElemType()
1275 IplImage* img = (IplImage*)arr; in cvGetElemType()
1289 cvGetDims( const CvArr* arr, int* sizes ) in cvGetDims() argument
1296 if( CV_IS_MAT_HDR( arr )) in cvGetDims()
1298 CvMat* mat = (CvMat*)arr; in cvGetDims()
1307 else if( CV_IS_IMAGE( arr )) in cvGetDims()
1309 IplImage* img = (IplImage*)arr; in cvGetDims()
1318 else if( CV_IS_MATND_HDR( arr )) in cvGetDims()
1320 CvMatND* mat = (CvMatND*)arr; in cvGetDims()
1330 else if( CV_IS_SPARSE_MAT_HDR( arr )) in cvGetDims()
1332 CvSparseMat* mat = (CvSparseMat*)arr; in cvGetDims()
1351 cvGetDimSize( const CvArr* arr, int index ) in cvGetDimSize() argument
1358 if( CV_IS_MAT( arr )) in cvGetDimSize()
1360 CvMat *mat = (CvMat*)arr; in cvGetDimSize()
1374 else if( CV_IS_IMAGE( arr )) in cvGetDimSize()
1376 IplImage* img = (IplImage*)arr; in cvGetDimSize()
1390 else if( CV_IS_MATND_HDR( arr )) in cvGetDimSize()
1392 CvMatND* mat = (CvMatND*)arr; in cvGetDimSize()
1399 else if( CV_IS_SPARSE_MAT_HDR( arr )) in cvGetDimSize()
1401 CvSparseMat* mat = (CvSparseMat*)arr; in cvGetDimSize()
1421 cvGetSize( const CvArr* arr ) in cvGetSize() argument
1429 if( CV_IS_MAT_HDR( arr )) in cvGetSize()
1431 CvMat *mat = (CvMat*)arr; in cvGetSize()
1436 else if( CV_IS_IMAGE_HDR( arr )) in cvGetSize()
1438 IplImage* img = (IplImage*)arr; in cvGetSize()
1464 cvGetSubRect( const CvArr* arr, CvMat* submat, CvRect rect ) in cvGetSubRect() argument
1472 CvMat stub, *mat = (CvMat*)arr; in cvGetSubRect()
1515 cvGetRows( const CvArr* arr, CvMat* submat, in cvGetRows() argument
1524 CvMat stub, *mat = (CvMat*)arr; in cvGetRows()
1574 cvGetCols( const CvArr* arr, CvMat* submat, int start_col, int end_col ) in cvGetCols() argument
1582 CvMat stub, *mat = (CvMat*)arr; in cvGetCols()
1623 cvGetDiag( const CvArr* arr, CvMat* submat, int diag ) in cvGetDiag() argument
1631 CvMat stub, *mat = (CvMat*)arr; in cvGetDiag()
1896 cvPtr1D( const CvArr* arr, int idx, int* _type ) in cvPtr1D() argument
1904 if( CV_IS_MAT( arr )) in cvPtr1D()
1906 CvMat* mat = (CvMat*)arr; in cvPtr1D()
1934 else if( CV_IS_IMAGE_HDR( arr )) in cvPtr1D()
1936 IplImage* img = (IplImage*)arr; in cvPtr1D()
1940 ptr = cvPtr2D( arr, y, x, _type ); in cvPtr1D()
1942 else if( CV_IS_MATND( arr )) in cvPtr1D()
1944 CvMatND* mat = (CvMatND*)arr; in cvPtr1D()
1977 else if( CV_IS_SPARSE_MAT( arr )) in cvPtr1D()
1979 CvSparseMat* m = (CvSparseMat*)arr; in cvPtr1D()
1981 ptr = icvGetNodePtr( (CvSparseMat*)arr, &idx, _type, 1, 0 ); in cvPtr1D()
1993 ptr = icvGetNodePtr( (CvSparseMat*)arr, _idx, _type, 1, 0 ); in cvPtr1D()
2009 cvPtr2D( const CvArr* arr, int y, int x, int* _type ) in cvPtr2D() argument
2017 if( CV_IS_MAT( arr )) in cvPtr2D()
2019 CvMat* mat = (CvMat*)arr; in cvPtr2D()
2032 else if( CV_IS_IMAGE( arr )) in cvPtr2D()
2034 IplImage* img = (IplImage*)arr; in cvPtr2D()
2080 else if( CV_IS_MATND( arr )) in cvPtr2D()
2082 CvMatND* mat = (CvMatND*)arr; in cvPtr2D()
2093 else if( CV_IS_SPARSE_MAT( arr )) in cvPtr2D()
2096 ptr = icvGetNodePtr( (CvSparseMat*)arr, idx, _type, 1, 0 ); in cvPtr2D()
2111 cvPtr3D( const CvArr* arr, int z, int y, int x, int* _type ) in cvPtr3D() argument
2119 if( CV_IS_MATND( arr )) in cvPtr3D()
2121 CvMatND* mat = (CvMatND*)arr; in cvPtr3D()
2135 else if( CV_IS_SPARSE_MAT( arr )) in cvPtr3D()
2138 ptr = icvGetNodePtr( (CvSparseMat*)arr, idx, _type, 1, 0 ); in cvPtr3D()
2153 cvPtrND( const CvArr* arr, const int* idx, int* _type, in cvPtrND() argument
2164 if( CV_IS_SPARSE_MAT( arr )) in cvPtrND()
2165 ptr = icvGetNodePtr( (CvSparseMat*)arr, idx, in cvPtrND()
2167 else if( CV_IS_MATND( arr )) in cvPtrND()
2169 CvMatND* mat = (CvMatND*)arr; in cvPtrND()
2183 else if( CV_IS_MAT_HDR(arr) || CV_IS_IMAGE_HDR(arr) ) in cvPtrND()
2184 ptr = cvPtr2D( arr, idx[0], idx[1], _type ); in cvPtrND()
2196 cvGet1D( const CvArr* arr, int idx ) in cvGet1D() argument
2207 if( CV_IS_MAT( arr ) && CV_IS_MAT_CONT( ((CvMat*)arr)->type )) in cvGet1D()
2209 CvMat* mat = (CvMat*)arr; in cvGet1D()
2222 else if( !CV_IS_SPARSE_MAT( arr ) || ((CvSparseMat*)arr)->dims > 1 ) in cvGet1D()
2223 ptr = cvPtr1D( arr, idx, &type ); in cvGet1D()
2225 ptr = icvGetNodePtr( (CvSparseMat*)arr, &idx, &type, 0, 0 ); in cvGet1D()
2237 cvGet2D( const CvArr* arr, int y, int x ) in cvGet2D() argument
2248 if( CV_IS_MAT( arr )) in cvGet2D()
2250 CvMat* mat = (CvMat*)arr; in cvGet2D()
2259 else if( !CV_IS_SPARSE_MAT( arr )) in cvGet2D()
2260 ptr = cvPtr2D( arr, y, x, &type ); in cvGet2D()
2264 ptr = icvGetNodePtr( (CvSparseMat*)arr, idx, &type, 0, 0 ); in cvGet2D()
2277 cvGet3D( const CvArr* arr, int z, int y, int x ) in cvGet3D() argument
2288 if( !CV_IS_SPARSE_MAT( arr )) in cvGet3D()
2289 ptr = cvPtr3D( arr, z, y, x, &type ); in cvGet3D()
2293 ptr = icvGetNodePtr( (CvSparseMat*)arr, idx, &type, 0, 0 ); in cvGet3D()
2306 cvGetND( const CvArr* arr, const int* idx ) in cvGetND() argument
2317 if( !CV_IS_SPARSE_MAT( arr )) in cvGetND()
2318 ptr = cvPtrND( arr, idx, &type ); in cvGetND()
2320 ptr = icvGetNodePtr( (CvSparseMat*)arr, idx, &type, 0, 0 ); in cvGetND()
2332 cvGetReal1D( const CvArr* arr, int idx ) in cvGetReal1D() argument
2343 if( CV_IS_MAT( arr ) && CV_IS_MAT_CONT( ((CvMat*)arr)->type )) in cvGetReal1D()
2345 CvMat* mat = (CvMat*)arr; in cvGetReal1D()
2358 else if( !CV_IS_SPARSE_MAT( arr ) || ((CvSparseMat*)arr)->dims > 1 ) in cvGetReal1D()
2359 ptr = cvPtr1D( arr, idx, &type ); in cvGetReal1D()
2361 ptr = icvGetNodePtr( (CvSparseMat*)arr, &idx, &type, 0, 0 ); in cvGetReal1D()
2379 cvGetReal2D( const CvArr* arr, int y, int x ) in cvGetReal2D() argument
2390 if( CV_IS_MAT( arr )) in cvGetReal2D()
2392 CvMat* mat = (CvMat*)arr; in cvGetReal2D()
2401 else if( !CV_IS_SPARSE_MAT( arr )) in cvGetReal2D()
2402 ptr = cvPtr2D( arr, y, x, &type ); in cvGetReal2D()
2406 ptr = icvGetNodePtr( (CvSparseMat*)arr, idx, &type, 0, 0 ); in cvGetReal2D()
2425 cvGetReal3D( const CvArr* arr, int z, int y, int x ) in cvGetReal3D() argument
2436 if( !CV_IS_SPARSE_MAT( arr )) in cvGetReal3D()
2437 ptr = cvPtr3D( arr, z, y, x, &type ); in cvGetReal3D()
2441 ptr = icvGetNodePtr( (CvSparseMat*)arr, idx, &type, 0, 0 ); in cvGetReal3D()
2460 cvGetRealND( const CvArr* arr, const int* idx ) in cvGetRealND() argument
2471 if( !CV_IS_SPARSE_MAT( arr )) in cvGetRealND()
2472 ptr = cvPtrND( arr, idx, &type ); in cvGetRealND()
2474 ptr = icvGetNodePtr( (CvSparseMat*)arr, idx, &type, 0, 0 ); in cvGetRealND()
2492 cvSet1D( CvArr* arr, int idx, CvScalar scalar ) in cvSet1D() argument
2501 if( CV_IS_MAT( arr ) && CV_IS_MAT_CONT( ((CvMat*)arr)->type )) in cvSet1D()
2503 CvMat* mat = (CvMat*)arr; in cvSet1D()
2516 else if( !CV_IS_SPARSE_MAT( arr ) || ((CvSparseMat*)arr)->dims > 1 ) in cvSet1D()
2517 ptr = cvPtr1D( arr, idx, &type ); in cvSet1D()
2519 ptr = icvGetNodePtr( (CvSparseMat*)arr, &idx, &type, -1, 0 ); in cvSet1D()
2529 cvSet2D( CvArr* arr, int y, int x, CvScalar scalar ) in cvSet2D() argument
2538 if( CV_IS_MAT( arr )) in cvSet2D()
2540 CvMat* mat = (CvMat*)arr; in cvSet2D()
2549 else if( !CV_IS_SPARSE_MAT( arr )) in cvSet2D()
2550 ptr = cvPtr2D( arr, y, x, &type ); in cvSet2D()
2554 ptr = icvGetNodePtr( (CvSparseMat*)arr, idx, &type, -1, 0 ); in cvSet2D()
2564 cvSet3D( CvArr* arr, int z, int y, int x, CvScalar scalar ) in cvSet3D() argument
2573 if( !CV_IS_SPARSE_MAT( arr )) in cvSet3D()
2574 ptr = cvPtr3D( arr, z, y, x, &type ); in cvSet3D()
2578 ptr = icvGetNodePtr( (CvSparseMat*)arr, idx, &type, -1, 0 ); in cvSet3D()
2588 cvSetND( CvArr* arr, const int* idx, CvScalar scalar ) in cvSetND() argument
2597 if( !CV_IS_SPARSE_MAT( arr )) in cvSetND()
2598 ptr = cvPtrND( arr, idx, &type ); in cvSetND()
2600 ptr = icvGetNodePtr( (CvSparseMat*)arr, idx, &type, -1, 0 ); in cvSetND()
2608 cvSetReal1D( CvArr* arr, int idx, double value ) in cvSetReal1D() argument
2617 if( CV_IS_MAT( arr ) && CV_IS_MAT_CONT( ((CvMat*)arr)->type )) in cvSetReal1D()
2619 CvMat* mat = (CvMat*)arr; in cvSetReal1D()
2632 else if( !CV_IS_SPARSE_MAT( arr ) || ((CvSparseMat*)arr)->dims > 1 ) in cvSetReal1D()
2633 ptr = cvPtr1D( arr, idx, &type ); in cvSetReal1D()
2635 ptr = icvGetNodePtr( (CvSparseMat*)arr, &idx, &type, -1, 0 ); in cvSetReal1D()
2648 cvSetReal2D( CvArr* arr, int y, int x, double value ) in cvSetReal2D() argument
2657 if( CV_IS_MAT( arr )) in cvSetReal2D()
2659 CvMat* mat = (CvMat*)arr; in cvSetReal2D()
2668 else if( !CV_IS_SPARSE_MAT( arr )) in cvSetReal2D()
2670 ptr = cvPtr2D( arr, y, x, &type ); in cvSetReal2D()
2675 ptr = icvGetNodePtr( (CvSparseMat*)arr, idx, &type, -1, 0 ); in cvSetReal2D()
2688 cvSetReal3D( CvArr* arr, int z, int y, int x, double value ) in cvSetReal3D() argument
2697 if( !CV_IS_SPARSE_MAT( arr )) in cvSetReal3D()
2698 ptr = cvPtr3D( arr, z, y, x, &type ); in cvSetReal3D()
2702 ptr = icvGetNodePtr( (CvSparseMat*)arr, idx, &type, -1, 0 ); in cvSetReal3D()
2715 cvSetRealND( CvArr* arr, const int* idx, double value ) in cvSetRealND() argument
2724 if( !CV_IS_SPARSE_MAT( arr )) in cvSetRealND()
2725 ptr = cvPtrND( arr, idx, &type ); in cvSetRealND()
2727 ptr = icvGetNodePtr( (CvSparseMat*)arr, idx, &type, -1, 0 ); in cvSetRealND()
2740 cvClearND( CvArr* arr, const int* idx ) in cvClearND() argument
2746 if( !CV_IS_SPARSE_MAT( arr )) in cvClearND()
2750 ptr = cvPtrND( arr, idx, &type ); in cvClearND()
2756 icvDeleteNode( (CvSparseMat*)arr, idx, 0 ); in cvClearND()
2895 cvReshapeMatND( const CvArr* arr, in cvReshapeMatND() argument
2906 if( !arr || !_header ) in cvReshapeMatND()
2912 CV_CALL( dims = cvGetDims( arr )); in cvReshapeMatND()
2933 CvMat* mat = (CvMat*)arr; in cvReshapeMatND()
3005 if( !CV_IS_MATND( arr )) in cvReshapeMatND()
3009 CvMatND* mat = (CvMatND*)arr; in cvReshapeMatND()
3032 CvMatND* mat = (CvMatND*)arr; in cvReshapeMatND()