Exiv2
Loading...
Searching...
No Matches
psdimage.hpp
1// SPDX-License-Identifier: GPL-2.0-or-later
2
3#ifndef PSDIMAGE_HPP_
4#define PSDIMAGE_HPP_
5
6// *****************************************************************************
7#include "exiv2lib_export.h"
8
9// included header files
10#include "image.hpp"
11
12// *****************************************************************************
13// namespace extensions
14namespace Exiv2 {
15// *****************************************************************************
16// class definitions
17
21class EXIV2API PsdImage : public Image {
22 public:
24
25
39
41
42 void readMetadata() override;
43 void writeMetadata() override;
47 void setComment(const std::string&) override;
49
51
52
63 [[nodiscard]] std::string mimeType() const override;
65
66 private:
68
69 void readResourceBlock(uint16_t resourceId, uint32_t resourceSize);
77 void doWriteMetadata(BasicIo& outIo);
78 uint32_t writeExifData(ExifData& exifData, BasicIo& out);
80
82
83 static uint32_t writeIptcData(const IptcData& iptcData, BasicIo& out);
84 uint32_t writeXmpData(const XmpData& xmpData, BasicIo& out) const;
86
87}; // class PsdImage
88
89// *****************************************************************************
90// template, inline and free functions
91
92// These could be static private functions on Image subclasses but then
93// ImageFactory needs to be made a friend.
99EXIV2API Image::UniquePtr newPsdInstance(BasicIo::UniquePtr io, bool create);
100
102EXIV2API bool isPsdType(BasicIo& iIo, bool advance);
103
104} // namespace Exiv2
105
106#endif // #ifndef PSDIMAGE_HPP_
An interface for simple binary IO.
Definition basicio.hpp:35
std::unique_ptr< BasicIo > UniquePtr
BasicIo auto_ptr type.
Definition basicio.hpp:38
A container for Exif data. This is a top-level class of the Exiv2 library. The container holds Exifda...
Definition exif.hpp:379
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
virtual BasicIo & io() const
Return a reference to the BasicIo instance being used for Io.
Definition image.cpp:680
virtual XmpData & xmpData()
Returns an XmpData instance containing currently buffered XMP data.
Definition image.cpp:540
virtual IptcData & iptcData()
Returns an IptcData instance containing currently buffered IPTC data.
Definition image.cpp:536
virtual ExifData & exifData()
Returns an ExifData instance containing currently buffered Exif data.
Definition image.cpp:532
std::unique_ptr< Image > UniquePtr
Image auto_ptr type.
Definition image.hpp:53
A container for IPTC data. This is a top-level class of the Exiv2 library.
Definition iptc.hpp:153
void setComment(const std::string &) override
Not supported. Calling this function will throw an Error(ErrorCode::kerInvalidSettingForImage).
Definition psdimage.cpp:110
void writeMetadata() override
Write metadata back to the image.
Definition psdimage.cpp:311
std::string mimeType() const override
Return the MIME type of the image.
Definition psdimage.cpp:106
PsdImage(BasicIo::UniquePtr io)
Constructor to open a Photoshop image. Since the constructor can not return a result,...
Definition psdimage.cpp:103
void readMetadata() override
Read all metadata supported by a specific image format from the image. Before this method is called,...
Definition psdimage.cpp:115
A container for XMP data. This is a top-level class of the Exiv2 library.
Definition xmp_exiv2.hpp:138
Class CrwImage to access Canon CRW images. References: The Canon RAW (CRW) File Format by Phil Harv...
Definition asfvideo.hpp:15
EXIV2API bool isPsdType(BasicIo &iIo, bool advance)
Check if the file iIo is a Photoshop image.
Definition psdimage.cpp:685
EXIV2API Image::UniquePtr newPsdInstance(BasicIo::UniquePtr io, bool create)
Create a new PsdImage instance and return an auto-pointer to it. Caller owns the returned object and ...
Definition psdimage.cpp:677