cstool/uberscreenshot.h
00001 /* 00002 Copyright (C) 2006 by Frank Richter 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License as published by the Free Software Foundation; either 00007 version 2 of the License, or (at your option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public 00015 License along with this library; if not, write to the Free 00016 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 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__
Generated for Crystal Space 2.0 by doxygen 1.6.1