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

Function cvEndWriteSeq

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

Calls icvFlushSeqWriter and finishes writing process: */

Source from the content-addressed store, hash-verified

869
870/* Calls icvFlushSeqWriter and finishes writing process: */
871CV_IMPL CvSeq *
872cvEndWriteSeq( CvSeqWriter * writer )
873{
874 if( !writer )
875 CV_Error( CV_StsNullPtr, "" );
876
877 cvFlushSeqWriter( writer );
878 CvSeq* seq = writer->seq;
879
880 /* Truncate the last block: */
881 if( writer->block && writer->seq->storage )
882 {
883 CvMemStorage *storage = seq->storage;
884 schar *storage_block_max = (schar *) storage->top + storage->block_size;
885
886 assert( writer->block->count > 0 );
887
888 if( (unsigned)((storage_block_max - storage->free_space)
889 - seq->block_max) < CV_STRUCT_ALIGN )
890 {
891 storage->free_space = cvAlignLeft((int)(storage_block_max - seq->ptr), CV_STRUCT_ALIGN);
892 seq->block_max = seq->ptr;
893 }
894 }
895
896 writer->ptr = 0;
897 return seq;
898}
899
900
901/* Create new sequence block: */

Callers 11

cvSeqPartitionFunction · 0.85
core_c.hFile · 0.85
icvApproximateChainTC89Function · 0.85
icvApproxPolyDPFunction · 0.85
icvFetchContourFunction · 0.85
icvFetchContourExFunction · 0.85
icvFetchContourEx_32sFunction · 0.85
cvConvexHull2Function · 0.85
cvConvexityDefectsFunction · 0.85

Calls 2

cvFlushSeqWriterFunction · 0.85
cvAlignLeftFunction · 0.85

Tested by

no test coverage detected