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

Method Mat

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

Source from the content-addressed store, hash-verified

264
265
266Mat::Mat(const Mat& m, const Range& _rowRange, const Range& _colRange) : size(&rows)
267{
268 initEmpty();
269 CV_Assert( m.dims >= 2 );
270 if( m.dims > 2 )
271 {
272 AutoBuffer<Range> rs(m.dims);
273 rs[0] = _rowRange;
274 rs[1] = _colRange;
275 for( int i = 2; i < m.dims; i++ )
276 rs[i] = Range::all();
277 *this = m(rs);
278 return;
279 }
280
281 *this = m;
282 try
283 {
284 if( _rowRange != Range::all() && _rowRange != Range(0,rows) )
285 {
286 CV_Assert( 0 <= _rowRange.start && _rowRange.start <= _rowRange.end
287 && _rowRange.end <= m.rows );
288 rows = _rowRange.size();
289 data += step*_rowRange.start;
290 flags |= SUBMATRIX_FLAG;
291 }
292
293 if( _colRange != Range::all() && _colRange != Range(0,cols) )
294 {
295 CV_Assert( 0 <= _colRange.start && _colRange.start <= _colRange.end
296 && _colRange.end <= m.cols );
297 cols = _colRange.size();
298 data += _colRange.start*elemSize();
299 flags &= cols < m.cols ? ~CONTINUOUS_FLAG : -1;
300 flags |= SUBMATRIX_FLAG;
301 }
302 }
303 catch(...)
304 {
305 release();
306 throw;
307 }
308
309 if( rows == 1 )
310 flags |= CONTINUOUS_FLAG;
311
312 if( rows <= 0 || cols <= 0 )
313 {
314 release();
315 rows = cols = 0;
316 }
317}
318
319
320Mat::Mat(const Mat& m, const Rect& roi)

Callers

nothing calls this directly

Calls 11

RangeClass · 0.85
CV_XADDFunction · 0.85
setSizeFunction · 0.85
finalizeHdrFunction · 0.85
updateContinuityFlagFunction · 0.85
MatClass · 0.85
createFunction · 0.85
elemSizeFunction · 0.50
sizeMethod · 0.45
copyToMethod · 0.45
typeMethod · 0.45

Tested by

no test coverage detected