Exiv2
pgfimage.hpp
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 
3 #ifndef PGFIMAGE_HPP_
4 #define PGFIMAGE_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 PgfImage : public Image {
23  public:
25 
26 
41  PgfImage(BasicIo::UniquePtr io, bool create);
43 
45 
46  void readMetadata() override;
47  void writeMetadata() override;
49 
51 
52  [[nodiscard]] std::string mimeType() const override {
53  return "image/pgf";
54  }
56 
57  private:
58  bool bSwap_; // true for bigEndian hardware, else false
66  void doWriteMetadata(BasicIo& outIo);
68  static byte readPgfMagicNumber(BasicIo& iIo);
70  size_t readPgfHeaderSize(BasicIo& iIo) const;
72  DataBuf readPgfHeaderStructure(BasicIo& iIo, uint32_t& width, uint32_t& height) const;
74 
75 }; // class PgfImage
76 
77 // *****************************************************************************
78 // template, inline and free functions
79 
80 // These could be static private functions on Image subclasses but then
81 // ImageFactory needs to be made a friend.
87 EXIV2API Image::UniquePtr newPgfInstance(BasicIo::UniquePtr io, bool create);
88 
90 EXIV2API bool isPgfType(BasicIo& iIo, bool advance);
91 
92 } // namespace Exiv2
93 
94 #endif // #ifndef PGFIMAGE_HPP_
std::string mimeType() const override
Return the MIME type of the image.
Definition: pgfimage.hpp:52
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 isPgfType(BasicIo &iIo, bool advance)
Check if the file iIo is a PGF image.
Definition: pgfimage.cpp:297
Class to access PGF images. Exif and IPTC metadata are supported directly.
Definition: pgfimage.hpp:22
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
Utility class containing a character array. All it does is to take care of memory allocation and dele...
Definition: types.hpp:124
std::unique_ptr< BasicIo > UniquePtr
BasicIo auto_ptr type.
Definition: basicio.hpp:38
Class CrwImage to access Canon CRW images. References: The Canon RAW (CRW) File Format by Phil Harv...
Definition: asfvideo.hpp:15
EXIV2API Image::UniquePtr newPgfInstance(BasicIo::UniquePtr io, bool create)
Create a new PgfImage instance and return an auto-pointer to it. Caller owns the returned object and ...
Definition: pgfimage.cpp:289