Jet< T > Class Template Reference

This class specifies a Jet, i.e., array of feature values for one location. More...

#include <Channels/Jet.H>

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

List of all members.

Public Member Functions

Constructors, initialization and destructor

 Jet (const rutz::shared_ptr< JetSpec > js)
 Constructor; must provide a fully-configured JetSpec.
 Jet ()
 Uninitialized constructor (for arrays of Jets).
void init (const rutz::shared_ptr< JetSpec > js)
 Initialization of an uninitialized Jet.
Jet< T > & operator= (const Image< T > &img)
 Load from an Image, presenving our JetSpec.
template<class TT >
Jet< T > & operator= (const Image< TT > &img)
 Load from an image, preserving our JetSpec and doing a clamped convert.
 ~Jet ()
 Destructor.
Access functions

getVal (const VisualFeature f, const VisualFeatureType t,...) const
 Get a value, for given feature, type and indices.
getValV (const VisualFeature f, const VisualFeatureType t, const std::vector< int > &v) const
 Get a value, for given feature, type and vector of indices.
getVal (const int idx) const
 Get a value by absolute index in the Jet array. Use with caution!
void setVal (const T &val, const VisualFeature f, const VisualFeatureType t,...)
 Set a value, for given feature, type and indices.
void setValV (const T &val, const VisualFeature f, const VisualFeatureType t, const std::vector< int > &v)
 Set a value, for given feature, type and vector of indices.
void setVal (const int idx, const T &val)
 Set a value by absolute index in the Jet array. Use with caution!
rutz::shared_ptr< JetSpecgetSpec () const
 Retrieve the JetSpec in case your original has run out of scope.
Convenience JetSpec Access Methods

bool hasFeature (const VisualFeature f) const
 Query whether we have some representation for given feature.
bool hasFeatureType (const VisualFeature f, const VisualFeatureType t) const
 Query whether we have some representation for given feature/type.
int getIndexBase (const VisualFeature f, const VisualFeatureType t, int &siz) const
 Get index of first Jet element for given feature & type.
int getNbIndexRanges (const VisualFeature f, const VisualFeatureType t) const
 Get number of index ranges.
bool getIndexRange (const VisualFeature f, const VisualFeatureType t, const int idxnum, int &idxmin, int &idxmax) const
 Get an index range; true if range exists in JetSpec.

Detailed Description

template<class T>
class Jet< T >

This class specifies a Jet, i.e., array of feature values for one location.

The features represented in the Jet are defined by a JetSpec object that must be passed at construction of the Jet. Jet extends Image and inherits all of its functionality. The JetSpec is passed as a rutz::shared_ptr, so that the original can run out of scope and be destroyed (and the actual data will be freed upon destruction of the last Jet built from that JetSpec).

Definition at line 182 of file Jet.H.


Constructor & Destructor Documentation

template<class T >
Jet< T >::Jet ( const rutz::shared_ptr< JetSpec js  )  [inline]

Constructor; must provide a fully-configured JetSpec.

Definition at line 234 of file Jet.C.

References Image< T >::resize().

template<class T >
Jet< T >::Jet (  )  [inline]

Uninitialized constructor (for arrays of Jets).

Definition at line 239 of file Jet.C.

template<class T >
Jet< T >::~Jet (  )  [inline]

Destructor.

Definition at line 249 of file Jet.C.

References Image< T >::freeMem().


Member Function Documentation

template<class T >
int Jet< T >::getIndexBase ( const VisualFeature  f,
const VisualFeatureType  t,
int &  siz 
) const [inline]

Get index of first Jet element for given feature & type.

Also returns total size allocated in the Jet for this feature/type

Definition at line 506 of file Jet.H.

template<class T >
bool Jet< T >::getIndexRange ( const VisualFeature  f,
const VisualFeatureType  t,
const int  idxnum,
int &  idxmin,
int &  idxmax 
) const [inline]

Get an index range; true if range exists in JetSpec.

Definition at line 520 of file Jet.H.

Referenced by raodistance(), and JetFiller::visitSingleChannel().

template<class T >
int Jet< T >::getNbIndexRanges ( const VisualFeature  f,
const VisualFeatureType  t 
) const [inline]

Get number of index ranges.

Definition at line 513 of file Jet.H.

Referenced by raodistance().

template<class T >
rutz::shared_ptr< JetSpec > Jet< T >::getSpec (  )  const [inline]

Retrieve the JetSpec in case your original has run out of scope.

Definition at line 490 of file Jet.H.

Referenced by JetFiller::visitSingleChannel().

template<class T >
T Jet< T >::getVal ( const int  idx  )  const [inline]

Get a value by absolute index in the Jet array. Use with caution!

Reimplemented from Image< T >.

Definition at line 462 of file Jet.H.

References Image< T >::begin().

template<class T >
T Jet< T >::getVal ( const VisualFeature  f,
const VisualFeatureType  t,
  ... 
) const [inline]

Get a value, for given feature, type and indices.

Definition at line 444 of file Jet.H.

Referenced by Jet< T >::getValV(), and raodistance().

template<class T >
T Jet< T >::getValV ( const VisualFeature  f,
const VisualFeatureType  t,
const std::vector< int > &  v 
) const [inline]

Get a value, for given feature, type and vector of indices.

Definition at line 453 of file Jet.H.

References Jet< T >::getVal().

template<class T >
bool Jet< T >::hasFeature ( const VisualFeature  f  )  const [inline]

Query whether we have some representation for given feature.

Definition at line 495 of file Jet.H.

template<class T >
bool Jet< T >::hasFeatureType ( const VisualFeature  f,
const VisualFeatureType  t 
) const [inline]

Query whether we have some representation for given feature/type.

Definition at line 500 of file Jet.H.

Referenced by raodistance().

template<class T >
void Jet< T >::init ( const rutz::shared_ptr< JetSpec js  )  [inline]

Initialization of an uninitialized Jet.

Definition at line 244 of file Jet.C.

References ASSERT, rutz::shared_ptr< T >::get(), and Image< T >::resize().

template<class T >
template<class TT >
Jet< T > & Jet< T >::operator= ( const Image< TT > &  img  )  [inline]

Load from an image, preserving our JetSpec and doing a clamped convert.

The Jet must have been initialized previously and its size must match that of the Image. This is potentially dangerous, and mostly provided so that we can inherit all of the Image free functions that return images (e.g., those of Image_MathOps.H). This is an expensive operation in which we convert each pixel in turn.

Definition at line 436 of file Jet.H.

References ASSERT, Image< T >::isSameSize(), and Jet< T >::operator=().

template<class T>
Jet< T > & Jet< T >::operator= ( const Image< T > &  img  )  [inline]

Load from an Image, presenving our JetSpec.

The Jet must have been initialized previously and its size must match that of the Image. This is potentially dangerous, and mostly provided so that we can inherit all of the Image free functions that return images (e.g., those of Image_MathOps.H). This is a cheap operation thanks to the copy-on-write/ref-counting

Reimplemented from Image< T >.

Definition at line 426 of file Jet.H.

References ASSERT, Image< T >::isSameSize(), and Image< T >::swap().

Referenced by Jet< T >::operator=().

template<class T>
void Jet< T >::setVal ( const int  idx,
const T &  val 
) [inline]

Set a value by absolute index in the Jet array. Use with caution!

Definition at line 485 of file Jet.H.

References Image< T >::beginw().

template<class T>
void Jet< T >::setVal ( const T &  val,
const VisualFeature  f,
const VisualFeatureType  t,
  ... 
) [inline]

Set a value, for given feature, type and indices.

Definition at line 467 of file Jet.H.

Referenced by Jet< T >::setValV(), and JetFiller::visitSingleChannel().

template<class T>
void Jet< T >::setValV ( const T &  val,
const VisualFeature  f,
const VisualFeatureType  t,
const std::vector< int > &  v 
) [inline]

Set a value, for given feature, type and vector of indices.

Definition at line 477 of file Jet.H.

References Jet< T >::setVal().


The documentation for this class was generated from the following files:
Generated on Sun May 8 08:22:50 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3