CvInitLineIterator Method (CvArr, CvPoint, CvPoint, CvLineIterator, PixelConnectivity, Boolean) OpenCvSharp Class Library
Initializes line iterator

Namespace:  OpenCvSharp
Assembly:  OpenCvSharp (in OpenCvSharp.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax

public static int InitLineIterator(
	CvArr image,
	CvPoint pt1,
	CvPoint pt2,
	out CvLineIterator lineIterator,
	PixelConnectivity connectivity,
	bool leftToRight
)

Parameters

image
Type: OpenCvSharpCvArr
Image to sample the line from.
pt1
Type: OpenCvSharpCvPoint
First ending point of the line segment.
pt2
Type: OpenCvSharpCvPoint
Second ending point of the line segment.
lineIterator
Type: OpenCvSharpCvLineIterator
Line iterator state structure to be generated.
connectivity
Type: OpenCvSharpPixelConnectivity
The scanned line connectivity, 4 or 8.
leftToRight
Type: SystemBoolean
The flag, indicating whether the line should be always scanned from the left-most point to the right-most out of pt1 and pt2 (left_to_right=true), or it is scanned in the specified order, from pt1 to pt2 (left_to_right=false).

Return Value

Type: Int32
The function cvInitLineIterator initializes the line iterator and returns the number of pixels between two end points. Both points must be inside the image. After the iterator has been initialized, all the points on the raster line that connects the two ending points may be retrieved by successive calls of NextLinePoint point. The points on the line are calculated one by one using 4-connected or 8-connected Bresenham algorithm.
See Also

Reference