nouveau fichier : include/AttributeProfiles.hpp
nouveau fichier : include/AttributeProfiles.tpp nouveau fichier : include/Attributes/AreaAttributes.hpp nouveau fichier : include/Attributes/AreaAttributes.tpp nouveau fichier : include/Attributes/WeightAttributes.hpp nouveau fichier : include/Attributes/WeightAttributes.tpp
This commit is contained in:
parent
2933efb9d9
commit
9a76443603
31
include/AttributeProfiles.hpp
Normal file
31
include/AttributeProfiles.hpp
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
#ifndef _OTB_TRISKELE_ATTRIBUTE_PROFILES_HPP
|
||||||
|
#define _OTB_TRISKELE_ATTRIBUTE_PROFILES_HPP
|
||||||
|
|
||||||
|
#include "Tree.hpp"
|
||||||
|
|
||||||
|
namespace otb {
|
||||||
|
namespace triskele {
|
||||||
|
|
||||||
|
template<typename PixelT>
|
||||||
|
class AttributeProfiles {
|
||||||
|
public:
|
||||||
|
inline AttributeProfiles (const Tree &tree);
|
||||||
|
inline ~AttributeProfiles ();
|
||||||
|
|
||||||
|
inline void updateTranscient ();
|
||||||
|
inline PixelT *getValues ();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
const Tree &tree;
|
||||||
|
DimNodeId leafCount;
|
||||||
|
PixelT *values;
|
||||||
|
|
||||||
|
inline void free ();
|
||||||
|
inline void book (const DimImg &leafCount);
|
||||||
|
};
|
||||||
|
|
||||||
|
#include "AttributeProfiles.tpp"
|
||||||
|
} // triskele
|
||||||
|
} // otb
|
||||||
|
|
||||||
|
#endif // _OTB_TRISKELE_ATTRIBUTE_PROFILES_HPP
|
||||||
51
include/AttributeProfiles.tpp
Normal file
51
include/AttributeProfiles.tpp
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
#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 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];
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // _OTB_TRISKELE_ATTRIBUTE_PROFILES_TPP
|
||||||
20
include/Attributes/AreaAttributes.hpp
Normal file
20
include/Attributes/AreaAttributes.hpp
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
#ifndef _OTB_TRISKELE_AREA_ATTRIBUTES_HPP
|
||||||
|
#define _OTB_TRISKELE_AREA_ATTRIBUTES_HPP
|
||||||
|
|
||||||
|
#include "triskeleBase.hpp"
|
||||||
|
#include "CompAttribute.hpp"
|
||||||
|
|
||||||
|
namespace otb {
|
||||||
|
namespace triskele {
|
||||||
|
|
||||||
|
class AreaAttributes : public CompAttribute<double> {
|
||||||
|
public:
|
||||||
|
inline AreaAttributes (const Tree &tree);
|
||||||
|
inline ~AreaAttributes ();
|
||||||
|
};
|
||||||
|
|
||||||
|
#include "AreaAttributes.tpp"
|
||||||
|
} // triskele
|
||||||
|
} // otb
|
||||||
|
|
||||||
|
#endif // _OTB_TRISKELE_AREA_ATTRIBUTES_HPP
|
||||||
13
include/Attributes/AreaAttributes.tpp
Normal file
13
include/Attributes/AreaAttributes.tpp
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#ifndef _OTB_TRISKELE_AREA_ATTRIBUTES_TPP
|
||||||
|
#define _OTB_TRISKELE_AREA_ATTRIBUTES_TPP
|
||||||
|
|
||||||
|
inline
|
||||||
|
AreaAttributes::AreaAttributes (const Tree &tree)
|
||||||
|
: CompAttribute<double> (tree) {
|
||||||
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
|
AreaAttributes::~AreaAttributes () {
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // _OTB_TRISKELE_AREA_ATTRIBUTES_TPP
|
||||||
22
include/Attributes/WeightAttributes.hpp
Normal file
22
include/Attributes/WeightAttributes.hpp
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
#ifndef _OTB_TRISKELE_WEIGHT_ATTRIBUTES_HPP
|
||||||
|
#define _OTB_TRISKELE_WEIGHT_ATTRIBUTES_HPP
|
||||||
|
|
||||||
|
#include "triskeleBase.hpp"
|
||||||
|
#include "CompAttribute.hpp"
|
||||||
|
|
||||||
|
namespace otb {
|
||||||
|
namespace triskele {
|
||||||
|
|
||||||
|
/** Attribute */
|
||||||
|
template<typename WeightT>
|
||||||
|
class WeightAttributes : public CompAttribute<WeightT> {
|
||||||
|
public:
|
||||||
|
inline WeightAttributes (const Tree &tree);
|
||||||
|
inline ~WeightAttributes ();
|
||||||
|
};
|
||||||
|
|
||||||
|
#include "WeightAttributes.tpp"
|
||||||
|
} // triskele
|
||||||
|
} // otb
|
||||||
|
|
||||||
|
#endif // _OTB_TRISKELE_WEIGHT_ATTRIBUTES_HPP
|
||||||
15
include/Attributes/WeightAttributes.tpp
Normal file
15
include/Attributes/WeightAttributes.tpp
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#ifndef _OTB_TRISKELE_WEIGHT_ATTRIBUTES_TPP
|
||||||
|
#define _OTB_TRISKELE_WEIGHT_ATTRIBUTES_TPP
|
||||||
|
|
||||||
|
template<typename WeightT>
|
||||||
|
inline
|
||||||
|
WeightAttributes<WeightT>::WeightAttributes (const Tree &tree)
|
||||||
|
: CompAttribute<WeightT> (tree) {
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename WeightT>
|
||||||
|
inline
|
||||||
|
WeightAttributes<WeightT>::~WeightAttributes () {
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // _OTB_TRISKELE_WEIGHT_ATTRIBUTES_TPP
|
||||||
Loading…
Reference in New Issue
Block a user