Exiv2
jp2image.hpp
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 
3 #ifndef JP2IMAGE_HPP_
4 #define JP2IMAGE_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 
21 class EXIV2API Jp2Image : public Image {
22  public:
24 
25 
39  Jp2Image(BasicIo::UniquePtr io, bool create);
41 
43 
44  void readMetadata() override;
45  void writeMetadata() override;
46 
53  void printStructure(std::ostream& out, PrintStructureOption option, size_t depth) override;
54 
59  void setComment(const std::string&) override;
61 
63 
64  [[nodiscard]] std::string mimeType() const override;
66 
67  private:
75  void doWriteMetadata(BasicIo& outIo);
76 
82  void encodeJp2Header(const DataBuf& boxBuf, DataBuf& outBuf);
84 
85  static std::string toAscii(uint32_t n);
86 }; // class Jp2Image
87 
88 // *****************************************************************************
89 // template, inline and free functions
90 
91 // These could be static private functions on Image subclasses but then
92 // ImageFactory needs to be made a friend.
98 EXIV2API Image::UniquePtr newJp2Instance(BasicIo::UniquePtr io, bool create);
99 
101 EXIV2API bool isJp2Type(BasicIo& iIo, bool advance);
102 
103 } // namespace Exiv2
104 
105 #endif // #ifndef JP2IMAGE_HPP_
Class to access JPEG-2000 images.
Definition: jp2image.hpp:21
std::unique_ptr< Image > UniquePtr
Image auto_ptr type.
Definition: image.hpp:53
An interface for simple binary IO.
Definition: basicio.hpp:35
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
PrintStructureOption
Options for printStructure.
Definition: image.hpp:38
List of TIFF compression to MIME type mappings.
Definition: tiffimage.cpp:47
EXIV2API Image::UniquePtr newJp2Instance(BasicIo::UniquePtr io, bool create)
Create a new Jp2Image instance and return an auto-pointer to it. Caller owns the returned object and ...
Definition: jp2image.cpp:865
EXIV2API bool isJp2Type(BasicIo &iIo, bool advance)
Check if the file iIo is a JPEG-2000 image.
Definition: jp2image.cpp:873
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