digiKam
dimgpgfloader.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 : 2009-06-03
7  * Description : A PGF IO file for DImg framework
8  *
9  * Copyright (C) 2009-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  *
11  * This implementation use LibPGF API <https://www.libpgf.org>
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_PGF_LOADER_H
27 #define DIGIKAM_DIMG_PGF_LOADER_H
28 
29 // Local includes
30 
31 #include "dimg.h"
32 #include "dimgloader.h"
33 
34 using namespace Digikam;
35 
36 namespace Digikam
37 {
38 
39 class DImgPGFLoader : public DImgLoader
40 {
41 
42 public:
43 
44  explicit DImgPGFLoader(DImg* const image);
45  ~DImgPGFLoader() override;
46 
47  bool load(const QString& filePath, DImgLoaderObserver* const observer) override;
48  bool save(const QString& filePath, DImgLoaderObserver* const observer) override;
49 
50  bool hasAlpha() const override;
51  bool sixteenBit() const override;
52  bool isReadOnly() const override;
53 
54 private:
55 
56  bool progressCallback(double percent, bool escapeAllowed);
57 
58  static bool CallbackForLibPGF(double percent,
59  bool escapeAllowed,
60  void* data);
61 
62 private:
63 
64  bool m_sixteenBit;
65  bool m_hasAlpha;
66 
67  DImgLoaderObserver* m_observer;
68 };
69 
70 } // namespace Digikam
71 
72 #endif // DIGIKAM_DIMG_PGF_LOADER_H
Definition: dimgloaderobserver.h:41
Definition: dimgloader.h:51
Definition: dimgpgfloader.h:40
DImgPGFLoader(DImg *const image)
Definition: dimgpgfloader.cpp:95
bool isReadOnly() const override
Definition: dimgpgfloader.cpp:132
bool sixteenBit() const override
Definition: dimgpgfloader.cpp:112
bool save(const QString &filePath, DImgLoaderObserver *const observer) override
Definition: dimgpgfloader_save.cpp:95
bool hasAlpha() const override
Definition: dimgpgfloader.cpp:107
bool load(const QString &filePath, DImgLoaderObserver *const observer) override
Definition: dimgpgfloader_load.cpp:95
~DImgPGFLoader() override
Definition: dimgpgfloader.cpp:103
Definition: dimg.h:62
Definition: datefolderview.cpp:43