Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
alvar::IntIndex Class Reference

Class for calculating "evenly spaced" integer indices for data sequence. More...

#include <IntegralImage.h>

Public Member Functions

int end () const
 For testing have we reached the end. More...
 
int get () const
 Get the index value. More...
 
int get_next_step () const
 How much the index will be increased with the next next() More...
 
 IntIndex (int _res, int _steps)
 Create IntIndex for indexing _res elements in predefined amount of _steps . More...
 
int next ()
 Take the next integer index step. More...
 
int operator= (int v)
 Set the integer index to the "grid" value nearest to v . More...
 

Protected Member Functions

void update_next_step ()
 

Protected Attributes

int estep
 
int index
 
int next_step
 
int res
 
int step
 
int step_remainder
 
int steps
 

Detailed Description

Class for calculating "evenly spaced" integer indices for data sequence.

If we have a data sequence we want to step through in certain amount of steps, IntIndex can be used for iterating through the steps using fast integer implementation. This class is related to stride iterators.

Usage

int data[x_res];
for (IntIndex x(x_res, sub_res); x.get() != x.end(); x.next()) {
std::cout<<"data["<<x.get()<<"] is "<<data[x.get()]<<std::endl;
...
}

Definition at line 55 of file IntegralImage.h.

Constructor & Destructor Documentation

alvar::IntIndex::IntIndex ( int  _res,
int  _steps 
)

Create IntIndex for indexing _res elements in predefined amount of _steps .

Parameters
_resThe number of elements in the data sequence we want to index.
_stepsThe number of steps to use to cover the _res elements (_steps < _res)

Definition at line 37 of file IntegralImage.cpp.

Member Function Documentation

int alvar::IntIndex::end ( ) const

For testing have we reached the end.

Definition at line 62 of file IntegralImage.cpp.

int alvar::IntIndex::get ( ) const

Get the index value.

Definition at line 56 of file IntegralImage.cpp.

int alvar::IntIndex::get_next_step ( ) const

How much the index will be increased with the next next()

Definition at line 59 of file IntegralImage.cpp.

int alvar::IntIndex::next ( )

Take the next integer index step.

Definition at line 51 of file IntegralImage.cpp.

int alvar::IntIndex::operator= ( int  v)

Set the integer index to the "grid" value nearest to v .

Definition at line 42 of file IntegralImage.cpp.

void alvar::IntIndex::update_next_step ( )
protected

Definition at line 28 of file IntegralImage.cpp.

Member Data Documentation

int alvar::IntIndex::estep
protected

Definition at line 60 of file IntegralImage.h.

int alvar::IntIndex::index
protected

Definition at line 57 of file IntegralImage.h.

int alvar::IntIndex::next_step
protected

Definition at line 61 of file IntegralImage.h.

int alvar::IntIndex::res
protected

Definition at line 62 of file IntegralImage.h.

int alvar::IntIndex::step
protected

Definition at line 58 of file IntegralImage.h.

int alvar::IntIndex::step_remainder
protected

Definition at line 59 of file IntegralImage.h.

int alvar::IntIndex::steps
protected

Definition at line 63 of file IntegralImage.h.


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


ar_track_alvar
Author(s): Scott Niekum
autogenerated on Thu Jun 6 2019 19:27:24