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

Function cvSeqPushFront

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

Push element onto the front of the sequence: */

Source from the content-addressed store, hash-verified

1182
1183/* Push element onto the front of the sequence: */
1184CV_IMPL schar*
1185cvSeqPushFront( CvSeq *seq, const void *element )
1186{
1187 schar* ptr = 0;
1188 int elem_size;
1189 CvSeqBlock *block;
1190
1191 if( !seq )
1192 CV_Error( CV_StsNullPtr, "" );
1193
1194 elem_size = seq->elem_size;
1195 block = seq->first;
1196
1197 if( !block || block->start_index == 0 )
1198 {
1199 icvGrowSeq( seq, 1 );
1200
1201 block = seq->first;
1202 assert( block->start_index > 0 );
1203 }
1204
1205 ptr = block->data -= elem_size;
1206
1207 if( element )
1208 memcpy( ptr, element, elem_size );
1209 block->count++;
1210 block->start_index--;
1211 seq->total++;
1212
1213 return ptr;
1214}
1215
1216
1217/* Shift out first element of the sequence: */

Callers 3

cvSeqInsertFunction · 0.85
seqPushFrontFunction · 0.85
push_frontMethod · 0.85

Calls 1

icvGrowSeqFunction · 0.85

Tested by

no test coverage detected