12 #ifndef hifi_SnapshotAnimated_h
13 #define hifi_SnapshotAnimated_h
15 #include <QtCore/QSharedPointer>
16 #include <QtCore/QVector>
17 #include <Application.h>
18 #include <DependencyManager.h>
19 #include <GifCreator.h>
21 #include <SettingHandle.h>
22 #include "scripting/WindowScriptingInterface.h"
26 #define SNAPSNOT_ANIMATED_WIDTH (720)
28 #define SNAPSNOT_ANIMATED_TARGET_FRAMERATE (25)
29 #define SNAPSNOT_ANIMATED_DURATION_SECS (3)
30 #define SNAPSNOT_ANIMATED_DURATION_MSEC (SNAPSNOT_ANIMATED_DURATION_SECS*1000)
32 #define SNAPSNOT_ANIMATED_FRAME_DELAY_MSEC (1000/SNAPSNOT_ANIMATED_TARGET_FRAMERATE)
34 class SnapshotAnimated {
36 static QTimer* snapshotAnimatedTimer;
37 static qint64 snapshotAnimatedTimestamp;
38 static qint64 snapshotAnimatedFirstFrameTimestamp;
39 static bool snapshotAnimatedTimerRunning;
40 static QString snapshotStillPath;
42 static QString snapshotAnimatedPath;
43 static QVector<QImage> snapshotAnimatedFrameVector;
44 static QVector<qint64> snapshotAnimatedFrameDelayVector;
45 static QSharedPointer<WindowScriptingInterface> snapshotAnimatedDM;
46 static float aspectRatio;
48 static GifWriter snapshotAnimatedGifWriter;
50 static void captureFrames();
51 static void processFrames();
52 static void clearTempVariables();
54 static void saveSnapshotAnimated(QString pathStill,
float aspectRatio, QSharedPointer<WindowScriptingInterface> dm);
55 static bool isAlreadyTakingSnapshotAnimated() {
return snapshotAnimatedFirstFrameTimestamp != 0; };