triskele/include/CompAttribute.hpp
Git Merciol 2683beda1a modifié : CMakeLists.txt
modifié :         CMakeListsOTB.txt
	modifié :         LICENSE
	modifié :         MakefileNoOTB
	modifié :         Readme.html
	modifié :         Readme.txt
	modifié :         data/10m.tif
	modifié :         data/areaThresholds.txt
	modifié :         data/moiThresholds.txt
	modifié :         data/sdThresholds.txt
	modifié :         include/Appli/Option.hpp
	modifié :         include/Appli/Selected.hpp
	modifié :         include/Appli/Selected.tpp
	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.hpp
	modifié :         include/ArrayTree/Leader.tpp
	modifié :         include/ArrayTree/Weight.hpp
	modifié :         include/ArrayTree/Weight.tpp
	modifié :         include/ArrayTree/triskeleArrayTreeBase.hpp
	modifié :         include/ArrayTree/triskeleArrayTreeBase.tpp
	modifié :         include/ArrayTree/triskeleSort.hpp
	modifié :         include/ArrayTree/triskeleSort.tpp
	modifié :         include/AttributeProfiles.hpp
	modifié :         include/AttributeProfiles.tpp
	modifié :         include/Attributes/AreaAttributes.hpp
	modifié :         include/Attributes/AreaAttributes.tpp
	modifié :         include/Attributes/AverageAttributes.hpp
	modifié :         include/Attributes/AverageAttributes.tpp
	modifié :         include/Attributes/MoIAttributes.hpp
	modifié :         include/Attributes/MoIAttributes.tpp
	modifié :         include/Attributes/SDAttributes.hpp
	modifié :         include/Attributes/SDAttributes.tpp
	modifié :         include/Attributes/WeightAttributes.hpp
	modifié :         include/Attributes/WeightAttributes.tpp
	modifié :         include/Attributes/XYAttributes.hpp
	modifié :         include/Attributes/XYAttributes.tpp
	modifié :         include/CompAttribute.hpp
	modifié :         include/CompAttribute.tpp
	modifié :         include/IImage.hpp
	modifié :         include/IImage.tpp
	modifié :         include/QuadTree/QuadTreeBuilder.hpp
	modifié :         include/Tree.hpp
	modifié :         include/Tree.tpp
	modifié :         include/TreeBuilder.hpp
	modifié :         include/TreeBuilder.tpp
	modifié :         include/TreeStats.hpp
	modifié :         include/TreeStats.tpp
	modifié :         include/XMLTree/XMLTreeBuilder.hpp
	modifié :         include/triskeleBase.hpp
	modifié :         include/triskeleBase.tpp
	modifié :         include/triskeleDealThreads.hpp
	modifié :         include/triskeleDealThreads.tpp
	modifié :         include/triskeleDebug.hpp
	modifié :         include/triskeleGdalGetType.hpp
	modifié :         otb-module.cmake
	modifié :         src/Appli/Option.cpp
	modifié :         src/Appli/Selected.cpp
	modifié :         src/ArrayTree/triskeleArrayTreeBase.cpp
	modifié :         src/CMakeLists.txt
	modifié :         src/IImage.cpp
	modifié :         src/PerfArrayTreeBuilder.cpp
	modifié :         src/QuadTree/QuadTreeBuilder.cpp
	modifié :         src/TestArrayTreeBuilder.cpp
	modifié :         src/Tree.cpp
	modifié :         src/TreeStats.cpp
	modifié :         src/XMLTree/XMLTreeBuilder.cpp
	modifié :         src/apGenerator.cpp
	modifié :         src/triskeleBase.cpp
	modifié :         src/triskeleDebug.cpp
2018-03-29 09:34:28 +02:00

73 lines
2.1 KiB
C++
Executable File

#ifndef _OTB_TRISKELE_COMP_ATTRIBUTE_HPP
#define _OTB_TRISKELE_COMP_ATTRIBUTE_HPP
#include <vector>
#include "triskeleDebug.hpp"
#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 AttrT getMaxValue () const;
virtual inline ostream &print (ostream &out) const { print (out, ""); }
protected:
const Tree &tree;
DimNodeId leafCount;
vector<AttrT> values;
inline void free ();
inline void book (const DimImg &leafCount);
ostream &print (ostream &out, const string &msg) const;
friend ostream &operator << (ostream& out, const CompAttribute &ca) { return ca.print (out); }
};
} // triskele
} // otb
#include "Attributes/WeightAttributes.hpp"
namespace otb {
namespace triskele {
template<typename AttrT>
class CompAttributeC : public CompAttribute<AttrT> {
public:
inline CompAttributeC (const Tree &tree);
inline ~CompAttributeC ();
static inline vector<AttrT> getScaledThresholds (const vector<double> &thresholds, const AttrT &maxValue);
template<typename PixelT>
inline void cut (vector<vector<PixelT> > &allBands, const AttributeProfiles<PixelT> &attributeProfiles,
const AttrT &pixelAttrValue, const vector<AttrT> &thresholds) const;
template<typename PixelT>
inline void cutOnPos (vector<vector<PixelT> > &allBands, const AttributeProfiles<PixelT> &attributeProfiles,
const DimImg &pixelId, const AttrT &pixelAttrValue, const vector<AttrT> &thresholds) const;
protected:
template<typename CumpFunctPSE>
inline void computeSameCompLevel (const CumpFunctPSE &cumpFunctPSE /* cumpFunctPSE (DimImg parentId)*/) const;
};
#include "CompAttribute.tpp"
} // triskele
} // otb
#endif // _OTB_TRISKELE_COMP_ATTRIBUTE_HPP