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

Function cvGetSeqReaderPos

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

Return the current reader position: */

Source from the content-addressed store, hash-verified

1005
1006/* Return the current reader position: */
1007CV_IMPL int
1008cvGetSeqReaderPos( CvSeqReader* reader )
1009{
1010 int elem_size;
1011 int index = -1;
1012
1013 if( !reader || !reader->ptr )
1014 CV_Error( CV_StsNullPtr, "" );
1015
1016 elem_size = reader->seq->elem_size;
1017 if( elem_size <= ICV_SHIFT_TAB_MAX && (index = icvPower2ShiftTab[elem_size - 1]) >= 0 )
1018 index = (int)((reader->ptr - reader->block_min) >> index);
1019 else
1020 index = (int)((reader->ptr - reader->block_min) / elem_size);
1021
1022 index += reader->block->start_index - reader->delta_index;
1023
1024 return index;
1025}
1026
1027
1028/* Set reader position to given position,

Callers 3

cvSeqSortFunction · 0.85
core_c.hFile · 0.85
icvApproxPolyDPFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected