| Exiv2

Loading...
Searching...
No Matches
crwimage.hpp
1// SPDX-License-Identifier: GPL-2.0-or-later
2
12#ifndef CRWIMAGE_HPP_
13#define CRWIMAGE_HPP_
14
15// *****************************************************************************
16#include "exiv2lib_export.h"
17
18// included header files
19#include "image.hpp"
20
21// *****************************************************************************
22// namespace extensions
23 namespace Exiv2 {
24// *****************************************************************************
25// class declarations
26 class ExifData;
27 class IptcData;
28
29// *****************************************************************************
30// class definitions
31
36 class EXIV2API CrwImage : public Image {
37 public:
39
40
55 CrwImage(BasicIo::UniquePtr io, bool create);
57
59
60 void readMetadata() override;
61 void writeMetadata() override;
66 void setIptcData(const IptcData& iptcData) override;
68
70
71 [[nodiscard]] std::string mimeType() const override;
72 [[nodiscard]] uint32_t pixelWidth() const override;
73 [[nodiscard]] uint32_t pixelHeight() const override;
75}; // class CrwImage
76
80 class EXIV2API CrwParser {
81 public:
97 static void decode(CrwImage* pCrwImage, const byte* pData, size_t size);
112 static void encode(Blob& blob, const byte* pData, size_t size, const CrwImage* pCrwImage);
113
114}; // class CrwParser
115
116// *****************************************************************************
117// template, inline and free functions
118
119// These could be static private functions on Image subclasses but then
120// ImageFactory needs to be made a friend.
126EXIV2API Image::UniquePtr newCrwInstance(BasicIo::UniquePtr io, bool create);
127
129EXIV2API bool isCrwType(BasicIo& iIo, bool advance);
130
131} // namespace Exiv2
132
133#endif // #ifndef CRWIMAGE_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::CrwImage
Class to access raw Canon CRW images. Only Exif metadata and a comment are supported....
Definition crwimage.hpp:36
Exiv2::CrwImage::mimeType
std::string mimeType() const override
Return the MIME type of the image.
Definition crwimage.cpp:25
Exiv2::CrwImage::pixelHeight
uint32_t pixelHeight() const override
Return the pixel height of the image.
Definition crwimage.cpp:37
Exiv2::CrwImage::CrwImage
CrwImage(BasicIo::UniquePtr io, bool create)
Constructor that can either open an existing CRW image or create a new image from scratch....
Definition crwimage.cpp:22
Exiv2::CrwImage::setIptcData
void setIptcData(const IptcData &iptcData) override
Not supported. CRW format does not contain IPTC metadata. Calling this function will throw an Error(E...
Definition crwimage.cpp:45
Exiv2::CrwImage::writeMetadata
void writeMetadata() override
Write metadata back to the image.
Definition crwimage.cpp:72
Exiv2::CrwImage::pixelWidth
uint32_t pixelWidth() const override
Return the pixel width of the image.
Definition crwimage.cpp:29
Exiv2::CrwImage::readMetadata
void readMetadata() override
Read all metadata supported by a specific image format from the image. Before this method is called,...
Definition crwimage.cpp:50
Exiv2::CrwParser
Definition crwimage.hpp:80
Exiv2::CrwParser::encode
static void encode(Blob &blob, const byte *pData, size_t size, const CrwImage *pCrwImage)
Encode metadata from the CRW image into a data buffer (the binary CRW image).
Definition crwimage.cpp:116
Exiv2::CrwParser::decode
static void decode(CrwImage *pCrwImage, const byte *pData, size_t size)
Decode metadata from a Canon CRW image in data buffer pData of length size into crwImage.
Definition crwimage.cpp:102
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::iptcData
virtual IptcData & iptcData()
Returns an IptcData instance containing currently buffered IPTC data.
Definition image.cpp:536
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
Class CrwImage to access Canon CRW images. References: The Canon RAW (CRW) File Format by Phil Harv...
Definition asfvideo.hpp:15
Exiv2::newCrwInstance
EXIV2API Image::UniquePtr newCrwInstance(BasicIo::UniquePtr io, bool create)
Create a new CrwImage instance and return an auto-pointer to it. Caller owns the returned object and ...
Definition crwimage.cpp:131
Exiv2::isCrwType
EXIV2API bool isCrwType(BasicIo &iIo, bool advance)
Check if the file iIo is a CRW image.
Definition crwimage.cpp:139
Exiv2::Blob
std::vector< byte > Blob
Container for binary data.
Definition types.hpp:102