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