| Exiv2

Loading...
Searching...
No Matches
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.
107EXIV2API Image::UniquePtr newCr2Instance(BasicIo::UniquePtr io, bool create);
108
110EXIV2API bool isCr2Type(BasicIo& iIo, bool advance);
111
112} // namespace Exiv2
113
114#endif // #ifndef CR2IMAGE_HPP_
Exiv2::BasicIo
An interface for simple binary IO.
Definition basicio.hpp:35
Exiv2::BasicIo::UniquePtr
std::unique_ptr< BasicIo > UniquePtr
BasicIo auto_ptr type.
Definition basicio.hpp:38
Exiv2::Cr2Image::printStructure
void printStructure(std::ostream &out, PrintStructureOption option, size_t depth) override
Print out the structure of image file.
Definition cr2image.cpp:45
Exiv2::Cr2Image::writeMetadata
void writeMetadata() override
Write metadata back to the image.
Definition cr2image.cpp:76
Exiv2::Cr2Image::pixelWidth
uint32_t pixelWidth() const override
Return the pixel width of the image.
Definition cr2image.cpp:29
Exiv2::Cr2Image::pixelHeight
uint32_t pixelHeight() const override
Return the pixel height of the image.
Definition cr2image.cpp:37
Exiv2::Cr2Image::setComment
void setComment(const std::string &) override
Not supported. CR2 format does not contain a comment. Calling this function will throw an Error(Error...
Definition cr2image.cpp:52
Exiv2::Cr2Image::readMetadata
void readMetadata() override
Read all metadata supported by a specific image format from the image. Before this method is called,...
Definition cr2image.cpp:57
Exiv2::Cr2Image::Cr2Image
Cr2Image(BasicIo::UniquePtr io, bool create)
Constructor that can either open an existing CR2 image or create a new image from scratch....
Definition cr2image.cpp:21
Exiv2::Cr2Image::mimeType
std::string mimeType() const override
Return the MIME type of the image.
Definition cr2image.cpp:25
Exiv2::Cr2Parser
Stateless parser class for data in CR2 format. Images use this class to decode and encode CR2 data....
Definition cr2image.hpp:80
Exiv2::Cr2Parser::decode
static ByteOrder decode(ExifData &exifData, IptcData &iptcData, XmpData &xmpData, const byte *pData, size_t size)
Decode metadata from a buffer pData of length size with data in CR2 format to the provided metadata c...
Definition cr2image.cpp:100
Exiv2::Cr2Parser::encode
static WriteMethod encode(BasicIo &io, const byte *pData, size_t size, ByteOrder byteOrder, ExifData &exifData, IptcData &iptcData, XmpData &xmpData)
Encode metadata from the provided metadata to CR2 format. See TiffParser::encode().
Definition cr2image.cpp:106
Exiv2::ExifData
A container for Exif data. This is a top-level class of the Exiv2 library. The container holds Exifda...
Definition exif.hpp:379
Exiv2::Image::Image
Image(ImageType type, uint16_t supportedMetadata, BasicIo::UniquePtr io)
Constructor taking the image type, a bitmap of the supported metadata types and an auto-pointer that ...
Definition image.cpp:132
Exiv2::Image::io
virtual BasicIo & io() const
Return a reference to the BasicIo instance being used for Io.
Definition image.cpp:696
Exiv2::Image::UniquePtr
std::unique_ptr< Image > UniquePtr
Image auto_ptr type.
Definition image.hpp:53
Exiv2::IptcData
A container for IPTC data. This is a top-level class of the Exiv2 library.
Definition iptc.hpp:153
Exiv2::XmpData
A container for XMP data. This is a top-level class of the Exiv2 library.
Definition xmp_exiv2.hpp:138
Exiv2
Class CrwImage to access Canon CRW images. References: The Canon RAW (CRW) File Format by Phil Harv...
Definition asfvideo.hpp:15
Exiv2::PrintStructureOption
PrintStructureOption
Options for printStructure.
Definition image.hpp:38
Exiv2::newCr2Instance
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
Exiv2::ByteOrder
ByteOrder
Type to express the byte order (little or big endian).
Definition types.hpp:34
Exiv2::WriteMethod
WriteMethod
Type to indicate write method used by TIFF parsers.
Definition types.hpp:41
Exiv2::isCr2Type
EXIV2API bool isCr2Type(BasicIo &iIo, bool advance)
Check if the file iIo is a CR2 image.
Definition cr2image.cpp:137