Equalizer  1.12.0
Parallel Rendering Framework
eq::Compositor Class Reference

A set of functions performing compositing for a set of input frames. More...

#include <compositor.h>

+ Collaboration diagram for eq::Compositor:

Static Public Member Functions

Frame-based operations.
static uint32_t assembleFrames (const Frames &frames, Channel *channel, util::Accum *accum)
 Assemble all frames in an arbitrary order using the fastest implemented algorithm on the given channel. More...
 
static uint32_t blendFrames (const Frames &frames, Channel *channel, util::Accum *accum)
 Assemble all frames in the given order using the fastest implemented algorithm on the given channel. More...
 
static uint32_t blendImages (const ImageOps &images, Channel *channel, util::Accum *accum)
 
static uint32_t assembleFramesUnsorted (const Frames &frames, Channel *channel, util::Accum *accum)
 Assemble all frames in the order they become available directly on the given channel. More...
 
static uint32_t assembleFramesCPU (const Frames &frames, Channel *channel, const bool blend=false)
 Assemble all frames in the given order in a memory buffer using the CPU before assembling the result on the given channel. More...
 
static uint32_t assembleImagesCPU (const ImageOps &ops, Channel *channel, const bool blend)
 
static const ImagemergeFramesCPU (const Frames &frames, const bool blend=false, const uint32_t timeout=LB_TIMEOUT_INDEFINITE)
 Merge the provided frames in the given order into one image in main memory. More...
 
static const ImagemergeImagesCPU (const ImageOps &ops, const bool blend)
 
static void assembleFrame (const Frame *frame, Channel *channel)
 Assemble a frame into the frame buffer using the default algorithm. More...
 
Image-based operations.
static void assembleImage (const ImageOp &operation, Channel *channel)
 Assemble an image into the frame buffer. More...
 
static void setupStencilBuffer (const ImageOp &operation, const Channel *channel)
 Setup the stencil buffer for a pixel compound recomposition. More...
 
static void clearStencilBuffer (const ImageOp &operation)
 Clear the stencil buffer after a pixel compound recomposition. More...
 
static void setupAssemblyState (const PixelViewport &pvp, const GLEWContext *gl)
 Setup the OpenGL state. More...
 
static void resetAssemblyState ()
 Reset the OpenGL state.
 
static void assembleImage2D (const ImageOp &op, Channel *channel)
 Start a tile-based assembly of the image color attachment. More...
 
static void assembleImageDB (const ImageOp &op, Channel *channel)
 Start a Z-based assembly of the image color and depth attachment. More...
 
static void assembleImageDB_FF (const ImageOp &op, Channel *channel)
 Start a Z-based assembly of the image color and depth attachment, based on OpenGL 1.1 functionality.
 
static void assembleImageDB_GLSL (const ImageOp &op, Channel *channel)
 Start a Z-based assembly of the image color and depth attachment, using GLSL.
 
Region of Interest.
static void declareRegion (const ImageOp &op, Channel *channel)
 Declare the region covered by the image on the operation's channel. More...
 
Early assembly.
static WaitHandle * startWaitFrames (const Frames &frames, Channel *channel)
 Start waiting on a set of input frames. More...
 
static FramewaitFrame (WaitHandle *handle)
 Wait for one input frame from a set of pending frames. More...
 
Introspection and setup
static bool isSubPixelDecomposition (const Frames &frames)
 
static bool isSubPixelDecomposition (const ImageOps &ops)
 
static Frames extractOneSubPixel (Frames &frames)
 
static ImageOps extractOneSubPixel (ImageOps &ops)
 

Detailed Description

A set of functions performing compositing for a set of input frames.

The following diagram depicts the call flow within the compositor. Typically, an application uses one of the entry functions assembleFrames() or assembleFramesUnsorted(), but the various lower-level functions are still useful for advanced tasks, e.g., mergeFramesCPU() to perform compositing on the CPU into a main memory buffer.

Definition at line 42 of file compositor.h.

Member Function Documentation

static void eq::Compositor::assembleFrame ( const Frame frame,
Channel channel 
)
static

Assemble a frame into the frame buffer using the default algorithm.

Version
1.0
static uint32_t eq::Compositor::assembleFrames ( const Frames frames,
Channel channel,
util::Accum accum 
)
static

Assemble all frames in an arbitrary order using the fastest implemented algorithm on the given channel.

Parameters
framesthe frames to assemble.
channelthe destination channel.
accumthe accumulation buffer.
Returns
the number of different subpixel steps assembled.
Version
1.0
static uint32_t eq::Compositor::assembleFramesCPU ( const Frames frames,
Channel channel,
const bool  blend = false 
)
static

Assemble all frames in the given order in a memory buffer using the CPU before assembling the result on the given channel.

If alpha-blending is enabled, the images are blended into the intermediate image in main memory as if using: glBlendFuncSeparate( GL_ONE, GL_SRC_ALPHA, GL_ZERO, GL_SRC_ALPHA ). The resulting image is composited into the current framebuffer, using preset OpenGL blending state.

Parameters
framesthe frames to assemble.
channelthe destination channel.
blendblend color-only images if they have an alpha channel
Returns
the number of different subpixel steps assembled (0 or 1).
Version
1.0
static uint32_t eq::Compositor::assembleFramesUnsorted ( const Frames frames,
Channel channel,
util::Accum accum 
)
static

Assemble all frames in the order they become available directly on the given channel.

Parameters
framesthe frames to assemble.
channelthe destination channel.
accumthe accumulation buffer.
Returns
the number of different subpixel steps assembled.
Version
1.0
static void eq::Compositor::assembleImage ( const ImageOp operation,
Channel channel 
)
static

Assemble an image into the frame buffer.

Parameters
operationan ImageOp struct describing the operation.
channelthe destination channel
static void eq::Compositor::assembleImage2D ( const ImageOp op,
Channel channel 
)
static

Start a tile-based assembly of the image color attachment.

static void eq::Compositor::assembleImageDB ( const ImageOp op,
Channel channel 
)
static

Start a Z-based assembly of the image color and depth attachment.

static uint32_t eq::Compositor::blendFrames ( const Frames frames,
Channel channel,
util::Accum accum 
)
static

Assemble all frames in the given order using the fastest implemented algorithm on the given channel.

For alpha-blending see comment for assembleFramesCPU().

Parameters
framesthe frames to assemble.
channelthe destination channel.
accumthe accumulation buffer.
Returns
the number of different subpixel steps assembled.
Version
1.11
static void eq::Compositor::clearStencilBuffer ( const ImageOp operation)
static

Clear the stencil buffer after a pixel compound recomposition.

Parameters
operationthe assembly parameters.
static void eq::Compositor::declareRegion ( const ImageOp op,
Channel channel 
)
static

Declare the region covered by the image on the operation's channel.

Called from all assembleImage methods.

Version
1.3
static const Image* eq::Compositor::mergeFramesCPU ( const Frames frames,
const bool  blend = false,
const uint32_t  timeout = LB_TIMEOUT_INDEFINITE 
)
static

Merge the provided frames in the given order into one image in main memory.

The returned image does not have to be freed. The compositor maintains one image per thread, that is, the returned image is valid until the next usage of the compositor in the current thread.

Version
1.0
static void eq::Compositor::setupAssemblyState ( const PixelViewport &  pvp,
const GLEWContext *  gl 
)
static

Setup the OpenGL state.

Parameters
pvpthe current pixel viewport.
glthe OpenGL function table
static void eq::Compositor::setupStencilBuffer ( const ImageOp operation,
const Channel channel 
)
static

Setup the stencil buffer for a pixel compound recomposition.

Parameters
operationthe assembly parameters.
channelthe destination channel
static WaitHandle* eq::Compositor::startWaitFrames ( const Frames frames,
Channel channel 
)
static

Start waiting on a set of input frames.

Version
1.3.1
static Frame* eq::Compositor::waitFrame ( WaitHandle *  handle)
static

Wait for one input frame from a set of pending frames.

Before the first call, a wait handle is acquired using startWaitFrames(). When all frames have been processed, 0 is returned and the wait handle is invalidated. If the wait times out, an exception is thrown and the wait handle in invalidated.

Parameters
handlethe wait handle acquires using startWaitFrames().
Returns
One ready frame, or 0 if all frames have been processed.
Version
1.3.1

The documentation for this class was generated from the following file: