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

Function cvSampleLine

deps/opencv/modules/imgproc/src/samplers.cpp:48–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46\**************************************************************************************/
47
48CV_IMPL int
49cvSampleLine( 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
80static const void*

Callers

nothing calls this directly

Calls 2

cvGetMatFunction · 0.85
cvInitLineIteratorFunction · 0.85

Tested by

no test coverage detected