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

Method size

deps/opencv/modules/core/src/matrix.cpp:1142–1224  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1140}
1141
1142Size _InputArray::size(int i) const
1143{
1144 int k = kind();
1145
1146 if( k == MAT )
1147 {
1148 CV_Assert( i < 0 );
1149 return ((const Mat*)obj)->size();
1150 }
1151
1152 if( k == EXPR )
1153 {
1154 CV_Assert( i < 0 );
1155 return ((const MatExpr*)obj)->size();
1156 }
1157
1158 if( k == MATX )
1159 {
1160 CV_Assert( i < 0 );
1161 return sz;
1162 }
1163
1164 if( k == STD_VECTOR )
1165 {
1166 CV_Assert( i < 0 );
1167 const vector<uchar>& v = *(const vector<uchar>*)obj;
1168 const vector<int>& iv = *(const vector<int>*)obj;
1169 size_t szb = v.size(), szi = iv.size();
1170 return szb == szi ? Size((int)szb, 1) : Size((int)(szb/CV_ELEM_SIZE(flags)), 1);
1171 }
1172
1173 if( k == NONE )
1174 return Size();
1175
1176 if( k == STD_VECTOR_VECTOR )
1177 {
1178 const vector<vector<uchar> >& vv = *(const vector<vector<uchar> >*)obj;
1179 if( i < 0 )
1180 return vv.empty() ? Size() : Size((int)vv.size(), 1);
1181 CV_Assert( i < (int)vv.size() );
1182 const vector<vector<int> >& ivv = *(const vector<vector<int> >*)obj;
1183
1184 size_t szb = vv[i].size(), szi = ivv[i].size();
1185 return szb == szi ? Size((int)szb, 1) : Size((int)(szb/CV_ELEM_SIZE(flags)), 1);
1186 }
1187
1188 if( k == STD_VECTOR_MAT )
1189 {
1190 const vector<Mat>& vv = *(const vector<Mat>*)obj;
1191 if( i < 0 )
1192 return vv.empty() ? Size() : Size((int)vv.size(), 1);
1193 CV_Assert( i < (int)vv.size() );
1194
1195 return vv[i].size();
1196 }
1197
1198 if( k == OPENGL_BUFFER )
1199 {

Callers 15

MatMethod · 0.45
getMatMethod · 0.45
getMatVectorMethod · 0.45
totalMethod · 0.45
typeMethod · 0.45
createMethod · 0.45
matrix.cppFile · 0.45
hconcatMethod · 0.45
vconcatMethod · 0.45
transposeMethod · 0.45
crossMethod · 0.45
reduceR_Function · 0.45

Calls 2

SizeFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected