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

Iterator to scan rectangular windows. More...

#include <vgl_window_scan_iterator.h>

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

List of all members.

Public Member Functions

void set_window_corners (T x1_, T y1_, T x2_, T y2_)
 Define rectangular region to be [x1, x2] x [y1, y2].
void set_window (T x, T y, T w, T h)
 Define rectangular region to be [x-w, x+w] x [y-h, y+h].
void set_window (T x, T y, T r)
 Define rectangular region to be [x-r, x+r] x [y-r, y+r].
 vgl_window_scan_iterator ()
 makes uninitialized iterator.
 vgl_window_scan_iterator (T x1_, T y1_, T x2_, T y2_)
 region is [x1, x2] x [y1, y2]. No assumption about x1<x2 or y1<y2.
void reset ()
 Resets the scan iterator to before the first scan line.
bool next ()
 Tries to move to the next scan line.
int scany () const
 y-coordinate of the current scan line.
int startx () const
 Returns starting x-value of the current scan line.
int endx () const
 Returns ending x-value of the current scan line.
int count ()
 Number of image points (= integer grid points) inside the region.

Public Attributes

int current_y

Private Attributes

int x1
int y1
int x2
int y2

Detailed Description

template<class T>
class vgl_window_scan_iterator< T >

Iterator to scan rectangular windows.

This class is completely inlined.

Definition at line 20 of file vgl_window_scan_iterator.h.


Constructor & Destructor Documentation

template<class T >
vgl_window_scan_iterator< T >::vgl_window_scan_iterator ( ) [inline]

makes uninitialized iterator.

Definition at line 52 of file vgl_window_scan_iterator.h.

template<class T >
vgl_window_scan_iterator< T >::vgl_window_scan_iterator ( x1_,
y1_,
x2_,
y2_ 
) [inline]

region is [x1, x2] x [y1, y2]. No assumption about x1<x2 or y1<y2.

Definition at line 55 of file vgl_window_scan_iterator.h.


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 >
int vgl_window_scan_iterator< T >::endx ( ) const [inline, virtual]

Returns ending x-value of the current scan line.

endx() should be larger than startx(), unless the scan line is empty

Implements vgl_region_scan_iterator.

Definition at line 64 of file vgl_window_scan_iterator.h.

template<class T >
bool vgl_window_scan_iterator< T >::next ( ) [inline, virtual]

Tries to move to the next scan line.

Returns false if there are no more scan lines.

Implements vgl_region_scan_iterator.

Definition at line 61 of file vgl_window_scan_iterator.h.

template<class T >
void vgl_window_scan_iterator< T >::reset ( ) [inline, 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 60 of file vgl_window_scan_iterator.h.

template<class T >
int vgl_window_scan_iterator< T >::scany ( ) const [inline, virtual]

y-coordinate of the current scan line.

The next scan line is not guaranteed to have scany()+1; use next() instead.

Implements vgl_region_scan_iterator.

Definition at line 62 of file vgl_window_scan_iterator.h.

template<class T >
void vgl_window_scan_iterator< T >::set_window ( x,
y,
w,
h 
) [inline]

Define rectangular region to be [x-w, x+w] x [y-h, y+h].

Definition at line 44 of file vgl_window_scan_iterator.h.

template<class T >
void vgl_window_scan_iterator< T >::set_window ( x,
y,
r 
) [inline]

Define rectangular region to be [x-r, x+r] x [y-r, y+r].

Definition at line 48 of file vgl_window_scan_iterator.h.

template<class T >
void vgl_window_scan_iterator< T >::set_window_corners ( x1_,
y1_,
x2_,
y2_ 
) [inline]

Define rectangular region to be [x1, x2] x [y1, y2].

Definition at line 26 of file vgl_window_scan_iterator.h.

template<class T >
int vgl_window_scan_iterator< T >::startx ( ) const [inline, virtual]

Returns starting x-value of the current scan line.

startx() should be smaller than endx(), unless the scan line is empty

Implements vgl_region_scan_iterator.

Definition at line 63 of file vgl_window_scan_iterator.h.


Member Data Documentation

template<class T >
int vgl_window_scan_iterator< T >::current_y

Definition at line 58 of file vgl_window_scan_iterator.h.

template<class T >
int vgl_window_scan_iterator< T >::x1 [private]

Definition at line 22 of file vgl_window_scan_iterator.h.

template<class T >
int vgl_window_scan_iterator< T >::x2 [private]

Definition at line 22 of file vgl_window_scan_iterator.h.

template<class T >
int vgl_window_scan_iterator< T >::y1 [private]

Definition at line 22 of file vgl_window_scan_iterator.h.

template<class T >
int vgl_window_scan_iterator< T >::y2 [private]

Definition at line 22 of file vgl_window_scan_iterator.h.


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