Equalizer  1.13.0
Parallel Rendering Framework
compositor.h
1 
2 /* Copyright (c) 2007-2016, 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 EQ_COMPOSITOR_H
19 #define EQ_COMPOSITOR_H
20 
21 #include <eq/frame.h> // nested type Frame::Buffer
22 #include <eq/types.h> // type definitions
23 
24 #include <eq/fabric/pixel.h> // member
25 #include <eq/fabric/zoom.h> // member
26 
27 #include <vector>
28 
29 namespace eq
30 {
42 class EQ_API Compositor
43 {
44 public:
57  static uint32_t assembleFrames( const Frames& frames,
58  Channel* channel, util::Accum* accum );
59 
72  static uint32_t blendFrames( const Frames& frames, Channel* channel,
73  util::Accum* accum );
74  static uint32_t blendImages( const ImageOps& images, Channel* channel,
75  util::Accum* accum );
76 
87  static uint32_t assembleFramesUnsorted( const Frames& frames,
88  Channel* channel,
89  util::Accum* accum );
90 
108  static uint32_t assembleFramesCPU( const Frames& frames, Channel* channel,
109  const bool blend = false );
110  static uint32_t assembleImagesCPU( const ImageOps& ops, Channel* channel,
111  const bool blend );
112 
123  static const Image* mergeFramesCPU( const Frames& frames,
124  const bool blend = false,
125  const uint32_t timeout = LB_TIMEOUT_INDEFINITE );
126  static const Image* mergeImagesCPU( const ImageOps& ops, const bool blend );
127 
132  static void assembleFrame( const Frame* frame, Channel* channel );
134 
135 
144  static void assembleImage( const ImageOp& operation, Channel* channel );
145 
152  static void setupStencilBuffer( const ImageOp& operation,
153  const Channel* channel );
154 
160  static void clearStencilBuffer( const ImageOp& operation );
161 
167  static void setupAssemblyState( const PixelViewport& pvp,
168  const GLEWContext* gl );
169 
173  static void resetAssemblyState();
174 
176  static void assembleImage2D( const ImageOp& op, Channel* channel );
178  static void assembleImageDB( const ImageOp& op, Channel* channel );
179 
184  static void assembleImageDB_FF( const ImageOp& op, Channel* channel );
185 
190  static void assembleImageDB_GLSL( const ImageOp& op, Channel* channel );
192 
201  static void declareRegion( const ImageOp& op, Channel* channel );
203 
207  class WaitHandle;
208 
210  static WaitHandle* startWaitFrames( const Frames& frames,
211  Channel* channel );
212 
225  static Frame* waitFrame( WaitHandle* handle );
227 
230  static bool isSubPixelDecomposition( const Frames& frames );
231  static bool isSubPixelDecomposition( const ImageOps& ops );
232  static Frames extractOneSubPixel( Frames& frames );
233  static ImageOps extractOneSubPixel( ImageOps& ops );
235 
236 private:
237  typedef std::pair< const Frame*, const Image* > FrameImage;
238 };
239 }
240 
241 #endif // EQ_COMPOSITOR_H
std::vector< ImageOp > ImageOps
A vector of image compositing operations.
Definition: eq/types.h:174
A channel represents a two-dimensional viewport within a Window.
Definition: channel.h:43
A C++ class to abstract an accumulation buffer.
Definition: accum.h:39
A set of functions performing compositing for a set of input frames.
Definition: compositor.h:42
A structure describing an image assembly task, used by the Compositor.
Definition: imageOp.h:31
A holder for pixel data.
Definition: image.h:36
The Equalizer client library.
Definition: eq/agl/types.h:23
std::vector< Frame * > Frames
A vector of pointers to eq::Frame.
Definition: eq/types.h:158
A holder for a frame data and related parameters.
Definition: frame.h:43