modifié : include/ArrayTree/ArrayTreeBuilder.hpp modifié : include/ArrayTree/ArrayTreeBuilder.tpp modifié : include/ArrayTree/Border.hpp modifié : include/ArrayTree/Border.tpp modifié : include/ArrayTree/GraphWalker.hpp modifié : include/ArrayTree/GraphWalker.tpp modifié : include/ArrayTree/Leader.tpp modifié : include/ArrayTree/triskeleArrayTreeBase.hpp modifié : include/ArrayTree/triskeleArrayTreeBase.tpp modifié : include/AttributeProfiles.hpp modifié : include/AttributeProfiles.tpp modifié : include/Attributes/AreaAttributes.hpp modifié : include/Attributes/AverageAttributes.hpp modifié : include/Attributes/MoIAttributes.hpp modifié : include/Attributes/SDAttributes.hpp modifié : include/Attributes/WeightAttributes.hpp modifié : include/Attributes/XYAttributes.hpp modifié : include/CompAttribute.hpp modifié : include/CompAttribute.tpp modifié : include/Tree.hpp modifié : include/Tree.tpp modifié : include/TreeStats.hpp modifié : include/triskeleBase.hpp modifié : include/triskeleBase.tpp modifié : include/triskeleDebug.hpp modifié : src/Tree.cpp modifié : src/TreeStats.cpp modifié : src/apGenerator.cpp
67 lines
1.4 KiB
C++
67 lines
1.4 KiB
C++
#ifndef _OTB_TRISKELE_ATTRIBUTE_PROFILES_TPP
|
|
#define _OTB_TRISKELE_ATTRIBUTE_PROFILES_TPP
|
|
|
|
template<typename PixelT>
|
|
inline
|
|
AttributeProfiles<PixelT>::AttributeProfiles (const Tree &tree)
|
|
: tree (tree),
|
|
leafCount (0),
|
|
values (nullptr) {
|
|
updateTranscient ();
|
|
}
|
|
|
|
template<typename PixelT>
|
|
inline
|
|
AttributeProfiles<PixelT>::~AttributeProfiles () {
|
|
free ();
|
|
}
|
|
|
|
template<typename PixelT>
|
|
inline void
|
|
AttributeProfiles<PixelT>::updateTranscient () {
|
|
book (tree.getLeafCount ());
|
|
}
|
|
|
|
template<typename PixelT>
|
|
inline PixelT *
|
|
AttributeProfiles<PixelT>::getValues () {
|
|
return values;
|
|
}
|
|
|
|
template<typename PixelT>
|
|
inline const PixelT *
|
|
AttributeProfiles<PixelT>::getValues () const {
|
|
return values;
|
|
}
|
|
|
|
template<typename PixelT>
|
|
inline void
|
|
AttributeProfiles<PixelT>::free () {
|
|
if (values)
|
|
delete[] values;
|
|
values = nullptr;
|
|
}
|
|
|
|
template<typename PixelT>
|
|
inline void
|
|
AttributeProfiles<PixelT>::book (const DimImg &leafCount) {
|
|
if (this->leafCount == leafCount)
|
|
return;
|
|
free ();
|
|
if (!leafCount)
|
|
return;
|
|
this->leafCount = leafCount;
|
|
values = new PixelT[leafCount*2];
|
|
}
|
|
|
|
// ========================================
|
|
template<typename PixelT>
|
|
ostream &
|
|
AttributeProfiles<PixelT>::print (ostream &out) const {
|
|
const Size doubleSize (tree.getSize().width, 2*tree.getSize ().height);
|
|
out << "AP" << endl
|
|
<< printMap (values, doubleSize, tree.getNodeCount ()) << endl << endl;
|
|
}
|
|
|
|
#endif // _OTB_TRISKELE_ATTRIBUTE_PROFILES_TPP
|