triskele/include/AttributeProfiles.tpp
Git Merciol 8ca10923c4 modifié : include/ArrayTree/ArrayTreeBuilder.hpp
modifié :         include/ArrayTree/ArrayTreeBuilder.tpp
	modifié :         include/ArrayTree/Border.hpp
	modifié :         include/ArrayTree/Border.tpp
	modifié :         include/ArrayTree/GraphWalker.tpp
	modifié :         include/ArrayTree/Leader.hpp
	modifié :         include/ArrayTree/Leader.tpp
	modifié :         include/Attribute.hpp
	modifié :         include/AttributeProfiles.hpp
	modifié :         include/AttributeProfiles.tpp
	modifié :         include/CompAttribute.hpp
	modifié :         include/CompAttribute.tpp
	modifié :         include/IImage.hpp
	modifié :         include/IImage.tpp
	modifié :         include/Tree.hpp
	modifié :         include/Tree.tpp
	modifié :         include/TreeBuilder.hpp
	modifié :         include/TreeBuilder.tpp
	supprimé :        src/Attribute.cpp
	modifié :         src/CMakeLists.txt
	modifié :         src/QuadTree/QuadTreeBuilder.cpp
	modifié :         src/TestArrayTreeBuilder.cpp
	modifié :         src/Tree.cpp
	modifié :         src/XMLTree/XMLTreeBuilder.cpp
	modifié :         src/apGenerator.cpp
2018-03-06 21:57:15 +01:00

61 lines
1.3 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 () {
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[0];
}
template<typename PixelT>
inline const PixelT *
AttributeProfiles<PixelT>::getValues () const {
return &values[0];
}
template<typename PixelT>
inline void
AttributeProfiles<PixelT>::free () {
values = vector<PixelT> ();
}
template<typename PixelT>
inline void
AttributeProfiles<PixelT>::book (const DimImg &leafCount) {
this->leafCount = leafCount;
// XXX max : leafCount*2-1
values.resize (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[0], doubleSize, tree.getNodeCount ()) << endl << endl;
}
#endif // _OTB_TRISKELE_ATTRIBUTE_PROFILES_TPP