digiKam
dimgrawloader.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 : 2005-11-01
7  * Description : A digital camera RAW files loader for DImg
8  * framework using an external dcraw instance.
9  *
10  * Copyright (C) 2005-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
11  * Copyright (C) 2005-2012 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
12  *
13  * This program is free software; you can redistribute it
14  * and/or modify it under the terms of the GNU General
15  * Public License as published by the Free Software Foundation;
16  * either version 2, or (at your option)
17  * any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  * GNU General Public License for more details.
23  *
24  * ============================================================ */
25 
26 #ifndef DIGIKAM_DIMG_RAW_LOADER_H
27 #define DIGIKAM_DIMG_RAW_LOADER_H
28 
29 // Local includes
30 
31 #include "dimg.h"
32 #include "drawdecoder.h"
33 #include "dimgloader.h"
34 #include "drawdecoding.h"
35 #include "rawprocessingfilter.h"
36 
37 using namespace Digikam;
38 
39 namespace DigikamRAWDImgPlugin
40 {
41 
42 class DImgRAWLoader : public DRawDecoder,
43  public DImgLoader
44 {
45  Q_OBJECT
46 
47 public:
48 
49  explicit DImgRAWLoader(DImg* const image, const DRawDecoding& rawDecodingSettings = DRawDecoding());
50  ~DImgRAWLoader() override;
51 
52  bool load(const QString& filePath, DImgLoaderObserver* const observer = nullptr) override;
53  bool save(const QString&, DImgLoaderObserver* const) override;
54 
55  bool hasAlpha() const override;
56  bool isReadOnly() const override;
57  bool sixteenBit() const override;
58 
59  void postProcess(DImgLoaderObserver* const observer);
60 
61  FilterAction filterAction() const;
62 
63 private:
64 
65  bool loadedFromRawData(const QByteArray& data,
66  int width,
67  int height,
68  int rgbmax,
69  DImgLoaderObserver* const observer);
70 
71  bool checkToCancelWaitingData() override;
72  void setWaitingDataProgress(double value) override;
73 
74 private:
75 
76  // Disable
77  explicit DImgRAWLoader(QObject*) = delete;
78  DImgRAWLoader(const DImgRAWLoader&) = delete;
79  DImgRAWLoader& operator=(const DImgRAWLoader&) = delete;
80 
81 private:
82 
83  DImgLoaderObserver* m_observer;
84  RawProcessingFilter* m_filter;
85 };
86 
87 } // namespace DigikamRAWDImgPlugin
88 
89 #endif // DIGIKAM_DIMG_RAW_LOADER_H
Definition: dimgrawloader.h:44
Definition: dimgloaderobserver.h:41
Definition: dimgloader.h:51
Definition: dimg.h:62
Definition: drawdecoder.h:50
Definition: drawdecoding.h:48
Definition: filteraction.h:43
Definition: rawprocessingfilter.h:48
qulonglong value
Definition: itemviewutilities.cpp:592
Definition: dimgrawloader.cpp:43
Definition: datefolderview.cpp:43