|
| LineIterator (const Mat &img, Point pt1, Point pt2, int connectivity=8, bool leftToRight=false) |
| Initializes iterator object for the given line and image.
|
|
| LineIterator (Point pt1, Point pt2, int connectivity=8, bool leftToRight=false) |
|
| LineIterator (Rect boundingAreaRect, Point pt1, Point pt2, int connectivity=8, bool leftToRight=false) |
|
| LineIterator (Size boundingAreaSize, 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++ () |
| Moves iterator to the next pixel on the line.
|
|
LineIterator | operator++ (int) |
| Moves iterator to the next pixel on the line.
|
|
Point | pos () const |
| Returns coordinates of the current pixel.
|
|
Class for iterating over all pixels on a raster line segment.
The class LineIterator is used to get each pixel of a raster line connecting two specified points. It can be treated as a 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:
vector<Vec3b> buf(it.count);
for(int i = 0; i < it.count; i++, ++it)
buf[i] = *(
const Vec3b*)*it;
for(
int i = 0; i < it2.
count; i++, ++it2)
{
}
Class for iterating over all pixels on a raster line segment.
Definition imgproc.hpp:4932
int count
Definition imgproc.hpp:5002
Point pos() const
Returns coordinates of the current pixel.
Template class for short numerical vectors, a partial case of Matx.
Definition matx.hpp:369
#define CV_Assert(expr)
Checks a condition at runtime and throws exception if it fails.
Definition base.hpp:342