Equalizer  1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
fabric/frame.h
1 
2 /* Copyright (c) 2012-2014, Stefan Eilemann <eile@eyescale.ch>
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_FRAME_H
19 #define EQFABRIC_FRAME_H
20 
21 #include <eq/fabric/api.h>
22 #include <eq/fabric/eye.h> // enum
23 #include <eq/fabric/types.h>
24 #include <co/object.h> // base class
25 
26 namespace eq
27 {
28 namespace fabric
29 {
30 namespace detail { class Frame; }
32  class Frame : public co::Object
33  {
34  public:
40  enum Buffer
41  {
42  BUFFER_NONE = LB_BIT_NONE,
43  BUFFER_UNDEFINED = LB_BIT1,
44  BUFFER_COLOR = LB_BIT5,
45  BUFFER_DEPTH = LB_BIT9,
46  BUFFER_ALL = LB_BIT_ALL_32
47  };
48 
50  enum Type
51  {
54  };
55 
57  EQFABRIC_API Frame();
58 
60  EQFABRIC_API virtual ~Frame();
61 
65  EQFABRIC_API void setName( const std::string& name );
66 
68  EQFABRIC_API const std::string& getName() const;
69 
71  EQFABRIC_API const Vector2i& getOffset() const;
72 
81  EQFABRIC_API void setOffset( const Vector2i& offset );
82 
91  EQFABRIC_API void setZoom( const Zoom& zoom );
92 
94  EQFABRIC_API const Zoom& getZoom() const;
95 
97  EQFABRIC_API const co::ObjectVersion& getDataVersion( const Eye ) const;
99 
101  EQFABRIC_API
102  const std::vector< uint128_t >& getInputNodes( const Eye eye ) const;
103 
105  EQFABRIC_API const co::NodeIDs& getInputNetNodes(const Eye eye) const;
106 
107  protected:
108  virtual ChangeType getChangeType() const { return INSTANCE; }
109  EQFABRIC_API virtual void getInstanceData( co::DataOStream& os );
110  EQFABRIC_API virtual void applyInstanceData( co::DataIStream& is );
111 
113  EQFABRIC_API void _setDataVersion( const unsigned i,
114  const co::ObjectVersion& ov );
115 
117  EQFABRIC_API std::vector< uint128_t >& _getInputNodes( const unsigned i );
118 
120  EQFABRIC_API co::NodeIDs& _getInputNetNodes( const unsigned i );
121 
122  private:
123  detail::Frame* const _impl;
124  };
125 
127  EQFABRIC_API std::ostream& operator << ( std::ostream&, const Frame& );
129  EQFABRIC_API std::ostream& operator << ( std::ostream&, const Frame::Type );
131  EQFABRIC_API std::ostream& operator << (std::ostream&, const Frame::Buffer);
132 }
133 }
134 
135 namespace lunchbox
136 {
137 template<> inline void byteswap( eq::fabric::Frame::Type& value )
138  { byteswap( reinterpret_cast< uint32_t& >( value )); }
139 }
140 #endif // EQFABRIC_FRAME_H
EQFABRIC_API void setName(const std::string &name)
Set the name of the frame.
A zoom specification with methods for manipulation.
Definition: zoom.h:34
EQFABRIC_API Frame()
Construct a new frame.
Buffer
The buffer format defines which components of the frame are to be used during readback and assembly...
Definition: fabric/frame.h:40
EQFABRIC_API void setOffset(const Vector2i &offset)
Set the position of the frame wrt the channel.
Type
The storage type for pixel data.
Definition: fabric/frame.h:50
virtual EQFABRIC_API ~Frame()
Destruct the frame.
Eye
Eye pass bit mask for which is enabled.
Definition: fabric/eye.h:33
use a GL texture to store pixel data
Definition: fabric/frame.h:53
A holder for a frame data and related parameters.
Definition: fabric/frame.h:32
Inherit, only if no others are set.
Definition: fabric/frame.h:43
EQFABRIC_API const Zoom & getZoom() const
use main memory to store pixel data
Definition: fabric/frame.h:52
EQFABRIC_API const std::string & getName() const
EQFABRIC_API void setZoom(const Zoom &zoom)
Set the zoom for this frame holder.
EQFABRIC_API const Vector2i & getOffset() const
vmml::vector< 2, int > Vector2i
A two-component integer vector.
Definition: vmmlib.h:42