74 lines
2.0 KiB
C++
74 lines
2.0 KiB
C++
#ifndef _OTB_TRISKELE_COMP_ATTRIBUTE_HPP
|
|
#define _OTB_TRISKELE_COMP_ATTRIBUTE_HPP
|
|
|
|
#include <vector>
|
|
|
|
#include "triskeleBase.hpp"
|
|
#include "Tree.hpp"
|
|
#include "AttributeProfiles.hpp"
|
|
|
|
namespace otb {
|
|
namespace triskele {
|
|
|
|
template<typename AttrT>
|
|
class CompAttribute {
|
|
public:
|
|
inline CompAttribute (const Tree &tree);
|
|
inline ~CompAttribute ();
|
|
|
|
inline void updateTranscient ();
|
|
inline const AttrT *getValues () const;
|
|
inline AttrT *getValues ();
|
|
inline void printValues (const string &msg) const;
|
|
|
|
protected:
|
|
const Tree &tree;
|
|
DimNodeId leafCount;
|
|
AttrT *values;
|
|
|
|
inline void free ();
|
|
inline void book (const DimImg &leafCount);
|
|
};
|
|
|
|
} // triskele
|
|
} // otb
|
|
|
|
#include "Attributes/WeightAttributes.hpp"
|
|
|
|
namespace otb {
|
|
namespace triskele {
|
|
|
|
template <typename AttrT>
|
|
struct ThresholdsChanel {
|
|
AttrT threshold;
|
|
DimChanel chanel;
|
|
ThresholdsChanel (const AttrT &threshold, const DimChanel &chanel) : threshold (threshold), chanel (chanel) {}
|
|
};
|
|
|
|
template<typename AttrT>
|
|
class CompAttributeC : public CompAttribute<AttrT> {
|
|
public:
|
|
inline CompAttributeC (const Tree &tree, const unsigned int &treeCoreCount);
|
|
inline ~CompAttributeC ();
|
|
|
|
template<typename PixelT>
|
|
inline void cut (vector<vector<PixelT> > allBands, const AttributeProfiles<PixelT> &attributeProfiles,
|
|
const AttrT &pixelAttrValue, const vector<const ThresholdsChanel<AttrT> > &selection);
|
|
|
|
template<typename PixelT>
|
|
inline void cutOnPos (vector<vector<PixelT> > allBands, const AttributeProfiles<PixelT> &attributeProfiles,
|
|
const DimImg &pixelId, const AttrT &pixelAttrValue, const vector<const ThresholdsChanel<AttrT> > &selection);
|
|
|
|
protected:
|
|
const unsigned int treeCoreCount;
|
|
|
|
template<typename CumpFunctPSE>
|
|
inline void computeSameCompLevel (const CumpFunctPSE &cumpFunctPSE /* cumpFunctPSE (DimImg parentId)*/);
|
|
};
|
|
|
|
#include "CompAttribute.tpp"
|
|
} // triskele
|
|
} // otb
|
|
|
|
#endif // _OTB_TRISKELE_COMP_ATTRIBUTE_HPP
|