Public Member Functions | Private Attributes
vgl_ellipse_scan_iterator< T > Class Template Reference

Scan convert an ellipse. More...

#include <vgl_ellipse_scan_iterator.h>

Inheritance diagram for vgl_ellipse_scan_iterator< T >:
Inheritance graph
[legend]

List of all members.

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

xc_
 Parameters of the ellipse being scan converted.
yc_
rx_
ry_
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.

Detailed Description

template<class T>
class vgl_ellipse_scan_iterator< T >

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.


Constructor & Destructor Documentation

template<class T >
vgl_ellipse_scan_iterator< T >::vgl_ellipse_scan_iterator ( xc,
yc,
rx,
ry,
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.

template<class T >
vgl_ellipse_scan_iterator< T >::~vgl_ellipse_scan_iterator ( ) [virtual]

Destructor.

Definition at line 26 of file vgl_ellipse_scan_iterator.txx.


Member Function Documentation

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.

template<class T >
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.

template<class T >
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.

template<class T >
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.

template<class T >
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.

template<class T >
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.


Member Data Documentation

template<class T >
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.

template<class T >
int vgl_ellipse_scan_iterator< T >::min_y_ [private]

Final scan line.

Definition at line 66 of file vgl_ellipse_scan_iterator.h.

template<class T >
T vgl_ellipse_scan_iterator< T >::rx_ [private]

Definition at line 60 of file vgl_ellipse_scan_iterator.h.

template<class T >
T vgl_ellipse_scan_iterator< T >::ry_ [private]

Definition at line 60 of file vgl_ellipse_scan_iterator.h.

template<class T >
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.

template<class T >
T vgl_ellipse_scan_iterator< T >::theta_ [private]

Definition at line 60 of file vgl_ellipse_scan_iterator.h.

template<class T >
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.

template<class T >
int vgl_ellipse_scan_iterator< T >::y_ [private]

Current scan line.

Definition at line 63 of file vgl_ellipse_scan_iterator.h.

template<class T >
T vgl_ellipse_scan_iterator< T >::yc_ [private]

Definition at line 60 of file vgl_ellipse_scan_iterator.h.


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