/usr/include/crystalspace-2.0/cstool/uberscreenshot.h is in libcrystalspace-dev 2.0+dfsg-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | /*
Copyright (C) 2006 by Frank Richter
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __CSTOOL_UBERSCREENSHOT_H__
#define __CSTOOL_UBERSCREENSHOT_H__
#include "iengine/engine.h"
#include "igraphic/image.h"
#include "ivaria/view.h"
#include "ivideo/graph2d.h"
#include "ivideo/graph3d.h"
class csImageMemory;
namespace CS
{
/**
* Helper to create "überscreenshots", screenshots with a resolution
* larger than the current framebuffer resolution.
*
* It works by splitting up the ubershot into tiles, creating multiple
* screenshots (one for each tile) and stitching those tiles together into
* a larger image.
*
* \remarks Since the ubershot maker bypasses the normal event loop to
* render the tiles, e.g. GUI elements can't appear on the screenshot.
* However, you can derive a custom uberscreenshot maker from this
* class which implements a custom ShootTile() method to handle GUI
* drawing
*/
class CS_CRYSTALSPACE_EXPORT UberScreenshotMaker
{
protected:
/// Width of the uberscreenshot
uint ubershotW;
/// Height of the uberscreenshot
uint ubershotH;
/// Width of the framebuffer
uint screenW;
/// Height of the framebuffer
uint screenH;
csRef<iGraphics3D> g3d;
csRef<iGraphics2D> g2d;
csRef<iEngine> engine;
/// View used to render the tiles
csRef<iView> shotView;
/// Original camera
csRef<iCamera> originalCam;
/**
* Draw the view, set up to cover the current tile.
*/
virtual bool DrawTile3D (uint tileLeft, uint tileTop,
uint tileRight, uint tileBottom);
/**
* Take and crop the actual screenshot.
*/
virtual csRef<iImage> TakeScreenshot (uint tileLeft, uint tileTop,
uint tileRight, uint tileBottom);
/**
* Shoot the image for a single tile. The area of the tile on the
* ubershot is given by the parameters.
*
* Any custom implementations should call DrawTile3D(), do any custom
* drawing, and finally call TakeScreenshot().
*/
virtual csRef<iImage> ShootTile (uint tileLeft, uint tileTop,
uint tileRight, uint tileBottom)
{
if (!DrawTile3D (tileLeft, tileTop, tileRight, tileBottom))
return 0;
return TakeScreenshot (tileLeft, tileTop, tileRight, tileBottom);
}
/**
* Post-process the final image (e.g. add watermark). By default does
* nothing.
*/
virtual csRef<iImage> PostProcessImage (csImageMemory* img);
/// Setup the shotView member.
void Setup (iCamera* camera, iEngine* engine, iGraphics3D* g3d);
public:
/// Initialize for dimensions \p width and \p height.
UberScreenshotMaker (uint width, uint height, iCamera* camera,
iEngine* engine, iGraphics3D* g3d);
/// Initialize, with camera, engine and g3d taken from \p view.
UberScreenshotMaker (uint width, uint height, iView* view);
/// Destroy.
virtual ~UberScreenshotMaker() {}
/// Create an uberscreenshot.
csPtr<iImage> Shoot ();
};
}
#endif // __CSTOOL_UBERSCREENSHOT_H__
|