synaps/base/Range.h

00001 #ifndef SYNAPS_UTIL_RANGE_H
00002 #define SYNAPS_UTIL_RANGE_H
00003 
00004 #include <synaps/init.h>
00005 #include <synaps/arithm/GENERIC.h>
00006 
00007 __BEGIN_NAMESPACE_SYNAPS
00008 
00009 struct Range
00010 {
00011   unsigned int i1, i2;
00012   Range():i1(0),i2(0){}
00013   Range(const Range & r):i1(r.i1),i2(r.i2){}
00014   Range(unsigned int a, unsigned int b):i1(a),i2(b){}
00015 };
00016 
00017 struct Range2d
00018 {
00019   unsigned int i1, i2, j1, j2;
00020   Range2d():i1(0),i2(0),j1(0),j2(0){}
00021   Range2d(const Range2d & r):i1(r.i1),i2(r.i2),j1(r.j1),j2(r.j2){}
00022   Range2d(unsigned int a, unsigned int b, unsigned int c, unsigned int d):i1(a),i2(b),j1(c),j2(d){}
00023   Range2d( const Range & a, const Range & b ) : i1(a.i1), i2(a.i2), j1(b.i1), j2(b.i2) {};
00024 };
00025 
00026 std::ostream & operator<<( std::ostream & , const Range & );
00027 std::ostream & operator<<( std::ostream & , const Range2d & );
00028 
00029 
00030 template<>
00031 class OPTraits<Range> {
00032 public:
00033   typedef Range const OP_node_ref;
00034 };
00035 
00036 template<>
00037 class OPTraits<Range2d> {
00038 public:
00039   typedef Range2d const OP_node_ref;
00040 };
00041 
00042 __END_NAMESPACE_SYNAPS
00043 
00044 #endif // SYNAPS_UTIL_RANGE_H
00045 

SYNAPS DOCUMENTATION
logo