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

Function cvCreateSeq

deps/opencv/modules/core/src/datastructs.cpp:365–397  ·  view source on GitHub ↗

Create empty sequence: */

Source from the content-addressed store, hash-verified

363
364/* Create empty sequence: */
365CV_IMPL CvSeq *
366cvCreateSeq( int seq_flags, size_t header_size, size_t elem_size, CvMemStorage* storage )
367{
368 CvSeq *seq = 0;
369
370 if( !storage )
371 CV_Error( CV_StsNullPtr, "" );
372 if( header_size < sizeof( CvSeq ) || elem_size <= 0 )
373 CV_Error( CV_StsBadSize, "" );
374
375 /* allocate sequence header */
376 seq = (CvSeq*)cvMemStorageAlloc( storage, header_size );
377 memset( seq, 0, header_size );
378
379 seq->header_size = (int)header_size;
380 seq->flags = (seq_flags & ~CV_MAGIC_MASK) | CV_SEQ_MAGIC_VAL;
381 {
382 int elemtype = CV_MAT_TYPE(seq_flags);
383 int typesize = CV_ELEM_SIZE(elemtype);
384
385 if( elemtype != CV_SEQ_ELTYPE_GENERIC && elemtype != CV_USRTYPE1 &&
386 typesize != 0 && typesize != (int)elem_size )
387 CV_Error( CV_StsBadSize,
388 "Specified element size doesn't match to the size of the specified element type "
389 "(try to use 0 for element type)" );
390 }
391 seq->elem_size = (int)elem_size;
392 seq->storage = storage;
393
394 cvSetSeqBlockSize( seq, (int)((1 << 10)/elem_size) );
395
396 return seq;
397}
398
399
400/* adjusts <delta_elems> field of sequence. It determines how much the sequence

Callers 15

cvStartWriteSeqFunction · 0.85
cvSeqSliceFunction · 0.85
cvSeqPartitionFunction · 0.85
cvCreateSetFunction · 0.85
datastructs.cppFile · 0.85
cvTreeToNodeSeqFunction · 0.85
icvFSCreateCollectionFunction · 0.85
persistence.cppFile · 0.85
icvWriteSparseMatFunction · 0.85
icvReadSeqFunction · 0.85
SeqMethod · 0.85
cvHoughLines2Function · 0.85

Calls 2

cvMemStorageAllocFunction · 0.85
cvSetSeqBlockSizeFunction · 0.85

Tested by

no test coverage detected