19 #ifndef EQFABRIC_SUBPIXEL_H
20 #define EQFABRIC_SUBPIXEL_H
22 #include <eq/fabric/api.h>
23 #include <eq/fabric/types.h>
24 #include <lunchbox/bitOperation.h>
25 #include <lunchbox/log.h>
26 #include <lunchbox/types.h>
32 std::ostream& operator << ( std::ostream& os,
const SubPixel& subPixel );
54 SubPixel(
const uint32_t index_,
const uint32_t size_ )
55 : index( index_ ), size( size_ ) {}
74 return index==rhs.
index && size==rhs.
size;
83 return index != rhs.
index || size != rhs.
size;
93 LBWARN <<
"Invalid " << *
this << std::endl;
94 if( index >= size ) index = 0;
95 if( size == 0 ) size = 1;
96 LBWARN <<
"Corrected " << *
this << std::endl;
100 bool isValid()
const {
return ( index < size ); }
105 EQFABRIC_API
static const SubPixel ALL;
108 inline std::ostream& operator << ( std::ostream& os,
112 os <<
"subpixel [ " << subPixel.
index <<
' ' << subPixel.
size
123 byteswap( value.
index );
124 byteswap( value.
size );
127 #endif // EQFABRIC_SUBPIXEL_H
uint32_t index
The contributor id.
Holds a subpixel decomposition specification along with some methods for manipulation.
void validate()
Make the subpixel specification valid.
void invalidate()
Make the subpixel specification invalid.
SubPixel()
Construct an empty subpixel specification.
SubPixel(const uint32_t index_, const uint32_t size_)
Construct a subpixel specification with default values.
uint32_t size
Total number of contributors.
bool operator!=(const SubPixel &rhs) const
bool operator==(const SubPixel &rhs) const
void apply(const SubPixel &rhs)
Apply (accumulate) another subpixel specification.