bucket2d< T > Class Template Reference
[Sparse point track structures]

Fast access to 2d points within a limited range. More...

#include <bucket2d.h>

Collaboration diagram for bucket2d< T >:

Collaboration graph
[legend]

List of all members.

Classes

class  iterator

Public Member Functions

 bucket2d ()
 bucket2d (unsigned width, unsigned height, unsigned size_bits)
virtual ~bucket2d ()
void setup (unsigned width, unsigned height, unsigned size_bits)
void add_pt (T *p)
void clear ()
void rm_pt (T *p)
void move_pt (T *p, float u, float v)
iterator search (float u, float v, float r)
iterator begin ()
T * closest_point (float u, float v, float max_dist)
unsigned size () const

Protected Member Functions

unsigned idxu (unsigned u)
unsigned idxu (int u)
unsigned idxv (unsigned v)
unsigned idxv (int v)
unsigned idx (unsigned u, unsigned v)
unsigned idx (int u, int v)
unsigned idx (float u, float v)

Protected Attributes

unsigned size_bits
unsigned buckets_max_u
unsigned buckets_max_v
T ** buckets
unsigned nb_elem


Detailed Description

template<typename T>
class bucket2d< T >

Fast access to 2d points within a limited range.

The template argument T takes any class that contain a member points_in_frame such as the one in the example below:

  class bucket_elem {
  	float u, v;
	mlist_elem<bucket_elem> points_in_frame;
  };
  

Definition at line 43 of file bucket2d.h.


Constructor & Destructor Documentation

template<typename T>
bucket2d< T >::bucket2d (  )  [inline]

Definition at line 46 of file bucket2d.h.

template<typename T>
bucket2d< T >::bucket2d ( unsigned  width,
unsigned  height,
unsigned  size_bits 
) [inline]

Definition at line 47 of file bucket2d.h.

template<typename T >
bucket2d< T >::~bucket2d (  )  [inline, virtual]

Definition at line 122 of file bucket2d.h.

References bucket2d< T >::buckets.


Member Function Documentation

template<typename T>
void bucket2d< T >::add_pt ( T *  p  )  [inline]

Definition at line 52 of file bucket2d.h.

Referenced by pic_randomizer::group_ids(), and tkeypoint::set().

template<typename T>
iterator bucket2d< T >::begin (  )  [inline]

template<typename T >
void bucket2d< T >::clear (  )  [inline]

template<typename T >
T * bucket2d< T >::closest_point ( float  u,
float  v,
float  max_dist 
) [inline]

Definition at line 210 of file bucket2d.h.

References bucket2d< T >::iterator::end(), and bucket2d< T >::search().

Referenced by kpt_tracker::track_ncclk().

template<typename T>
unsigned bucket2d< T >::idx ( float  u,
float  v 
) [inline, protected]

Definition at line 117 of file bucket2d.h.

Referenced by bucket2d< tkeypoint >::idx().

template<typename T>
unsigned bucket2d< T >::idx ( int  u,
int  v 
) [inline, protected]

Definition at line 116 of file bucket2d.h.

template<typename T>
unsigned bucket2d< T >::idx ( unsigned  u,
unsigned  v 
) [inline, protected]

template<typename T>
unsigned bucket2d< T >::idxu ( int  u  )  [inline, protected]

Definition at line 104 of file bucket2d.h.

Referenced by bucket2d< tkeypoint >::idxu().

template<typename T>
unsigned bucket2d< T >::idxu ( unsigned  u  )  [inline, protected]

Definition at line 99 of file bucket2d.h.

Referenced by bucket2d< tkeypoint >::idx(), and bucket2d< T >::iterator::iterator().

template<typename T>
unsigned bucket2d< T >::idxv ( int  v  )  [inline, protected]

Definition at line 111 of file bucket2d.h.

template<typename T>
unsigned bucket2d< T >::idxv ( unsigned  v  )  [inline, protected]

template<typename T>
void bucket2d< T >::move_pt ( T *  p,
float  u,
float  v 
) [inline]

Definition at line 58 of file bucket2d.h.

Referenced by pic_randomizer::group_ids().

template<typename T>
void bucket2d< T >::rm_pt ( T *  p  )  [inline]

Definition at line 56 of file bucket2d.h.

Referenced by pic_randomizer::prune(), and tkeypoint::unlink().

template<typename T>
iterator bucket2d< T >::search ( float  u,
float  v,
float  r 
) [inline]

template<typename T >
void bucket2d< T >::setup ( unsigned  width,
unsigned  height,
unsigned  size_bits 
) [inline]

template<typename T>
unsigned bucket2d< T >::size (  )  const [inline]


Member Data Documentation

template<typename T>
T** bucket2d< T >::buckets [protected]

template<typename T>
unsigned bucket2d< T >::buckets_max_u [protected]

template<typename T>
unsigned bucket2d< T >::buckets_max_v [protected]

template<typename T>
unsigned bucket2d< T >::nb_elem [protected]

template<typename T>
unsigned bucket2d< T >::size_bits [protected]

Definition at line 93 of file bucket2d.h.

Referenced by bucket2d< tkeypoint >::idxu(), and bucket2d< tkeypoint >::idxv().


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

Generated on Tue Mar 30 15:53:25 2010 for Polyora by  doxygen 1.5.9