36 lines
1.1 KiB
C++
36 lines
1.1 KiB
C++
#ifndef _OTB_TRISKELE_XY_ATTRIBUTES_HPP
|
|
#define _OTB_TRISKELE_XY_ATTRIBUTES_HPP
|
|
|
|
#include <boost/chrono.hpp>
|
|
|
|
#include "triskeleBase.hpp"
|
|
#include "CompAttribute.hpp"
|
|
#include "Attributes/AreaAttributes.hpp"
|
|
|
|
namespace otb {
|
|
namespace triskele {
|
|
using namespace ::triskele;
|
|
|
|
/*! Fonction non monotonne. */
|
|
struct AverageXY {
|
|
double x, y;
|
|
inline AverageXY () : x(0), y(0) {}
|
|
friend ostream &operator << (ostream& out, const AverageXY &xy) { return out << "(" << xy.x << ", " << xy.y << ")"; return out; }
|
|
operator DimImg () const { return (DimImg) (x*y); }
|
|
};
|
|
|
|
class XYAttributes : public CompAttribute<AverageXY> {
|
|
public:
|
|
inline XYAttributes (const Tree &tree, const AreaAttributes &areaAttributes);
|
|
inline ~XYAttributes ();
|
|
virtual inline ostream &print (ostream &out) const { CompAttribute::print (out, "xy"); return out; }
|
|
protected:
|
|
inline void compute (const AreaAttributes &areaAttributes);
|
|
};
|
|
|
|
#include "XYAttributes.tpp"
|
|
} // triskele
|
|
} // otb
|
|
|
|
#endif // _OTB_TRISKELE_XY_ATTRIBUTES_HPP
|