18 #ifndef EQFABRIC_RANGE_H
19 #define EQFABRIC_RANGE_H
21 #include <eq/fabric/api.h>
36 Range() : start(0.f), end(1.f) {}
39 Range(
const float start_,
const float end_ )
40 : start(start_), end(end_) {}
47 {
return start==rhs.
start && end==rhs.
end; }
51 {
return start!=rhs.
start || end!=rhs.
end; }
57 void invalidate() { start=0.f; end=0.f; }
61 {
return ( start>=0.f && end <=1.f && (end - start) >= 0.f ); }
64 bool hasData()
const {
return (end - start) > 0.f; }
67 void apply(
const Range& rhs )
69 const float w = end-
start;
70 end = start + rhs.end * w;
71 start += rhs.start * w;
81 inline std::ostream& operator << ( std::ostream& os,
const Range& range )
83 os <<
"range [ " << range.
start <<
" " << range.
end <<
" ]";
93 byteswap( value.
start );
94 byteswap( value.
end );
97 #endif // EQFABRIC_RANGE_H
A fractional database range with methods for manipulation.
Range()
Construct a new range covering all data.
static const Range ALL
A full database range.
Range(const float start_, const float end_)
Construct a new range with default values.
bool operator!=(const Range &rhs) const
float end
The end position.
bool operator==(const Range &rhs) const
float start
The start position.