|
| LineIterator (const Mat &img, Point pt1, Point pt2, int connectivity=8, bool leftToRight=false) |
| Initializes iterator object for the given line and image. More...
|
|
| 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. More...
|
|
LineIterator & | operator++ () |
| Moves iterator to the next pixel on the line. More...
|
|
LineIterator | operator++ (int) |
| Moves iterator to the next pixel on the line. More...
|
|
Point | pos () const |
| Returns coordinates of the current pixel. More...
|
|
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)
{
}
LineIterator(const Mat &img, Point pt1, Point pt2, int connectivity=8, bool leftToRight=false)
Initializes iterator object for the given line and image.
Definition: imgproc.hpp:4948
Vec< uchar, 3 > Vec3b
Definition: matx.hpp:441
#define CV_Assert(expr)
Checks a condition at runtime and throws exception if it fails.
Definition: base.hpp:342
CvPoint pt1
Definition: imgproc_c.h:357
CvPoint CvPoint pt2
Definition: imgproc_c.h:357