MCPcopy Create free account
hub / github.com/creatale/node-dv / cvGetSize

Function cvGetSize

deps/opencv/modules/core/src/array.cpp:1210–1241  ·  view source on GitHub ↗

Returns the size of CvMat or IplImage

Source from the content-addressed store, hash-verified

1208
1209// Returns the size of CvMat or IplImage
1210CV_IMPL CvSize
1211cvGetSize( const CvArr* arr )
1212{
1213 CvSize size = { 0, 0 };
1214
1215 if( CV_IS_MAT_HDR_Z( arr ))
1216 {
1217 CvMat *mat = (CvMat*)arr;
1218
1219 size.width = mat->cols;
1220 size.height = mat->rows;
1221 }
1222 else if( CV_IS_IMAGE_HDR( arr ))
1223 {
1224 IplImage* img = (IplImage*)arr;
1225
1226 if( img->roi )
1227 {
1228 size.width = img->roi->width;
1229 size.height = img->roi->height;
1230 }
1231 else
1232 {
1233 size.width = img->width;
1234 size.height = img->height;
1235 }
1236 }
1237 else
1238 CV_Error( CV_StsBadArg, "Array should be CvMat or IplImage" );
1239
1240 return size;
1241}
1242
1243
1244// Selects sub-array (no data is copied)

Callers 1

icvWriteMatFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected