Exiv2
psdimage.hpp
Go to the documentation of this file.
1 // ***************************************************************** -*- C++ -*-
2 /*
3  * Copyright (C) 2004-2018 Exiv2 authors
4  * This program is part of the Exiv2 distribution.
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301 USA.
19  */
30 #ifndef PSDIMAGE_HPP_
31 #define PSDIMAGE_HPP_
32 
33 // *****************************************************************************
34 #include "exiv2lib_export.h"
35 
36 // included header files
37 #include "image.hpp"
38 
39 // *****************************************************************************
40 // namespace extensions
41 namespace Exiv2 {
42 
43 // *****************************************************************************
44 // class definitions
45 
46  // Add PSD to the supported image formats
47  namespace ImageType {
48  const int psd = 12;
49  }
50 
54  class EXIV2API PsdImage : public Image {
56 
57  PsdImage(const PsdImage& rhs);
60  PsdImage& operator=(const PsdImage& rhs);
62 
63  public:
65 
66 
78  explicit PsdImage(BasicIo::AutoPtr io);
80 
82 
83  void readMetadata();
84  void writeMetadata();
88  void setComment(const std::string& comment);
90 
92 
93 
104  std::string mimeType() const;
106 
107  private:
109 
110  void readResourceBlock(uint16_t resourceId, uint32_t resourceSize);
118  void doWriteMetadata(BasicIo& oIo);
119  uint32_t writeExifData(const ExifData& exifData, BasicIo& out);
121 
123 
124  uint32_t writeIptcData(const IptcData& iptcData, BasicIo& out) const;
125  uint32_t writeXmpData(const XmpData& xmpData, BasicIo& out) const;
127 
128  }; // class PsdImage
129 
130 // *****************************************************************************
131 // template, inline and free functions
132 
133  // These could be static private functions on Image subclasses but then
134  // ImageFactory needs to be made a friend.
140  EXIV2API Image::AutoPtr newPsdInstance(BasicIo::AutoPtr io, bool create);
141 
143  EXIV2API bool isPsdType(BasicIo& iIo, bool advance);
144 
145 } // namespace Exiv2
146 
147 #endif // #ifndef PSDIMAGE_HPP_
An interface for simple binary IO.
Definition: basicio.hpp:55
A container for XMP data. This is a top-level class of the Exiv2 library.
Definition: xmp_exiv2.hpp:173
std::auto_ptr< Image > AutoPtr
Image auto_ptr type.
Definition: image.hpp:84
A container for Exif data. This is a top-level class of the Exiv2 library. The container holds Exifda...
Definition: exif.hpp:434
Abstract base class defining the interface for an image. This is the top-level interface to the Exiv2...
Definition: image.hpp:81
A container for IPTC data. This is a top-level class of the Exiv2 library.
Definition: iptc.hpp:173
EXIV2API bool isPsdType(BasicIo &iIo, bool advance)
Check if the file iIo is a Photoshop image.
Definition: psdimage.cpp:702
std::auto_ptr< BasicIo > AutoPtr
BasicIo auto_ptr type.
Definition: basicio.hpp:58
IPTC string type.
Definition: types.hpp:147
EXIV2API Image::AutoPtr newPsdInstance(BasicIo::AutoPtr io, bool create)
Create a new PsdImage instance and return an auto-pointer to it. Caller owns the returned object and ...
Definition: psdimage.cpp:692
Class to access raw Photoshop images.
Definition: psdimage.hpp:54
Provides classes and functions to encode and decode Exif and Iptc data. The libexiv2 API consists of ...
Definition: asfvideo.hpp:36
const int psd
Photoshop (PSD) image type (see class PsdImage)
Definition: psdimage.hpp:48
Exiv2 type for the Exif user comment.
Definition: types.hpp:150