Equalizer  1.13.0
Parallel Rendering Framework
colorMask.h
1 
2 /* Copyright (c) 2007-2014, Stefan Eilemann <eile@equalizergraphics.com>
3  *
4  * This library is free software; you can redistribute it and/or modify it under
5  * the terms of the GNU Lesser General Public License version 2.1 as published
6  * by the Free Software Foundation.
7  *
8  * This library is distributed in the hope that it will be useful, but WITHOUT
9  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
10  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
11  * details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this library; if not, write to the Free Software Foundation, Inc.,
15  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16  */
17 
18 #ifndef EQFABRIC_COLORMASK_H
19 #define EQFABRIC_COLORMASK_H
20 
21 #include <eq/fabric/api.h>
22 #include <lunchbox/bitOperation.h>
23 #include <iostream>
24 
25 namespace eq
26 {
27 namespace fabric
28 {
34  class ColorMask
35  {
36  public:
38  ColorMask() : red( true ), green( true ), blue( true ), alpha( true ) {}
39 
41  ColorMask( const bool r, const bool g, const bool b,
42  const bool a = true )
43  : red( r ), green( g ), blue( b ), alpha( a ) {}
44 
45  bool red;
46  bool green;
47  bool blue;
48  bool alpha;
49 
50  EQFABRIC_API static const ColorMask ALL;
51  };
52 
53  inline std::ostream& operator << ( std::ostream& os, const ColorMask& mask )
54  {
55  os << "[ ";
56  if( mask.red )
57  os << "RED ";
58  if( mask.green )
59  os << "GREEN ";
60  if( mask.blue )
61  os << "BLUE ";
62  os << "]";
63 
64  return os;
65  }
66 }
67 }
68 
69 namespace lunchbox
70 {
71 template<> inline void byteswap( eq::fabric::ColorMask& /*value*/ ) { /* NOP */ }
72 }
73 
74 #endif // EQFABRIC_COLORMASK_H
Defines export visibility macros for library EqualizerFabric.
Defines which parts of the color buffer are to be written.
Definition: colorMask.h:34
The Equalizer client library.
Definition: eq/agl/types.h:23
ColorMask()
Construct a color mask with all components enabled.
Definition: colorMask.h:38
ColorMask(const bool r, const bool g, const bool b, const bool a=true)
Construct a color mask with given default values.
Definition: colorMask.h:41