LTI-Lib latest version v1.9 - last update 10 Apr 2010

lti::pyramid< T > Class Template Reference

Pyramid class. More...

#include <ltiPyramid.h>

Inheritance diagram for lti::pyramid< T >:
Inheritance graph
[legend]
Collaboration diagram for lti::pyramid< T >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef std::vector< T >::iterator iterator
typedef std::vector< T >
::const_iterator 
const_iterator
typedef int size_type

Public Member Functions

 pyramid ()
 pyramid (const int &resolutions)
 pyramid (const pyramid &other)
virtual ~pyramid ()
const char * getTypeName () const
int size () const
bool empty () const
const_iterator begin () const
iterator begin ()
const_iterator end () const
iterator end ()
virtual void resize (const int &resolutions, const bool &copyData=true)
void append (const T &theElement)
void clear ()
const T & at (const int &x) const
T & at (const int &x)
const T & operator[] (const int &x) const
T & operator[] (const int &x)
pyramid< T > & copy (const pyramid< T > &other)
virtual mathObjectclone () const
bool equals (const pyramid &other) const
bool compareResolutions (const pyramid &other) const
bool operator== (const pyramid &other) const
pyramidoperator= (const pyramid &other)

Protected Attributes

std::vector< T > thePyramid

Detailed Description

template<class T>
class lti::pyramid< T >

Pyramid class.

The lti::pyramid class is the parent class for the multiresolutional pyramids. For example lti::gaussianPyramid

It contains some objects of type T (e.g. channel, channel8 or image), which must implement the type T::size_type and the member size(). Note that pyramids of pyramids are allowed.


Member Typedef Documentation

template<class T>
typedef std::vector<T>::const_iterator lti::pyramid< T >::const_iterator

The const_iterator is equivalent to a lti::fvector::const_iterator.

template<class T>
typedef std::vector<T>::iterator lti::pyramid< T >::iterator

The iterator is equivalent to a lti::fvector::iterator.

template<class T>
typedef int lti::pyramid< T >::size_type

The return type of the size() member.


Constructor & Destructor Documentation

template<class T>
lti::pyramid< T >::pyramid (  ) 

Default constructor creates an empty pyramid;.

template<class T>
lti::pyramid< T >::pyramid ( const int &  resolutions  ) 

Create a pyramid with the given number of resolutions or scales.

Parameters:
resolutions the number of resolutions or scales in the pyramid
template<class T>
lti::pyramid< T >::pyramid ( const pyramid< T > &  other  ) 

Create this pyramid as a copy of another pyramid.

Parameters:
other the pyramid to be copied.
template<class T>
virtual lti::pyramid< T >::~pyramid (  )  [virtual]

Destructor.


Member Function Documentation

template<class T>
void lti::pyramid< T >::append ( const T &  theElement  ) 

Append one element to the pyramid.

Parameters:
theElement Element that will be appended to the pyramid
template<class T>
T& lti::pyramid< T >::at ( const int &  x  )  [inline]

Access element x of the pyramid.

Parameters:
x index of the pyramid element to be accessed. It should be between 0 and size()-1
Returns:
the number of entries in the given cell
template<class T>
const T& lti::pyramid< T >::at ( const int &  x  )  const [inline]

Read-only access to the element x of the pyramid.

Parameters:
x index of the pyramid element to be accessed. It should be between 0 and size()-1
Returns:
the number of entries in the given cell
template<class T>
iterator lti::pyramid< T >::begin (  )  [inline]

Returns an iterator pointing to the first element.

The use of the interators is similar to the iterators of the Standard Template Library (STL).

template<class T>
const_iterator lti::pyramid< T >::begin (  )  const [inline]

Returns an iterator pointing to the first element.

Note that you can not change the values of the pyramid elements when you use a const_iterator. See also begin()

template<class T>
void lti::pyramid< T >::clear (  ) 

Equivalent to resize(0);.

template<class T>
virtual mathObject* lti::pyramid< T >::clone (  )  const [virtual]
template<class T>
bool lti::pyramid< T >::compareResolutions ( const pyramid< T > &  other  )  const

Compare if the resolutions of this and the other pyramid are the same.

Parameters:
other the pyramid to be compared with.
Returns:
true if both pyramids and its elements have the same size
template<class T>
pyramid<T>& lti::pyramid< T >::copy ( const pyramid< T > &  other  ) 

Assigment operator.

copy the contents of other in this object.

Parameters:
other the source pyramid to be copied.
Returns:
a reference to this object

Reimplemented from lti::ioObject.

Reimplemented in lti::gaborPyramid< T >, lti::gaussianPyramid< T >, lti::laplacianPyramid< T >, and lti::scaleSpacePyramid< T >.

template<class T>
bool lti::pyramid< T >::empty (  )  const [inline]

Returns true if the size of this pyramid is zero.

template<class T>
iterator lti::pyramid< T >::end (  )  [inline]

Returns last index as an iterator For an example see begin().

template<class T>
const_iterator lti::pyramid< T >::end (  )  const [inline]

Returns last index as a const iterator.

For an example see begin()

template<class T>
bool lti::pyramid< T >::equals ( const pyramid< T > &  other  )  const

Compare this pyramid with another one.

Parameters:
other the other pyramid to be compared with
Returns:
true if both pyramids have the same elements and same size

Referenced by lti::pyramid< channel >::operator==().

template<class T>
const char* lti::pyramid< T >::getTypeName ( void   )  const [inline, virtual]
template<class T>
pyramid& lti::pyramid< T >::operator= ( const pyramid< T > &  other  )  [inline]

Assigment operator (alias for copy(other)).

Parameters:
other the pyramid to be copied
Returns:
a reference to the actual pyramid

Reimplemented from lti::ioObject.

Reimplemented in lti::scaleSpacePyramid< T >.

template<class T>
bool lti::pyramid< T >::operator== ( const pyramid< T > &  other  )  const [inline]

Compare this pyramid with another one.

Parameters:
other the other pyramid to be compared with
Returns:
true if both pyramids have the same elements and same size
template<class T>
T& lti::pyramid< T >::operator[] ( const int &  x  )  [inline]

Access element x of the pyramid.

Parameters:
x index of the pyramid element to be accessed. It should be between 0 and size()-1
Returns:
the number of entries in the given cell
template<class T>
const T& lti::pyramid< T >::operator[] ( const int &  x  )  const [inline]

Read-only access to the element x of the pyramid.

Parameters:
x index of the pyramid element to be accessed. It should be between 0 and size()-1
Returns:
the number of entries in the given cell
template<class T>
virtual void lti::pyramid< T >::resize ( const int &  resolutions,
const bool &  copyData = true 
) [virtual]

Change the number of resolutions of the pyramid.

Parameters:
resolutions the new number of resolutions of the pyramid
copyData if true (default), the old data will be keeped. If false, all data will be lost.

Reimplemented in lti::scaleSpacePyramid< T >, and lti::scaleSpacePyramid< channel >.

template<class T>
int lti::pyramid< T >::size (  )  const [inline]

Returns the number of resolutions of this pyramid.


Member Data Documentation

template<class T>
std::vector<T> lti::pyramid< T >::thePyramid [protected]

The data of the pyramid.


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

Generated on Sat Apr 10 15:27:43 2010 for LTI-Lib by Doxygen 1.6.1