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

Function writeMat

deps/opencv/modules/core/src/out.cpp:115–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113
114
115static void writeMat(std::ostream& out, const Mat& m, char rowsep, char elembrace, bool singleLine)
116{
117 CV_Assert(m.dims <= 2);
118 int type = m.type();
119
120 char crowbrace = getCloseBrace(rowsep);
121 char orowbrace = crowbrace ? rowsep : '\0';
122
123 if( orowbrace || isspace(rowsep) )
124 rowsep = '\0';
125
126 for( int i = 0; i < m.rows; i++ )
127 {
128 if(orowbrace)
129 out << orowbrace;
130 if( m.data )
131 writeElems(out, m.ptr(i), m.cols, type, elembrace);
132 if(orowbrace)
133 out << crowbrace << (i+1 < m.rows ? ", " : "");
134 if(i+1 < m.rows)
135 {
136 if(rowsep)
137 out << rowsep << (singleLine ? " " : "");
138 if(!singleLine)
139 out << "\n ";
140 }
141 }
142}
143
144class MatlabFormatter : public Formatter
145{

Callers 5

writeMethod · 0.85
writeMethod · 0.85
writeMethod · 0.85
writeMethod · 0.85
writeMethod · 0.85

Calls 4

getCloseBraceFunction · 0.85
writeElemsFunction · 0.85
typeMethod · 0.45
ptrMethod · 0.45

Tested by

no test coverage detected