Equalizer  2.1.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 {
43 class EQ_API Compositor
44 {
45 public:
58  static uint32_t assembleFrames(const Frames& frames, Channel* channel,
59  util::Accum* accum);
60 
73  static uint32_t blendFrames(const Frames& frames, Channel* channel,
74  util::Accum* accum);
75  static uint32_t blendImages(const ImageOps& images, Channel* channel,
76  util::Accum* accum);
77 
88  static uint32_t assembleFramesUnsorted(const Frames& frames,
89  Channel* channel,
90  util::Accum* accum);
91 
109  static uint32_t assembleFramesCPU(const Frames& frames, Channel* channel,
110  const bool blend = false);
111  static uint32_t assembleImagesCPU(const ImageOps& ops, Channel* channel,
112  const bool blend);
113 
124  static const Image* mergeFramesCPU(
125  const Frames& frames, const bool blend = false,
126  const uint32_t timeout = LB_TIMEOUT_INDEFINITE);
127  static const Image* mergeImagesCPU(const ImageOps& ops, const bool blend);
128 
133  static void assembleFrame(const Frame* frame, Channel* channel);
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, Channel* channel);
211 
224  static Frame* waitFrame(WaitHandle* handle);
226 
229  static bool isSubPixelDecomposition(const Frames& frames);
230  static bool isSubPixelDecomposition(const ImageOps& ops);
231  static Frames extractOneSubPixel(Frames& frames);
232  static ImageOps extractOneSubPixel(ImageOps& ops);
234 
235 private:
236  typedef std::pair<const Frame*, const Image*> FrameImage;
237 };
238 }
239 
240 #endif // EQ_COMPOSITOR_H
std::vector< ImageOp > ImageOps
A vector of image compositing operations.
Definition: eq/types.h:177
A channel represents a two-dimensional viewport within a Window.
Definition: channel.h:46
A C++ class to abstract an accumulation buffer.
Definition: accum.h:42
A set of functions performing compositing for a set of input frames.
Definition: compositor.h:43
A structure describing an image assembly task, used by the Compositor.
Definition: imageOp.h:32
std::vector< Frame * > Frames
A vector of pointers to eq::Frame.
Definition: eq/types.h:161
A holder for pixel data.
Definition: image.h:39
The Equalizer client library.
Definition: eq/agl/types.h:23
A holder for a frame data and related parameters.
Definition: frame.h:46