00001 #ifndef Impala_Core_Stream_RgbDataDstFactory_h
00002 #define Impala_Core_Stream_RgbDataDstFactory_h
00003
00004 #include "Core/Stream/RgbDataDst.h"
00005 #ifdef OGL_USED
00006 #include "Core/Stream/RgbDataDstOgl.h"
00007 #endif
00008 #ifdef DX_USED
00009 #include "Core/Stream/RgbDataDstWin.h"
00010 #include "Core/Stream/RgbDataDstDX.h"
00011 #include "Core/Stream/RgbDataDstAVI.h"
00012 #endif
00013
00014 namespace Impala
00015 {
00016 namespace Core
00017 {
00018 namespace Stream
00019 {
00020
00021
00022 class RgbDataDstFactory
00023 {
00024 public:
00025
00026 static const int DST_OGL = 1;
00027 static const int DST_WIN = 2;
00028 static const int DST_DX = 4;
00029 static const int DST_AVI = 8;
00030
00031
00032 ~RgbDataDstFactory()
00033 {
00034 }
00035
00036 static RgbDataDstFactory&
00037 Instance()
00038 {
00039 static RgbDataDstFactory theFactory;
00040 return theFactory;
00041 }
00042
00043 RgbDataDst*
00044 Construct(int dst, CString dstName, int imageWidth, int imageHeight)
00045 {
00046 #ifdef OGL_USED
00047 if (dst & DST_OGL)
00048 return new RgbDataDstOgl(dst, dstName, imageWidth, imageHeight);
00049 #endif
00050 #ifdef DX_USED
00051 if (dst & DST_WIN)
00052 return new RgbDataDstWin(dst, dstName, imageWidth, imageHeight);
00053 if (dst & DST_DX)
00054 return new RgbDataDstDX(dst, dstName, imageWidth, imageHeight);
00055 if (dst & DST_AVI)
00056 return new RgbDataDstAVI(dst, dstName, imageWidth, imageHeight);
00057 #endif
00058 ILOG_ERROR("RgbDataDstFactory : construct failed");
00059 return 0;
00060 }
00061
00062
00063 private:
00064
00065
00066 RgbDataDstFactory()
00067 {
00068 mDummy = DST_OGL;
00069 }
00070
00071 RgbDataDstFactory(const RgbDataDstFactory&)
00072 {
00073 }
00074
00075 RgbDataDstFactory&
00076 operator=(const RgbDataDstFactory&);
00077
00078 int mDummy;
00079
00080 ILOG_VAR_DECL;
00081 };
00082
00083 ILOG_VAR_INIT(RgbDataDstFactory, Impala.Core.Stream);
00084
00085 }
00086 }
00087 }
00088
00089 #endif