Equalizer  1.2.1
Classes
eq::Compositor Class Reference

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

#include <compositor.h>

List of all members.

Classes

struct  ImageOp
 A structure describing an image assembly task. More...

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.
static uint32_t assembleFramesSorted (const Frames &frames, Channel *channel, util::Accum *accum, const bool blendAlpha=false)
 Assemble all frames in the given order using the fastest implemented algorithm on the given channel.
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.
static uint32_t assembleFramesCPU (const Frames &frames, Channel *channel, const bool blendAlpha=false)
 Assemble all frames in the given order in a memory buffer using the CPU before assembling the result on the given channel.
static const ImagemergeFramesCPU (const Frames &frames, const bool blendAlpha=false, const uint32_t timeout=EQ_TIMEOUT_INDEFINITE)
 Merge the provided frames in the given order into one image in main memory.
static bool mergeFramesCPU (const Frames &frames, const bool blendAlpha, void *colorBuffer, const uint32_t colorBufferSize, void *depthBuffer, const uint32_t depthBufferSize, PixelViewport &outPVP, const uint32_t timeout=EQ_TIMEOUT_INDEFINITE)
 Merge the provided frames into one main memory buffer.
static void assembleFrame (const Frame *frame, Channel *channel)
 Assemble a frame into the frame buffer using the default algorithm.
Image-based operations.
static void assembleImage (const Image *image, const ImageOp &operation)
 Assemble an image into the frame buffer.
static void setupStencilBuffer (const Image *image, const ImageOp &operation)
 Setup the stencil buffer for a pixel compound recomposition.
static void clearStencilBuffer (const ImageOp &operation)
 Clear the stencil buffer after a pixel compound recomposition.
static void setupAssemblyState (const PixelViewport &pvp, const GLEWContext *gl)
 Setup the OpenGL state.
static void resetAssemblyState ()
 Reset the OpenGL state.
static void assembleImage2D (const Image *image, const ImageOp &op)
 Start a tile-based assembly of the image color attachment.
static void assembleImageDB (const Image *image, const ImageOp &op)
 Start a Z-based assembly of the image color and depth attachment.
static void assembleImageDB_FF (const Image *image, const ImageOp &op)
 Start a Z-based assembly of the image color and depth attachment, based on OpenGL 1.1 functionality.
static void assembleImageDB_GLSL (const Image *image, const ImageOp &op)
 Start a Z-based assembly of the image color and depth attachment, using GLSL.

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

Referenced by eVolve::Channel::frameAssemble().

+ Here is the caller graph for this function:

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

Referenced by eqPly::Channel::frameAssemble().

+ Here is the caller graph for this function:

static uint32_t eq::Compositor::assembleFramesCPU ( const Frames frames,
Channel channel,
const bool  blendAlpha = 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 using glBlendFunc( GL_ONE, GL_SRC_ALPHA ) into the current framebuffer.

Parameters:
framesthe frames to assemble.
channelthe destination channel.
blendAlphablend 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::assembleFramesSorted ( const Frames frames,
Channel channel,
util::Accum accum,
const bool  blendAlpha = false 
) [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.
blendAlphablend color-only images if they have an alpha channel
Returns:
the number of different subpixel steps assembled.
Version:
1.0

Referenced by eVolve::Channel::frameAssemble().

+ Here is the caller graph for this function:

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 Image image,
const ImageOp operation 
) [static]

Assemble an image into the frame buffer.

Parameters:
imagethe input image.
operationan ImageOp struct describing the operation.
static void eq::Compositor::assembleImage2D ( const Image image,
const ImageOp op 
) [static]

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

static void eq::Compositor::assembleImageDB ( const Image image,
const ImageOp op 
) [static]

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

static void eq::Compositor::clearStencilBuffer ( const ImageOp operation) [static]

Clear the stencil buffer after a pixel compound recomposition.

Parameters:
operationthe assembly parameters.
static const Image* eq::Compositor::mergeFramesCPU ( const Frames frames,
const bool  blendAlpha = false,
const uint32_t  timeout = EQ_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 bool eq::Compositor::mergeFramesCPU ( const Frames frames,
const bool  blendAlpha,
void *  colorBuffer,
const uint32_t  colorBufferSize,
void *  depthBuffer,
const uint32_t  depthBufferSize,
PixelViewport &  outPVP,
const uint32_t  timeout = EQ_TIMEOUT_INDEFINITE 
) [static]

Merge the provided frames into one main memory buffer.

The callee has to allocate and clear (if needed) the output buffers to hold the necessary data. All input images have to use the same format and type, which will also be the output format. The depth buffer and depth buffer size may be 0, if the images contain no depth information.

The output pixel viewport receives the image size and offset wrt the destination channel.

Returns:
true if the compositing was successful, false otherwise, e.g., a buffer is too small.
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 Image image,
const ImageOp operation 
) [static]

Setup the stencil buffer for a pixel compound recomposition.

Parameters:
imagethe image to be assembled.
operationthe assembly parameters.

The documentation for this class was generated from the following file:
Generated on Fri Jun 8 2012 15:44:35 for Equalizer 1.2.1 by  doxygen 1.8.0