digiKam
rawpreview.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 : 2008-08-04
7  * Description : RAW preview widget.
8  *
9  * Copyright (C) 2008-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)
15  * any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * ============================================================ */
23 
24 #ifndef DIGIKAM_RAW_PREVIEW_H
25 #define DIGIKAM_RAW_PREVIEW_H
26 
27 // Qt includes
28 
29 #include <QImage>
30 #include <QPixmap>
31 #include <QResizeEvent>
32 #include <QUrl>
33 
34 // Local includes
35 
36 #include "dimg.h"
37 #include "graphicsdimgview.h"
38 #include "loadingdescription.h"
39 
40 class QPixmap;
41 
42 using namespace Digikam;
43 
45 {
46 
48 {
49  Q_OBJECT
50 
51 public:
52 
53  explicit RawPreview(const QUrl& url, QWidget* const parent);
54  ~RawPreview() override;
55 
56  DImg& demosaicedImage() const;
57  DImg postProcessedImage() const;
58 
59  void setDecodingSettings(const DRawDecoding& settings);
60  void setPostProcessedImage(const DImg& image);
61 
62  void ICCSettingsChanged();
63  void exposureSettingsChanged();
64 
65  void cancelLoading();
66 
67 Q_SIGNALS:
68 
70  void signalLoadingProgress(float);
74 
75 private Q_SLOTS:
76 
77  void slotLoadingProgress(const LoadingDescription& description, float progress);
78  void slotImageLoaded(const LoadingDescription& description, const DImg& image);
79 
80 private:
81 
82  void setdemosaicedImg(const DImg& image);
83  void postProcessing(const DRawDecoding& settings);
84  int previewWidth() const;
85  int previewHeight() const;
86  bool previewIsNull() const;
87  QImage previewToQImage() const;
88  void resetPreview();
89 
90 private:
91 
92  class Private;
93  Private* const d;
94 };
95 
96 } // namespace DigikamRawImportNativePlugin
97 
98 #endif // DIGIKAM_RAW_PREVIEW_H
Definition: rawpreview.h:48
Definition: dimg.h:62
Definition: drawdecoding.h:48
Definition: graphicsdimgview.h:44
Definition: loadingdescription.h:45
Definition: rawimport.cpp:48
Definition: datefolderview.cpp:43