Scan convert an ellipse. More...
#include <vgl_ellipse_scan_iterator.h>
Public Member Functions | |
vgl_ellipse_scan_iterator (T xc, T yc, T rx, T ry, T theta) | |
Constructor. | |
virtual | ~vgl_ellipse_scan_iterator () |
Destructor. | |
virtual void | reset () |
Resets the scan iterator to before the first scan line. | |
virtual bool | next () |
Tries to moves to the next scan line. | |
virtual int | scany () const |
y-coordinate of the current scan line. | |
virtual int | startx () const |
Returns starting x-value of the current scan line. | |
virtual int | endx () const |
Returns ending x-value of the current scan line. | |
int | count () |
Number of image points (= integer grid points) inside the region. | |
Private Attributes | |
T | xc_ |
Parameters of the ellipse being scan converted. | |
T | yc_ |
T | rx_ |
T | ry_ |
T | theta_ |
int | y_ |
Current scan line. | |
int | min_y_ |
Final scan line. | |
int | start_x_ |
Start of current scan line. | |
int | end_x_ |
End of current scan line. |
Scan convert an ellipse.
The ellipse is parameterised by (xc, yc) (the centre), by a and b (the radii along the principle axes) and by theta, the rotation of the main axis (in radians) about the centre of the ellipse w.r.t\. the horizontal direction (X-axis).
Scan lines are horizontal lines intersecting the ellipse interior. For a convex region like an ellipse, such a scan line is fully determined by the two end points (startx(),scany()) and (endx(),scany()).
Definition at line 26 of file vgl_ellipse_scan_iterator.h.
vgl_ellipse_scan_iterator< T >::vgl_ellipse_scan_iterator | ( | T | xc, |
T | yc, | ||
T | rx, | ||
T | ry, | ||
T | theta | ||
) |
Constructor.
The ellipse is parameterised by (xc, yc) (the centre), by rx and ry (the radii along the principle axes) and by theta, the rotation of the main axis (in radians) about the centre of the ellipse w.r.t\. the horizontal direction (X-axis).
Definition at line 14 of file vgl_ellipse_scan_iterator.txx.
vgl_ellipse_scan_iterator< T >::~vgl_ellipse_scan_iterator | ( | ) | [virtual] |
Destructor.
Definition at line 26 of file vgl_ellipse_scan_iterator.txx.
int vgl_region_scan_iterator::count | ( | ) | [inline, inherited] |
Number of image points (= integer grid points) inside the region.
Definition at line 48 of file vgl_region_scan_iterator.h.
virtual int vgl_ellipse_scan_iterator< T >::endx | ( | ) | const [inline, virtual] |
Returns ending x-value of the current scan line.
Implements vgl_region_scan_iterator.
Definition at line 55 of file vgl_ellipse_scan_iterator.h.
bool vgl_ellipse_scan_iterator< T >::next | ( | ) | [virtual] |
Tries to moves to the next scan line.
Returns false if there are no more scan lines.
Implements vgl_region_scan_iterator.
Definition at line 49 of file vgl_ellipse_scan_iterator.txx.
void vgl_ellipse_scan_iterator< T >::reset | ( | ) | [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.
Implements vgl_region_scan_iterator.
Definition at line 31 of file vgl_ellipse_scan_iterator.txx.
virtual int vgl_ellipse_scan_iterator< T >::scany | ( | ) | const [inline, virtual] |
y-coordinate of the current scan line.
Implements vgl_region_scan_iterator.
Definition at line 49 of file vgl_ellipse_scan_iterator.h.
virtual int vgl_ellipse_scan_iterator< T >::startx | ( | ) | const [inline, virtual] |
Returns starting x-value of the current scan line.
Implements vgl_region_scan_iterator.
Definition at line 52 of file vgl_ellipse_scan_iterator.h.
int vgl_ellipse_scan_iterator< T >::end_x_ [private] |
End of current scan line.
Definition at line 72 of file vgl_ellipse_scan_iterator.h.
int vgl_ellipse_scan_iterator< T >::min_y_ [private] |
Final scan line.
Definition at line 66 of file vgl_ellipse_scan_iterator.h.
T vgl_ellipse_scan_iterator< T >::rx_ [private] |
Definition at line 60 of file vgl_ellipse_scan_iterator.h.
T vgl_ellipse_scan_iterator< T >::ry_ [private] |
Definition at line 60 of file vgl_ellipse_scan_iterator.h.
int vgl_ellipse_scan_iterator< T >::start_x_ [private] |
Start of current scan line.
Definition at line 69 of file vgl_ellipse_scan_iterator.h.
T vgl_ellipse_scan_iterator< T >::theta_ [private] |
Definition at line 60 of file vgl_ellipse_scan_iterator.h.
T vgl_ellipse_scan_iterator< T >::xc_ [private] |
Parameters of the ellipse being scan converted.
Centre, squared radii, and angle of rotation about the centre.
Definition at line 60 of file vgl_ellipse_scan_iterator.h.
int vgl_ellipse_scan_iterator< T >::y_ [private] |
Current scan line.
Definition at line 63 of file vgl_ellipse_scan_iterator.h.
T vgl_ellipse_scan_iterator< T >::yc_ [private] |
Definition at line 60 of file vgl_ellipse_scan_iterator.h.