Public Member Functions | Protected Member Functions | List of all members
vgl_region_scan_iterator Class Referenceabstract

Abstract base class for iterating over the pixels in a region of an image. More...

#include <vgl_region_scan_iterator.h>

Inheritance diagram for vgl_region_scan_iterator:
Inheritance graph
[legend]

Public Member Functions

virtual void reset ()=0
 Resets the scan iterator to before the first scan line. More...
 
virtual bool next ()=0
 Tries to move to the next scan line. More...
 
virtual int scany () const =0
 y-coordinate of the current scan line. More...
 
virtual int startx () const =0
 Returns starting x-value of the current scan line. More...
 
virtual int endx () const =0
 Returns ending x-value of the current scan line. More...
 
int count ()
 Number of image points (= integer grid points) inside the region. More...
 

Protected Member Functions

 vgl_region_scan_iterator ()=default
 
virtual ~vgl_region_scan_iterator ()=default
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ vgl_region_scan_iterator()

vgl_region_scan_iterator::vgl_region_scan_iterator ( )
inlineprotecteddefault

◆ ~vgl_region_scan_iterator()

virtual vgl_region_scan_iterator::~vgl_region_scan_iterator ( )
protectedvirtualdefault

Member Function Documentation

◆ count()

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.

◆ endx()

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 >.

◆ next()

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 >.

◆ reset()

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 >.

◆ scany()

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 >.

◆ startx()

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 >.


The documentation for this class was generated from the following file: