This class specifies a Jet, i.e., array of feature values for one location. More...
#include <Channels/Jet.H>
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 | |
T | getVal (const VisualFeature f, const VisualFeatureType t,...) const |
Get a value, for given feature, type and indices. | |
T | getValV (const VisualFeature f, const VisualFeatureType t, const std::vector< int > &v) const |
Get a value, for given feature, type and vector of indices. | |
T | 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< JetSpec > | getSpec () 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. |
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.
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().
int Jet< T >::getIndexBase | ( | const VisualFeature | f, | |
const VisualFeatureType | t, | |||
int & | siz | |||
) | const [inline] |
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().
int Jet< T >::getNbIndexRanges | ( | const VisualFeature | f, | |
const VisualFeatureType | t | |||
) | const [inline] |
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().
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().
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().
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().
bool Jet< T >::hasFeature | ( | const VisualFeature | f | ) | const [inline] |
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().
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().
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=().
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=().
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().
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().
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().