00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __CSTOOL_UBERSCREENSHOT_H__
00020 #define __CSTOOL_UBERSCREENSHOT_H__
00021
00022 #include "iengine/engine.h"
00023 #include "igraphic/image.h"
00024 #include "ivaria/view.h"
00025 #include "ivideo/graph2d.h"
00026 #include "ivideo/graph3d.h"
00027
00028 class csImageMemory;
00029
00030 namespace CS
00031 {
00046 class CS_CRYSTALSPACE_EXPORT UberScreenshotMaker
00047 {
00048 protected:
00050 uint ubershotW;
00052 uint ubershotH;
00054 uint screenW;
00056 uint screenH;
00057
00058 csRef<iGraphics3D> g3d;
00059 csRef<iGraphics2D> g2d;
00060 csRef<iEngine> engine;
00062 csRef<iView> shotView;
00064 csRef<iCamera> originalCam;
00065
00069 virtual bool DrawTile3D (uint tileLeft, uint tileTop,
00070 uint tileRight, uint tileBottom);
00074 virtual csRef<iImage> TakeScreenshot (uint tileLeft, uint tileTop,
00075 uint tileRight, uint tileBottom);
00083 virtual csRef<iImage> ShootTile (uint tileLeft, uint tileTop,
00084 uint tileRight, uint tileBottom)
00085 {
00086 if (!DrawTile3D (tileLeft, tileTop, tileRight, tileBottom))
00087 return 0;
00088 return TakeScreenshot (tileLeft, tileTop, tileRight, tileBottom);
00089 }
00090
00095 virtual csRef<iImage> PostProcessImage (csImageMemory* img);
00096
00098 void Setup (iCamera* camera, iEngine* engine, iGraphics3D* g3d);
00099 public:
00101 UberScreenshotMaker (uint width, uint height, iCamera* camera,
00102 iEngine* engine, iGraphics3D* g3d);
00104 UberScreenshotMaker (uint width, uint height, iView* view);
00106 virtual ~UberScreenshotMaker() {}
00107
00109 csPtr<iImage> Shoot ();
00110 };
00111 }
00112
00113 #endif // __CSTOOL_UBERSCREENSHOT_H__