digiKam
kbimageloader.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 : 2007-11-14
7  * Description : a presentation tool.
8  *
9  * Copyright (C) 2007-2009 by Valerio Fuoglio <valerio dot fuoglio at gmail dot com>
10  * Copyright (C) 2012-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
11  *
12  * Parts of this code are based on smoothslidesaver by Carsten Weinhold
13  * <carsten dot weinhold at gmx dot de>
14  *
15  * This program is free software; you can redistribute it
16  * and/or modify it under the terms of the GNU General
17  * Public License as published by the Free Software Foundation;
18  * either version 2, or (at your option) any later version.
19  *
20  * This program is distributed in the hope that it will be useful,
21  * but WITHOUT ANY WARRANTY; without even the implied warranty of
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23  * GNU General Public License for more details.
24  *
25  * ============================================================ */
26 
27 #ifndef DIGIKAM_KB_IMAGE_LOADER_H
28 #define DIGIKAM_KB_IMAGE_LOADER_H
29 
30 // Qt includes
31 
32 #include <QList>
33 #include <QImage>
34 #include <QThread>
35 #include <QWaitCondition>
36 #include <QMutex>
37 #include <QPair>
38 #include <QString>
39 
41 {
42 
43 class PresentationContainer;
44 
45 class KBImageLoader : public QThread
46 {
47  Q_OBJECT
48 
49 public:
50 
51  KBImageLoader(PresentationContainer* const sharedData, int width, int height);
52  ~KBImageLoader() override;
53 
54  void quit();
55  void requestNewImage();
56 
57  void ungrabImage();
58  bool grabImage();
59  bool ready() const;
60  const QImage& image() const;
61  float imageAspect() const;
62 
63 protected:
64 
65  void run() override;
66  bool loadImage();
68 
69 private:
70 
71  // Disable
72  explicit KBImageLoader(QObject*) = delete;
73 
74 private:
75 
76  class Private;
77  Private* const d;
78 };
79 
80 } // namespace DigikamGenericPresentationPlugin
81 
82 #endif // DIGIKAM_KB_IMAGE_LOADER_H
KBImageLoader(PresentationContainer *const sharedData, int width, int height)
Definition: kbimageloader.cpp:87
bool loadImage()
Definition: kbimageloader.cpp:205
~KBImageLoader() override
Definition: kbimageloader.cpp:103
void invalidateCurrentImageName()
Definition: kbimageloader.cpp:228
void run() override
Definition: kbimageloader.cpp:127
bool grabImage()
Definition: kbimageloader.cpp:234
const QImage & image() const
Definition: kbimageloader.cpp:251
void quit()
Definition: kbimageloader.cpp:108
void ungrabImage()
Definition: kbimageloader.cpp:241
float imageAspect() const
Definition: kbimageloader.cpp:256
bool ready() const
Definition: kbimageloader.cpp:246
void requestNewImage()
Definition: kbimageloader.cpp:116
Definition: presentationcontainer.h:54
Definition: presentation_audiopage.cpp:46