Equalizer  1.11.0
Parallel Rendering Framework
fabric/frameData.h
1 
2 /* Copyright (c) 2006-2016, Stefan Eilemann <eile@equalizergraphics.com>
3  * Daniel Nachbaur <danielnachbaur@gmail.com>
4  *
5  * This library is free software; you can redistribute it and/or modify it under
6  * the terms of the GNU Lesser General Public License version 2.1 as published
7  * by the Free Software Foundation.
8  *
9  * This library is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12  * details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with this library; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18 
19 #ifndef EQFABRIC_FRAMEDATA_H
20 #define EQFABRIC_FRAMEDATA_H
21 
22 #include <eq/fabric/api.h>
23 #include <eq/fabric/types.h>
24 #include <eq/fabric/vmmlib.h>
25 
26 #include <eq/fabric/frame.h> // for Frame::Type
27 #include <eq/fabric/renderContext.h> // member
28 
29 namespace eq
30 {
31 namespace fabric
32 {
33 class FrameData
34 {
35 public:
36  FrameData() : _frameType( Frame::TYPE_MEMORY ), _buffers( 0 ) {}
37 
45  void setPixelViewport( const PixelViewport& pvp ) { _pvp = pvp; }
46 
48  const PixelViewport& getPixelViewport() const { return _pvp; }
49 
51  void setBuffers( const uint32_t buffers ) { _buffers = buffers; }
52 
54  void disableBuffer( const Frame::Buffer buffer ) { _buffers &= ~buffer; }
55 
57  uint32_t getBuffers() const { return _buffers; }
58 
60  void setContext( const RenderContext& context ) { _context = context; }
61 
63  const RenderContext& getContext() const { return _context; }
64  RenderContext& getContext() { return _context; }
65 
67  void setZoom( const Zoom& zoom ) { _zoom = zoom; }
68 
70  const Zoom& getZoom() const { return _zoom; }
71 
77  void setType( const fabric::Frame::Type type ) { _frameType = type; }
78 
80  Frame::Type getType() const { return _frameType; }
81 
82  EQFABRIC_API void serialize( co::DataOStream& os ) const;
83  EQFABRIC_API void deserialize( co::DataIStream& is );
84 
85 protected:
86  PixelViewport _pvp;
87  RenderContext _context; //<! source channel render context
88  Zoom _zoom;
89  Frame::Type _frameType;
90  uint32_t _buffers;
91  template< class T > friend void lunchbox::byteswap( T& );
92 };
93 
94 }
95 }
96 
97 namespace lunchbox
98 {
99 template<> inline void byteswap( eq::fabric::FrameData& value )
100 {
101  byteswap( value._pvp );
102  byteswap( value._context );
103  byteswap( value._zoom );
104  byteswap( value._frameType );
105  byteswap( value._buffers );
106 }
107 }
108 
109 #endif // EQFABRIC_FRAMEDATA_H
A zoom specification with methods for manipulation.
Definition: zoom.h:35
const RenderContext & getContext() const
Defines export visibility macros for library EqualizerFabric.
void disableBuffer(const Frame::Buffer buffer)
Disable the usage of a frame buffer attachment for all images.
Frame::Type getType() const
uint32_t getBuffers() const
const Zoom & getZoom() const
Buffer
Components of the frame are to be used during readback and assembly.
Definition: fabric/frame.h:39
const PixelViewport & getPixelViewport() const
void setType(const fabric::Frame::Type type)
Set the frame storage type.
Type
The storage type for pixel data.
Definition: fabric/frame.h:49
The Equalizer client library.
Definition: eq/agl/types.h:23
use main memory to store pixel data
Definition: fabric/frame.h:51
void setZoom(const Zoom &zoom)
Set additional zoom for input frames.
void setBuffers(const uint32_t buffers)
Set the (color, depth) buffers of the source frame.
void setPixelViewport(const PixelViewport &pvp)
Set the covered area for readbacks.
void setContext(const RenderContext &context)
Set the source context decomposition wrt dest channel.
The context applied to a channel during rendering operations.
Definition: renderContext.h:37
Holds a 2D pixel viewport with methods for manipulation.
Definition: pixelViewport.h:34