00001
00002
00003
00004
00005 #ifndef EQ_COMPOSITOR_H
00006 #define EQ_COMPOSITOR_H
00007
00008 #include <eq/client/pixel.h>
00009 #include <eq/client/types.h>
00010 #include <eq/base/base.h>
00011
00012 #include <vmmlib/vector2.h>
00013 #include <vector>
00014
00015 namespace eq
00016 {
00017 class Channel;
00018 class Frame;
00019 class Image;
00020
00022 class EQ_EXPORT Compositor
00023 {
00024 public:
00026 struct ImageOp
00027 {
00028 ImageOp() : channel( 0 ), buffers( 0 )
00029 , offset( vmml::Vector2i::ZERO ) {}
00030
00031 Channel* channel;
00032 uint32_t buffers;
00033 vmml::Vector2i offset;
00034 Pixel pixel;
00035 };
00036
00038
00046 static void assembleFrames( const FrameVector& frames,
00047 Channel* channel );
00048
00060 static void assembleFramesSorted( const FrameVector& frames,
00061 Channel* channel,
00062 const bool blendAlpha = false );
00063
00071 static void assembleFramesUnsorted( const FrameVector& frames,
00072 Channel* channel );
00073
00090 static void assembleFramesCPU( const FrameVector& frames,
00091 Channel* channel,
00092 const bool blendAlpha = false );
00093
00094 static const Image* assembleFramesCPU(const FrameVector& frames,
00095 const bool blendAlpha = false );
00096
00098 static void assembleFrame( const Frame* frame, Channel* channel );
00099
00100
00101
00103
00110 static void assembleImage( const Image* image,
00111 const ImageOp& operation );
00112
00119 static void setupStencilBuffer( const Image* image,
00120 const ImageOp& operation );
00121
00123 static void assembleImage2D( const Image* image, const ImageOp& op );
00125 static void assembleImageDB( const Image* image, const ImageOp& op );
00126
00131 static void assembleImageDB_FF( const Image* image, const ImageOp& op );
00132
00137 static void assembleImageDB_GLSL( const Image* image,
00138 const ImageOp& op );
00139
00140
00141 private:
00142 typedef std::pair< const Frame*, const Image* > FrameImage;
00143
00144 static void _assembleDBImages( Image* result,
00145 const std::vector< FrameImage >& images);
00146 static void _assemble2DImages( Image* result,
00147 const std::vector< FrameImage >& images);
00148 static void _assembleBlendImages( Image* result,
00149 const std::vector< FrameImage >& images);
00150 static bool _assembleImage_PC( int operation, Image* result,
00151 const Image* source );
00152
00153 };
00154 }
00155
00156 #endif // EQ_COMPOSITOR_H
00157