Public Member Functions | Private Attributes | List of all members
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]

Public Member Functions

 vgl_ellipse_scan_iterator (T xc, T yc, T rx, T ry, T theta)
 Constructor. More...
 
 ~vgl_ellipse_scan_iterator () override
 Destructor. More...
 
void reset () override
 Resets the scan iterator to before the first scan line. More...
 
bool next () override
 Tries to moves to the next scan line. More...
 
int scany () const override
 y-coordinate of the current scan line. More...
 
int startx () const override
 Returns starting x-value of the current scan line. More...
 
int endx () const override
 Returns ending x-value of the current scan line. More...
 
int count ()
 Number of image points (= integer grid points) inside the region. More...
 

Private Attributes

xc_
 Parameters of the ellipse being scan converted. More...
 
yc_
 
rx_
 
ry_
 
theta_
 
int y_
 Current scan line. More...
 
int min_y_
 Final scan line. More...
 
int start_x_
 Start of current scan line. More...
 
int end_x_
 End of current scan line. More...
 

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

◆ vgl_ellipse_scan_iterator()

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 17 of file vgl_ellipse_scan_iterator.hxx.

◆ ~vgl_ellipse_scan_iterator()

template<class T >
vgl_ellipse_scan_iterator< T >::~vgl_ellipse_scan_iterator ( )
overridedefault

Destructor.

Member Function Documentation

◆ count()

int vgl_region_scan_iterator::count ( )
inlineinherited

Number of image points (= integer grid points) inside the region.

Definition at line 48 of file vgl_region_scan_iterator.h.

◆ endx()

template<class T >
int vgl_ellipse_scan_iterator< T >::endx ( ) const
inlineoverridevirtual

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.

◆ next()

template<class T >
bool vgl_ellipse_scan_iterator< T >::next ( )
overridevirtual

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 50 of file vgl_ellipse_scan_iterator.hxx.

◆ reset()

template<class T >
void vgl_ellipse_scan_iterator< T >::reset ( )
overridevirtual

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 32 of file vgl_ellipse_scan_iterator.hxx.

◆ scany()

template<class T >
int vgl_ellipse_scan_iterator< T >::scany ( ) const
inlineoverridevirtual

y-coordinate of the current scan line.

Implements vgl_region_scan_iterator.

Definition at line 49 of file vgl_ellipse_scan_iterator.h.

◆ startx()

template<class T >
int vgl_ellipse_scan_iterator< T >::startx ( ) const
inlineoverridevirtual

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

◆ end_x_

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.

◆ min_y_

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.

◆ rx_

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

Definition at line 60 of file vgl_ellipse_scan_iterator.h.

◆ ry_

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

Definition at line 60 of file vgl_ellipse_scan_iterator.h.

◆ start_x_

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.

◆ theta_

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

Definition at line 60 of file vgl_ellipse_scan_iterator.h.

◆ xc_

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.

◆ y_

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.

◆ yc_

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: