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. | |
int | get () const |
Get the index value. | |
int | get_next_step () const |
How much the index will be increased with the next next() | |
IntIndex (int _res, int _steps) | |
Create IntIndex for indexing _res elements in predefined amount of _steps . | |
int | next () |
Take the next integer index step. | |
int | operator= (int v) |
Set the integer index to the "grid" value nearest to v . | |
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 |
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.
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.
alvar::IntIndex::IntIndex | ( | int | _res, |
int | _steps | ||
) |
Create IntIndex for indexing _res elements in predefined amount of _steps .
_res | The number of elements in the data sequence we want to index. |
_steps | The number of steps to use to cover the _res elements (_steps < _res) |
Definition at line 37 of file IntegralImage.cpp.
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.
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.