Exiv2
cr2image.hpp
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 
8 #ifndef CR2IMAGE_HPP_
9 #define CR2IMAGE_HPP_
10 
11 // *****************************************************************************
12 #include "exiv2lib_export.h"
13 
14 // included header files
15 #include "image.hpp"
16 
17 // *****************************************************************************
18 // namespace extensions
19 namespace Exiv2 {
20 // *****************************************************************************
21 // class definitions
22 
27 class EXIV2API Cr2Image : public Image {
28  public:
30 
31 
46  Cr2Image(BasicIo::UniquePtr io, bool create);
48 
50 
51  void readMetadata() override;
52  void writeMetadata() override;
59  void printStructure(std::ostream& out, PrintStructureOption option, size_t depth) override;
64  void setComment(const std::string&) override;
66 
68 
69  [[nodiscard]] std::string mimeType() const override;
70  [[nodiscard]] uint32_t pixelWidth() const override;
71  [[nodiscard]] uint32_t pixelHeight() const override;
73 }; // class Cr2Image
74 
80 class EXIV2API Cr2Parser {
81  public:
87  static ByteOrder decode(ExifData& exifData, IptcData& iptcData, XmpData& xmpData, const byte* pData, size_t size);
92  static WriteMethod encode(BasicIo& io, const byte* pData, size_t size, ByteOrder byteOrder, ExifData& exifData,
93  IptcData& iptcData, XmpData& xmpData);
94 
95 }; // class Cr2Parser
96 
97 // *****************************************************************************
98 // template, inline and free functions
99 
100 // These could be static private functions on Image subclasses but then
101 // ImageFactory needs to be made a friend.
107 EXIV2API Image::UniquePtr newCr2Instance(BasicIo::UniquePtr io, bool create);
108 
110 EXIV2API bool isCr2Type(BasicIo& iIo, bool advance);
111 
112 } // namespace Exiv2
113 
114 #endif // #ifndef CR2IMAGE_HPP_
std::unique_ptr< Image > UniquePtr
Image auto_ptr type.
Definition: image.hpp:53
An interface for simple binary IO.
Definition: basicio.hpp:35
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
Stateless parser class for data in CR2 format. Images use this class to decode and encode CR2 data...
Definition: cr2image.hpp:80
WriteMethod
Type to indicate write method used by TIFF parsers.
Definition: types.hpp:41
Class to access raw Canon CR2 images. Exif metadata is supported directly, IPTC is read from the Exif...
Definition: cr2image.hpp:27
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
EXIV2API Image::UniquePtr newCr2Instance(BasicIo::UniquePtr io, bool create)
Create a new Cr2Image instance and return an auto-pointer to it. Caller owns the returned object and ...
Definition: cr2image.cpp:129
EXIV2API bool isCr2Type(BasicIo &iIo, bool advance)
Check if the file iIo is a CR2 image.
Definition: cr2image.cpp:137
Class CrwImage to access Canon CRW images. References: The Canon RAW (CRW) File Format by Phil Harv...
Definition: asfvideo.hpp:15