| 46 | \**************************************************************************************/ |
| 47 | |
| 48 | CV_IMPL int |
| 49 | cvSampleLine( const void* img, CvPoint pt1, CvPoint pt2, |
| 50 | void* _buffer, int connectivity ) |
| 51 | { |
| 52 | int count = -1; |
| 53 | |
| 54 | int i, coi = 0, pix_size; |
| 55 | CvMat stub, *mat = cvGetMat( img, &stub, &coi ); |
| 56 | CvLineIterator iterator; |
| 57 | uchar* buffer = (uchar*)_buffer; |
| 58 | |
| 59 | if( coi != 0 ) |
| 60 | CV_Error( CV_BadCOI, "" ); |
| 61 | |
| 62 | if( !buffer ) |
| 63 | CV_Error( CV_StsNullPtr, "" ); |
| 64 | |
| 65 | count = cvInitLineIterator( mat, pt1, pt2, &iterator, connectivity ); |
| 66 | |
| 67 | pix_size = CV_ELEM_SIZE(mat->type); |
| 68 | for( i = 0; i < count; i++ ) |
| 69 | { |
| 70 | for( int j = 0; j < pix_size; j++ ) |
| 71 | buffer[j] = iterator.ptr[j]; |
| 72 | buffer += pix_size; |
| 73 | CV_NEXT_LINE_POINT( iterator ); |
| 74 | } |
| 75 | |
| 76 | return count; |
| 77 | } |
| 78 | |
| 79 | |
| 80 | static const void* |
nothing calls this directly
no test coverage detected