OpenCV453
|
Line iterator [詳解]
#include <imgproc.hpp>
公開メンバ関数 | |
LineIterator (const Mat &img, Point pt1, Point pt2, int connectivity=8, bool leftToRight=false) | |
initializes the iterator [詳解] | |
LineIterator (Point pt1, Point pt2, int connectivity=8, bool leftToRight=false) | |
LineIterator (Size boundingAreaSize, Point pt1, Point pt2, int connectivity=8, bool leftToRight=false) | |
LineIterator (Rect boundingAreaRect, Point pt1, Point pt2, int connectivity=8, bool leftToRight=false) | |
void | init (const Mat *img, Rect boundingAreaRect, Point pt1, Point pt2, int connectivity, bool leftToRight) |
uchar * | operator* () |
returns pointer to the current pixel | |
LineIterator & | operator++ () |
prefix increment operator (++it). shifts iterator to the next pixel | |
LineIterator | operator++ (int) |
postfix increment operator (it++). shifts iterator to the next pixel | |
Point | pos () const |
returns coordinates of the current pixel | |
公開変数類 | |
uchar * | ptr |
const uchar * | ptr0 |
int | step |
int | elemSize |
int | err |
int | count |
int | minusDelta |
int | plusDelta |
int | minusStep |
int | plusStep |
int | minusShift |
int | plusShift |
Point | p |
bool | ptmode |
Line iterator
The class is used to iterate over all the pixels on the raster line segment connecting two specified points.
The class LineIterator is used to get each pixel of a raster line. It can be treated as versatile implementation of the Bresenham algorithm where you can stop at each pixel and do some extra processing, for example, grab pixel values along the line or draw a line with an effect (for example, with XOR operation).
The number of pixels along the line is stored in LineIterator::count. The method LineIterator::pos returns the current position in the image:
|
inline |
initializes the iterator
creates iterators for the line connecting pt1 and pt2 the line will be clipped on the image boundaries the line is 8-connected or 4-connected If leftToRight=true, then the iteration is always done from the left-most point to the right most, not to depend on the ordering of pt1 and pt2 parameters;