File indexing completed on 2025-01-05 03:57:24

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2017-05-24
0007  * Description : video frame effects manager.
0008  *
0009  * SPDX-FileCopyrightText: 2017-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0010  *
0011  * SPDX-License-Identifier: GPL-2.0-or-later
0012  *
0013  * ============================================================ */
0014 
0015 #ifndef DIGIKAM_EFFECT_MNGR_H
0016 #define DIGIKAM_EFFECT_MNGR_H
0017 
0018 // Qt includes
0019 
0020 #include <QMap>
0021 #include <QString>
0022 #include <QImage>
0023 
0024 // Local includes
0025 
0026 #include "digikam_export.h"
0027 
0028 namespace Digikam
0029 {
0030 
0031 class DIGIKAM_EXPORT EffectMngr
0032 {
0033 public:
0034 
0035     /**
0036      * See KEn Burns effect description: https://en.wikipedia.org/wiki/Ken_Burns_effect
0037      */
0038     enum EffectType
0039     {
0040         None = 0,        ///< Static camera
0041         KenBurnsZoomIn,
0042         KenBurnsZoomOut,
0043         KenBurnsPanLR,
0044         KenBurnsPanRL,
0045         KenBurnsPanTB,
0046         KenBurnsPanBT,
0047         Random
0048     };
0049 
0050 public:
0051 
0052     explicit EffectMngr();
0053     ~EffectMngr();
0054 
0055     void setOutputSize(const QSize& size);
0056     void setEffect(EffectType eff);
0057     void setImage(const QImage& img);
0058     void setFrames(int ifrms);
0059 
0060     QImage currentFrame(int& tmout);
0061 
0062     static QMap<EffectType, QString> effectNames();
0063 
0064 private:
0065 
0066     // Disable
0067     EffectMngr(const EffectMngr&)            = delete;
0068     EffectMngr& operator=(const EffectMngr&) = delete;
0069 
0070 private:
0071 
0072     class Private;
0073     Private* const d;
0074 };
0075 
0076 } // namespace Digikam
0077 
0078 #endif // DIGIKAM_EFFECT_MNGR_H