digiKam
effectmngr_p.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2017-05-24
7  * Description : video frame effects manager.
8  *
9  * Copyright (C) 2017-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  *
11  * This program is free software; you can redistribute it
12  * and/or modify it under the terms of the GNU General
13  * Public License as published by the Free Software Foundation;
14  * either version 2, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * ============================================================ */
22 
23 #ifndef DIGIKAM_EFFECT_MNGR_PRIVATE_H
24 #define DIGIKAM_EFFECT_MNGR_PRIVATE_H
25 
26 // C++ includes
27 
28 #include <cmath>
29 
30 // Qt includes
31 
32 #include <QPointF>
33 #include <QRect>
34 #include <QRectF>
35 #include <QImage>
36 
37 // Local includes
38 
39 #include "effectmngr.h"
40 #include "digikam_config.h"
41 #include "digikam_debug.h"
42 
43 namespace Digikam
44 {
45 
46 class Q_DECL_HIDDEN EffectMngr::Private
47 {
48 public:
49 
50  typedef int (EffectMngr::Private::*EffectMethod)(bool);
51 
52 public:
53 
54  explicit Private()
55  : eff_isRunning(false),
56  eff_curEffect(EffectMngr::None),
57  eff_step(0),
58  eff_imgFrames(125)
59  {
60  registerEffects();
61  }
62 
64  {
65  }
66 
67  QMap<EffectMngr::EffectType, EffectMethod> eff_effectList;
68 
69  QImage eff_image;
70  QImage eff_curFrame;
71  QSize eff_outSize;
72 
75 
76  int eff_step;
78 
79 public:
80 
81  void registerEffects();
82 
83  EffectMngr::EffectType getRandomEffect() const;
84 
85 private:
86 
95  int effectNone(bool aInit);
96  int effectRandom(bool aInit);
97  int effectKenBurnsZoomIn(bool aInit);
98  int effectKenBurnsZoomOut(bool aInit);
99  int effectKenBurnsPanLR(bool aInit);
100  int effectKenBurnsPanRL(bool aInit);
101  int effectKenBurnsPanTB(bool aInit);
102  int effectKenBurnsPanBT(bool aInit);
103 
104  void updateCurrentFrame(const QRectF& area);
105 };
106 
107 } // namespace Digikam
108 
109 #endif // DIGIKAM_EFFECT_MNGR_PRIVATE_H
Definition: effectmngr_p.h:47
Private()
Definition: effectmngr_p.h:54
int eff_imgFrames
Definition: effectmngr_p.h:77
int eff_step
Definition: effectmngr_p.h:76
QSize eff_outSize
Definition: effectmngr_p.h:71
QMap< EffectMngr::EffectType, EffectMethod > eff_effectList
Definition: effectmngr_p.h:67
QImage eff_image
Definition: effectmngr_p.h:69
EffectMngr::EffectType eff_curEffect
Definition: effectmngr_p.h:74
~Private()
Definition: effectmngr_p.h:63
QImage eff_curFrame
Definition: effectmngr_p.h:70
bool eff_isRunning
Definition: effectmngr_p.h:73
Definition: effectmngr.h:40
EffectType
Definition: effectmngr.h:47
Definition: datefolderview.cpp:43