Equalizer  2.1.0
Parallel Rendering Framework
colorMask.h
1 
2 /* Copyright (c) 2007-2017, 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 <iostream>
23 #include <lunchbox/bitOperation.h>
24 
25 namespace eq
26 {
27 namespace fabric
28 {
34 class ColorMask
35 {
36 public:
39  : red(true)
40  , green(true)
41  , blue(true)
42  , alpha(true)
43  {
44  }
45 
47  ColorMask(const bool r, const bool g, const bool b, const bool a = true)
48  : red(r)
49  , green(g)
50  , blue(b)
51  , alpha(a)
52  {
53  }
54 
55  bool red;
56  bool green;
57  bool blue;
58  bool alpha;
59 
60  EQFABRIC_API static const ColorMask ALL;
61 };
62 
63 inline std::ostream& operator<<(std::ostream& os, const ColorMask& mask)
64 {
65  os << "[ ";
66  if (mask.red)
67  os << "RED ";
68  if (mask.green)
69  os << "GREEN ";
70  if (mask.blue)
71  os << "BLUE ";
72  os << "]";
73 
74  return os;
75 }
76 }
77 }
78 
79 #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
std::ostream & operator<<(std::ostream &os, const AxisEvent &event)
Print the axis event to the given output stream.
Definition: axisEvent.h:49
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:47