My Project
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
IntIndex Class Reference

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

#include <IntegralImage.h>

Public Member Functions

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

Protected Member Functions

void update_next_step ()
 

Protected Attributes

int index
 
int step
 
int step_remainder
 
int estep
 
int next_step
 
int res
 
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;
...
}
IntIndex(int _res, int _steps)
Create IntIndex for indexing _res elements in predefined amount of _steps .

Definition at line 56 of file IntegralImage.h.

Constructor & Destructor Documentation

◆ 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)

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