18 #ifndef EQ_COMPOSITOR_H
19 #define EQ_COMPOSITOR_H
24 #include <eq/fabric/pixel.h>
25 #include <eq/fabric/zoom.h>
48 ImageOp() : channel( 0 ), buffers( 0 )
49 , offset( Vector2i::ZERO )
72 static uint32_t assembleFrames(
const Frames& frames,
89 static uint32_t assembleFramesSorted(
const Frames& frames,
92 const bool blendAlpha =
false );
104 static uint32_t assembleFramesUnsorted(
const Frames& frames,
126 static uint32_t assembleFramesCPU(
const Frames& frames,
128 const bool blendAlpha =
false );
140 static const Image* mergeFramesCPU(
const Frames& frames,
141 const bool blendAlpha =
false,
142 const uint32_t timeout = LB_TIMEOUT_INDEFINITE );
160 static bool mergeFramesCPU(
const Frames& frames,
161 const bool blendAlpha,
163 const uint32_t colorBufferSize,
165 const uint32_t depthBufferSize,
166 PixelViewport& outPVP,
167 const uint32_t timeout = LB_TIMEOUT_INDEFINITE );
173 static void assembleFrame(
const Frame* frame,
Channel* channel );
185 static void assembleImage(
const Image* image,
194 static void setupStencilBuffer(
const Image* image,
202 static void clearStencilBuffer(
const ImageOp& operation );
209 static void setupAssemblyState(
const PixelViewport& pvp,
210 const GLEWContext* gl );
215 static void resetAssemblyState();
218 static void assembleImage2D(
const Image* image,
const ImageOp& op );
220 static void assembleImageDB(
const Image* image,
const ImageOp& op );
226 static void assembleImageDB_FF(
const Image* image,
const ImageOp& op );
232 static void assembleImageDB_GLSL(
const Image* image,
244 static void declareRegion(
const Image* image,
const ImageOp& op );
253 static WaitHandle* startWaitFrames(
const Frames& frames,
268 static Frame* waitFrame( WaitHandle* handle );
272 typedef std::pair< const Frame*, const Image* > FrameImage;
274 static bool _isSubPixelDecomposition(
const Frames& frames );
275 static const Frames _extractOneSubPixel(
Frames& frames );
277 static bool _collectOutputData(
279 PixelViewport& destPVP,
280 uint32_t& colorInternalFormat,
281 uint32_t& colorPixelSize,
282 uint32_t& colorExternalFormat,
283 uint32_t& depthInternalFormat,
284 uint32_t& depthPixelSize,
285 uint32_t& depthExternalFormat,
286 const uint32_t timeout );
288 static void _collectOutputData(
const PixelData& pixelData,
289 uint32_t& internalFormat,
291 uint32_t& externalFormat );
293 static void _mergeFrames(
const Frames& frames,
294 const bool blendAlpha,
295 void* colorBuffer,
void* depthBuffer,
296 const PixelViewport& destPVP );
298 static void _mergeDBImage(
void* destColor,
void* destDepth,
299 const PixelViewport& destPVP,
301 const Vector2i& offset );
303 static void _merge2DImage(
void* destColor,
void* destDepth,
304 const PixelViewport& destPVP,
306 const Vector2i& offset );
308 static void _mergeBlendImage(
void* dest,
309 const PixelViewport& destPVP,
311 const Vector2i& offset );
312 static bool _mergeImage_PC(
int operation,
void* destColor,
313 void* destDepth,
const Image* source );
317 static void _drawPixelsFF(
const Image* image,
const ImageOp& op,
320 static void _drawPixelsGLSL(
const Image* image,
const ImageOp& op,
323 static bool _setupDrawPixels(
const Image* image,
const ImageOp& op,
326 static Vector4f _getCoords(
const ImageOp& op,
327 const PixelViewport& pvp );
329 template<
typename T >
330 static void _drawTexturedQuad(
const T* key,
const ImageOp& op,
331 const PixelViewport& pvp,
332 const bool withDepth );
339 #endif // EQ_COMPOSITOR_H
uint32_t buffers
The Frame buffer attachments to use.
Zoom zoom
The zoom factor.
ZoomFilter zoomFilter
The zoom Filter from Frame.
A channel represents a two-dimensional viewport within a Window.
A C++ class to abstract an accumulation buffer.
A set of functions performing compositing for a set of input frames.
Vector2i offset
The offset wrt destination window.
The pixel data structure manages the pixel information for images.
Buffer
The buffer format defines which components of the frame are to be used during readback and assembly...
Pixel pixel
The pixel decomposition parameters.
ZoomFilter
Filtering algorithm to applied during zoom operations.
A structure describing an image assembly task.
std::vector< Frame * > Frames
A vector of pointers to eq::Frame.
A holder for a frame data and related parameters.
Channel * channel
The destination channel.