Exiv2
tiffimage.hpp
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 
3 #ifndef TIFFIMAGE_HPP_
4 #define TIFFIMAGE_HPP_
5 
6 // *****************************************************************************
7 #include "exiv2lib_export.h"
8 
9 // included header files
10 #include "image.hpp"
11 
12 // *****************************************************************************
13 // namespace extensions
14 namespace Exiv2 {
15 // *****************************************************************************
16 // class definitions
17 
22 class EXIV2API TiffImage : public Image {
23  public:
25 
26 
41  TiffImage(BasicIo::UniquePtr io, bool create);
43 
45 
46  void readMetadata() override;
47  void writeMetadata() override;
48 
55  void printStructure(std::ostream& out, PrintStructureOption option, size_t depth) override;
56 
61  void setComment(const std::string&) override;
63 
65 
66  std::string mimeType() const override;
67  uint32_t pixelWidth() const override;
68  uint32_t pixelHeight() const override;
70 
71  private:
73 
74  std::string primaryGroup() const;
77 
78  // DATA
79  mutable std::string primaryGroup_;
80  mutable std::string mimeType_;
81  mutable uint32_t pixelWidthPrimary_{0};
82  mutable uint32_t pixelHeightPrimary_{0};
83 
84 }; // class TiffImage
85 
91 class EXIV2API TiffParser {
92  public:
106  static ByteOrder decode(ExifData& exifData, IptcData& iptcData, XmpData& xmpData, const byte* pData, size_t size);
140  static WriteMethod encode(BasicIo& io, const byte* pData, size_t size, ByteOrder byteOrder, ExifData& exifData,
141  IptcData& iptcData, XmpData& xmpData);
142 
143 }; // class TiffParser
144 
145 // *****************************************************************************
146 // template, inline and free functions
147 
148 // These could be static private functions on Image subclasses but then
149 // ImageFactory needs to be made a friend.
155 EXIV2API Image::UniquePtr newTiffInstance(BasicIo::UniquePtr io, bool create);
156 
158 EXIV2API bool isTiffType(BasicIo& iIo, bool advance);
159 
160 } // namespace Exiv2
161 
162 #endif // #ifndef TIFFIMAGE_HPP_
std::unique_ptr< Image > UniquePtr
Image auto_ptr type.
Definition: image.hpp:53
An interface for simple binary IO.
Definition: basicio.hpp:35
EXIV2API bool isTiffType(BasicIo &iIo, bool advance)
Check if the file iIo is a TIFF image.
Definition: tiffimage.cpp:247
A container for XMP data. This is a top-level class of the Exiv2 library.
Definition: xmp_exiv2.hpp:138
A container for Exif data. This is a top-level class of the Exiv2 library. The container holds Exifda...
Definition: exif.hpp:373
ByteOrder
Type to express the byte order (little or big endian)
Definition: types.hpp:34
uint8_t byte
1 byte unsigned integer type.
Definition: types.hpp:26
Abstract base class defining the interface for an image. This is the top-level interface to the Exiv2...
Definition: image.hpp:50
PrintStructureOption
Options for printStructure.
Definition: image.hpp:38
A container for IPTC data. This is a top-level class of the Exiv2 library.
Definition: iptc.hpp:153
WriteMethod
Type to indicate write method used by TIFF parsers.
Definition: types.hpp:41
List of TIFF compression to MIME type mappings.
Definition: tiffimage.cpp:47
std::unique_ptr< BasicIo > UniquePtr
BasicIo auto_ptr type.
Definition: basicio.hpp:38
Class to access TIFF images. Exif metadata is supported directly, IPTC is read from the Exif data...
Definition: tiffimage.hpp:22
Class CrwImage to access Canon CRW images. References: The Canon RAW (CRW) File Format by Phil Harv...
Definition: asfvideo.hpp:15
EXIV2API Image::UniquePtr newTiffInstance(BasicIo::UniquePtr io, bool create)
Create a new TiffImage instance and return an auto-pointer to it. Caller owns the returned object and...
Definition: tiffimage.cpp:239
Stateless parser class for data in TIFF format. Images use this class to decode and encode TIFF data...
Definition: tiffimage.hpp:91