Lines Matching refs:mat
277 cvInitMatNDHeader( CvMatND* mat, int dims, const int* sizes, in cvInitMatNDHeader() argument
290 if( !mat ) in cvInitMatNDHeader()
307 mat->dim[i].size = sizes[i]; in cvInitMatNDHeader()
310 mat->dim[i].step = (int)step; in cvInitMatNDHeader()
314 mat->type = CV_MATND_MAGIC_VAL | (step <= INT_MAX ? CV_MAT_CONT_FLAG : 0) | type; in cvInitMatNDHeader()
315 mat->dims = dims; in cvInitMatNDHeader()
316 mat->data.ptr = (uchar*)data; in cvInitMatNDHeader()
317 mat->refcount = 0; in cvInitMatNDHeader()
318 mat->hdr_refcount = 0; in cvInitMatNDHeader()
319 result = mat; in cvInitMatNDHeader()
323 if( cvGetErrStatus() < 0 && mat ) in cvInitMatNDHeader()
325 mat->type = 0; in cvInitMatNDHeader()
326 mat->data.ptr = 0; in cvInitMatNDHeader()
440 CvMat stub, *mat = (CvMat*)arr; in cvGetMatND() local
442 if( CV_IS_IMAGE_HDR( mat )) in cvGetMatND()
443 CV_CALL( mat = cvGetMat( mat, &stub, coi )); in cvGetMatND()
445 if( !CV_IS_MAT_HDR( mat )) in cvGetMatND()
448 if( !mat->data.ptr ) in cvGetMatND()
451 matnd->data.ptr = mat->data.ptr; in cvGetMatND()
454 matnd->type = mat->type; in cvGetMatND()
456 matnd->dim[0].size = mat->rows; in cvGetMatND()
457 matnd->dim[0].step = mat->step; in cvGetMatND()
458 matnd->dim[1].size = mat->cols; in cvGetMatND()
459 matnd->dim[1].step = CV_ELEM_SIZE(mat->type); in cvGetMatND()
753 cvInitSparseMatIterator( const CvSparseMat* mat, CvSparseMatIterator* iterator ) in cvInitSparseMatIterator() argument
763 if( !CV_IS_SPARSE_MAT( mat )) in cvInitSparseMatIterator()
769 iterator->mat = (CvSparseMat*)mat; in cvInitSparseMatIterator()
772 for( idx = 0; idx < mat->hashsize; idx++ ) in cvInitSparseMatIterator()
773 if( mat->hashtable[idx] ) in cvInitSparseMatIterator()
775 node = iterator->node = (CvSparseNode*)mat->hashtable[idx]; in cvInitSparseMatIterator()
789 icvGetNodePtr( CvSparseMat* mat, const int* idx, int* _type, in icvGetNodePtr() argument
801 assert( CV_IS_SPARSE_MAT( mat )); in icvGetNodePtr()
805 for( i = 0; i < mat->dims; i++ ) in icvGetNodePtr()
808 if( (unsigned)t >= (unsigned)mat->size[i] ) in icvGetNodePtr()
818 tabidx = hashval & (mat->hashsize - 1); in icvGetNodePtr()
821 for( node = (CvSparseNode*)mat->hashtable[tabidx]; in icvGetNodePtr()
826 int* nodeidx = CV_NODE_IDX(mat,node); in icvGetNodePtr()
827 for( i = 0; i < mat->dims; i++ ) in icvGetNodePtr()
830 if( i == mat->dims ) in icvGetNodePtr()
832 ptr = (uchar*)CV_NODE_VAL(mat,node); in icvGetNodePtr()
840 if( mat->heap->active_count >= mat->hashsize*CV_SPARSE_HASH_RATIO ) in icvGetNodePtr()
843 int newsize = MAX( mat->hashsize*2, CV_SPARSE_HASH_SIZE0); in icvGetNodePtr()
853 node = cvInitSparseMatIterator( mat, &iterator ); in icvGetNodePtr()
863 cvFree( &mat->hashtable ); in icvGetNodePtr()
864 mat->hashtable = newtable; in icvGetNodePtr()
865 mat->hashsize = newsize; in icvGetNodePtr()
869 node = (CvSparseNode*)cvSetNew( mat->heap ); in icvGetNodePtr()
871 node->next = (CvSparseNode*)mat->hashtable[tabidx]; in icvGetNodePtr()
872 mat->hashtable[tabidx] = node; in icvGetNodePtr()
873 CV_MEMCPY_INT( CV_NODE_IDX(mat,node), idx, mat->dims ); in icvGetNodePtr()
874 ptr = (uchar*)CV_NODE_VAL(mat,node); in icvGetNodePtr()
876 CV_ZERO_CHAR( ptr, CV_ELEM_SIZE(mat->type)); in icvGetNodePtr()
880 *_type = CV_MAT_TYPE(mat->type); in icvGetNodePtr()
889 icvDeleteNode( CvSparseMat* mat, const int* idx, unsigned* precalc_hashval ) in icvDeleteNode() argument
898 assert( CV_IS_SPARSE_MAT( mat )); in icvDeleteNode()
902 for( i = 0; i < mat->dims; i++ ) in icvDeleteNode()
905 if( (unsigned)t >= (unsigned)mat->size[i] ) in icvDeleteNode()
915 tabidx = hashval & (mat->hashsize - 1); in icvDeleteNode()
918 for( node = (CvSparseNode*)mat->hashtable[tabidx]; in icvDeleteNode()
923 int* nodeidx = CV_NODE_IDX(mat,node); in icvDeleteNode()
924 for( i = 0; i < mat->dims; i++ ) in icvDeleteNode()
927 if( i == mat->dims ) in icvDeleteNode()
937 mat->hashtable[tabidx] = node->next; in icvDeleteNode()
938 cvSetRemoveByPtr( mat->heap, node ); in icvDeleteNode()
961 CvMat* mat = (CvMat*)arr; in cvCreateData() local
962 step = mat->step; in cvCreateData()
964 if( mat->data.ptr != 0 ) in cvCreateData()
968 step = CV_ELEM_SIZE(mat->type)*mat->cols; in cvCreateData()
970 total_size = step*mat->rows + sizeof(int) + CV_MALLOC_ALIGN; in cvCreateData()
971 CV_CALL( mat->refcount = (int*)cvAlloc( (size_t)total_size )); in cvCreateData()
972 mat->data.ptr = (uchar*)cvAlignPtr( mat->refcount + 1, CV_MALLOC_ALIGN ); in cvCreateData()
973 *mat->refcount = 1; in cvCreateData()
1006 CvMatND* mat = (CvMatND*)arr; in cvCreateData() local
1008 size_t total_size = CV_ELEM_SIZE(mat->type); in cvCreateData()
1010 if( mat->data.ptr != 0 ) in cvCreateData()
1013 if( CV_IS_MAT_CONT( mat->type )) in cvCreateData()
1015 total_size = (size_t)mat->dim[0].size*(mat->dim[0].step != 0 ? in cvCreateData()
1016 mat->dim[0].step : total_size); in cvCreateData()
1020 for( i = mat->dims - 1; i >= 0; i-- ) in cvCreateData()
1022 size_t size = (size_t)mat->dim[i].step*mat->dim[i].size; in cvCreateData()
1029 CV_CALL( mat->refcount = (int*)cvAlloc( total_size + in cvCreateData()
1031 mat->data.ptr = (uchar*)cvAlignPtr( mat->refcount + 1, CV_MALLOC_ALIGN ); in cvCreateData()
1032 *mat->refcount = 1; in cvCreateData()
1058 CvMat* mat = (CvMat*)arr; in cvSetData() local
1060 int type = CV_MAT_TYPE(mat->type); in cvSetData()
1062 min_step = mat->cols*pix_size & ((mat->rows <= 1) - 1); in cvSetData()
1068 mat->step = step & ((mat->rows <= 1) - 1); in cvSetData()
1072 mat->step = min_step; in cvSetData()
1075 mat->data.ptr = (uchar*)data; in cvSetData()
1076 mat->type = CV_MAT_MAGIC_VAL | type | in cvSetData()
1077 (mat->step==min_step ? CV_MAT_CONT_FLAG : 0); in cvSetData()
1078 icvCheckHuge( mat ); in cvSetData()
1113 CvMatND* mat = (CvMatND*)arr; in cvSetData() local
1121 mat->data.ptr = (uchar*)data; in cvSetData()
1122 cur_step = CV_ELEM_SIZE(mat->type); in cvSetData()
1124 for( i = mat->dims - 1; i >= 0; i-- ) in cvSetData()
1128 mat->dim[i].step = (int)cur_step; in cvSetData()
1129 cur_step *= mat->dim[i].size; in cvSetData()
1151 CvMat* mat = (CvMat*)arr; in cvReleaseData() local
1152 cvDecRefData( mat ); in cvReleaseData()
1188 CvMat *mat = (CvMat*)arr; in cvGetRawData() local
1191 *step = mat->step; in cvGetRawData()
1194 *data = mat->data.ptr; in cvGetRawData()
1197 *roi_size = cvGetMatSize( mat ); in cvGetRawData()
1223 CvMatND* mat = (CvMatND*)arr; in cvGetRawData() local
1225 if( !CV_IS_MAT_CONT( mat->type )) in cvGetRawData()
1229 *data = mat->data.ptr; in cvGetRawData()
1233 int i, size1 = mat->dim[0].size, size2 = 1; in cvGetRawData()
1235 if( mat->dims > 2 ) in cvGetRawData()
1236 for( i = 1; i < mat->dims; i++ ) in cvGetRawData()
1237 size1 *= mat->dim[i].size; in cvGetRawData()
1239 size2 = mat->dim[1].size; in cvGetRawData()
1248 *step = size1 == 1 ? 0 : mat->dim[0].step; in cvGetRawData()
1298 CvMat* mat = (CvMat*)arr; in cvGetDims() local
1303 sizes[0] = mat->rows; in cvGetDims()
1304 sizes[1] = mat->cols; in cvGetDims()
1320 CvMatND* mat = (CvMatND*)arr; in cvGetDims() local
1321 dims = mat->dims; in cvGetDims()
1327 sizes[i] = mat->dim[i].size; in cvGetDims()
1332 CvSparseMat* mat = (CvSparseMat*)arr; in cvGetDims() local
1333 dims = mat->dims; in cvGetDims()
1336 memcpy( sizes, mat->size, dims*sizeof(sizes[0])); in cvGetDims()
1360 CvMat *mat = (CvMat*)arr; in cvGetDimSize() local
1365 size = mat->rows; in cvGetDimSize()
1368 size = mat->cols; in cvGetDimSize()
1392 CvMatND* mat = (CvMatND*)arr; in cvGetDimSize() local
1394 if( (unsigned)index >= (unsigned)mat->dims ) in cvGetDimSize()
1397 size = mat->dim[index].size; in cvGetDimSize()
1401 CvSparseMat* mat = (CvSparseMat*)arr; in cvGetDimSize() local
1403 if( (unsigned)index >= (unsigned)mat->dims ) in cvGetDimSize()
1406 size = mat->size[index]; in cvGetDimSize()
1431 CvMat *mat = (CvMat*)arr; in cvGetSize() local
1433 size.width = mat->cols; in cvGetSize()
1434 size.height = mat->rows; in cvGetSize()
1472 CvMat stub, *mat = (CvMat*)arr; in cvGetSubRect() local
1474 if( !CV_IS_MAT( mat )) in cvGetSubRect()
1475 CV_CALL( mat = cvGetMat( mat, &stub )); in cvGetSubRect()
1483 if( rect.x + rect.width > mat->cols || in cvGetSubRect()
1484 rect.y + rect.height > mat->rows ) in cvGetSubRect()
1496 submat->data.ptr = mat->data.ptr + (size_t)rect.y*mat->step + in cvGetSubRect()
1497 rect.x*CV_ELEM_SIZE(mat->type); in cvGetSubRect()
1498 submat->step = mat->step & (rect.height > 1 ? -1 : 0); in cvGetSubRect()
1499 submat->type = (mat->type & (rect.width < mat->cols ? ~CV_MAT_CONT_FLAG : -1)) | in cvGetSubRect()
1524 CvMat stub, *mat = (CvMat*)arr; in cvGetRows() local
1526 if( !CV_IS_MAT( mat )) in cvGetRows()
1527 CV_CALL( mat = cvGetMat( mat, &stub )); in cvGetRows()
1532 if( (unsigned)start_row >= (unsigned)mat->rows || in cvGetRows()
1533 (unsigned)end_row > (unsigned)mat->rows || delta_row <= 0 ) in cvGetRows()
1548 submat->step = mat->step & (submat->rows > 1 ? -1 : 0); in cvGetRows()
1553 submat->step = mat->step * delta_row; in cvGetRows()
1556 submat->cols = mat->cols; in cvGetRows()
1558 submat->data.ptr = mat->data.ptr + (size_t)start_row*mat->step; in cvGetRows()
1559 submat->type = (mat->type | (submat->step == 0 ? CV_MAT_CONT_FLAG : 0)) & in cvGetRows()
1582 CvMat stub, *mat = (CvMat*)arr; in cvGetCols() local
1585 if( !CV_IS_MAT( mat )) in cvGetCols()
1586 CV_CALL( mat = cvGetMat( mat, &stub )); in cvGetCols()
1591 cols = mat->cols; in cvGetCols()
1605 submat->rows = mat->rows; in cvGetCols()
1607 submat->step = mat->step & (submat->rows > 1 ? -1 : 0); in cvGetCols()
1608 submat->data.ptr = mat->data.ptr + (size_t)start_col*CV_ELEM_SIZE(mat->type); in cvGetCols()
1609 submat->type = mat->type & (submat->step && submat->cols < cols ? ~CV_MAT_CONT_FLAG : -1); in cvGetCols()
1631 CvMat stub, *mat = (CvMat*)arr; in cvGetDiag() local
1634 if( !CV_IS_MAT( mat )) in cvGetDiag()
1635 CV_CALL( mat = cvGetMat( mat, &stub )); in cvGetDiag()
1640 pix_size = CV_ELEM_SIZE(mat->type); in cvGetDiag()
1653 len = mat->cols - diag; in cvGetDiag()
1658 len = CV_IMIN( len, mat->rows ); in cvGetDiag()
1659 submat->data.ptr = mat->data.ptr + diag*pix_size; in cvGetDiag()
1663 len = mat->rows + diag; in cvGetDiag()
1668 len = CV_IMIN( len, mat->cols ); in cvGetDiag()
1669 submat->data.ptr = mat->data.ptr - diag*mat->step; in cvGetDiag()
1674 submat->step = (mat->step + pix_size) & (submat->rows > 1 ? -1 : 0); in cvGetDiag()
1675 submat->type = mat->type; in cvGetDiag()
1906 CvMat* mat = (CvMat*)arr; in cvPtr1D() local
1908 int type = CV_MAT_TYPE(mat->type); in cvPtr1D()
1916 if( (unsigned)idx >= (unsigned)(mat->rows + mat->cols - 1) && in cvPtr1D()
1917 (unsigned)idx >= (unsigned)(mat->rows*mat->cols)) in cvPtr1D()
1920 if( CV_IS_MAT_CONT(mat->type)) in cvPtr1D()
1922 ptr = mat->data.ptr + (size_t)idx*pix_size; in cvPtr1D()
1927 if( mat->cols == 1 ) in cvPtr1D()
1930 row = idx/mat->cols, col = idx - row*mat->cols; in cvPtr1D()
1931 ptr = mat->data.ptr + (size_t)row*mat->step + col*pix_size; in cvPtr1D()
1944 CvMatND* mat = (CvMatND*)arr; in cvPtr1D() local
1945 int j, type = CV_MAT_TYPE(mat->type); in cvPtr1D()
1946 size_t size = mat->dim[0].size; in cvPtr1D()
1951 for( j = 1; j < mat->dims; j++ ) in cvPtr1D()
1952 size *= mat->dim[j].size; in cvPtr1D()
1957 if( CV_IS_MAT_CONT(mat->type)) in cvPtr1D()
1960 ptr = mat->data.ptr + (size_t)idx*pix_size; in cvPtr1D()
1964 ptr = mat->data.ptr; in cvPtr1D()
1965 for( j = mat->dims - 1; j >= 0; j-- ) in cvPtr1D()
1967 int sz = mat->dim[j].size; in cvPtr1D()
1971 ptr += (idx - t*sz)*mat->dim[j].step; in cvPtr1D()
2019 CvMat* mat = (CvMat*)arr; in cvPtr2D() local
2022 if( (unsigned)y >= (unsigned)(mat->rows) || in cvPtr2D()
2023 (unsigned)x >= (unsigned)(mat->cols) ) in cvPtr2D()
2026 type = CV_MAT_TYPE(mat->type); in cvPtr2D()
2030 ptr = mat->data.ptr + (size_t)y*mat->step + x*CV_ELEM_SIZE(type); in cvPtr2D()
2082 CvMatND* mat = (CvMatND*)arr; in cvPtr2D() local
2084 if( mat->dims != 2 || in cvPtr2D()
2085 (unsigned)y >= (unsigned)(mat->dim[0].size) || in cvPtr2D()
2086 (unsigned)x >= (unsigned)(mat->dim[1].size) ) in cvPtr2D()
2089 ptr = mat->data.ptr + (size_t)y*mat->dim[0].step + x*mat->dim[1].step; in cvPtr2D()
2091 *_type = CV_MAT_TYPE(mat->type); in cvPtr2D()
2121 CvMatND* mat = (CvMatND*)arr; in cvPtr3D() local
2123 if( mat->dims != 3 || in cvPtr3D()
2124 (unsigned)z >= (unsigned)(mat->dim[0].size) || in cvPtr3D()
2125 (unsigned)y >= (unsigned)(mat->dim[1].size) || in cvPtr3D()
2126 (unsigned)x >= (unsigned)(mat->dim[2].size) ) in cvPtr3D()
2129 ptr = mat->data.ptr + (size_t)z*mat->dim[0].step + in cvPtr3D()
2130 (size_t)y*mat->dim[1].step + x*mat->dim[2].step; in cvPtr3D()
2133 *_type = CV_MAT_TYPE(mat->type); in cvPtr3D()
2169 CvMatND* mat = (CvMatND*)arr; in cvPtrND() local
2171 ptr = mat->data.ptr; in cvPtrND()
2173 for( i = 0; i < mat->dims; i++ ) in cvPtrND()
2175 if( (unsigned)idx[i] >= (unsigned)(mat->dim[i].size) ) in cvPtrND()
2177 ptr += (size_t)idx[i]*mat->dim[i].step; in cvPtrND()
2181 *_type = CV_MAT_TYPE(mat->type); in cvPtrND()
2209 CvMat* mat = (CvMat*)arr; in cvGet1D() local
2211 type = CV_MAT_TYPE(mat->type); in cvGet1D()
2216 if( (unsigned)idx >= (unsigned)(mat->rows + mat->cols - 1) && in cvGet1D()
2217 (unsigned)idx >= (unsigned)(mat->rows*mat->cols)) in cvGet1D()
2220 ptr = mat->data.ptr + (size_t)idx*pix_size; in cvGet1D()
2250 CvMat* mat = (CvMat*)arr; in cvGet2D() local
2252 if( (unsigned)y >= (unsigned)(mat->rows) || in cvGet2D()
2253 (unsigned)x >= (unsigned)(mat->cols) ) in cvGet2D()
2256 type = CV_MAT_TYPE(mat->type); in cvGet2D()
2257 ptr = mat->data.ptr + (size_t)y*mat->step + x*CV_ELEM_SIZE(type); in cvGet2D()
2345 CvMat* mat = (CvMat*)arr; in cvGetReal1D() local
2347 type = CV_MAT_TYPE(mat->type); in cvGetReal1D()
2352 if( (unsigned)idx >= (unsigned)(mat->rows + mat->cols - 1) && in cvGetReal1D()
2353 (unsigned)idx >= (unsigned)(mat->rows*mat->cols)) in cvGetReal1D()
2356 ptr = mat->data.ptr + (size_t)idx*pix_size; in cvGetReal1D()
2392 CvMat* mat = (CvMat*)arr; in cvGetReal2D() local
2394 if( (unsigned)y >= (unsigned)(mat->rows) || in cvGetReal2D()
2395 (unsigned)x >= (unsigned)(mat->cols) ) in cvGetReal2D()
2398 type = CV_MAT_TYPE(mat->type); in cvGetReal2D()
2399 ptr = mat->data.ptr + (size_t)y*mat->step + x*CV_ELEM_SIZE(type); in cvGetReal2D()
2503 CvMat* mat = (CvMat*)arr; in cvSet1D() local
2505 type = CV_MAT_TYPE(mat->type); in cvSet1D()
2510 if( (unsigned)idx >= (unsigned)(mat->rows + mat->cols - 1) && in cvSet1D()
2511 (unsigned)idx >= (unsigned)(mat->rows*mat->cols)) in cvSet1D()
2514 ptr = mat->data.ptr + (size_t)idx*pix_size; in cvSet1D()
2540 CvMat* mat = (CvMat*)arr; in cvSet2D() local
2542 if( (unsigned)y >= (unsigned)(mat->rows) || in cvSet2D()
2543 (unsigned)x >= (unsigned)(mat->cols) ) in cvSet2D()
2546 type = CV_MAT_TYPE(mat->type); in cvSet2D()
2547 ptr = mat->data.ptr + (size_t)y*mat->step + x*CV_ELEM_SIZE(type); in cvSet2D()
2619 CvMat* mat = (CvMat*)arr; in cvSetReal1D() local
2621 type = CV_MAT_TYPE(mat->type); in cvSetReal1D()
2626 if( (unsigned)idx >= (unsigned)(mat->rows + mat->cols - 1) && in cvSetReal1D()
2627 (unsigned)idx >= (unsigned)(mat->rows*mat->cols)) in cvSetReal1D()
2630 ptr = mat->data.ptr + (size_t)idx*pix_size; in cvSetReal1D()
2659 CvMat* mat = (CvMat*)arr; in cvSetReal2D() local
2661 if( (unsigned)y >= (unsigned)(mat->rows) || in cvSetReal2D()
2662 (unsigned)x >= (unsigned)(mat->cols) ) in cvSetReal2D()
2665 type = CV_MAT_TYPE(mat->type); in cvSetReal2D()
2666 ptr = mat->data.ptr + (size_t)y*mat->step + x*CV_ELEM_SIZE(type); in cvSetReal2D()
2769 cvGetMat( const CvArr* array, CvMat* mat, in cvGetMat() argument
2780 if( !mat || !src ) in cvGetMat()
2814 CV_CALL( cvInitMatHeader( mat, img->roi->height, in cvGetMat()
2830 CV_CALL( cvInitMatHeader( mat, img->roi->height, img->roi->width, in cvGetMat()
2844 CV_CALL( cvInitMatHeader( mat, img->height, img->width, type, in cvGetMat()
2848 result = mat; in cvGetMat()
2868 mat->refcount = 0; in cvGetMat()
2869 mat->hdr_refcount = 0; in cvGetMat()
2870 mat->data.ptr = matnd->data.ptr; in cvGetMat()
2871 mat->rows = size1; in cvGetMat()
2872 mat->cols = size2; in cvGetMat()
2873 mat->type = CV_MAT_TYPE(matnd->type) | CV_MAT_MAGIC_VAL | CV_MAT_CONT_FLAG; in cvGetMat()
2874 mat->step = size2*CV_ELEM_SIZE(matnd->type); in cvGetMat()
2875 mat->step &= size1 > 1 ? -1 : 0; in cvGetMat()
2877 icvCheckHuge( mat ); in cvGetMat()
2878 result = mat; in cvGetMat()
2933 CvMat* mat = (CvMat*)arr; in cvReshapeMatND() local
2942 if( mat == header ) in cvReshapeMatND()
2944 refcount = mat->refcount; in cvReshapeMatND()
2945 hdr_refcount = mat->hdr_refcount; in cvReshapeMatND()
2947 else if( !CV_IS_MAT( mat )) in cvReshapeMatND()
2948 CV_CALL( mat = cvGetMat( mat, header, &coi, 1 )); in cvReshapeMatND()
2950 cn = CV_MAT_CN( mat->type ); in cvReshapeMatND()
2951 total_width = mat->cols * cn; in cvReshapeMatND()
2959 new_rows = total_width*mat->rows/new_cn; in cvReshapeMatND()
2962 new_rows = mat->rows; in cvReshapeMatND()
2964 new_rows = mat->rows * total_width / new_cn; in cvReshapeMatND()
2967 if( new_rows != mat->rows ) in cvReshapeMatND()
2969 int total_size = total_width * mat->rows; in cvReshapeMatND()
2971 if( !CV_IS_MAT_CONT( mat->type )) in cvReshapeMatND()
2990 header->type = CV_MAKETYPE( mat->type & ~CV_MAT_CN_MASK, new_cn ); in cvReshapeMatND()
2991 header->step = header->cols * CV_ELEM_SIZE(mat->type); in cvReshapeMatND()
3009 CvMatND* mat = (CvMatND*)arr; in cvReshapeMatND() local
3011 int last_dim_size = mat->dim[mat->dims-1].size*CV_MAT_CN(mat->type); in cvReshapeMatND()
3018 if( mat != header ) in cvReshapeMatND()
3020 memcpy( header, mat, sizeof(*header)); in cvReshapeMatND()
3032 CvMatND* mat = (CvMatND*)arr; in cvReshapeMatND() local
3041 if( !CV_IS_MATND( mat )) in cvReshapeMatND()
3043 CV_CALL( cvGetMatND( mat, &stub, &coi )); in cvReshapeMatND()
3044 mat = &stub; in cvReshapeMatND()
3047 if( CV_IS_MAT_CONT( mat->type )) in cvReshapeMatND()
3050 size1 = mat->dim[0].size; in cvReshapeMatND()
3052 size1 *= mat->dim[i].size; in cvReshapeMatND()
3067 if( header != mat ) in cvReshapeMatND()
3074 header->type = mat->type; in cvReshapeMatND()
3075 header->data.ptr = mat->data.ptr; in cvReshapeMatND()
3107 CvMat *mat = (CvMat*)array; in cvReshape() local
3113 if( !CV_IS_MAT( mat )) in cvReshape()
3116 CV_CALL( mat = cvGetMat( mat, header, &coi, 1 )); in cvReshape()
3122 new_cn = CV_MAT_CN(mat->type); in cvReshape()
3126 if( mat != header ) in cvReshape()
3129 *header = *mat; in cvReshape()
3134 total_width = mat->cols * CV_MAT_CN( mat->type ); in cvReshape()
3137 new_rows = mat->rows * total_width / new_cn; in cvReshape()
3139 if( new_rows == 0 || new_rows == mat->rows ) in cvReshape()
3141 header->rows = mat->rows; in cvReshape()
3142 header->step = mat->step; in cvReshape()
3146 int total_size = total_width * mat->rows; in cvReshape()
3147 if( !CV_IS_MAT_CONT( mat->type )) in cvReshape()
3161 header->step = total_width * CV_ELEM_SIZE1(mat->type); in cvReshape()
3171 header->type = CV_MAKETYPE( mat->type & ~CV_MAT_CN_MASK, new_cn ); in cvReshape()
3199 const CvMat* mat = (const CvMat*)src; in cvGetImage() local
3201 if( !CV_IS_MAT_HDR(mat)) in cvGetImage()
3204 if( mat->data.ptr == 0 ) in cvGetImage()
3207 depth = cvCvToIplDepth(mat->type); in cvGetImage()
3209 cvInitImageHeader( img, cvSize(mat->cols, mat->rows), in cvGetImage()
3210 depth, CV_MAT_CN(mat->type) ); in cvGetImage()
3211 cvSetData( img, mat->data.ptr, mat->step ); in cvGetImage()