| 509 | |
| 510 | |
| 511 | CV_IMPL int |
| 512 | cvSliceLength( CvSlice slice, const CvSeq* seq ) |
| 513 | { |
| 514 | int total = seq->total; |
| 515 | int length = slice.end_index - slice.start_index; |
| 516 | |
| 517 | if( length != 0 ) |
| 518 | { |
| 519 | if( slice.start_index < 0 ) |
| 520 | slice.start_index += total; |
| 521 | if( slice.end_index <= 0 ) |
| 522 | slice.end_index += total; |
| 523 | |
| 524 | length = slice.end_index - slice.start_index; |
| 525 | } |
| 526 | |
| 527 | while( length < 0 ) |
| 528 | length += total; |
| 529 | if( length > total ) |
| 530 | length = total; |
| 531 | |
| 532 | return length; |
| 533 | } |
| 534 | |
| 535 | |
| 536 | /* Copy all sequence elements into single continuous array: */ |
no outgoing calls
no test coverage detected