Equalizer  1.6.1
fabric/frame.h
1 
2 /* Copyright (c) 2012, 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 const std::vector< uint128_t >&
102  getInputNodes( const Eye eye ) const;
103 
105  EQFABRIC_API const std::vector< uint128_t >&
106  getInputNetNodes(const Eye eye) const;
107 
108  protected:
109  virtual ChangeType getChangeType() const { return INSTANCE; }
110  EQFABRIC_API virtual void getInstanceData( co::DataOStream& os );
111  EQFABRIC_API virtual void applyInstanceData( co::DataIStream& is );
112 
114  EQFABRIC_API void _setDataVersion( const unsigned i,
115  const co::ObjectVersion& ov );
116 
118  EQFABRIC_API std::vector< uint128_t >& _getInputNodes(const unsigned i);
119 
121  EQFABRIC_API std::vector< uint128_t >&
122  _getInputNetNodes( const unsigned i);
123 
124  private:
125  detail::Frame* const _impl;
126  };
127 
129  EQFABRIC_API std::ostream& operator << ( std::ostream&, const Frame& );
131  EQFABRIC_API std::ostream& operator << ( std::ostream&, const Frame::Type );
133  EQFABRIC_API std::ostream& operator << (std::ostream&, const Frame::Buffer);
134 }
135 }
136 
137 namespace lunchbox
138 {
139 template<> inline void byteswap( eq::fabric::Frame::Type& value )
140  { byteswap( reinterpret_cast< uint32_t& >( value )); }
141 }
142 #endif // EQFABRIC_FRAME_H
void setName(const std::string &name)
Set the name of the frame.
virtual ~Frame()
Destruct the frame.
use a GL texture to store pixel data
Definition: fabric/frame.h:53
const Vector2i & getOffset() const
A holder for a frame data and related parameters.
Definition: fabric/frame.h:32
use main memory to store pixel data
Definition: fabric/frame.h:52
Eye
Eye pass bit mask for which is enabled.
Definition: fabric/eye.h:32
void setZoom(const Zoom &zoom)
Set the zoom for this frame holder.
Frame()
Construct a new frame.
const std::string & getName() const
const Zoom & getZoom() const
void setOffset(const Vector2i &offset)
Set the position of the frame wrt the channel.
A zoom specification with methods for manipulation.
Definition: zoom.h:34
Buffer
The buffer format defines which components of the frame are to be used during readback and assembly...
Definition: fabric/frame.h:40
Inherit, only if no others are set.
Definition: fabric/frame.h:43
vmml::vector< 2, int > Vector2i
A two-component integer vector.
Definition: vmmlib.h:40
Type
The storage type for pixel data.
Definition: fabric/frame.h:50