1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date        : 2017-05-24
7  * Description : images transition manager.
8  *
9  * Copyright (C) 2017-2021 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_TRANSITION_MNGR_H
24 #define DIGIKAM_TRANSITION_MNGR_H
25 
26 // Qt includes
27 
28 #include <QMap>
29 #include <QString>
30 #include <QImage>
31 
32 // Local includes
33 
34 #include "digikam_export.h"
35 
36 namespace Digikam
37 {
38 
39 class DIGIKAM_EXPORT TransitionMngr
40 {
41 public:
42 
43     enum TransType
44     {
45         None = 0,
46         ChessBoard,
47         MeltDown,
48         Sweep,
49         Mosaic,
50         Cubism,
51         Growing,
52         HorizontalLines,
53         VerticalLines,
54         CircleOut,
55         MultiCircleOut,
56         SpiralIn,
57         Blobs,
58         Fade,
59         SlideL2R,
60         SlideR2L,
61         SlideT2B,
62         SlideB2T,
63         PushL2R,
64         PushR2L,
65         PushT2B,
66         PushB2T,
67         SwapL2R,
68         SwapR2L,
69         SwapT2B,
70         SwapB2T,
71         BlurIn,
72         BlurOut,
73         Random
74     };
75 
76 public:
77 
78     explicit TransitionMngr();
79     ~TransitionMngr();
80 
81     void setOutputSize(const QSize& size);
82     void setTransition(TransType type);
83     void setInImage(const QImage& iimg);
84     void setOutImage(const QImage& oimg);
85 
86     QImage currentFrame(int& tmout);
87 
88     static QMap<TransType, QString> transitionNames();
89 
90 private:
91 
92     // Disable
93     TransitionMngr(const TransitionMngr&)            = delete;
94     TransitionMngr& operator=(const TransitionMngr&) = delete;
95 
96 private:
97 
98     class Private;
99     Private* const d;
100 };
101 
102 } // namespace Digikam
103 
104 #endif // DIGIKAM_TRANSITION_MNGR_H
105