Abstract base class for iterating over the pixels in a region of an image. More...
#include <vgl_region_scan_iterator.h>
Public Member Functions | |
virtual void | reset ()=0 |
Resets the scan iterator to before the first scan line. | |
virtual bool | next ()=0 |
Tries to move to the next scan line. | |
virtual int | scany () const =0 |
y-coordinate of the current scan line. | |
virtual int | startx () const =0 |
Returns starting x-value of the current scan line. | |
virtual int | endx () const =0 |
Returns ending x-value of the current scan line. | |
int | count () |
Number of image points (= integer grid points) inside the region. | |
Protected Member Functions | |
vgl_region_scan_iterator () | |
virtual | ~vgl_region_scan_iterator () |
Abstract base class for iterating over the pixels in a region of an image.
The region should be "scanline-convex", i.e., every horizontal line should intersect the region in at most one connected part. Vertically, there may be even disconnected parts: e.g. (part of) a hyperbola with vertical axis. The region should of course be bounded, otherwise iteration makes no sense.
Definition at line 17 of file vgl_region_scan_iterator.h.
vgl_region_scan_iterator::vgl_region_scan_iterator | ( | ) | [inline, protected] |
Definition at line 20 of file vgl_region_scan_iterator.h.
virtual vgl_region_scan_iterator::~vgl_region_scan_iterator | ( | ) | [inline, protected, virtual] |
Definition at line 21 of file vgl_region_scan_iterator.h.
int vgl_region_scan_iterator::count | ( | ) | [inline] |
Number of image points (= integer grid points) inside the region.
Definition at line 48 of file vgl_region_scan_iterator.h.
virtual int vgl_region_scan_iterator::endx | ( | ) | const [pure virtual] |
Returns ending x-value of the current scan line.
endx() should be larger than startx(), unless the scan line is empty
Implemented in vgl_polygon_scan_iterator< T >, vgl_window_scan_iterator< T >, vgl_ellipse_scan_iterator< T >, and vgl_triangle_scan_iterator< T >.
virtual bool vgl_region_scan_iterator::next | ( | ) | [pure virtual] |
Tries to move to the next scan line.
Returns false if there are no more scan lines.
Implemented in vgl_polygon_scan_iterator< T >, vgl_window_scan_iterator< T >, vgl_ellipse_scan_iterator< T >, and vgl_triangle_scan_iterator< T >.
virtual void vgl_region_scan_iterator::reset | ( | ) | [pure virtual] |
Resets the scan iterator to before the first scan line.
After calling this function, next() needs to be called before startx() and endx() form a valid scan line.
Implemented in vgl_polygon_scan_iterator< T >, vgl_window_scan_iterator< T >, vgl_ellipse_scan_iterator< T >, and vgl_triangle_scan_iterator< T >.
virtual int vgl_region_scan_iterator::scany | ( | ) | const [pure virtual] |
y-coordinate of the current scan line.
The next scan line is not guaranteed to have scany()+1; use next() instead.
Implemented in vgl_polygon_scan_iterator< T >, vgl_window_scan_iterator< T >, vgl_ellipse_scan_iterator< T >, and vgl_triangle_scan_iterator< T >.
virtual int vgl_region_scan_iterator::startx | ( | ) | const [pure virtual] |
Returns starting x-value of the current scan line.
startx() should be smaller than endx(), unless the scan line is empty
Implemented in vgl_polygon_scan_iterator< T >, vgl_window_scan_iterator< T >, vgl_ellipse_scan_iterator< T >, and vgl_triangle_scan_iterator< T >.