Deallocates array's data
| 970 | |
| 971 | // Deallocates array's data |
| 972 | CV_IMPL void |
| 973 | cvReleaseData( CvArr* arr ) |
| 974 | { |
| 975 | if( CV_IS_MAT_HDR( arr ) || CV_IS_MATND_HDR( arr )) |
| 976 | { |
| 977 | CvMat* mat = (CvMat*)arr; |
| 978 | cvDecRefData( mat ); |
| 979 | } |
| 980 | else if( CV_IS_IMAGE_HDR( arr )) |
| 981 | { |
| 982 | IplImage* img = (IplImage*)arr; |
| 983 | |
| 984 | if( !CvIPL.deallocate ) |
| 985 | { |
| 986 | char* ptr = img->imageDataOrigin; |
| 987 | img->imageData = img->imageDataOrigin = 0; |
| 988 | cvFree( &ptr ); |
| 989 | } |
| 990 | else |
| 991 | { |
| 992 | CvIPL.deallocate( img, IPL_IMAGE_DATA ); |
| 993 | } |
| 994 | } |
| 995 | else |
| 996 | CV_Error( CV_StsBadArg, "unrecognized or unsupported array type" ); |
| 997 | } |
| 998 | |
| 999 | |
| 1000 | // Retrieves essential information about image ROI or CvMat data |
no test coverage detected