Equalizer  2.1.0
Parallel Rendering Framework
fabric/frame.h
1 /* Copyright (c) 2012-2017, Stefan Eilemann <eile@eyescale.ch>
2  *
3  * This library is free software; you can redistribute it and/or modify it under
4  * the terms of the GNU Lesser General Public License version 2.1 as published
5  * by the Free Software Foundation.
6  *
7  * This library is distributed in the hope that it will be useful, but WITHOUT
8  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
9  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
10  * details.
11  *
12  * You should have received a copy of the GNU Lesser General Public License
13  * along with this library; if not, write to the Free Software Foundation, Inc.,
14  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
15  */
16 
17 #ifndef EQFABRIC_FRAME_H
18 #define EQFABRIC_FRAME_H
19 
20 #include <co/object.h> // base class
21 #include <eq/fabric/api.h>
22 #include <eq/fabric/eye.h> // enum
23 #include <eq/fabric/types.h>
24 
25 namespace eq
26 {
27 namespace fabric
28 {
29 namespace detail
30 {
31 class Frame;
32 }
33 
35 class Frame : public co::Object
36 {
37 public:
42  enum class Buffer : uint32_t
43  {
44  none = LB_BIT_NONE,
45  undefined = LB_BIT1,
46  color = LB_BIT5,
47  depth = LB_BIT9,
48  all = LB_BIT_ALL_32
49  };
50 
52  enum Type
53  {
55  TYPE_TEXTURE
56  };
57 
59  EQFABRIC_API Frame();
60 
62  EQFABRIC_API virtual ~Frame();
63 
67  EQFABRIC_API void setName(const std::string& name);
68 
70  EQFABRIC_API const std::string& getName() const;
71 
73  EQFABRIC_API const Vector2i& getOffset() const;
74 
83  EQFABRIC_API void setOffset(const Vector2i& offset);
84 
93  EQFABRIC_API void setZoom(const Zoom& zoom);
94 
96  EQFABRIC_API const Zoom& getZoom() const;
97 
99  EQFABRIC_API const co::ObjectVersion& getDataVersion(const Eye) const;
101 
103  EQFABRIC_API
104  const std::vector<uint128_t>& getInputNodes(const Eye eye) const;
105 
107  EQFABRIC_API const co::NodeIDs& getInputNetNodes(const Eye eye) const;
108 
109 protected:
110  virtual ChangeType getChangeType() const { return INSTANCE; }
111  EQFABRIC_API virtual void getInstanceData(co::DataOStream& os);
112  EQFABRIC_API virtual void applyInstanceData(co::DataIStream& is);
113 
115  EQFABRIC_API void _setDataVersion(const unsigned i,
116  const co::ObjectVersion& ov);
117 
119  EQFABRIC_API std::vector<uint128_t>& _getInputNodes(const unsigned i);
120 
122  EQFABRIC_API co::NodeIDs& _getInputNetNodes(const unsigned i);
123 
124 private:
125  detail::Frame* const _impl;
126 };
127 
128 inline bool operator&(const Frame::Buffer l, const Frame::Buffer r)
129 {
130  return (static_cast<uint32_t>(l) & static_cast<uint32_t>(r));
131 }
132 
133 inline Frame::Buffer operator|(const Frame::Buffer l, const Frame::Buffer r)
134 {
135  return static_cast<Frame::Buffer>(static_cast<uint32_t>(l) |
136  static_cast<uint32_t>(r));
137 }
138 
139 inline Frame::Buffer& operator&=(Frame::Buffer& l, const Frame::Buffer r)
140 {
141  l = static_cast<Frame::Buffer>(static_cast<uint32_t>(l) &
142  static_cast<uint32_t>(r));
143  return l;
144 }
145 
146 inline Frame::Buffer& operator|=(Frame::Buffer& l, const Frame::Buffer r)
147 {
148  l = static_cast<Frame::Buffer>(static_cast<uint32_t>(l) |
149  static_cast<uint32_t>(r));
150  return l;
151 }
152 
153 inline Frame::Buffer operator~(const Frame::Buffer l)
154 {
155  return static_cast<Frame::Buffer>(~static_cast<uint32_t>(l));
156 }
157 
159 EQFABRIC_API std::ostream& operator<<(std::ostream&, const Frame&);
161 EQFABRIC_API std::ostream& operator<<(std::ostream&, const Frame::Type);
163 EQFABRIC_API std::ostream& operator<<(std::ostream&, const Frame::Buffer);
164 }
165 }
166 
167 #endif // EQFABRIC_FRAME_H
A zoom specification with methods for manipulation.
Definition: zoom.h:35
Defines export visibility macros for library EqualizerFabric.
Type
The storage type for pixel data.
Definition: fabric/frame.h:52
Eye
Eye pass bit mask for which rendering is enabled.
Definition: fabric/eye.h:31
A holder for a frame data and related parameters.
Definition: fabric/frame.h:35
The Equalizer client library.
Definition: eq/agl/types.h:23
use main memory to store pixel data
Definition: fabric/frame.h:54
std::ostream & operator<<(std::ostream &os, const AxisEvent &event)
Print the axis event to the given output stream.
Definition: axisEvent.h:49
Buffer
Components of the frame are to be used during readback and assembly.
Definition: fabric/frame.h:42