Public Member Functions | Public Attributes | Private Attributes | List of all members
vgl_window_scan_iterator< T > Class Template Reference

Iterator to scan rectangular windows. More...

#include <vgl_fwd.h>

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

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]. More...
 
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]. More...
 
void set_window (T x, T y, T r)
 Define rectangular region to be [x-r, x+r] x [y-r, y+r]. More...
 
 vgl_window_scan_iterator ()=default
 makes uninitialized iterator. More...
 
 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. More...
 
void reset () override
 Resets the scan iterator to before the first scan line. More...
 
bool next () override
 Tries to move 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...
 

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 35 of file vgl_fwd.h.

Constructor & Destructor Documentation

◆ vgl_window_scan_iterator() [1/2]

template<class T >
vgl_window_scan_iterator< T >::vgl_window_scan_iterator ( )
inlinedefault

makes uninitialized iterator.

◆ vgl_window_scan_iterator() [2/2]

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 58 of file vgl_window_scan_iterator.h.

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_window_scan_iterator< T >::endx ( ) const
inlineoverridevirtual

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 67 of file vgl_window_scan_iterator.h.

◆ next()

template<class T >
bool vgl_window_scan_iterator< T >::next ( )
inlineoverridevirtual

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 64 of file vgl_window_scan_iterator.h.

◆ reset()

template<class T >
void vgl_window_scan_iterator< T >::reset ( )
inlineoverridevirtual

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 63 of file vgl_window_scan_iterator.h.

◆ scany()

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

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 65 of file vgl_window_scan_iterator.h.

◆ set_window() [1/2]

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 47 of file vgl_window_scan_iterator.h.

◆ set_window() [2/2]

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 51 of file vgl_window_scan_iterator.h.

◆ set_window_corners()

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 29 of file vgl_window_scan_iterator.h.

◆ startx()

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

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 66 of file vgl_window_scan_iterator.h.

Member Data Documentation

◆ current_y

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

Definition at line 61 of file vgl_window_scan_iterator.h.

◆ x1

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

Definition at line 25 of file vgl_window_scan_iterator.h.

◆ x2

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

Definition at line 25 of file vgl_window_scan_iterator.h.

◆ y1

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

Definition at line 25 of file vgl_window_scan_iterator.h.

◆ y2

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

Definition at line 25 of file vgl_window_scan_iterator.h.


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