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

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2017-05-24
0007  * Description : images transition 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 #include "transitionmngr_p.h"
0016 
0017 namespace Digikam
0018 {
0019 
0020 void TransitionMngr::Private::registerTransitions()
0021 {
0022     eff_transList.insert(TransitionMngr::None,            &TransitionMngr::Private::transitionNone);
0023     eff_transList.insert(TransitionMngr::ChessBoard,      &TransitionMngr::Private::transitionChessboard);
0024     eff_transList.insert(TransitionMngr::MeltDown,        &TransitionMngr::Private::transitionMeltdown);
0025     eff_transList.insert(TransitionMngr::Sweep,           &TransitionMngr::Private::transitionSweep);
0026     eff_transList.insert(TransitionMngr::Mosaic,          &TransitionMngr::Private::transitionMosaic);
0027     eff_transList.insert(TransitionMngr::Cubism,          &TransitionMngr::Private::transitionCubism);
0028     eff_transList.insert(TransitionMngr::Growing,         &TransitionMngr::Private::transitionGrowing);
0029     eff_transList.insert(TransitionMngr::HorizontalLines, &TransitionMngr::Private::transitionHorizLines);
0030     eff_transList.insert(TransitionMngr::VerticalLines,   &TransitionMngr::Private::transitionVertLines);
0031     eff_transList.insert(TransitionMngr::CircleOut,       &TransitionMngr::Private::transitionCircleOut);
0032     eff_transList.insert(TransitionMngr::MultiCircleOut,  &TransitionMngr::Private::transitionMultiCircleOut);
0033     eff_transList.insert(TransitionMngr::SpiralIn,        &TransitionMngr::Private::transitionSpiralIn);
0034     eff_transList.insert(TransitionMngr::Blobs,           &TransitionMngr::Private::transitionBlobs);
0035     eff_transList.insert(TransitionMngr::Fade,            &TransitionMngr::Private::transitionFade);
0036     eff_transList.insert(TransitionMngr::SlideL2R,        &TransitionMngr::Private::transitionSlideL2R);
0037     eff_transList.insert(TransitionMngr::SlideR2L,        &TransitionMngr::Private::transitionSlideR2L);
0038     eff_transList.insert(TransitionMngr::SlideT2B,        &TransitionMngr::Private::transitionSlideT2B);
0039     eff_transList.insert(TransitionMngr::SlideB2T,        &TransitionMngr::Private::transitionSlideB2T);
0040     eff_transList.insert(TransitionMngr::PushL2R,         &TransitionMngr::Private::transitionPushL2R);
0041     eff_transList.insert(TransitionMngr::PushR2L,         &TransitionMngr::Private::transitionPushR2L);
0042     eff_transList.insert(TransitionMngr::PushT2B,         &TransitionMngr::Private::transitionPushT2B);
0043     eff_transList.insert(TransitionMngr::PushB2T,         &TransitionMngr::Private::transitionPushB2T);
0044     eff_transList.insert(TransitionMngr::SwapL2R,         &TransitionMngr::Private::transitionSwapL2R);
0045     eff_transList.insert(TransitionMngr::SwapR2L,         &TransitionMngr::Private::transitionSwapR2L);
0046     eff_transList.insert(TransitionMngr::SwapT2B,         &TransitionMngr::Private::transitionSwapT2B);
0047     eff_transList.insert(TransitionMngr::SwapB2T,         &TransitionMngr::Private::transitionSwapB2T);
0048     eff_transList.insert(TransitionMngr::BlurIn,          &TransitionMngr::Private::transitionBlurIn);
0049     eff_transList.insert(TransitionMngr::BlurOut,         &TransitionMngr::Private::transitionBlurOut);
0050 }
0051 
0052 TransitionMngr::TransType TransitionMngr::Private::getRandomTransition() const
0053 {
0054     QList<TransitionMngr::TransType> effs = eff_transList.keys();
0055     effs.removeAt(effs.indexOf(TransitionMngr::None));
0056 
0057     int i = randomGenerator->bounded(effs.count());
0058 
0059     return effs[i];
0060 }
0061 
0062 int TransitionMngr::Private::transitionRandom(bool /*aInit*/)
0063 {
0064     return -1;
0065 }
0066 
0067 int TransitionMngr::Private::transitionNone(bool)
0068 {
0069     eff_curFrame = eff_outImage;
0070 
0071     return -1;
0072 }
0073 
0074 } // namespace Digikam