#ifndef _OTB_TRISKELE_ATTRIBUTE_PROFILES_TPP #define _OTB_TRISKELE_ATTRIBUTE_PROFILES_TPP template inline AttributeProfiles::AttributeProfiles (const Tree &tree) : tree (tree), leafCount (0), values (nullptr) { updateTranscient (); } template inline AttributeProfiles::~AttributeProfiles () { free (); } template inline void AttributeProfiles::updateTranscient () { book (tree.getLeafCount ()); } template inline PixelT * AttributeProfiles::getValues () { return values; } template inline void AttributeProfiles::printValues () const { cout << "AP" << endl; const Size doubleSize (tree.getSize().width, 2*tree.getSize ().height); printMap (cout, values, doubleSize, tree.getNodeCount ()) << endl << endl; } template inline void AttributeProfiles::free () { if (values) delete[] values; values = nullptr; } template inline void AttributeProfiles::book (const DimImg &leafCount) { if (this->leafCount == leafCount) return; free (); if (!leafCount) return; this->leafCount = leafCount; values = new PixelT[leafCount*2]; } #endif // _OTB_TRISKELE_ATTRIBUTE_PROFILES_TPP