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

Method getMat

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

Source from the content-addressed store, hash-verified

945_InputArray::_InputArray(const ogl::Texture2D& tex) : flags(OPENGL_TEXTURE), obj((void*)&tex) {}
946
947Mat _InputArray::getMat(int i) const
948{
949 int k = kind();
950
951 if( k == MAT )
952 {
953 const Mat* m = (const Mat*)obj;
954 if( i < 0 )
955 return *m;
956 return m->row(i);
957 }
958
959 if( k == EXPR )
960 {
961 CV_Assert( i < 0 );
962 return (Mat)*((const MatExpr*)obj);
963 }
964
965 if( k == MATX )
966 {
967 CV_Assert( i < 0 );
968 return Mat(sz, flags, obj);
969 }
970
971 if( k == STD_VECTOR )
972 {
973 CV_Assert( i < 0 );
974 int t = CV_MAT_TYPE(flags);
975 const vector<uchar>& v = *(const vector<uchar>*)obj;
976
977 return !v.empty() ? Mat(size(), t, (void*)&v[0]) : Mat();
978 }
979
980 if( k == NONE )
981 return Mat();
982
983 if( k == STD_VECTOR_VECTOR )
984 {
985 int t = type(i);
986 const vector<vector<uchar> >& vv = *(const vector<vector<uchar> >*)obj;
987 CV_Assert( 0 <= i && i < (int)vv.size() );
988 const vector<uchar>& v = vv[i];
989
990 return !v.empty() ? Mat(size(i), t, (void*)&v[0]) : Mat();
991 }
992
993 if( k == OCL_MAT )
994 {
995 CV_Error(CV_StsNotImplemented, "This method is not implemented for oclMat yet");
996 }
997
998 CV_Assert( k == STD_VECTOR_MAT );
999 //if( k == STD_VECTOR_MAT )
1000 {
1001 const vector<Mat>& v = *(const vector<Mat>*)obj;
1002 CV_Assert( 0 <= i && i < (int)v.size() );
1003
1004 return v[i];

Callers 15

splitMethod · 0.45
mergeMethod · 0.45
mixChannelsMethod · 0.45
extractChannelMethod · 0.45
insertChannelMethod · 0.45
convert.cppFile · 0.45
mulMethod · 0.45
determinantMethod · 0.45
invertMethod · 0.45
solveMethod · 0.45
eigenMethod · 0.45
_SVDcomputeFunction · 0.45

Calls 6

MatClass · 0.85
sizeFunction · 0.50
typeFunction · 0.50
rowMethod · 0.45
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected