digiKam
dimgtiffloader.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-06-17
7  * Description : A TIFF IO file for DImg framework
8  *
9  * Copyright (C) 2005 by Renchi Raju <renchi dot raju at gmail dot com>
10  * Copyright (C) 2006-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
11  *
12  * Specifications & references:
13  * - TIFF 6.0 : partners.adobe.com/public/developer/en/tiff/TIFF6.pdf
14  * - TIFF/EP : www.map.tu.chiba-u.ac.jp/IEC/100/TA2/recdoc/N4378.pdf
15  * - TIFF/Tags : www.awaresystems.be/imaging/tiff/tifftags.html
16  * - DNG : www.adobe.com/products/dng/pdfs/dng_spec.pdf
17  *
18  * Others Linux Tiff Loader implementation using libtiff:
19  * - websvn.kde.org/trunk/koffice/filters/krita/tiff/kis_tiff_converter.cc
20  * - artis.inrialpes.fr/Software/TiffIO/
21  * - cvs.graphicsmagick.org/cgi-bin/cvsweb.cgi/GraphicsMagick/coders/tiff.c
22  * - freeimage.cvs.sourceforge.net/freeimage/FreeImage/Source/FreeImage/PluginTIFF.cpp
23  * - freeimage.cvs.sourceforge.net/freeimage/FreeImage/Source/Metadata/XTIFF.cpp
24  * - subversion.imagemagick.org/subversion/ImageMagick/trunk/coders/tiff.c
25  *
26  * Test images repository:
27  * - www.remotesensing.org/libtiff/images.html
28  *
29  * This program is free software; you can redistribute it
30  * and/or modify it under the terms of the GNU General
31  * Public License as published by the Free Software Foundation;
32  * either version 2, or (at your option)
33  * any later version.
34  *
35  * This program is distributed in the hope that it will be useful,
36  * but WITHOUT ANY WARRANTY; without even the implied warranty of
37  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
38  * GNU General Public License for more details.
39  *
40  * ============================================================ */
41 
42 #ifndef DIGIKAM_DIMG_TIFF_LOADER_H
43 #define DIGIKAM_DIMG_TIFF_LOADER_H
44 
45 // C ANSI includes
46 
47 extern "C"
48 {
49 #include <tiffio.h>
50 #include <tiff.h>
51 }
52 
53 // Local includes
54 
55 #include "dimg.h"
56 #include "dimgloader.h"
57 #include "dmetadata.h"
58 
59 using namespace Digikam;
60 
61 namespace DigikamTIFFDImgPlugin
62 {
63 
64 class DImgTIFFLoader : public DImgLoader
65 {
66 public:
67 
68  explicit DImgTIFFLoader(DImg* const image);
69  ~DImgTIFFLoader() override;
70 
71  bool load(const QString& filePath, DImgLoaderObserver* const observer) override;
72  bool save(const QString& filePath, DImgLoaderObserver* const observer) override;
73 
74  bool hasAlpha() const override;
75  bool sixteenBit() const override;
76  bool isReadOnly() const override;
77 
78 private:
79 
80  void tiffSetExifAsciiTag(TIFF* const tif, ttag_t tiffTag, const DMetadata& metaData, const char* const exifTagName);
81 
82  // cppcheck-suppress unusedPrivateFunction
83  void tiffSetExifDataTag(TIFF* const tif, ttag_t tiffTag, const DMetadata& metaData, const char* const exifTagName);
84 
85  static void dimg_tiff_warning(const char* module, const char* format, va_list warnings);
86  static void dimg_tiff_error(const char* module, const char* format, va_list errors);
87 
88 private:
89 
90  bool m_sixteenBit;
91  bool m_hasAlpha;
92 };
93 
94 } // namespace DigikamTIFFDImgPlugin
95 
96 #endif // DIGIKAM_DIMG_TIFF_LOADER_H
Definition: dimgtiffloader.h:65
Definition: dimgloaderobserver.h:41
Definition: dimgloader.h:51
Definition: dimg.h:62
Definition: dmetadata.h:55
@ TIFF
Definition: panoactions.h:63
Definition: dimgtiffloader.cpp:48
Definition: datefolderview.cpp:43